微信小程序 对接口常用

时间:2018-01-26 15:48:42   收藏:0   阅读:288
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)
 
}
}
});
 
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!