本文实例为大家分享了微信小程序实现登录注册的具体代码,供大家参考,具体内容如下
html:
js:
// pages/login/login.js
Page({
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)
}
})
},
onLoad: function (options) {
},
onReady: function () {
},
onShow: function () {
},
onHide: function () {
},
onUnload: function () {
},
onPullDownRefresh: function () {
},
onReachBottom: function () {
},
onShareAppMessage: function () {
}
})
效果图:
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



