2023-11-27 09:24:16 +08:00
|
|
|
|
<script>
|
|
|
|
|
export default {
|
2024-01-22 16:14:28 +08:00
|
|
|
|
onLaunch: function(e) {
|
2023-11-27 09:24:16 +08:00
|
|
|
|
console.log('App Launch')
|
|
|
|
|
// #ifdef MP-WEIXIN
|
2023-12-28 17:31:50 +08:00
|
|
|
|
uni.setStorageSync("appltType","WECHAT")
|
|
|
|
|
console.log("微信")
|
2023-11-27 09:24:16 +08:00
|
|
|
|
//检查是否存在新版本
|
|
|
|
|
uni.getUpdateManager().onCheckForUpdate(function(res) {
|
|
|
|
|
// 请求完新版本信息的回调
|
|
|
|
|
console.log("是否有新版本:" + res.hasUpdate);
|
|
|
|
|
if (res.hasUpdate) { //如果有新版本
|
|
|
|
|
|
|
|
|
|
// 小程序有新版本,会主动触发下载操作(无需开发者触发)
|
|
|
|
|
uni.getUpdateManager().onUpdateReady(function() { //当新版本下载完成,会进行回调
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: '更新提示',
|
|
|
|
|
content: '新版本已经准备好,单击确定重启应用',
|
|
|
|
|
showCancel: false,
|
|
|
|
|
success: function(res) {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
|
|
|
uni.getUpdateManager().applyUpdate();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 小程序有新版本,会主动触发下载操作(无需开发者触发)
|
|
|
|
|
uni.getUpdateManager().onUpdateFailed(function() { //当新版本下载失败,会进行回调
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: '检查到有新版本,但下载失败,请检查网络设置',
|
|
|
|
|
showCancel: false,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// #endif
|
2023-12-28 17:31:50 +08:00
|
|
|
|
// #ifdef MP-ALIPAY
|
|
|
|
|
uni.setStorageSync("appltType","ALIPAY")
|
|
|
|
|
console.log("支付宝")
|
2023-12-29 15:27:06 +08:00
|
|
|
|
my.canIUse('button.open-type.getAuthorize')
|
2024-01-22 14:25:45 +08:00
|
|
|
|
//获取关联普通二维码的码值,放到全局变量qrCode中
|
|
|
|
|
if (e.query && e.query.qrCode) {
|
|
|
|
|
console.log(JSON.stringify(e)+"1.0")
|
|
|
|
|
let q = e.query.qrCode;
|
|
|
|
|
if (e.query.qrCode) {
|
|
|
|
|
let str = q.split("?")[1];
|
|
|
|
|
let storeId = "";
|
|
|
|
|
|
|
|
|
|
let staffId = "";
|
|
|
|
|
if (str.includes("&")){
|
|
|
|
|
let arr = str.split("&");
|
|
|
|
|
arr.forEach(item => {
|
|
|
|
|
if (item.includes("storeId")) {
|
|
|
|
|
storeId = item.split("=")[1]
|
|
|
|
|
}else {
|
|
|
|
|
staffId = item.split("=")[1]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
if (str.includes("storeId")) {
|
|
|
|
|
storeId = str.split("=")[1]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
uni.setStorageSync("storeId", storeId)
|
|
|
|
|
uni.setStorageSync("inviteStaffId", staffId)
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title:uni.getStorageSync("storeId") + "staffId" + uni.getStorageSync("inviteStaffId")
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-12-28 17:31:50 +08:00
|
|
|
|
// #endif
|
2023-11-27 09:24:16 +08:00
|
|
|
|
},
|
|
|
|
|
onShow: function() {
|
|
|
|
|
console.log('App Show')
|
|
|
|
|
},
|
|
|
|
|
onHide: function() {
|
|
|
|
|
console.log('App Hide')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
2023-11-27 15:53:06 +08:00
|
|
|
|
// /*每个页面公共css */
|
|
|
|
|
@import "@/node_modules/uview-ui/index.scss";
|
|
|
|
|
|
2023-11-27 09:24:16 +08:00
|
|
|
|
|
|
|
|
|
.dis {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
</style>
|