zengh
2022-09-14 8ea19a6bb34daab1410f6186992a4c1e90299c92
store/positions.js
@@ -8,6 +8,9 @@
   state: {
      isBeginTask: {},
      isOnTask: {},
      isOnTaskValue: {},
      changes: true,
      i: 0
   },
   actions: {
      // connectws({
@@ -26,9 +29,16 @@
               id: id,
               fn: function(res) {
                  // console.log(res);
                  state.isOnTaskValue = {
                     id: id,
                     intlat: res.intlat,
                     i: state.i++
                  }
                  state.changes = !state.changes;
                  // console.log(state.isOnTaskValue)
                  $store.commit("setMsg", {
                     id: id,
                     intlat: res.intlat
                     intlat: res.intlat,
                  })
               }
            })
@@ -58,12 +68,12 @@
      setMsg(state, value) {
         //发送任务位置
         //uid ;自己id,rid: 任务id,jd,wd经度纬度
         // console.log(value)
         console.log(value, 123)
         let d = {
            uid: WxStorage.get("ids"),
            uid: WxStorage.get("ids") || $store.state.puserID,
            rid: value.id,
            jd: value.intlat[0],
            wd: value.intlat[1],
            jd: value.intlatold[0],
            wd: value.intlatold[1],
         }
         uni.request({
            url: $store.state.piAPI + "trar/submit",
@@ -79,14 +89,21 @@
            serid = val.serid,
            type = val.type,
            that = val.that,
            goto1 = val.goto,
            // data = val.data,
            tips = (type, title) => {
               that.$refs.uTips.show({
                  title: title,
                  type: type,
                  duration: '2300'
               })
               if (that.$refs.uTips) {
                  that.$refs.uTips.show({
                     title: title,
                     type: type,
                     duration: '2300'
                  })
               }
               // that.getGrabOrders(that.current); //重获取数据
            }
         if (type == "start") {
            type = goto1 + ',' + type
         }
         uni.request({
            url: $store.state.piAPI + "taskqd/startTask?" +
               `rid=${rid}&serid=${serid}&type=${type}`,