diff --git a/common/http.interceptor.js b/common/http.interceptor.js index cd9a338..f6f21fb 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -8,7 +8,7 @@ const install = (Vue, vm) => { // baseUrl:'https://ysd.chuantewulian.cn/prod-api', //嵛山岛线上api 嵛山岛appid:wx4d178f8c80348214 loadingText: '努力加载中~', loadingTime: 10000, - // 设置自定义头部content-type + // 设置自定义头部content-type header: { 'content-type': 'application/json;charset=UTF-8', }, diff --git a/page_fenbao/storedlist/trueorder.vue b/page_fenbao/storedlist/trueorder.vue index b6ce7ba..8a64e0a 100644 --- a/page_fenbao/storedlist/trueorder.vue +++ b/page_fenbao/storedlist/trueorder.vue @@ -644,7 +644,8 @@ kefulist: [], respData:{}, instructions:'', - duoirder:'' + duoirder:'', + zaixianflag:false } }, onLoad(option) { @@ -718,6 +719,8 @@ uni.hideLoading() this.modelId = option.modelId this.chesn = option.sn + this.sn = option.sn + this.getzaixian() //判断是否在线 this.getQiniuToken() this.gettaocan() this.getcheliang() @@ -805,6 +808,7 @@ this.mac = res.data.mac this.areaNeedCheckVideo = res.data.areaNeedCheckVideo this.modelId = res.data.modelId + this.getzaixian() //判断是否在线 this.getcheliang() this.getQiniuToken() this.gettaocan() @@ -837,6 +841,34 @@ }, methods: { + // 判断车辆是否在线 + getzaixian(){ + this.$u.put(`/app/device/iot/uploadData?sn=${this.sn}`).then(res =>{ + if(res.code == 200){ + this.zaixianflag = true + } + }) + let that = this + const findDevice = () =>{ + const matchedDevice = that.devicesarr.find(device => { + return device.name.slice(-12) == that.mac.slice(-12) + }) + if (matchedDevice) { + xBlufi.notifyStartDiscoverBle({ + 'isStart': false + }) + that.zaixianflag = true + } else { + if(that.shibainum < 3){ + that.shibainum++ + that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使用 bind 保持 this 上下文 + } + } + } + findDevice() + }, + + // 点击跳转到最近还车点 btntcd() { uni.navigateTo({ @@ -1258,6 +1290,21 @@ }, // 点击进行支付 btnzhifu() { + if(this.zaixianflag == false){ + uni.showModal({ + title: '提示', + content: '当前车辆不可用', + showCancel: true, + success: function(res) { + if (res.confirm) { + + } else if (res.cancel) { + + } + } + }) + return + } if(this.jiance == true){ xBlufi.initXBlufi(1) xBlufi.notifyStartDiscoverBle({ diff --git a/page_shanghu/gongzuotai/AccountDetails.vue b/page_shanghu/gongzuotai/AccountDetails.vue index b3c19ec..9489ac6 100644 --- a/page_shanghu/gongzuotai/AccountDetails.vue +++ b/page_shanghu/gongzuotai/AccountDetails.vue @@ -50,19 +50,6 @@ - diff --git a/pages/index/index.vue b/pages/index/index.vue index c98f7db..5f6a192 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1886,12 +1886,12 @@ duration:5000 }) }else if(err.errMsg == 'openBluetoothAdapter:fail:not available'){ - uni.showToast({ - title: '请检查手机蓝牙是否打开', - icon: 'none', - duration:5000 - }) - } + uni.showToast({ + title: '请检查手机蓝牙是否打开', + icon: 'none', + duration:5000 + }) + } } }) } @@ -1944,12 +1944,12 @@ duration:5000 }) }else if(err.errMsg == 'openBluetoothAdapter:fail:not available'){ - uni.showToast({ - title: '请检查手机蓝牙是否打开', - icon: 'none', - duration:5000 - }) - } + uni.showToast({ + title: '请检查手机蓝牙是否打开', + icon: 'none', + duration:5000 + }) + } } }) } @@ -2682,7 +2682,7 @@ orderId: that.orderobj.orderId, lat: that.lslat, lon: that.lslon, - requiredIot: true, + requiredIot: false, macList:that.scdevlist, bltRemark:that.bltRemark }