JS页面
需要用到页面onshow方法里要重置
this.setDate({
isNull: false
})
const _http = (options, page, loading) =>{
return new Promise((resolve,reject) => {
let that = this;
if(loading){
wx.showLoading({
title: '请稍后...',
mask: true
})
}
wx.request({
url: options.url,
method: options.method || 'GET',
data: options.data || {},
header: options.header || {
'content-type':'application/x-www-form-urlencoded'
},
success: function (res) {
resolve(res);
},
fail: function (res) {
//防止页面多次跳转
if (!page.data.isNull) {
wx.navigateTo({