|
|
@@ -779,42 +779,88 @@
|
|
|
},
|
|
|
//商户去取车
|
|
|
goGetCar(item) {
|
|
|
- console.log(item)
|
|
|
- let data = {
|
|
|
- taskId: item.taskId,
|
|
|
- checkType: item.checkType,
|
|
|
- paramState: '05', //商户接单成功
|
|
|
- serveType: '01'
|
|
|
- }
|
|
|
- let that = this
|
|
|
- // uni.navigateTo({
|
|
|
- // url: (window.location.href = `https://uri.amap.com/navigation?to=${item.userLongitude},${item.userLatitude},${item.carAddress}&mode=car&policy=1&src=https://gawl.gazhcs.com/wap/index.html&callnative=0`)
|
|
|
- // })
|
|
|
- this.serviceList = []
|
|
|
- let page = {
|
|
|
- num: 1,
|
|
|
- size: 10
|
|
|
- }
|
|
|
- this.getserviceList(page)
|
|
|
- uni.openLocation({
|
|
|
- longitude: Number(item.userLongitude),
|
|
|
- latitude: Number(item.userLatitude),
|
|
|
- name: item.carAddres, // 位置名称
|
|
|
- // address: e.F_Address, // 位置地点
|
|
|
- success: function(res) {
|
|
|
- console.log('打开系统位置地图成功')
|
|
|
- that.$http.post("/ts/merchant/update/Serve", data).then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- // this.isReceive = true
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- fail: function(error) {
|
|
|
- console.log(error)
|
|
|
- },
|
|
|
- })
|
|
|
- },
|
|
|
+ // 清除之前的定时器,实现防抖
|
|
|
+ if (this.getCarDebounceTimer) {
|
|
|
+ clearTimeout(this.getCarDebounceTimer);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2000ms后执行真正的逻辑
|
|
|
+ this.getCarDebounceTimer = setTimeout(() => {
|
|
|
+ console.log(item);
|
|
|
+ let data = {
|
|
|
+ taskId: item.taskId,
|
|
|
+ checkType: item.checkType,
|
|
|
+ paramState: '05', //商户接单成功
|
|
|
+ serveType: '01'
|
|
|
+ };
|
|
|
+ let that = this;
|
|
|
+
|
|
|
+ this.serviceList = [];
|
|
|
+ let page = {
|
|
|
+ num: 1,
|
|
|
+ size: 10
|
|
|
+ };
|
|
|
+ this.getserviceList(page);
|
|
|
+
|
|
|
+ uni.openLocation({
|
|
|
+ longitude: Number(item.userLongitude),
|
|
|
+ latitude: Number(item.userLatitude),
|
|
|
+ name: item.carAddres, // 位置名称(注意:原代码可能笔误,应该是carAddress?)
|
|
|
+ // address: e.F_Address, // 位置地点
|
|
|
+ success: function(res) {
|
|
|
+ console.log('打开系统位置地图成功');
|
|
|
+ that.$http.post("/ts/merchant/update/Serve", data).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ // this.isReceive = true
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail: function(error) {
|
|
|
+ console.log(error);
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ // 执行完成后清空定时器(可选,防止内存泄漏)
|
|
|
+ this.getCarDebounceTimer = null;
|
|
|
+ }, 2000); // 防抖间隔2000ms
|
|
|
+ },
|
|
|
+ // goGetCar(item) {
|
|
|
+ // console.log(item)
|
|
|
+ // let data = {
|
|
|
+ // taskId: item.taskId,
|
|
|
+ // checkType: item.checkType,
|
|
|
+ // paramState: '05', //商户接单成功
|
|
|
+ // serveType: '01'
|
|
|
+ // }
|
|
|
+ // let that = this
|
|
|
+ // // uni.navigateTo({
|
|
|
+ // // url: (window.location.href = `https://uri.amap.com/navigation?to=${item.userLongitude},${item.userLatitude},${item.carAddress}&mode=car&policy=1&src=https://gawl.gazhcs.com/wap/index.html&callnative=0`)
|
|
|
+ // // })
|
|
|
+ // this.serviceList = []
|
|
|
+ // let page = {
|
|
|
+ // num: 1,
|
|
|
+ // size: 10
|
|
|
+ // }
|
|
|
+ // this.getserviceList(page)
|
|
|
+ // uni.openLocation({
|
|
|
+ // longitude: Number(item.userLongitude),
|
|
|
+ // latitude: Number(item.userLatitude),
|
|
|
+ // name: item.carAddres, // 位置名称
|
|
|
+ // // address: e.F_Address, // 位置地点
|
|
|
+ // success: function(res) {
|
|
|
+ // console.log('打开系统位置地图成功')
|
|
|
+ // that.$http.post("/ts/merchant/update/Serve", data).then(res => {
|
|
|
+ // if (res.data.code == 200) {
|
|
|
+ // // this.isReceive = true
|
|
|
+
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // fail: function(error) {
|
|
|
+ // console.log(error)
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // },
|
|
|
//救援出发
|
|
|
depart(item) {
|
|
|
console.log(item)
|