qingyiay
2023-05-17 05273ace3da665cb10c36ca0dac4413a8284302a
pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue
@@ -9,10 +9,10 @@
               <p>{{ nowTime }}</p>
            </view>
         </view>
         <view class="punchTheClock_text">
         <!-- <view class="punchTheClock_text">
            <u-icon name="map" color="#51e30d" size="30"></u-icon>
            <text>未进入矿场区域</text>
         </view>
         </view> -->
      </view>
   </view>
</template>
@@ -21,19 +21,17 @@
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
         }
      };
   },
@@ -69,8 +67,8 @@
            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;
            }
         });
      },
@@ -81,7 +79,8 @@
      },
      // 签到
      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) {
@@ -95,7 +94,7 @@
                     );
                  });
               } else {
                  this.$u.toast(res.data ? res.data : '签到失败');
                  this.$u.toast(res.msg ? res.msg : '签到失败');
               }
            });
         } else {
@@ -123,7 +122,7 @@
         display: flex;
         justify-content: center;
         align-items: center;
         p{
         p {
            text-align: center;
         }
      }