perry-mall/App.vue

64 lines
1.8 KiB
Vue

<script>
import toolAll from '@/jsFile/tools.js';
import requst from '@/jsFile/requst.js';
export default {
// 全局域名配置
globalData:{
// domainName:'https://hengmei.scdxtc.cn/api/',
domainName:'https://hm.hmzfyy.cn/api/',
},
onLaunch: function() {
toolAll.tools.clearClog();//去除体验版和正式版的所有输出日志
// 主题颜色
// toolAll.tools.zhuColorT();
uni.request({
url: `${this.globalData.domainName}index/mini-program-setting`,
method: 'GET',
data: '',
header: {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: res => {
// console.log('反的结果===>',res);
if (res.statusCode == 200) {
if (res.data.code == 0) {
uni.setStorageSync('publicColor', res.data.data.mainColor) //#3875F6 #2E8B57
// uni.setStorageSync('publicColor', '#2E8B57') //#3875F6 #2E8B57
}
}
}
})
},
onShow: function() {
// uni.clearStorageSync()
if(uni.getStorageSync('token')!='') {
toolAll.tools.daoTime();
toolAll.tools.networkStatus();//检查当前网络状态
toolAll.tools.updaX();//检测版本更新
}
setTimeout(()=>{
toolAll.tools.overdue();//查询是否第一次授权
},3000)
toolAll.tools.isVedio();
toolAll.tools.checkQuan();
},
onHide: function() {
toolAll.tools.closeTimer();//清空埋点倒计时
uni.removeStorageSync('isQuan');
uni.removeStorageSync('quanImg');
uni.removeStorageSync('quanId');
uni.removeStorageSync('isQuan');
uni.removeStorageSync('firstTime');
}
};
</script>
<style>
/*每个页面公共css */
@import url("./commons/hengmei.css");
@import url("./commons/animate.min.css");
page {background-color: rgba(244, 244, 244, 1);}
</style>