ll
liukangdong
2024-12-06 86baa8ff948d2e79588e0dd7efa16f6b8ac3b157
h5/pages/driver/taskDetail.vue
@@ -181,10 +181,10 @@
               status: '0'
            },
            jobId: '',
            // lat: '',
            // lnt: '',
            lat: '31.783205',
            lnt: '117.262635',
            lat: '',
            lnt: '',
            // lat: '31.783205',
            // lnt: '117.262635',
            nowTime: '',
            wmsInfo: {},
            signDistance: uni.getStorageSync('driverGuide').signDistance,
@@ -193,12 +193,23 @@
      },
      onLoad(option) {
         this.jobId = option.id
         // if(option.status && option.status == '1'){
         //    this.getLocation()
         // }else{
         //    this.getDetail()
         // }
         this.getDetail()
         if (option.status && option.status == '1') {
            // wx.config({
            //    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
            //    appId: 'wx173e6caf5abc718a', // 必填,公众号的唯一标识
            //    timestamp: timeStamp, // 必填,生成签名的时间戳
            //    nonceStr: nonceStr, // 必填,生成签名的随机串
            //    signature: Sign, // 必填,签名
            //    jsApiList: [
            //       'getLocation',
            //       'openLocation'
            //    ] // 必填,需要使用的JS接口列表
            // })
            this.getLocation()
         } else {
            this.getDetail()
         }
         // this.getDetail()
         setInterval(() => {
            this.nowTime = dayjs().format('HH:mm:ss')
         })
@@ -254,6 +265,22 @@
            const {
               jobId
            } = this
            // wx.ready(() => {
            //    wx.getLocation({
            //       type: "gcj02", // gcj02(火星坐标),wgs84(GPS坐标)
            //       success: (res) => {
            //          this.lat = res.latitude
            //          this.lnt = res.longitude
            //          this.getDetail()
            //       },
            //       fail: (err) => {
            //          console.error("获取定位失败:", err);
            //       },
            //       cancel: () => {
            //          console.warn("用户拒绝授权获取地理位置");
            //       },
            //    });
            // });
            uni.getLocation({
               type: 'wgs84',
               success: (res) => {
@@ -262,7 +289,7 @@
                  this.getDetail()
               },
               fail: (err) => {
                  this.showToast('获取定位失败')
                  this.showToast('获取定位失败', err)
               }
            })
         },
@@ -438,11 +465,12 @@
      }
   }
.detail_modal {
      height: calc( 100vh - 88rpx );
   .detail_modal {
      height: calc(100vh - 88rpx);
      padding: 36rpx 30rpx;
      border-radius: 12rpx;
      box-shadow: 0 0 6rpx rgba(0, 0, 0, 0.5);
      .modal_title {
         font-weight: 600;
         font-size: 32rpx;
@@ -451,37 +479,46 @@
         text-align: center;
         margin-bottom: 36rpx;
      }
      .contract_wrap{
         height: calc( 100% - 400rpx );
      .contract_wrap {
         height: calc(100% - 400rpx);
         overflow-y: auto;
      }
      .contract_list {
         border-top: 1rpx solid #E5E5E5;
         margin-bottom: 30rpx;
         padding-top: 30rpx;
         &:nth-last-child(1){
         &:nth-last-child(1) {
            margin-bottom: 0;
         }
         .list {
            background: #f7f7f7;
            border-radius: 8rpx;
            padding: 20rpx;
            .item{
            .item {
               border-bottom: 1rpx solid #e5e5e5;
               padding-bottom: 20rpx;
               margin-bottom: 20rpx;
               &:nth-last-child(1){
               &:nth-last-child(1) {
                  border: none;
                  padding-bottom: 0;
                  margin-bottom: 0;
               }
            }
            .line {
               display: flex;
               margin-bottom: 20rpx;
               &:nth-last-child(1){
               &:nth-last-child(1) {
                  margin-bottom: 0rpx;
               }
               .label {
                  color: #666666;
                  width: 92rpx;