ctrl s 刷新页面
app.js
需要刷新后访问的页面 放在最前面
data: {
navIndex:0,
navList: [
{
text: "收支明细"
},
{
text: "提现明细"
}
],
orderList:[
[
{
ctime: "2018-10-01"
,money:"1001"
}
]
,[
{
ctime: "2018-10-01"
,money:"10012"
},
]
]
},
顶部 let url = getApp().globalData.feizhuUrl;
wx.request({
url: 'https://zyc1h1p.zhu1o1hanet.com/Feizhu.php/Account/incomeExpend',
method: "POST",
header: { "Content-Type": "application/x-www-form-urlencoded" }, //必填
data: {
uid: 50092
},
success: function (res) {
var that = this;
if (res.data.code) {
that.setData({
["orderList[0]"]: res.data.data
});
}
else {
wx.showToast({
title: '加载失败',
icon: 'loading'
})
}
}
})
在 app.js 中
globalData: {
userInfo: null,
hostUrl: 'https://www.xxx.cn/xxx.php/',//api地址
hostUrl2: 'http://xxxx.xx.cn/',//图片地址
feizhuUrl: 'https://zycsxxx.com/feizhu.php/',//飞猪url请求
navBarInfo:{
height:0
, position:{}
}
}
**baocun:function(){
if(this.data.name.length==0){
wx.showToast({
title: '请输入昵称',
})
}else{
var uid = '50112';
var username = this.data.name;
console.log(username)
wx.request({
url: hostUrl2 + 'Api.php/Littles/editusername',
data:{
uid : uid,
nickname: username
},
header: {//请求头
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
// console.log(res.data);
wx.showToast({
title: res.data.msg,
mask: false,
success: function () {
setTimeout(function () {
wx.redirectTo({
url: '../my/my',
})
}, 1500)
}
})
},
fail:function()
{
console.log('连接失败')
}
})
}
},**
*/
onLoad: function (options) {
var that = this;
wx.request({
url: `${url}Banks/getBankcard`,
method: "GET",
header: { "Content-Type": "application/x-www-form-urlencoded" }, //必填
data: {
uid: 111
},
success: function (res) {
if (res.data.code) {
that.setData({
["bankArr"]: res.data.data
});
}
else {
wx.showToast({
title: '暂未绑定银行卡',
// mask: false,
icon: 'loading',
// duration: 3000,
success: function () {
setTimeout(function () {
wx.redirectTo({
url: '../bindBank/bindBank',
})
}, 50)
}
})
}
}
})
pub.openLoading();
},
wx.showToast({
title: res.data.data,
mask: false,
success: function () {
setTimeout(function () {
wx.redirectTo({
url: '../tongcheng/tongcheng',
})
}, 100)
}
})
let url = getApp().globalData.hostUrl;
app.js
globalData: {
userInfo: null,
sessionKey: null,
openId: null,
hostUrl: 'https://zycshop. 学习.com/feizhu.php/', //api地址
hostUrl2: 'http://feizhu. 学学学.cn/',//图片地址
navBarInfo:{
height:0
, position:{}
}
}