微信小程序 对接口常用

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)
 
}
}
});
 

微信小程序 对接口常用

上一篇:微信小程序-学习笔记3-生命周期


下一篇:kX3552 应用指南[双语海外版] kX Application Guide2.11.3.51