Luminous te lleva al campo del desarrollo de programas pequeños de WeChat (diez)

Prólogo luminoso:

 

Eres inmortal en las pinturas de las personas celestiales. Es difícil de alcanzar
. Mantenme en el rompecabezas del amor.

 

 

 

 

 

 

 

 
 
Texto:
 
                                              Reconocer el Tao con el Tao

 

{
  "pages": [
    "pages/index/index",
    "pages/login/login",
    "pages/milk/milk",
    "pages/shopping/shopping"
    
  ],
  "window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#576b95",
    "navigationBarTitleText": "夜光开发-小商城",
    "navigationBarTextStyle": "black"
  },
  "tabBar": {
    "list": [
      {
        "pagePath": "pages/index/index",
        "text": "主页",
        "iconPath": "/images/4.jpg",
        "selectedIconPath": "/images/4.jpg"
      },
      {
        "pagePath": "pages/shopping/shopping",
        "text": "购物车",
        "iconPath": "/images/6.jpg",
        "selectedIconPath": "/images/6.jpg"
      },
      {
        "pagePath": "pages/milk/milk",
        "text": "特价",
        "iconPath": "/images/1.jpeg",
        "selectedIconPath": "/images/1.jpeg"
      }
    ]
  },
  "sitemapLocation": "sitemap.json"
}

 

 

 

// pages/login/login.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    phone_number:"",
    code:"",
  },
  //夜光:获取手机号码
  getPhone:function(e){
    this.setData({
      phone_number: e.detail.value
    })
    if(this.data.phone_number.length != 11){
      wx.showToast({
        title: '抱歉~~请输入正确手机号码',
      })
      return;
    }
    console.log(this.data.phone_number)
  },
  //夜光:获取验证码
  getCode:function(e){
    this.setData({
      code: e.detail.value
    })
    console.log(this.data.code)
  },

  //夜光:我们还需要写一个登录的方法
  // login1:function(){
  //    wx.request({
  //     //  url: 'http://www.baidu.com',
  //      data:({
  //        phone:this.data.phone_number,
  //        code:this.data.code 
  //      }),
  //      success(res){
  //        if(res.data == "true"){
  //           wx.showToast({
  //             title: '登录成功~~',
  //           });
  //           wx.switchTab({
  //             url: '/pages/milk/milk',
  //           })
  //         }
  //        wx.switchTab({
  //          url: '/pages/milk/milk',
  //        })
  //      }
  //    })
  // },
  login1: function () {

    var phone = this.data.phone_number;
    var code = this.data.code;

    if (phone != null && code != null) {
      // var backUrl = this.data.backUrl;
      // wx.redirectTo({
      //   url:\'eapdomain/src/pages/pageCreate/pageCreate\'
      // })
      // app.data.userInfo = {
      //   phone: phone_number,
      //   code: code
      // };

      wx.switchTab({
        url: '/pages/milk/milk',
      });

      //   wx.redirectTo({
      // //目的页面地址
      //       url: \'pages/logs/index\',
      //       success: function(res){},

      //   })
    } else {
      this.setData({
        phone: null,
        code: null
      });
    }
  },



  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})

 

 

 

 

<!--pages/milk/milk.wxml-->
<text>特价页面</text>
<!--  首先 需要一个容器 夜光 -->
<view class="container">
  <!-- 学过前端都知道,这种一直变换的图片组件~~ 在微信小程序开发里面稍微轻松点-->
  <swiper>
    <swiper-item>
    <!-- 轮播,一般,我们都是放图片 -->
     <image src=""></image>
    </swiper-item>
  </swiper>
</view>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Publicado 1529 artículos originales · elogiado 305 · 180,000 vistas +

Supongo que te gusta

Origin blog.csdn.net/weixin_41987706/article/details/104598470
Recomendado
Clasificación