| | |
| | | import { todayDate } from '@/utils/util.js'; |
| | | export default { |
| | | onLoad(params) { |
| | | if (params.orderPlanId && params.coalStatus) { |
| | | this.punchTheClockObj.id = params.orderPlanId; |
| | | this.coalStatus = params.coalStatus; |
| | | } |
| | | this.punchTheClockObj.tmcoa = params.tmId.toString(); |
| | | this.coalStatus = params.coalStatus; |
| | | }, |
| | | data() { |
| | | return { |
| | | nowTime: '', |
| | | coalStatus: 0, |
| | | punchTheClockObj: { |
| | | latitude: null, |
| | | longitude: null, |
| | | id: null |
| | | tmcoa: null, |
| | | latA: null, |
| | | latB: null |
| | | } |
| | | }; |
| | | }, |
| | |
| | | type: 'wgs84', |
| | | success(res) { |
| | | console.log(res, '获取位置', that); |
| | | that.punchTheClockObj.latitude = res.latitude; |
| | | that.punchTheClockObj.longitude = res.longitude; |
| | | that.punchTheClockObj.latB = res.latitude; |
| | | that.punchTheClockObj.latA = res.longitude; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | // 签到 |
| | | arrive() { |
| | | if (this.punchTheClockObj.latitude && this.punchTheClockObj.longitude) { |
| | | if (this.punchTheClockObj.latA && this.punchTheClockObj.latB) { |
| | | console.log(this.punchTheClockObj); |
| | | this.$reqPost('arrive', this.punchTheClockObj, 'params').then(res => { |
| | | console.log(res, '签到'); |
| | | if (res.code == 0) { |
| | |
| | | ); |
| | | }); |
| | | } else { |
| | | this.$u.toast(res.data ? res.data : '签到失败'); |
| | | this.$u.toast(res.msg ? res.msg : '签到失败'); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | p{ |
| | | p { |
| | | text-align: center; |
| | | } |
| | | } |