hengmei-two/App.vue

61 lines
1.8 KiB
Vue
Raw Normal View History

2021-08-19 06:40:59 +00:00
<script>
import toolAll from '@/jsFile/tools.js';
import requst from '@/jsFile/requst.js';
2021-08-19 06:40:59 +00:00
export default {
onLaunch: function() {
2022-02-17 03:49:34 +00:00
// 全局域名配置
// uni.setStorageSync('hostapi','https://hengmei.scdxtc.cn/api/');
uni.setStorageSync('hostapi','https://hm.hmzfyy.cn/api/');
2021-11-02 10:23:53 +00:00
toolAll.tools.clearClog();//去除体验版和正式版的所有输出日志
// 主题颜色
// toolAll.tools.zhuColorT();
uni.request({
2022-02-17 03:49:34 +00:00
url: `${uni.getStorageSync('hostapi')}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
}
}
}
})
2021-08-19 06:40:59 +00:00
},
onShow: function() {
// uni.clearStorageSync()
if(uni.getStorageSync('token')!='') {
2021-11-02 10:23:53 +00:00
toolAll.tools.daoTime();
toolAll.tools.networkStatus();//检查当前网络状态
toolAll.tools.updaX();//检测版本更新
2021-10-11 10:21:06 +00:00
}
2021-08-26 01:50:19 +00:00
setTimeout(()=>{
2021-11-02 10:23:53 +00:00
toolAll.tools.overdue();//查询是否第一次授权
2022-02-17 03:49:34 +00:00
},5000)
2021-12-20 08:02:27 +00:00
toolAll.tools.isVedio();
2021-11-02 10:23:53 +00:00
toolAll.tools.checkQuan();
2021-08-19 06:40:59 +00:00
},
onHide: function() {
2021-11-02 10:23:53 +00:00
toolAll.tools.closeTimer();//清空埋点倒计时
uni.removeStorageSync('isQuan');
uni.removeStorageSync('quanImg');
uni.removeStorageSync('quanId');
2021-11-08 08:38:55 +00:00
uni.removeStorageSync('isQuan');
2022-01-24 05:53:00 +00:00
uni.removeStorageSync('firstTime');
2021-08-19 06:40:59 +00:00
}
};
</script>
<style>
/*每个页面公共css */
@import url("./commons/hengmei.css");
@import url("./commons/animate.min.css");
page {background-color: rgba(244, 244, 244, 1);}
</style>