|
|
@@ -131,6 +131,7 @@
|
|
|
// import wx from 'weixin-jsapi'
|
|
|
const wx = window.wx;
|
|
|
let TIME = null;
|
|
|
+
|
|
|
export default {
|
|
|
name: "index",
|
|
|
components: {
|
|
|
@@ -157,14 +158,23 @@
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ beforeCreate() {
|
|
|
+ if (location.href.indexOf("#") === -1) {
|
|
|
+ location.href = location.href + "#isreload";
|
|
|
+ location.reload();
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
+ //
|
|
|
//获取链接参数
|
|
|
- var query = this.$route.query;
|
|
|
- this.enterprise_id = query.enterprise_id;
|
|
|
- this.enterprise_name = query.enterprise_name;
|
|
|
+ // var query = this.$route.query;
|
|
|
+ // this.enterprise_id = query.enterprise_id;
|
|
|
+ // this.enterprise_name = query.enterprise_name;
|
|
|
this.role = getStore('role');
|
|
|
this.getJsapiConfig();
|
|
|
if (this.role === 'staff') {
|
|
|
+ this.enterprise_id = getStore('staff').enterpriseId;
|
|
|
+ this.enterprise_name = getStore('staff').enterpriseName;
|
|
|
getAction(queryStaffPunchClock, {staffId: getStore(getStore('role')).id}).then(data => {
|
|
|
if (data.data.dkPunchClockAPIList.length && isToday(data.data.dkPunchClockAPIList[0].punchTime)) {
|
|
|
this.temperature = data.data.dkPunchClockAPIList[0].temperature;
|
|
|
@@ -172,10 +182,13 @@
|
|
|
} else {
|
|
|
this.status = 1
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
+ } else {
|
|
|
+ this.enterprise_id = getStore('company').id;
|
|
|
+ this.enterprise_name = getStore('company').enterpriseName;
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
methods: {
|
|
|
loginout() {
|
|
|
const role = getStore('role');
|
|
|
@@ -189,19 +202,24 @@
|
|
|
this.$router.replace('login')
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
toJourney() {
|
|
|
this.$router.push({name: 'return_journey'})
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
toTemperature() {
|
|
|
this.$router.push({name: 'temperature'})
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
toStaffJourney() {
|
|
|
this.$router.push({name: 'journey_detail'})
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
toStaffTemperature() {
|
|
|
this.$router.push({name: 'clock'})
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
clock() {
|
|
|
if (this.ready) {
|
|
|
clearTimeout(TIME);
|
|
|
@@ -210,16 +228,20 @@
|
|
|
this.loading = true;
|
|
|
TIME = setTimeout(this.clock, 500)
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
toDonations() {
|
|
|
this.$router.push({name: 'donations'})
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
shareSure() {
|
|
|
this.cover = false
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
share() {
|
|
|
this.cover = true
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
getJsapiConfig() {
|
|
|
//获取微信js配置信息
|
|
|
getAction(this.url.getJsapiConfig, {fullUrl: encodeURIComponent(location.href.split('#')[0])})
|
|
|
@@ -250,7 +272,8 @@
|
|
|
})
|
|
|
.catch(() => {
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
location() {
|
|
|
var that = this;
|
|
|
// return new Promise(((resolve, reject) => {
|
|
|
@@ -275,11 +298,13 @@
|
|
|
console.log('fail');
|
|
|
Toast("获取位置失败,请检查定位");
|
|
|
that.loading = false;
|
|
|
+ that.$router.push({name: 'staff_temperature', params: {province: ''}});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
// }))
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
changeLocation(latitude, longitude) {
|
|
|
var that = this;
|
|
|
// return new Promise((resolve) => {
|
|
|
@@ -314,7 +339,8 @@
|
|
|
console.log(data);
|
|
|
});
|
|
|
// })
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
|
|
|
//分享给朋友
|
|
|
updateAppMessageShareData() {
|
|
|
@@ -328,7 +354,8 @@
|
|
|
// 设置成功
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
+ }
|
|
|
+ ,
|
|
|
|
|
|
//分享到朋友圈
|
|
|
updateTimelineShareData() {
|