diff --git a/App.vue b/App.vue index b51c090..7845730 100644 --- a/App.vue +++ b/App.vue @@ -41,6 +41,37 @@ export default { uni.setInnerAudioOption({ obeyMuteSwitch: false }) + if (wx.canIUse('getUpdateManager')) { + const updateManager = wx.getUpdateManager() + updateManager.onCheckForUpdate(function (res) { + console.log('onCheckForUpdate====', res) + // 请求完新版本信息的回调 + if (res.hasUpdate) { + console.log('res.hasUpdate====') + updateManager.onUpdateReady(function () { + wx.showModal({ + title: '更新提示', + content: '新版本已经准备好,是否重启应用?', + success: function (res) { + console.log('success====', res) + // res: {errMsg: "showModal: ok", cancel: false, confirm: true} + if (res.confirm) { + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate() + } + } + }) + }) + updateManager.onUpdateFailed(function () { + // 新的版本下载失败 + wx.showModal({ + title: '已经有新版本了哟~', + content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~' + }) + }) + } + }) + } }, onShow: function () { diff --git a/common/http.interceptor.js b/common/http.interceptor.js index b7dbb90..dd0d67d 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -1,9 +1,9 @@ const install = (Vue, vm) => { uni.setStorageSync('deptId', 100); Vue.prototype.$u.http.setConfig({ - // baseUrl: 'http://192.168.1.2:4101', //键辉本地 + baseUrl: 'http://192.168.1.10:4101', //键辉本地 // baseUrl: 'http://192.168.2.221:4101', //景森本地 - baseUrl: 'https://ele.ccttiot.com/prod-api', //线上 小鹿appid: wx8a05cf95418a6859 + // baseUrl: 'https://ele.ccttiot.com/prod-api', //线上 小鹿appid: wx8a05cf95418a6859 小兔骑骑appid:wx38f96c87621a87ab // baseUrl: 'https://cc.ccttiot.com/prod-api', //叉车线上 // baseUrl:'https://ysd.chuantewulian.cn/prod-api', //嵛山岛线上api 嵛山岛appid:wx4d178f8c80348214 loadingText: '努力加载中~', diff --git a/page_fenbao/jiameng/addjiam.vue b/page_fenbao/jiameng/addjiam.vue index 1998402..f0141c5 100644 --- a/page_fenbao/jiameng/addjiam.vue +++ b/page_fenbao/jiameng/addjiam.vue @@ -87,8 +87,8 @@ permissionConfig: { '查看运营区': 'area:view', '操作运营区': 'area:edit', - '查看子区域': 'areaSub:view', - '操作子区域': 'areaSub:edit', + '查看停车区': 'areaSub:view', + '操作停车区': 'areaSub:edit', '查看故障': 'fault:view', '故障审核': 'fault:edit', '查看订单': 'order:view', @@ -113,7 +113,9 @@ '查看投诉': 'complaint:view', '操作投诉': 'complaint:edit', '查看协议': 'agreement:view', - '操作协议': 'agreement:edit' + '操作协议': 'agreement:edit', + '查看换电工单': 'powerWork:view', + '操作换电工单': 'powerWork:edit' }, list: [{ name: '查看运营区', @@ -128,13 +130,13 @@ txt: 2 }, { - name: '查看子区域', + name: '查看停车区', tit: '是否允许', checked: false, txt: 3 }, { - name: '操作子区域', + name: '操作停车区', tit: '是否允许', checked: false, txt: 4 @@ -282,6 +284,16 @@ tit: '是否允许', checked: false, txt: 28 + }, { + name: '查看换电工单', + tit: '是否允许', + checked: false, + txt: 29 + },{ + name: '操作换电工单', + tit: '是否允许', + checked: false, + txt: 30 }, ], } @@ -344,7 +356,9 @@ 'complaint:view': 24, 'complaint:edit': 25, 'agreement:view': 26, - 'agreement:edit': 27 + 'agreement:edit': 27, + 'powerWork:view':28, + 'powerWork:edit':29 } permissions.forEach(permission => { diff --git a/page_fenbao/storedlist/trueorder.vue b/page_fenbao/storedlist/trueorder.vue index 894cbf1..b502c68 100644 --- a/page_fenbao/storedlist/trueorder.vue +++ b/page_fenbao/storedlist/trueorder.vue @@ -874,6 +874,10 @@ }, // 点击重试 btnchongshi(){ + let arr = this.devicesarr.map(item => { + const name = item.name || '' + return name.slice(-12) + }) this.ljsbflag = false this.wenbentxtflag = true this.wenbentxt = '开锁中...' @@ -889,7 +893,14 @@ console.error('获取位置失败:', err) } }) - this.$u.put(`/app/order/openDevice?orderId=${this.bstId}&requiredIot=true&lon=${xllng}&lat=${xllat}`).then(res =>{ + let data = { + orderId:this.bstId, + requiredIot:true, + lon:xllng, + lat:xllat, + macList:arr + } + this.$u.put(`/app/order/openDevice`,data).then(res =>{ if(res.code == 200){ uni.switchTab({ url: '/pages/index/index?orderid=' + this.bstId @@ -923,7 +934,18 @@ that.wenbentxtflag = false let flag = false that.zhezhaoflag = true - that.$u.put(`/app/order/openDevice?orderId=${that.bstId}&requiredIot=false&lon=${xllng}&lat=${xllat}`).then((res) =>{}) + let arr = that.devicesarr.map(item => { + const name = item.name || '' + return name.slice(-12) + }) + let datas = { + orderId:that.bstId, + requiredIot:true, + lon:xllng, + lat:xllat, + macList:arr + } + that.$u.put(`/app/order/openDevice`,datas).then((res) =>{}) setTimeout(()=>{ uni.switchTab({ url: '/pages/index/index?orderid=' + that.bstId @@ -1365,7 +1387,18 @@ console.error('获取位置失败:', err) } }) - this.$u.put(`/app/order/openDevice?orderId=${this.bstId}&requiredIot=true&lon=${xllng}&lat=${xllat}`).then(res =>{ + let arr = this.devicesarr.map(item => { + const name = item.name || '' + return name.slice(-12) + }) + let data = { + orderId:this.bstId, + requiredIot:true, + lon:xllng, + lat:xllat, + macList:arr + } + this.$u.put(`/app/order/openDevice`,data).then(res =>{ if(res.code == 200){ this.$u.put(`/app/pay/refreshPayResult?no=${this.respData.pay.no}`).then((res) => { setTimeout(() => { @@ -1403,7 +1436,18 @@ that.wenbentxtflag = false let flag = false that.zhezhaoflag = true - that.$u.put(`/app/order/openDevice?orderId=${that.bstId}&requiredIot=false&lon=${xllng}&lat=${xllat}`).then(res =>{}) + let arr = that.devicesarr.map(item => { + const name = item.name || '' + return name.slice(-12) + }) + let datas = { + orderId:that.bstId, + requiredIot:false, + lon:xllng, + lat:xllat, + macList:arr + } + that.$u.put(`/app/order/openDevice`,datas).then(res =>{}) setTimeout(() => { uni.switchTab({ url: '/pages/index/index?orderid=' + that.respData.pay.bstId @@ -1493,13 +1537,18 @@ } }) }else{ - this.zhezhaoflag = true - setTimeout(() => { - uni.switchTab({ - url: '/pages/index/index?orderid=' + resp.data.pay.bstId - }) - uni.hideLoading() - }, 2000) + this.bstId = resp.data.pay.bstId + this.respData = resp.data // 保存响应数据供开锁方法使用 + this.wenbentxtflag = true + this.wenbentxt = '开锁中...' + this.openDevice() + // this.zhezhaoflag = true + // setTimeout(() => { + // uni.switchTab({ + // url: '/pages/index/index?orderid=' + resp.data.pay.bstId + // }) + // uni.hideLoading() + // }, 2000) } }else if(resp.code == 401){ // this.logoflag = true @@ -1622,6 +1671,7 @@ this.$u.get(`/app/suit/listByModel?modelId=${this.modelId}`).then((res) => { if (res.code == 200) { this.taocanlist = res.data + this.instructions = res.data[0].instructions if(this.suitId == ''){ this.suitId = res.data[0].id this.actiobj = res.data[0] diff --git a/page_fenbao/yunwei/addyunwei.vue b/page_fenbao/yunwei/addyunwei.vue index 243fb29..5779ba4 100644 --- a/page_fenbao/yunwei/addyunwei.vue +++ b/page_fenbao/yunwei/addyunwei.vue @@ -85,8 +85,8 @@ permissionConfig: { '查看运营区': 'area:view', '操作运营区': 'area:edit', - '查看子区域': 'areaSub:view', - '操作子区域': 'areaSub:edit', + '查看停车区': 'areaSub:view', + '操作停车区': 'areaSub:edit', '查看故障': 'fault:view', '故障审核': 'fault:edit', '查看订单': 'order:view', @@ -111,7 +111,9 @@ '查看投诉': 'complaint:view', '操作投诉': 'complaint:edit', '查看协议': 'agreement:view', - '操作协议': 'agreement:edit' + '操作协议': 'agreement:edit', + '查看换电工单': 'powerWork:view', + '操作换电工单': 'powerWork:edit' }, list: [{ name: '查看运营区', @@ -126,13 +128,13 @@ txt: 2 }, { - name: '查看子区域', + name: '查看停车区', tit: '是否允许', checked: false, txt: 3 }, { - name: '操作子区域', + name: '操作停车区', tit: '是否允许', checked: false, txt: 4 @@ -219,73 +221,83 @@ name: '查看客服', tit: '是否允许', checked: false, - txt: 18 + txt: 17 }, { name: '操作客服', tit: '是否允许', checked: false, - txt: 19 + txt: 18 }, { name: '查看卡券', tit: '是否允许', checked: false, - txt: 20 + txt: 19 }, { name: '操作卡券', tit: '是否允许', checked: false, - txt: 21 + txt: 20 }, { name: '查看卡券订单', tit: '是否允许', checked: false, - txt: 22 + txt: 21 }, { name: '操作卡券订单', tit: '是否允许', checked: false, - txt: 23 + txt: 22 }, { name: '查看用户卡券', tit: '是否允许', checked: false, - txt: 24 + txt: 23 }, { name: '操作用户卡券', tit: '是否允许', checked: false, - txt: 25 + txt: 24 }, { name: '查看投诉', tit: '是否允许', checked: false, - txt: 26 + txt: 25 }, { name: '操作投诉', tit: '是否允许', checked: false, - txt: 27 + txt: 26 }, { name: '查看协议', tit: '是否允许', checked: false, - txt: 28 + txt: 27 }, { name: '操作协议', tit: '是否允许', checked: false, + txt: 28 + }, { + name: '查看换电工单', + tit: '是否允许', + checked: false, txt: 29 + },{ + name: '操作换电工单', + tit: '是否允许', + checked: false, + txt: 30 }, ], } @@ -348,7 +360,9 @@ 'complaint:view': 24, 'complaint:edit': 25, 'agreement:view': 26, - 'agreement:edit': 27 + 'agreement:edit': 27, + 'powerWork:view':28, + 'powerWork:edit':29 } permissions.forEach(permission => { diff --git a/page_shanghu/gongzuotai/ChargingDetail.vue b/page_shanghu/gongzuotai/ChargingDetail.vue index 07736c1..78b4f6d 100644 --- a/page_shanghu/gongzuotai/ChargingDetail.vue +++ b/page_shanghu/gongzuotai/ChargingDetail.vue @@ -45,7 +45,7 @@ 免费骑行 - @@ -114,18 +114,18 @@ 起步价 - - 元 含( {{timevalue}}) 超出价 - - 元 /( {{timevalue}}) @@ -204,7 +204,7 @@ 预存 - diff --git a/page_shanghu/gongzuotai/diaodujl.vue b/page_shanghu/gongzuotai/diaodujl.vue new file mode 100644 index 0000000..ff55739 --- /dev/null +++ b/page_shanghu/gongzuotai/diaodujl.vue @@ -0,0 +1,259 @@ + + + + + \ No newline at end of file diff --git a/page_shanghu/gongzuotai/diaodulist.vue b/page_shanghu/gongzuotai/diaodulist.vue new file mode 100644 index 0000000..ae4758b --- /dev/null +++ b/page_shanghu/gongzuotai/diaodulist.vue @@ -0,0 +1,294 @@ + + + + + \ No newline at end of file diff --git a/page_shanghu/gongzuotai/modelMt.vue b/page_shanghu/gongzuotai/modelMt.vue index 83ad98b..282bd2c 100644 --- a/page_shanghu/gongzuotai/modelMt.vue +++ b/page_shanghu/gongzuotai/modelMt.vue @@ -88,6 +88,25 @@ % + + + + 是否自动生成换电工单 + + + + + + + + 生成换电工单阈值(%) + + + + % + + + + + 请输入备注 + + + + + 取消 + + + 完成 + + + + + + + + + + + \ No newline at end of file diff --git a/page_shanghu/yunwei/index.vue b/page_shanghu/yunwei/index.vue new file mode 100644 index 0000000..82b7e99 --- /dev/null +++ b/page_shanghu/yunwei/index.vue @@ -0,0 +1,484 @@ + + + + + \ No newline at end of file diff --git a/page_user/hcshenhe.vue b/page_user/hcshenhe.vue index 791e78b..ecd528c 100644 --- a/page_user/hcshenhe.vue +++ b/page_user/hcshenhe.vue @@ -125,6 +125,7 @@ lon:this.lon, lat:this.lat, checkLocation:true, + macList:this.scdevlist } this.$u.post(`/app/order/calcFee`,data).then(res =>{ if(res.code == 200){ diff --git a/page_user/huanbike.vue b/page_user/huanbike.vue index 576b7d6..52fbe01 100644 --- a/page_user/huanbike.vue +++ b/page_user/huanbike.vue @@ -290,7 +290,10 @@ export default { getfeiyong(){ let data = { orderId:this.orderid, - checkLocation:true + checkLocation:true, + lat:this.latitude, + lon:this.longitude, + macList:this.scdevlist } this.$u.post(`/app/order/calcFee`,data).then(res =>{ if(res.code == 200){ diff --git a/page_user/luru/controlDevice.vue b/page_user/luru/controlDevice.vue index fcaa744..a26525a 100644 --- a/page_user/luru/controlDevice.vue +++ b/page_user/luru/controlDevice.vue @@ -125,7 +125,10 @@ title: '加载中...', mask: true }) - this.$u.put(`/bst/device/iot/update?sn=${this.sn}`).then((res) => { + let data = { + sn:this.sn + } + this.$u.put(`/bst/device/iot/update`,data).then((res) => { if (res.code === 200) { uni.hideLoading() uni.showToast({ @@ -208,7 +211,10 @@ title: '加载中...' }) console.log('点击了....1'); - this.$u.put('/bst/device/iot/unlock?sn=' + this.sn).then((res) => { + let data = { + sn:this.sn + } + this.$u.put('/bst/device/iot/unlock',data).then((res) => { if (res.code == 200) { // 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构 this.deviceInfo() @@ -233,7 +239,10 @@ title: '加载中...' }) console.log('点击了....2') - this.$u.put('/bst/device/iot/lock?sn=' + this.sn).then((res) => { + let datas = { + sn: this.sn, + } + this.$u.put('/bst/device/iot/lock',datas).then((res) => { if (res.code == 200) { // 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构 this.deviceInfo() @@ -257,7 +266,10 @@ uni.showLoading({ title: '加载中...' }) - this.$u.put('/bst/device/iot/ring?sn=' + this.sn).then((res) => { + let data = { + sn:this.sn + } + this.$u.put('/bst/device/iot/ring',data).then((res) => { if (res.code == 200) { this.deviceInfo() uni.hideLoading() @@ -321,7 +333,10 @@ uni.showLoading({ title: '加载中...' }) - this.$u.put('/bst/device/iot/reboot?sn=' + this.sn).then((res) => { + let data = { + sn:this.sn + } + this.$u.put('/bst/device/iot/reboot',data).then((res) => { if (res.code == 200) { this.deviceInfo() uni.hideLoading() @@ -342,7 +357,10 @@ uni.showLoading({ title: '加载中...' }) - this.$u.put('/bst/device/iot/unlockSeat?sn=' + this.sn).then((res) => { + let data = { + sn:this.sn + } + this.$u.put('/bst/device/iot/unlockSeat', data).then((res) => { if (res.code == 200) { this.deviceInfo() uni.hideLoading() diff --git a/pages.json b/pages.json index 0fdb8f0..9c47dbf 100644 --- a/pages.json +++ b/pages.json @@ -460,6 +460,20 @@ "navigationStyle": "custom" } },{ + "path": "yunwei/index", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + },{ + "path": "yunwei/gongdanxq", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + },{ "path": "gonggao", "style": { "navigationBarTitleText": "", @@ -557,6 +571,20 @@ "enablePullDownRefresh": false, "navigationStyle": "custom" } + },{ + "path": "gongzuotai/diaodujl", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + },{ + "path": "gongzuotai/diaodulist", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } },{ "path": "gongzuotai/ChargingTemplate", "style": { diff --git a/pages/index/index.vue b/pages/index/index.vue index 316d69f..459bafc 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -222,7 +222,7 @@ - @@ -647,26 +647,27 @@ }, // 点击请求客服列表进行咨询 btnkefu() { - this.$u.get(`/app/customerService/list?pageNum=1&pageSize=999&areaId=${this.orderobj.orderAreaId}`).then(res => { - if (res.code == 200) { - if (res.rows.length > 0) { - this.kefulist = res.rows - this.kefuflag = true + this.$u.get(`/app/customerService/list?pageNum=1&pageSize=999&areaId=${this.orderobj.orderAreaId}`).then( + res => { + if (res.code == 200) { + if (res.rows.length > 0) { + this.kefulist = res.rows + this.kefuflag = true + } else { + uni.showToast({ + title: '当前运营区暂无客服', + icon: 'none', + duration: 2000 + }) + } } else { uni.showToast({ - title: '当前运营区暂无客服', + title: res.msg, icon: 'none', duration: 2000 }) } - } else { - uni.showToast({ - title: res.msg, - icon: 'none', - duration: 2000 - }) - } - }) + }) }, // 点击跳转导航寻车 btnxunche() { @@ -676,6 +677,7 @@ uni.openLocation({ latitude: res.data.latitude, //纬度-目的地/坐标点 longitude: res.data.longitude, //经度-目的地/坐标点 + // name: res.data.deviceVehicleNum, //地点名称 }) } else { uni.showToast({ @@ -809,6 +811,11 @@ case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS: //获取附近蓝牙设备列表 if (options.result) { this.devicesarr = options.data + // 另外存一份 + // this.scdevlist = options.data.map(item => { + // const name = item.name || '' + // return name.slice(-12) + // }) } break; case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED: //连接回调是否连接上蓝牙 @@ -914,13 +921,6 @@ } }) }, - // 处理所有蓝牙前缀 上传 - getmaclist(){ - this.scdevlist = this.devicesarr.map(item => { - const name = item.name || '' - return name.slice(-12) - }) - }, // 3. 单独封装数据提交 submitData(data) { const payload = { @@ -1223,7 +1223,13 @@ longitude: parseFloat(item.longitude), width: 18, height: 26, - iconPath: item.type == 1 ? 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : item.type == 2 ? 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' : item.type == 3 ? 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' : 'https://api.ccttiot.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250829161752_210_17-1756455764351.png', + iconPath: item.type == 1 ? + 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : + item.type == 2 ? + 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' : + item.type == 3 ? + 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' : + 'https://api.ccttiot.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250829161752_210_17-1756455764351.png', callout: { content: item.name, color: '#ffffff', @@ -1302,7 +1308,6 @@ }, // 点击结束订单 btnjsdd() { - this.getmaclist() if (this.jiance == true) { xBlufi.initXBlufi(1) xBlufi.notifyStartDiscoverBle({ @@ -1414,7 +1419,8 @@ } else { if (that.shibainum < 3) { that.shibainum++ - that.findDeviceTimer = setTimeout(findDevice.bind(that),1000) // 使用 bind 保持 this 上下文 + that.findDeviceTimer = setTimeout(findDevice.bind(that), + 1000) // 使用 bind 保持 this 上下文 } else { console.log('不在旁边2'); that.ver_dataflag = 1 @@ -1738,28 +1744,7 @@ }) }, // 点击去进行换车 - btnghbikes(){ - uni.getLocation({ - type: 'gcj02', // 国内地图更兼容 - isHighAccuracy: true, - accuracy: 'best', - success: (res) => { - console.log('精确坐标:', res) - this.lslat = res.latitude - this.lslon = res.longitude - this.btnghbike() - }, - fail: (err) => { - console.error('获取位置失败:', err) - this.lslat = null - this.lslon = null - this.btnghbike() - } - }) - }, - // 点击去进行换车 btnghbike() { - this.getmaclist() this.caozuotext = '换车前请将车辆停放于运营区和停车区内' if (this.jiance == true) { xBlufi.initXBlufi(1) @@ -1777,6 +1762,21 @@ xBlufi.notifyStartDiscoverBle({ 'isStart': false }) + uni.getLocation({ + type: 'gcj02', // 国内地图更兼容 + isHighAccuracy: true, + accuracy: 'best', + success: (res) => { + console.log('精确坐标:', res) + this.lslat = res.latitude + this.lslon = res.longitude + }, + fail: (err) => { + console.error('获取位置失败:', err) + this.lslat = null + this.lslon = null + } + }) } else { if (this.shibainum < 3) { this.shibainum++ @@ -1799,7 +1799,6 @@ requiredIot: true, macList:that.scdevlist } - console.log(data,'datadata'); that.$u.put(`/app/order/closeDevice`,data).then((res) => { if (res.code == 200) { that.wenbentxt = '' @@ -1955,7 +1954,8 @@ } else { if (that.shibainum < 3) { that.shibainum++ - that.findDeviceTimer = setTimeout(findDevice.bind(that),1000) // 使用 bind 保持 this 上下文 + that.findDeviceTimer = setTimeout(findDevice.bind(that), + 1000) // 使用 bind 保持 this 上下文 } else { uni.getLocation({ type: 'gcj02', // 国内地图更兼容 @@ -2029,7 +2029,6 @@ }, // 点击启动and关闭 btnqd() { - this.getmaclist() this.caozuotext = '骑行前请检查车轿刹车是否灵敏,安全骑行' if (this.jiance == true) { xBlufi.initXBlufi(1) @@ -2078,15 +2077,13 @@ if (res.confirm) { that.wenbentxt = '车辆解锁中...' that.wenbentxtflag = true - let query = { + let dataks = { orderId: that.orderobj.orderId, lat: that.lslat, lon: that.lslon, requiredIot: true } - let url = '/app/order/openDevice?' + that.$tansParams( - query) - that.$u.put(url).then((res) => { + that.$u.put('/app/order/openDevice',dataks).then((res) => { if (res.code == 200) { that.wenbentxt = '' that.wenbentxtflag = false @@ -2122,14 +2119,13 @@ that.wenbentxt ='' that.wenbentxtflag =false that.orderobj.deviceLockStatus =1 - let query = { + let datakss = { orderId: that.orderobj.orderId, lat: that.lslat, lon: that.lslon, - requiredIot: false + requiredIot: false } - let url ='/app/order/openDevice?' +that.$tansParams(query) - that.$u.put(url).then((res) => {}) + that.$u.put('/app/order/openDevice',datakss).then((res) => {}) } else { that.ver_dataflag =1 that.shibainum =0 @@ -2461,6 +2457,14 @@ console.log('订单设备定时器已停止') } }, + // // 请求客服 + // getkefu() { + // this.$u.get(`/app/customerService/list?pageNum=1&pageSize=999`).then(res => { + // if (res.code == 200) { + // this.kefulist = res.rows + // } + // }) + // }, // 点击去下单 btndetaxq() { this.$u.get(`/getInfo`).then(res => { @@ -2527,6 +2531,7 @@ this.taocanflag = false this.newMarkers = '' }, + // 点击选择骑行套餐 btntcxz(index) { this.tcindex = index @@ -2602,7 +2607,9 @@ this.iconPath = 'https://api.ccttiot.com/smartmeter/img/static/upX2lLilhrRi4tttdHlo' } else if (this.rtindex == 2) { this.iconPath = this.iconobj.mappic - this.$u.get(`/app/device/listNearBy?radius=10000¢er=${this.jingweidu}&areaId=${this.orderobj.orderAreaId == undefined ? null : this.orderobj.orderAreaId}`).then((res) => { + this.$u.get( + `/app/device/listNearBy?radius=10000¢er=${this.jingweidu}&areaId=${this.orderobj.orderAreaId == undefined ? null : this.orderobj.orderAreaId}` + ).then((res) => { if (res.code == 200) { this.covers = [] this.listData = [] @@ -2620,7 +2627,8 @@ res.data.forEach(item => { const shopCover = { // 门店后面拼接1,车辆拼接2,3是导览 - id: this.rtindex == 1 ? parseInt(item.id + "1") : this.rtindex == 2 ? parseInt(item.id + "2") : parseInt(item.id + "3"), + id: this.rtindex == 1 ? parseInt(item.id + "1") : this.rtindex == + 2 ? parseInt(item.id + "2") : parseInt(item.id + "3"), latitude: item.latitude, longitude: item.longitude, width: 35, @@ -2815,7 +2823,6 @@ // 缓存数据 const filteredData = res.data.filter(item => item.status != 1); this.cachedParkingData[this.areaId] = filteredData - const type1Data = [] const type2Data = [] const type3Data = [] @@ -2826,13 +2833,8 @@ else if (row.type == 3) type3Data.push(row) else if (row.type == 4) type4Data.push(row) }) - const processBoundaries = (data, type) => { - const validBoundaries = data - .map(row => row.boundaryStr) - .filter(boundary => boundary && typeof boundary === 'string' && boundary - .trim() !== '') - + const validBoundaries = data.map(row => row.boundaryStr).filter(boundary => boundary && typeof boundary === 'string' && boundary.trim() !== '') if (validBoundaries.length > 0) { const polylines = this.convertBoundaryToPolylines(validBoundaries, type) if (polylines && polylines.length > 0) { @@ -2841,7 +2843,6 @@ } return [] } - // 先处理所有边界数据 const type1Polylines = processBoundaries(type1Data, 1) const type2Polylines = processBoundaries(type2Data, 2) @@ -2849,7 +2850,6 @@ const type4Polylines = processBoundaries(type4Data, 4) // 保留现有的运营区边界 const operationAreaPolylines = this.polyline.filter(p => p.isOperationArea) - // 合并所有边界数据 const allPolylines = [ ...operationAreaPolylines, @@ -2858,10 +2858,8 @@ ...type3Polylines, ...type4Polylines ] - // 缓存多边形数据 this.cachedPolyline = allPolylines - // 更新显示 this.polyline = allPolylines this.parkingList = filteredData @@ -2872,13 +2870,10 @@ updatePolylineFromCache() { // 保留现有的运营区边界 const operationAreaPolylines = this.polyline.filter(p => p.isOperationArea) - // 从缓存中获取其他边界数据 const otherPolylines = this.cachedPolyline.filter(p => !p.isOperationArea) - // 合并数据 const allPolylines = [...operationAreaPolylines, ...otherPolylines] - // 更新显示 this.polyline = allPolylines }, @@ -2958,7 +2953,6 @@ this.tempCovers = newMarkers this.covers = this.tempCovers }, - getIconPath() { if (this.rtindex == 1) { return 'https://api.ccttiot.com/smartmeter/img/static/upX2lLilhrRi4tttdHlo' @@ -2969,13 +2963,11 @@ } return null }, - updatePolyline(newPolylines) { // 使用Vue的响应式更新 this.tempPolyline = [...newPolylines] this.polyline = this.tempPolyline }, - updateCovers(newCovers) { // 使用Vue的响应式更新 this.tempCovers = [...newCovers] diff --git a/pages/my.vue b/pages/my.vue index 2fca1c5..f796064 100644 --- a/pages/my.vue +++ b/pages/my.vue @@ -6,7 +6,7 @@ - + diff --git a/pages/nearbystores/index.vue b/pages/nearbystores/index.vue index 6927e05..f8114d6 100644 --- a/pages/nearbystores/index.vue +++ b/pages/nearbystores/index.vue @@ -292,6 +292,7 @@ fajinobj: {}, fjflag: false, showIconAndCallout: false, + xianshinum:1, orderflag: false, hei: { height: '64vh' @@ -383,6 +384,22 @@ onHide() { this.clearTimer() }, + // 分享到好友(会话) + onShareAppMessage: function () { + return { + title: '小鹿骑行', + path: '/pages/nearbystores/index' + } + }, + + // 分享到朋友圈 + onShareTimeline: function () { + return { + title: '小鹿骑行', + query: '', + path: '/pages/nearbystores/index' + } + }, methods: { // 获取动态图片 getimg(){ @@ -434,7 +451,7 @@ deptName: item.userName })) this.displayList = this.list; // 重置显示列表 - console.log(this.displayList,'0000'); + console.log(this.displayList,'0000') }else{ this.guanliflag = false } @@ -712,6 +729,7 @@ this.iconflag = true if (e.type == 'end') { if (this.rtindex == 2) { + // this.parkingList = [] this.jingweidu = e.detail.centerLocation.longitude + ',' + e.detail.centerLocation.latitude this.getAone() this.iconflag = false @@ -949,7 +967,18 @@ console.error('获取位置失败:', err) } }) - this.$u.put(`/app/device/iot/ring?id=${this.cheobj.id}&lat=${this.xllat}&lon=${this.xllng}`).then((res) => { + let arr = this.devicesarr.map(item => { + const name = item.name || '' + return name.slice(-12) + }) + let data = { + id: this.cheobj.id, + requiredIot:true, + lat: this.xllat, + lon: this.xllng, + macList:arr + } + this.$u.put(`/app/device/iot/ring`,data).then((res) => { if (res.code == 200) { uni.showToast({ title: '操作成功', @@ -1212,12 +1241,17 @@ duration: 2000 }) } else { - console.log(this.showIconAndCallout,'this.showIconAndCallout1111',num); if(num == 2){ this.showIconAndCallout = !this.showIconAndCallout + if(this.xianshinum == 1){ + this.xianshinum = 2 + }else if(this.xianshinum == 2){ + this.xianshinum = 3 + }else if(this.xianshinum == 3){ + this.xianshinum = 1 + } } - console.log(this.showIconAndCallout,'this.showIconAndCallout2222',num); - if (this.showIconAndCallout) { + if (this.xianshinum == 1) { const newMarkers = [] this.parkingList.forEach(item => { newMarkers.push({ @@ -1241,9 +1275,33 @@ }) this.newMarkers = newMarkers this.$set(this, 'covers', [...this.covers, ...newMarkers]) - } else { + } else if(this.xianshinum == 2) { // 过滤掉所有气泡显示的标记 this.$set(this, 'covers', this.covers.filter(marker => !marker.isCalloutVisible)) + }else if(this.xianshinum == 3){ + const newMarkers = [] + this.parkingList.forEach(item => { + newMarkers.push({ + id: item.type == 1 ? parseInt(item.id + "4") : item.type == 2 ? parseInt(item.id + "5") : item.type == 3 ? parseInt(item.id + "6") : parseInt(item.id + "7"), + latitude: parseFloat(item.latitude), + longitude: parseFloat(item.longitude), + width: 18, + height: 26, + iconPath: item.type == 1 ? 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : item.type == 2 ? 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' : item.type == 3 ? 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' : 'https://api.ccttiot.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250829161752_210_17-1756455764351.png', + // callout: { + // content: item.name, + // color: '#ffffff', + // fontSize: 12, + // borderRadius: 8, + // bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FF473E' : item.type == 3 ? '#FFC107' : '#3bbd55', + // padding: 4, + // display: 'ALWAYS' + // }, + isCalloutVisible: true // 添加标记 + }) + }) + this.newMarkers = newMarkers + this.$set(this, 'covers', [...this.covers, ...newMarkers]) } } }, @@ -1254,10 +1312,10 @@ return } // 检查缓存 - if(this.cachedParkingData[this.yyid] && !this.isFirstLoad) { - this.updatePolylineFromCache() - return - } + // if(this.cachedParkingData[this.yyid] && !this.isFirstLoad) { + // this.updatePolylineFromCache() + // return + // } this.$u.get(`/app/areaSub/listByArea?areaId=${this.yyid}`).then((res) => { if (res.code === 200 && Array.isArray(res.data)) { // 缓存数据 diff --git a/store/index.js b/store/index.js index e9d8b9f..88fd25f 100644 --- a/store/index.js +++ b/store/index.js @@ -8,7 +8,7 @@ const store = new Vuex.Store({ isLogin: false, userInfo: null, token:"", - appid:'1',//1小鹿 6创享 2嵛山岛 + appid:'1',//1小鹿 6创享 2嵛山岛 7小兔 // 电动车图标 iconobj:{ tabcion:'https://api.ccttiot.com/smartmeter/img/static/uIiSizdNVb65ATEXvxfT', //底部导航栏图标