55 lines
1.1 KiB
Vue
55 lines
1.1 KiB
Vue
<script>
|
|
import toolAll from './jsFile/tools.js';
|
|
export default {
|
|
globalData:{
|
|
projectname:'', // 项目名称
|
|
lat:'', // 公司地址维度
|
|
lng:'' ,// 公司地址经度
|
|
hostapi:'https://yisi-scan.scdxtc.cn' // 域名配置
|
|
},
|
|
|
|
|
|
|
|
// 优先于show方法
|
|
onLaunch() {
|
|
let that = this;
|
|
uni.login({
|
|
provider: 'weixin',
|
|
success: (result)=> {
|
|
if (result.code) {
|
|
that.$requst.post('/api/user/login',{code:result.code}).then(res => {
|
|
if(res.code == 0){
|
|
uni.setStorageSync('token',res.data.token) //缓存token
|
|
uni.setStorageSync('openid',res.data.openid) //缓存openid
|
|
that.$isResolve(); //promise 异步执行
|
|
}
|
|
},error => {
|
|
|
|
})
|
|
}
|
|
},
|
|
});
|
|
},
|
|
onShow: ()=> {
|
|
|
|
},
|
|
onHide: ()=> {
|
|
}
|
|
};
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
/* 阿里巴巴矢量图标库 start */
|
|
@import url("./commons/icon-font.css");
|
|
/* 阿里巴巴矢量图标库 end */
|
|
|
|
/* 项目页面样式 start */
|
|
@import url("./commons/style.css");
|
|
/* 项目页面样式 end */
|
|
|
|
/* 加载中样式 start */
|
|
@import url("./commons/loading.css");
|
|
/* 加载中样式 end */
|
|
</style> |