that.setData({
user: wx.getStorageSync(‘user‘)
});
wx:if="{{==1}}"
chargeInto: function () {
wx.navigateTo({
url: "/pages/user/chargeintopay/chargeintopay"
})
},
wx.switchTab({
url: "/pages/user/index"
})
wx.showToast({
title: ‘登录成功‘,
icon: ‘success‘,
duration: 1000
})
setTimeout(function () {
}, 1000);
post请求-----------------------------------------
wx.setStorageSync(‘user‘, result)
let user = wx.getStorageSync(‘user‘);
let that = this;
post请求-----------------------------------------
wx.request({
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
method: "POST",
url: app.globalData.hpUrl + ‘User/userAllRegister‘,
data: {
typenum: selectArr[selectIndex],
phone: loveChe.hphone,
password: loveChe.hpwd
},
success: function (res) {
var result = res.data;
console.log(res)
}
}
});
原文地址:https://www.cnblogs.com/dianzan/p/8359505.html