//app.js viptime // appid wx842cf17c56448e51 // appid 装修宝 wxf33092e34e6ae8b1 var d = new Date() App({ globalData:{ statusBarHeight:'', titleBarHeight:44, imgUrl:'https://o.nczyzs.com/',//imgzqxgtest wburl:'https://img.yunxiekeji.cn', simgUrl:'https://wzh-zqxg.oss-cn-hangzhou.aliyuncs.com/', webUrl:'https://wzh.nczyzs.com/',//测试环境 saastest https://saasdev.zhuangqixiaoguan.com/,正式环境https://wzh.nczyzs.com/ token:'', userflag:false,//true是有个人信息,false没有个人信息 phone:false,//true是有手机号,false是没有手机号 shareuserid:'',//分享人的id currentUserId: '', brokeruserId: '', companyobj:{}, shareperson:{}, sharempid:'', personMsg:{},//org_type 2是设计师,其他的是销售 unreadNum:0, official_openid: null, screenHeight:'100%', sharename:'',//分享人的昵称 timearr:[], addstate:'',//add是添加客户页面,list是客户列表页面 clientype:'', companyname:'', platform: '', vraddress: '', sharepersonobj:{}, timeline:'',//1是从“单页模式”打开小程序”,2是朋友圈内打开“单页模式” }, onLaunch: function (opts) { var that = this; // wx.loadFontFace({ // family: 'digifaw', // global:true, // source: 'url("https://wzh.nczyzs.com/static/fonts/digifaw.ttf")', // success: console.log // }) this.globalData.timearr = []; const updateManager = wx.getUpdateManager() updateManager.onCheckForUpdate(function (res) { // 请求完新版本信息的回调 console.log(res.hasUpdate) }) updateManager.onUpdateReady(function () { wx.showModal({ title: '更新提示', content: '新版本已经准备好,是否重启应用?', success: function (res) { if (res.confirm) { // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 updateManager.applyUpdate() } } }) }) updateManager.onUpdateFailed(function () { // 新的版本下载失败 wx.showModal({ title: '更新提示', content: '新版本下载失败', showCancel: false }) }) wx.getSystemInfo({ success: (res) => { that.globalData.screenHeight = res.safeArea.height; that.globalData.platform = res.platform; that.globalData.statusBarHeight = res.statusBarHeight; if (!!that.globalData.statusBarHeight && res.platform != 'devtools') { wx.setStorage({ key: "statusBarHeight", data: res.statusBarHeight }) } }, fail: (res) => { } }) var that = this; var obj = wx.getLaunchOptionsSync(); if(obj.scene==1155){ that.globalData.timeline=1; if(obj.path=='index/pages/namecard/namecard'){ wx.reLaunch({ url:'/share/pages/shareCard/shareCard?uid=' + obj.query.uid + '&empid=' + obj.query.empid + '&ctp=' + obj.query.ctp, }) } }else if(obj.scene==1154&&(obj.path=='index/pages/namecard/namecard'||obj.path=='share/pages/shareCard/shareCard'||obj.path=='pages/index/index')){ that.globalData.timeline=2; }else{ that.globalData.timeline=''; } }, onShow: function (options) { var that = this; var obj = wx.getLaunchOptionsSync(); if(obj.scene==1155){ that.globalData.timeline=1; if(obj.path=='index/pages/namecard/namecard'){ wx.reLaunch({ url:'/share/pages/shareCard/shareCard?uid=' + obj.query.uid + '&empid=' + obj.query.empid + '&ctp=' + obj.query.ctp, }) } }else if(obj.scene==1154&&(obj.path=='index/pages/namecard/namecard'||obj.path=='share/pages/shareCard/shareCard'||obj.path=='pages/index/index')){ that.globalData.timeline=2; }else{ that.globalData.timeline=''; } wx.getStorage({ key: 'lastpath', success(res) { let arr = obj.path.split('/'); if (res.data == obj.path && obj.path == 'mycustomer/pages/invite/invite') { wx.reLaunch({ url: '/pages/index/index', }) } } }) if (obj.path == 'mycustomer/pages/invite/invite') { wx.removeStorage({ key: "lastpath", }) } else { wx.setStorage({ key: "lastpath", data: obj.path }) } }, })