最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

微信小程序?qū)崿F(xiàn)登錄注冊(cè)功能

 更新時(shí)間:2020年12月29日 14:37:02   作者:保護(hù)我方豆豆  
這篇文章主要介紹了微信小程序?qū)崿F(xiàn)登錄注冊(cè)功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了微信小程序?qū)崿F(xiàn)登錄注冊(cè)的具體代碼,供大家參考,具體內(nèi)容如下

html:

<form bindsubmit="handleSubmit" wx:if="{{ onoff }}">
 用戶(hù)名: <input type="text" name='username'/>
 密碼: <input type="password" name='password'/>
 手機(jī)號(hào): <input type="text" name='phone'/>
 <button form-type="submit"> 注冊(cè) </button>
</form>

<form bindsubmit="handleLogin" wx:else>
 用戶(hù)名: <input type="text" name='username'/>
 密碼: <input type="password" name='password'/>
 <button form-type="submit"> 登錄 </button>
</form>

js:

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

 /**
 * 頁(yè)面的初始數(shù)據(jù)
 */
 data: {
 onoff: false
 },
 handleSubmit(e){
 const {value} = e.detail;
 // console.log(value)
 const that = this;
 wx.request({
 url: 'http://pddapi.h5sm.com/index/pdduser/getpddregister',
 method: 'post',
 data: value,
 success(res){
 if(res.data.status == 1){
  that.setData({
  onoff: false
  })
 }
 }
 })
 },

 handleLogin(e){
 const {username, password} = e.detail.value;

 const that = this;
 wx.request({
 url: 'http://pddapi.h5sm.com/index/pdduser/getpddlogin',
 method: 'post',
 data:{
 username, password
 },
 success(res){
  console.log(res)
 }
 })
 },
 /**
 * 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面加載
 */
 onLoad: function (options) {

 },

 /**
 * 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面初次渲染完成
 */
 onReady: function () {

 },

 /**
 * 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面顯示
 */
 onShow: function () {

 },

 /**
 * 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面隱藏
 */
 onHide: function () {

 },

 /**
 * 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面卸載
 */
 onUnload: function () {

 },

 /**
 * 頁(yè)面相關(guān)事件處理函數(shù)--監(jiān)聽(tīng)用戶(hù)下拉動(dòng)作
 */
 onPullDownRefresh: function () {

 },

 /**
 * 頁(yè)面上拉觸底事件的處理函數(shù)
 */
 onReachBottom: function () {

 },

 /**
 * 用戶(hù)點(diǎn)擊右上角分享
 */
 onShareAppMessage: function () {

 }
})

效果圖:

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

随州市| 芜湖市| 云阳县| 临高县| 咸宁市| 龙海市| 铅山县| 金门县| 穆棱市| 义乌市| 荃湾区| 尼木县| 新晃| 渝中区| 丽江市| 靖边县| 邮箱| 礼泉县| 沈丘县| 修武县| 喜德县| 曲阜市| 友谊县| 团风县| 庄河市| 温宿县| 宣化县| 金坛市| 奎屯市| 青龙| 绥中县| 江源县| 大安市| 宝鸡市| 阳信县| 即墨市| 灌云县| 屯门区| 上栗县| 大洼县| 奉节县|