From ac65dc4046fb576a1bc9108d8cc20a8c16c4effe Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Thu, 15 Jan 2026 14:40:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E9=B9=BF=E9=AA=91=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- page_fenbao/chepai.vue | 15 + page_fenbao/storedlist/trueorder.vue | 53 +- page_shanghu/gongzuotai/sysSet.vue | 880 +++++++++++++-------------- page_user/luru/controlDevice.vue | 12 +- page_user/returnbike.vue | 24 +- page_user/shiping/index.vue | 2 +- page_user/shoukuan/addsk.vue | 129 +++- page_user/yongche/orderxq.vue | 10 +- pages/index/index.vue | 24 +- pages/my.vue | 55 +- pages/myorder/index.vue | 2 +- pages/myorder/returned/tingche.vue | 326 ++++++++-- pages/nearbystores/index.vue | 51 +- static/image/20.png | Bin 0 -> 2444 bytes static/image/21.png | Bin 0 -> 25419 bytes static/image/icon1.png | Bin 0 -> 2310 bytes static/image/icon10.png | Bin 0 -> 2855 bytes static/image/icon11.png | Bin 0 -> 2953 bytes static/image/icon12.png | Bin 0 -> 4574 bytes static/image/icon13.png | Bin 0 -> 2372 bytes static/image/icon14.png | Bin 0 -> 108667 bytes static/image/icon15.png | Bin 0 -> 769 bytes static/image/icon16.png | Bin 0 -> 101720 bytes static/image/icon17.png | Bin 0 -> 1243 bytes static/image/icon18.png | Bin 0 -> 1067 bytes static/image/icon19.png | Bin 0 -> 349 bytes static/image/icon2.png | Bin 0 -> 2730 bytes static/image/icon3.png | Bin 0 -> 3732 bytes static/image/icon4.png | Bin 0 -> 3412 bytes static/image/icon5.png | Bin 0 -> 3967 bytes static/image/icon6.png | Bin 0 -> 812 bytes static/image/icon7.png | Bin 0 -> 1004 bytes static/image/icon8.png | Bin 0 -> 1758 bytes static/image/icon9.png | Bin 0 -> 2051 bytes static/image/jt.png | Bin 0 -> 454 bytes 35 files changed, 977 insertions(+), 606 deletions(-) create mode 100644 static/image/20.png create mode 100644 static/image/21.png create mode 100644 static/image/icon1.png create mode 100644 static/image/icon10.png create mode 100644 static/image/icon11.png create mode 100644 static/image/icon12.png create mode 100644 static/image/icon13.png create mode 100644 static/image/icon14.png create mode 100644 static/image/icon15.png create mode 100644 static/image/icon16.png create mode 100644 static/image/icon17.png create mode 100644 static/image/icon18.png create mode 100644 static/image/icon19.png create mode 100644 static/image/icon2.png create mode 100644 static/image/icon3.png create mode 100644 static/image/icon4.png create mode 100644 static/image/icon5.png create mode 100644 static/image/icon6.png create mode 100644 static/image/icon7.png create mode 100644 static/image/icon8.png create mode 100644 static/image/icon9.png create mode 100644 static/image/jt.png diff --git a/page_fenbao/chepai.vue b/page_fenbao/chepai.vue index 5987b78..b2cfd32 100644 --- a/page_fenbao/chepai.vue +++ b/page_fenbao/chepai.vue @@ -193,6 +193,21 @@ } }) } + }else if(res.code == 401){ + uni.showModal({ + title: '提示', + content: '您当前未登录,是否前去登录?', + showCancel: true, + success: function (res) { + if (res.confirm) { + uni.reLaunch({ + url:'/pages/login/login' + }) + } else if (res.cancel) { + + } + } + }) } }) } diff --git a/page_fenbao/storedlist/trueorder.vue b/page_fenbao/storedlist/trueorder.vue index 8a64e0a..19d3a1d 100644 --- a/page_fenbao/storedlist/trueorder.vue +++ b/page_fenbao/storedlist/trueorder.vue @@ -153,7 +153,9 @@ - 免费骑行{{actiobj.freeRideTime == null ? '0' : actiobj.freeRideTime}}分钟,需在还车点还车,地图可查看还车点 + 免费骑行{{actiobj.freeRideTime == null ? '0' : actiobj.freeRideTime}}分钟, + 需在还车点还车,查看还车点 + 查看还车点 超出计费{{taocanlist[fanganindex].startRule.timeoutPrice}}元 @@ -437,7 +439,7 @@ - 同意并继续({{yucun == 0 ? '免押金' : '预支付'}} ¥{{yucun}}) + 同意并继续({{yucun == 0 ? '免押金' : '押金'}} ¥{{yucun}}) × @@ -769,6 +771,7 @@ this.modelId = res.data.modelId this.areaNeedCheckVideo = res.data.areaNeedCheckVideo this.mac = res.data.mac + this.getzaixian() //判断是否在线 this.gettaocan() this.getcheliang() this.getQiniuToken() @@ -846,6 +849,8 @@ this.$u.put(`/app/device/iot/uploadData?sn=${this.sn}`).then(res =>{ if(res.code == 200){ this.zaixianflag = true + }else if(res.code == 20003){ + this.zaixianflag = true } }) let that = this @@ -1024,19 +1029,37 @@ }, recordVideo() { // 调用录像API + const minVideoDuration = 10; + const maxVideoDuration = 60; uni.chooseVideo({ - sourceType: ['camera'], // 指定使用相机录像 - camera: 'back', // 指定使用后置摄像头,可选值有front、back - maxDuration: 15, // 最大录制时长(秒) - success: (res) => { - // 获取视频录制文件的临时路径 - this.videoPath = res.tempFilePath; - console.log(res.tempFilePath); - this.upload() - }, - fail: (err) => { - console.log('录像失败:', err); - } + sourceType: ['camera'], // 指定使用相机录像 + camera: 'back', // 后置摄像头 + maxDuration: maxVideoDuration, // 最大录制时长15秒 + success: (res) => { + // 1. 获取视频实际录制时长(res.duration 单位:秒) + const actualDuration = res.duration; + console.log('视频实际录制时长:', actualDuration, '秒'); + // 2. 判断是否满足最小录制时长要求 + if (actualDuration < minVideoDuration) { + uni.showToast({ + title: `视频时长不能少于${minVideoDuration}秒,请重新录制`, + icon: 'none', + duration: 5000 + }); + return; // 不执行后续上传操作 + } + // 3. 满足要求,继续后续流程 + this.videoPath = res.tempFilePath; + console.log('视频临时路径:', res.tempFilePath); + this.upload(); // 执行上传 + }, + fail: (err) => { + console.log('录像失败:', err); + uni.showToast({ + title: '录像失败,请重试', + icon: 'none' + }); + } }) }, upload(){ @@ -1294,7 +1317,7 @@ uni.showModal({ title: '提示', content: '当前车辆不可用', - showCancel: true, + showCancel: false, success: function(res) { if (res.confirm) { diff --git a/page_shanghu/gongzuotai/sysSet.vue b/page_shanghu/gongzuotai/sysSet.vue index 4346c3d..9de8b94 100644 --- a/page_shanghu/gongzuotai/sysSet.vue +++ b/page_shanghu/gongzuotai/sysSet.vue @@ -16,456 +16,458 @@ - - - - - - 运营区名称 - - - - - - - - - - - - - 行政区 - - {{selectedText || '请选择'}} - - - - - - - 请点击选择 - - 取消 - 确认 - - - - - - - - - {{item.name}} - - - - - - - {{item.name}} - - - - - - - {{item.name}} - - - - - - - - - 基础信息 - - - - - 状态 - - - - - - - 关闭后用户将不能使用运营区及车辆 - - - - - - 运营时间 - - - - - - — - - - - - - - 实名认证 - - - - - - - 开启后用户必须先进行实名认证才可使用 - - - - - - 最低用车年龄 - - - - - - - 用户年龄不满足最低年龄不可使用 - - - - - - 最高用车年龄 - - - - - - - 设置用户最高用车年龄,需配合实名认证使用;若无需校验,可设置为1000 - - - - - - 换车校验位置 - - - - - - - 开启后用户换车是否需要校验位置 - - - - - - 是否允许多订单 - - - - - - - 开启后用户可以进行多个订单 - - - - - - 手机校验附近设备 - - - - - - - 开启后,用户还车时会校验手机附近设备,若不匹配则视为无效定位,可以降低异地还车的风险 - - - - - - 是否开启使用前上传视频 - - - - - - - 开启后用户必须先拍摄全车视频才能下单 - - - - - - 驾驶证认证 - - - - - - - 开启后用户必须先通过驾驶证认证才可使用 - - - - - - 短信通知服务 - - - - - - - 开启短信通知,短信费用0.1元/条,从余额中扣除 - - - - - - 寻车范围 - - - - - - - - - - - 允许寻车范围 - - - 米 - - - - 开启后,用户需在车辆指定范围才允许响铃寻车(防止恶意响铃) - - - - - - + + - - 骑行设置 - - + - 靠近边界播报距离 + 运营区名称 - - 米 + + - - 靠近边界播报距离(米) - - - - - - 运营区外断电距离 - - - 米 - - - - 运营区外断电距离(米) - - - - - - 禁行区内断电 - - - - - - - 开启后当进入禁行区内将进行断电 - - - - - - 是否允许换车 - - - - - - - 开启后当进入禁行区内将进行断电 - - - - - - 运营区域外断电 - - - - - - - 开启后当进入运营区域外内将进行断电 - - - - - - 低于电量(%)不得骑行 - - - % - - - - 当车辆电量低于多少时无法解锁用车 - - - - - - - 还车设置 - - - - - 还车是否拍照审核 - - - + + + + + + 行政区 + + {{selectedText || '请选择'}} - - 开启后则需用户拍摄视频后审核订单方可退还押金 - - - - - - 强制停车点还车 - - - - - - - 开启则必须在停车点才可还车,停车点存在误差 - - - - - - 运营区外还车 - - - - - - - 开启后可以在运营区范围外还车 - - - - - - 运营区外管理费 - - - 元 - - - - 设置车辆超出运营区外产生的管理费用 - - - - - - 停车点外调度费 - - - 元 - - - - 设置车辆超出停车点外产生的调度费用 - - - - - - 还车误差 - - - 米 - - - - 允许用户在规划的停车点外多少米还车 - - - + + + + 请点击选择 + + 取消 + 确认 + + + + + + + {{item.name}} + + + + + + + {{item.name}} + + + + + + + {{item.name}} + + + - - 设置车辆可以正常行驶的区域 - - --> + - + + + 基础信息 + + + + + 状态 + + + + + + + 关闭后用户将不能使用运营区及车辆 + + + + + + 运营时间 + + + + + + — + + + + + + + 实名认证 + + + + + + + 开启后用户必须先进行实名认证才可使用 + + + + + + 最低用车年龄 + + + + + + + 用户年龄不满足最低年龄不可使用 + + + + + + 最高用车年龄 + + + + + + + 设置用户最高用车年龄,需配合实名认证使用;若无需校验,可设置为1000 + + + + + + 换车校验位置 + + + + + + + 开启后用户换车是否需要校验位置 + + + + + + 是否允许多订单 + + + + + + + 开启后用户可以进行多个订单 + + + + + + 手机校验附近设备 + + + + + + + 开启后,用户还车时会校验手机附近设备,若不匹配则视为无效定位,可以降低异地还车的风险 + + + + + + 是否开启使用前上传视频 + + + + + + + 开启后用户必须先拍摄全车视频才能下单 + + + + + + 驾驶证认证 + + + + + + + 开启后用户必须先通过驾驶证认证才可使用 + + + + + + 短信通知服务 + + + + + + + 开启短信通知,短信费用0.1元/条,从余额中扣除 + + + + + + 寻车范围 + + + + + + + + + + + 允许寻车范围 + + + 米 + + + + 开启后,用户需在车辆指定范围才允许响铃寻车(防止恶意响铃) + + + + + + + + + 骑行设置 + + + + + 靠近边界播报距离 + + + 米 + + + + 靠近边界播报距离(米) + + + + + + 运营区外断电距离 + + + 米 + + + + 运营区外断电距离(米) + + + + + + 禁行区内断电 + + + + + + + 开启后当进入禁行区内将进行断电 + + + + + + 是否允许换车 + + + + + + + 开启后当进入禁行区内将进行断电 + + + + + + 运营区域外断电 + + + + + + + 开启后当进入运营区域外内将进行断电 + + + + + + 低于电量(%)不得骑行 + + + % + + + + 当车辆电量低于多少时无法解锁用车 + + + + + + + + + 还车设置 + + + + + 还车是否拍照审核 + + + + + + + 开启后则需用户拍摄视频后审核订单方可退还押金 + + + + + + 强制停车点还车 + + + + + + + 开启则必须在停车点才可还车,停车点存在误差 + + + + + + 运营区外还车 + + + + + + + 开启后可以在运营区范围外还车 + + + + + + 运营区外管理费 + + + 元 + + + + 设置车辆超出运营区外产生的管理费用 + + + + + + 停车点外调度费 + + + 元 + + + + 设置车辆超出停车点外产生的调度费用 + + + + + + 还车误差 + + + 米 + + + + 允许用户在规划的停车点外多少米还车 + + + + + + @@ -835,11 +837,11 @@ align-items: center; gap: 82rpx; padding-left: 42rpx; - + font-size: 36rpx; view { text-align: center; color: #808080; - + text { display: block; width: 56rpx; @@ -1091,8 +1093,6 @@ } .page { - padding-bottom: 300rpx; - .choose_part { position: fixed; top: 530rpx; diff --git a/page_user/luru/controlDevice.vue b/page_user/luru/controlDevice.vue index a26525a..c9f724d 100644 --- a/page_user/luru/controlDevice.vue +++ b/page_user/luru/controlDevice.vue @@ -158,12 +158,12 @@ }, search(){ if (this.sn && this.sn.length === 7 && /^\d+$/.test(this.sn)) { - // 当 this.sn 满足条件时调用 deviceInfo - this.deviceInfo() - } else { - console.log('SN 不是 7 位数字') - // 你可以在这里处理不符合条件的情况,比如提示用户输入正确的 SN - } + // 当 this.sn 满足条件时调用 deviceInfo + this.deviceInfo() + } else { + console.log('SN 不是 7 位数字') + // 你可以在这里处理不符合条件的情况,比如提示用户输入正确的 SN + } }, qrcode() { uni.scanCode({ diff --git a/page_user/returnbike.vue b/page_user/returnbike.vue index 4afdd1b..2cd7b3a 100644 --- a/page_user/returnbike.vue +++ b/page_user/returnbike.vue @@ -161,7 +161,6 @@ // 允许不输入或者是0? 原逻辑没校验,这里保持宽容,或者给默认0 this.price = 0; } - uni.showLoading({ title:'提交中...' }) @@ -173,10 +172,17 @@ this.$u.put('/bst/order/verify', data).then((res) => { uni.hideLoading() if (res.code === 200) { - uni.showToast({ - title: '审核成功', - icon: 'success', - duration: 2000 + uni.showModal({ + title: '提示', + content: '审核成功', + showCancel: false, + success: function(res) { + if (res.confirm) { + + } else if (res.cancel) { + + } + } }) this.pageNum = 1 this.list = [] @@ -188,7 +194,7 @@ uni.showToast({ title: res.msg, icon: 'none', - duration: 2000 + duration: 5000 }) } }).catch(() => { @@ -197,9 +203,9 @@ }, handleScrollToLower() { console.log(this.total,this.list.length); - if(this.total > this.list.length){ - this.getlist() - } + if(this.total > this.list.length){ + this.getlist() + } }, parsePictures(pictureString) { if (pictureString) { diff --git a/page_user/shiping/index.vue b/page_user/shiping/index.vue index eadee0c..0424af6 100644 --- a/page_user/shiping/index.vue +++ b/page_user/shiping/index.vue @@ -24,7 +24,7 @@ } }, onLoad() { - this.http = 'https://ele.ccttiot.com/ext?url=' + encodeURIComponent('https://player.bilibili.com/player.html?isOutside=true&aid=114369123849636&bvid=BV1CuLczFEe2&cid=29515777844&p=1') + this.http = 'https://weixin.qq.com/sph/AV48NNirw' // this.http = 'https://weixin.qq.com/sph/AclK6wcxT' console.log(this.http); }, diff --git a/page_user/shoukuan/addsk.vue b/page_user/shoukuan/addsk.vue index 1df66bb..aeefc77 100644 --- a/page_user/shoukuan/addsk.vue +++ b/page_user/shoukuan/addsk.vue @@ -4,6 +4,25 @@ title-size='34' height='36' id="navbar"> + + + 实名信息 + + + 姓名: + {{realName || '--'}} + + + 身份证号: + {{realIdCard || '--'}} + + + + + 收款账户信息需与实名信息一致,请仔细核对 + + + 开户行名称 - + 银行卡号 - + 手机号 - + + + 注:该手机号必须是该银行卡预留的手机号 + @@ -149,19 +174,53 @@ export default { token: '', // 添加七牛云token upurl: 'https://api.ccttiot.com', // 添加上传域名 zhanghulist:[], - activeTypeid:'' + activeTypeid:'', + realName: '', // 实名姓名 + realIdCard: '' // 实名身份证号 } }, onShow() { - + this.getUserInfo() }, onLoad(e) { this.activeType = e.activeType this.activeTypeid = e.id // this.getqudao() this.getQiniuToken() + this.getUserInfo() }, methods: { + // 获取用户实名信息 + getUserInfo() { + this.$u.get("/getInfo").then(res => { + if (res.code == 200 && res.user) { + this.realName = res.user.realName || '' + this.realIdCard = res.user.realIdCard || '' + } + }) + }, + // 处理输入,去除空格 + handleInput(field, value) { + // 去除所有空格(包括粘贴时的空格) + let inputValue = '' + if (typeof value === 'string') { + inputValue = value + } else if (value && value.detail && typeof value.detail.value === 'string') { + // uView u-input 组件可能通过 detail.value 传递 + inputValue = value.detail.value + } else if (value && value.target) { + // 处理原生事件对象 + inputValue = value.target.value || '' + } else { + return + } + // 去除所有空格 + const trimmedValue = inputValue.replace(/\s/g, '') + // 使用 $nextTick 确保更新 + this.$nextTick(() => { + this.bankForm[field] = trimmedValue + }) + }, btnxz(item){ this.activeType = item.apiType this.activeTypeid = item.id @@ -490,4 +549,54 @@ page { box-shadow: none; transform: none; } + +/* 实名信息卡片样式 */ +.real-info-card { + background: linear-gradient(135deg, #EEF5FF 0%, #F7F9FC 100%); + border: 1rpx solid #E1F0FF; +} + +.real-info-content { + margin-bottom: 24rpx; +} + +.info-item { + display: flex; + align-items: center; + margin-bottom: 16rpx; + font-size: 28rpx; +} + +.info-item:last-child { + margin-bottom: 0; +} + +.info-label { + color: #606266; + font-weight: 500; + min-width: 140rpx; +} + +.info-value { + color: #303133; + font-weight: 600; + flex: 1; +} + +.info-tip { + display: flex; + align-items: flex-start; + padding: 16rpx 20rpx; + background: #FFF7E6; + border-radius: 12rpx; + border-left: 4rpx solid #FFA940; + align-items: center; +} + +.tip-text { + font-size: 24rpx; + color: #8C6A00; + line-height: 1.6; + flex: 1; +} \ No newline at end of file diff --git a/page_user/yongche/orderxq.vue b/page_user/yongche/orderxq.vue index 52c3ded..20b7ea2 100644 --- a/page_user/yongche/orderxq.vue +++ b/page_user/yongche/orderxq.vue @@ -8,7 +8,7 @@ - + 进行中 待支付 已取消 @@ -37,7 +37,7 @@ 订单编号 - {{info.no == null ? '--' : info.no}} + {{info.no == null ? '--' : info.no}} @@ -298,7 +298,7 @@ - + 联系客服 @@ -369,7 +369,6 @@ else if (row.type == 2) type2Data.push(row); else if (row.type == 3) type3Data.push(row); }); - // 处理 type1 数据 const validBoundaries = type1Data.map(row => row.boundaryStr).filter(boundary => typeof boundary === 'string' && boundary.trim() !== ''); @@ -377,7 +376,6 @@ if (polygons && polygons.length > 0) { this.polygon = this.polygon.concat(polygons); } - // 处理 type2 数据 const validBoundaries1 = type2Data.map(row => row.boundaryStr).filter(boundary => typeof boundary === 'string' && boundary.trim() !== ''); @@ -385,7 +383,6 @@ if (polygons1 && polygons1.length > 0) { this.polygon = this.polygon.concat(polygons1); } - // 处理 type3 数据 const validBoundaries2 = type3Data.map(row => row.boundaryStr).filter(boundary => typeof boundary === 'string' && boundary.trim() !== ''); @@ -393,7 +390,6 @@ if (polygons2 && polygons2.length > 0) { this.polygon = this.polygon.concat(polygons2); } - this.parkingList = filteredData this.$forceUpdate() this.toggleIconAndCallout() diff --git a/pages/index/index.vue b/pages/index/index.vue index 5f6a192..f2b05a5 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -92,10 +92,10 @@ - - - + + {{item.name == null ? '--' : item.name}}:{{item.contact == null ? '--' : item.contact}} @@ -107,12 +107,12 @@ - + 客服电话高峰期可能遇忙,请耐心等待 @@ -1281,13 +1281,7 @@ 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', @@ -2219,8 +2213,7 @@ latitude: that.lslat, result: '成功' } - that.$u.post(`/app/commandLog/bluetooth`, data).then( - res => { + that.$u.post(`/app/commandLog/bluetooth`, data).then(res => { console.log(res, '蓝牙') }) let datas = { @@ -2275,8 +2268,7 @@ } 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', // 国内地图更兼容 diff --git a/pages/my.vue b/pages/my.vue index 5db0282..a295922 100644 --- a/pages/my.vue +++ b/pages/my.vue @@ -30,25 +30,25 @@ 我的会员 - + 故障上报 - + 订单投诉 - + 帮助中心 - + @@ -56,13 +56,13 @@ 管理后台 - + 设备录入 - + @@ -70,13 +70,13 @@ 退出登录 - + 立即登录 - + @@ -85,7 +85,7 @@ - + @@ -383,22 +383,27 @@ this.show = true } } else if (num == 11) { //管理人员 - if(uni.getStorageSync('wzid')){ - if (this.list.length < 2) { - uni.setStorageSync('adminAreaid', this.list[0].value); - uni.setStorageSync('adminname', this.list[0].label) - uni.navigateTo({ - url: `/page_shanghu/guanli/admin_worke?id=${this.list[0].value}` - }) - } else { - this.show = true - } - }else{ - uni.navigateTo({ - url:'/pages/xiqian' - }) - } - + if(uni.getStorageSync('user').authTypes.includes('1')){ + if(uni.getStorageSync('wzid')){ + if (this.list.length < 2) { + uni.setStorageSync('adminAreaid', this.list[0].value); + uni.setStorageSync('adminname', this.list[0].label) + uni.navigateTo({ + url: `/page_shanghu/guanli/admin_worke?id=${this.list[0].value}` + }) + } else { + this.show = true + } + }else{ + uni.navigateTo({ + url:'/pages/xiqian' + }) + } + }else{ + uni.navigateTo({ + url:'/page_user/shiming' + }) + } // this.$u.get(`/app/contract/checkSigned?type=1`).then(res => { // if (res.code == 200) { // if (res.data == false) { diff --git a/pages/myorder/index.vue b/pages/myorder/index.vue index 68705d0..e65b2d5 100644 --- a/pages/myorder/index.vue +++ b/pages/myorder/index.vue @@ -70,7 +70,7 @@ - {{item.deviceVehicleNum == null ? '--' : item.deviceVehicleNum}} + {{item.deviceVehicleNum == null ? '--' : item.deviceVehicleNum}} 待支付 diff --git a/pages/myorder/returned/tingche.vue b/pages/myorder/returned/tingche.vue index ae20540..5508787 100644 --- a/pages/myorder/returned/tingche.vue +++ b/pages/myorder/returned/tingche.vue @@ -3,7 +3,7 @@ - + @@ -27,7 +27,7 @@ import QQMapWX from '@/common/qqmap-wx-jssdk.min.js' var qqmapsdk export default { - data() { + data() { return { bgc: { backgroundColor: "", @@ -36,6 +36,7 @@ latitude:'', longitude:'', mappolyline:[], + areaPolylines:[], // 保存区域边界数据 qqmapsdk: null, validBoundaries:{}, daohangflag:false, @@ -52,7 +53,6 @@ }, onShow() { this.getMyLocation() - this.convertBoundaryToPolylines(this.validBoundaries, 1) }, methods: { // 点击跳转导航 @@ -74,15 +74,29 @@ }, handleMarkerClick(e){ - // 规划路线 + // 规划路线(只针对停车区) console.log(e); - this.getcha(e.markerId) const clickedMarker = this.covers.find(marker => marker.id == e.markerId); if (clickedMarker) { - const { latitude, longitude } = clickedMarker; - this.routePlanning(latitude, longitude); + // 提取原始ID(去掉后缀) + let originalId = e.markerId.toString() + if (originalId.endsWith('4')) { + originalId = originalId.slice(0, -1) // 停车区 + } else if (originalId.endsWith('5')) { + originalId = originalId.slice(0, -1) // 禁停区 + } else if (originalId.endsWith('6')) { + originalId = originalId.slice(0, -1) // 禁行区 + } else if (originalId.endsWith('7')) { + originalId = originalId.slice(0, -1) // 景区 + } + this.getcha(originalId) + // 只对停车区进行路线规划 + if (clickedMarker.isParkingArea && clickedMarker.id.toString().endsWith('4')) { + const { latitude, longitude } = clickedMarker; + this.routePlanning(latitude, longitude); + this.daohangflag = true + } } - this.daohangflag = true }, routePlanning(end_lat, end_long) { let that = this @@ -115,22 +129,19 @@ }) } // console.log('点串数组', pl) - // 设置polyline属性,将路线显示出来,将解压坐标第一个数据作为起点 - that.mappolyline = [{ + // 创建路线polyline + const routePolyline = { points: pl, color: '#367EEF', // 线的填充色 - width: 3, // 折现宽度 + width: 8, // 折现宽度 borderWidth: 2, // 边线宽度 borderColor: '#5B98FD', // 边线颜色 lineCap: 'square', // 线端头 showArrow: true, // 沿线路方向显示箭头 - width: 8, arrowLine: true, - // color: '#00AF99', - // strokeWidth: 2, - // strokeColor: '#00AF99', - // fillColor: '#00AF99' - }] + } + // 路线数据(区域边界通过:polygons属性单独显示) + that.mappolyline = [routePolyline] }, fail(res) { console.log('resresresresresresres', res) @@ -145,56 +156,265 @@ this.latitude = res.latitude this.longitude = res.longitude this.setMapScale() - this.$u.get(`/app/areaSub/listByArea?areaId=${this.areaId}`).then((res) => { - if (res.code == 200) { - res.data.forEach(item =>{ - if(item.type == 1){ - const shopCover = { - id: parseInt(item.id), - latitude: item.latitude, - longitude:item.longitude, - width: 25, - height: 40, - iconPath:'https://api.ccttiot.com/bike/img/static/uUgkSmtcyyM7hQc5Dtmf', - label: { - content: item.name, - anchorX: this.calculateAnchorX(item.name), - fontWeight: 700, - color: '#0D75E5', - borderColor: '#fff', - borderRadius: 5, - bgColor: '#fff', - padding:1, - } - } - this.covers.push(shopCover) - } - }) - } - }) + this.getArea() }, fail: (err) => { console.error('获取位置失败:', err) } }) }, - // 停车点填充颜色 - convertBoundaryToPolylines(boundaries, num) { - let boundary = [27.324194, 120.216742, 25, 162, 0, 0, 79, 515, 0, 0, -277, 139, -34, 28, 0, 0, -104, 119, 0, 0, -133] - if (!boundary) return null; - const points = boundary.map(coord => ({ + // 请求运营区停车点,禁行区 + getArea() { + this.areaPolylines = [] + this.$u.get(`/app/area/detail?id=${this.areaId}`).then((res) => { + if (res.code == 200) { + // 获取运营区边界 + if (res.data && res.data.boundaryStr) { + const operationPolyline = this.convertBoundaryToPolyline(res.data.boundaryStr) + if (operationPolyline) { + this.areaPolylines.push(operationPolyline) + } + } + // 获取子区域数据 + this.getParking() + } + }) + }, + // 获取停车点的所有数据 + getParking() { + this.$u.get(`/app/areaSub/listByArea?areaId=${this.areaId}`).then((res) => { + if (res.code === 200 && Array.isArray(res.data)) { + // 过滤掉状态为1的数据 + const filteredData = res.data.filter(item => item.status != 1) + // 分类数据 + const type1Data = [] // 停车区 + const type2Data = [] // 禁停区(电子围栏) + const type3Data = [] // 禁行区 + const type4Data = [] // 景区 + filteredData.forEach(row => { + if (row.type == 1) type1Data.push(row) + else if (row.type == 2) type2Data.push(row) + else if (row.type == 3) type3Data.push(row) + else if (row.type == 4) type4Data.push(row) + }) + // 处理标记点(所有类型) + // 停车区标记点 + type1Data.forEach(item => { + const marker = { + id: parseInt(item.id + "4"), + latitude: parseFloat(item.latitude), + longitude: parseFloat(item.longitude), + width: 18, + height: 26, + iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3', + callout: { + content: item.name, + color: '#ffffff', + fontSize: 12, + borderRadius: 8, + bgColor: '#3A7EDB', + padding: 4, + display: 'ALWAYS' + }, + isParkingArea: true + } + this.covers.push(marker) + }) + // 禁停区标记点 + type2Data.forEach(item => { + const marker = { + id: parseInt(item.id + "5"), + latitude: parseFloat(item.latitude), + longitude: parseFloat(item.longitude), + width: 18, + height: 26, + iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq', + callout: { + content: item.name, + color: '#ffffff', + fontSize: 12, + borderRadius: 8, + bgColor: '#FF473E', + padding: 4, + display: 'ALWAYS' + }, + isParkingArea: true + } + this.covers.push(marker) + }) + // 禁行区标记点 + type3Data.forEach(item => { + const marker = { + id: parseInt(item.id + "6"), + latitude: parseFloat(item.latitude), + longitude: parseFloat(item.longitude), + width: 18, + height: 26, + iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t', + callout: { + content: item.name, + color: '#ffffff', + fontSize: 12, + borderRadius: 8, + bgColor: '#FFC107', + padding: 4, + display: 'ALWAYS' + }, + isParkingArea: true + } + this.covers.push(marker) + }) + // 景区标记点 + type4Data.forEach(item => { + const marker = { + id: parseInt(item.id + "7"), + latitude: parseFloat(item.latitude), + longitude: parseFloat(item.longitude), + width: 18, + height: 26, + iconPath: '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: '#3bbd55', + padding: 4, + display: 'ALWAYS' + }, + isParkingArea: true + } + this.covers.push(marker) + }) + // 处理边界数据 + const processBoundaries = (data, type) => { + 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) { + return polylines + } + } + return [] + } + // 处理所有类型的边界数据 + const type1Polylines = processBoundaries(type1Data, 1) + const type2Polylines = processBoundaries(type2Data, 2) + const type3Polylines = processBoundaries(type3Data, 3) + const type4Polylines = processBoundaries(type4Data, 4) + // 保留现有的运营区边界 + const operationAreaPolylines = this.areaPolylines.filter(p => p.isOperationArea) + // 合并所有边界数据 + const allPolylines = [ + ...operationAreaPolylines, + ...type1Polylines, + ...type2Polylines, + ...type3Polylines, + ...type4Polylines + ] + // 更新显示 + this.areaPolylines = allPolylines + } + }) + }, + // 将运营区边界转换为polyline(单个边界) + convertBoundaryToPolyline(boundary) { + if (!boundary) return null + const points = JSON.parse(boundary).map(coord => ({ latitude: coord[1], longitude: coord[0] })) const polyline = { points: points, - fillColor: "#55888840", //填充颜色 - strokeColor: "red", //描边颜色 - strokeWidth: 2, //描边宽度 - zIndex: 1, //层级 + fillColor: "#55888820", + strokeColor: "#22FF00", + strokeWidth: 1, + zIndex: 1, + isOperationArea: true } return polyline }, + // 将边界数据转换为polyline数组 + convertBoundaryToPolylines(boundaries, num) { + if (!Array.isArray(boundaries)) { + console.error('边界数据不是数组:', boundaries) + return [] + } + const polylines = boundaries.map(boundary => { + if (!boundary) { + console.warn('边界数据为空') + return null + } + let coords + try { + coords = JSON.parse(boundary) + } catch (error) { + console.error('解析边界JSON失败:', error) + return null + } + if (!Array.isArray(coords)) { + console.error('解析后的边界数据不是数组:', coords) + return null + } + const points = coords.map(coord => { + if (!Array.isArray(coord) || coord.length < 2) { + console.warn('坐标数据格式错误:', coord) + return null + } + return { + latitude: parseFloat(coord[1]), + longitude: parseFloat(coord[0]) + } + }).filter(point => point !== null) + + if (points.length < 3) { + console.warn('有效坐标点不足3个,无法构成多边形') + return null + } + // 根据类型设置不同的样式 + let style = {} + if (num == 1) { // 停车区 + style = { + fillColor: "#88888850", + strokeColor: "#88888850", + strokeWidth: 1, + zIndex: 1, + isOperationArea: false + } + } else if (num == 2) { // 禁停区(电子围栏) + style = { + fillColor: "#FF473E40", + strokeColor: "#FF473E", + strokeWidth: 2, + zIndex: 1, + isOperationArea: false + } + } else if (num == 3) { // 禁行区 + style = { + fillColor: "#FFC10740", + strokeColor: "#FFC107", + strokeWidth: 2, + zIndex: 1, + isOperationArea: false + } + } else if (num == 4) { // 景区 + style = { + fillColor: "#4abd2040", + strokeColor: "#4abd20", + strokeWidth: 2, + zIndex: 1, + isOperationArea: false + } + } + return { + points: points, + ...style + } + }).filter(polyline => polyline !== null) + return polylines + }, // 回到地图中心点 async setMapScale(e, val) { let mapContext = uni.createMapContext('map', this); diff --git a/pages/nearbystores/index.vue b/pages/nearbystores/index.vue index 769ae13..1f9a5db 100644 --- a/pages/nearbystores/index.vue +++ b/pages/nearbystores/index.vue @@ -1,6 +1,6 @@