
27 changed files with 893 additions and 328 deletions
@ -1,102 +1,103 @@ |
|||
<script> |
|||
import config from "common/config.js"; |
|||
import { |
|||
navParams |
|||
} from "common/nav-calc-utils.js"; |
|||
export default { |
|||
globalData: { |
|||
wxSilentLoginURL: config.baseUrl + "/lpkcustomer/wxSilentLogin", |
|||
sid: "", |
|||
token: "", |
|||
mobile: "", |
|||
isNewUser: "", //是否新人 0 否 1 是 邀请新人助力 |
|||
isPurchase: "", //是否购买过 1否 0是 首页新人礼包弹框 |
|||
navInfo: { |
|||
import config from "common/config.js"; |
|||
import { |
|||
navParams |
|||
} from "common/nav-calc-utils.js"; |
|||
export default { |
|||
globalData: { |
|||
wxSilentLoginURL: config.baseUrl + "/lpkcustomer/wxSilentLogin", |
|||
orgPath: "b0ef543c-7061-4f10-8baa-17930f5170be", // 注册企业全路径 绑定小程序appid |
|||
sid: "", |
|||
token: "", |
|||
mobile: "", |
|||
isNewUser: "", //是否新人 0 否 1 是 邀请新人助力 |
|||
isPurchase: "", //是否购买过 1否 0是 首页新人礼包弹框 |
|||
navInfo: { |
|||
|
|||
} |
|||
}, |
|||
onLaunch: function() { |
|||
} |
|||
}, |
|||
onLaunch: function() { |
|||
|
|||
wx.hideTabBar() |
|||
wx.hideTabBar() |
|||
|
|||
const updateManager = uni.getUpdateManager(); |
|||
const updateManager = uni.getUpdateManager(); |
|||
|
|||
updateManager.onCheckForUpdate(function(res) { |
|||
// 请求完新版本信息的回调 |
|||
console.log(res.hasUpdate); |
|||
}); |
|||
updateManager.onCheckForUpdate(function(res) { |
|||
// 请求完新版本信息的回调 |
|||
console.log(res.hasUpdate); |
|||
}); |
|||
|
|||
updateManager.onUpdateReady(function(res) { |
|||
uni.showModal({ |
|||
title: '更新提示', |
|||
content: '新版本已经准备好,是否重启应用?', |
|||
success(res) { |
|||
if (res.confirm) { |
|||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 |
|||
updateManager.applyUpdate(); |
|||
} |
|||
} |
|||
}); |
|||
updateManager.onUpdateReady(function(res) { |
|||
uni.showModal({ |
|||
title: '更新提示', |
|||
content: '新版本已经准备好,是否重启应用?', |
|||
success(res) { |
|||
if (res.confirm) { |
|||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 |
|||
updateManager.applyUpdate(); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
}); |
|||
}); |
|||
|
|||
updateManager.onUpdateFailed(function(res) { |
|||
// 新的版本下载失败 |
|||
}); |
|||
updateManager.onUpdateFailed(function(res) { |
|||
// 新的版本下载失败 |
|||
}); |
|||
|
|||
|
|||
this.globalData.navInfo = navParams() |
|||
this.globalData.navInfo = navParams() |
|||
|
|||
// let _this = this; |
|||
// wx.login({ |
|||
// success: function(res) { |
|||
// uni.request({ |
|||
// // 组装请求地址 |
|||
// url:_this.globalData.wxSilentLoginURL + "?wxCode=" + res.code, |
|||
// method: "GET", |
|||
// header: { |
|||
// 'content-type': "application/x-www-form-urlencoded" |
|||
// }, |
|||
// data: { |
|||
// "wxCode": res.code |
|||
// }, |
|||
// success: res => { |
|||
// if (res.statusCode == 200) { |
|||
// if (!res.data.success) { |
|||
// if (res.data.code == "110") { |
|||
// // 需要绑定手机号 |
|||
// uni.reLaunch({ |
|||
// url: '/pages/index/BindPhone?openid=' + |
|||
// res.data.data.wxMpOpenid |
|||
// }) |
|||
// } else { |
|||
// // _this.status = 'more' |
|||
// } |
|||
// } else { |
|||
// // 成功后跳转主页 |
|||
// _this.globalData.sid = res.data.data.sid |
|||
// console.log("用户sid",_this.globalData.sid) |
|||
// } |
|||
// } else { |
|||
// } |
|||
// }, |
|||
// fail: (err) => { |
|||
// } |
|||
// }); |
|||
// }, |
|||
// fail: function(res) { |
|||
// } |
|||
// }); |
|||
}, |
|||
onShow: function() { |
|||
console.log('App Show') |
|||
}, |
|||
onHide: function() { |
|||
console.log('App Hide') |
|||
}, |
|||
} |
|||
// let _this = this; |
|||
// wx.login({ |
|||
// success: function(res) { |
|||
// uni.request({ |
|||
// // 组装请求地址 |
|||
// url:_this.globalData.wxSilentLoginURL + "?wxCode=" + res.code, |
|||
// method: "GET", |
|||
// header: { |
|||
// 'content-type': "application/x-www-form-urlencoded" |
|||
// }, |
|||
// data: { |
|||
// "wxCode": res.code |
|||
// }, |
|||
// success: res => { |
|||
// if (res.statusCode == 200) { |
|||
// if (!res.data.success) { |
|||
// if (res.data.code == "110") { |
|||
// // 需要绑定手机号 |
|||
// uni.reLaunch({ |
|||
// url: '/pages/index/BindPhone?openid=' + |
|||
// res.data.data.wxMpOpenid |
|||
// }) |
|||
// } else { |
|||
// // _this.status = 'more' |
|||
// } |
|||
// } else { |
|||
// // 成功后跳转主页 |
|||
// _this.globalData.sid = res.data.data.sid |
|||
// console.log("用户sid",_this.globalData.sid) |
|||
// } |
|||
// } else { |
|||
// } |
|||
// }, |
|||
// fail: (err) => { |
|||
// } |
|||
// }); |
|||
// }, |
|||
// fail: function(res) { |
|||
// } |
|||
// }); |
|||
}, |
|||
onShow: function() { |
|||
console.log('App Show') |
|||
}, |
|||
onHide: function() { |
|||
console.log('App Hide') |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
/*每个页面公共css */ |
|||
/*每个页面公共css */ |
|||
</style> |
Loading…
Reference in new issue