From 81c5835879f1bc50897974e6238eff03a43236a8 Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Sat, 25 Oct 2025 15:52:11 +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 --- common/http.interceptor.js | 42 +- page_fenbao/jiameng/addjiam.vue | 112 +- page_fenbao/storedlist/trueorder.vue | 46 +- page_fenbao/tousu/shtsxq.vue | 297 ++- page_fenbao/yunwei/addyunwei.vue | 122 +- page_shanghu/gongzuotai/ChargingDetail.vue | 30 +- page_shanghu/guanli/Qrcode.vue | 5 +- page_shanghu/guanli/admin_order.vue | 57 +- page_shanghu/guanli/order_detail.vue | 29 +- page_user/hcshenhe.vue | 67 +- page_user/huanbike.vue | 146 +- page_user/returnbike.vue | 2 +- page_user/yongche/orderxq.vue | 32 +- pages.json | 15 +- pages/agreement.vue | 35 +- pages/index/index.vue | 2409 +++++++++++--------- pages/my.vue | 39 +- pages/myorder/returned/index.vue | 2286 ------------------- pages/nearbystores/index.vue | 276 +-- store/index.js | 2 +- 20 files changed, 2045 insertions(+), 4004 deletions(-) delete mode 100644 pages/myorder/returned/index.vue diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 5360ca4..b7dbb90 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -1,10 +1,11 @@ const install = (Vue, vm) => { uni.setStorageSync('deptId', 100); Vue.prototype.$u.http.setConfig({ - // baseUrl: 'http://192.168.2.31:4101', //键辉本地 - // baseUrl: 'http://192.168.0.102:4101', //景森本地 - baseUrl: 'https://ele.ccttiot.com/prod-api', //线上 + // baseUrl: 'http://192.168.1.2:4101', //键辉本地 + // baseUrl: 'http://192.168.2.221:4101', //景森本地 + baseUrl: 'https://ele.ccttiot.com/prod-api', //线上 小鹿appid: wx8a05cf95418a6859 // baseUrl: 'https://cc.ccttiot.com/prod-api', //叉车线上 + // baseUrl:'https://ysd.chuantewulian.cn/prod-api', //嵛山岛线上api 嵛山岛appid:wx4d178f8c80348214 loadingText: '努力加载中~', loadingTime: 10000, // 设置自定义头部content-type @@ -14,41 +15,38 @@ const install = (Vue, vm) => { }) // 请求拦截部分 Vue.prototype.$u.http.interceptor.request = (config) => { - const token = uni.getStorageSync('token'); - config.header.Authorization = token; + const token = uni.getStorageSync('token') + config.header.Authorization = token // config.header.Tenant-Id=1 // #ifdef H5 - config.header.Authorization = 'Bearer ' + token; + config.header.Authorization = 'Bearer ' + token // #endif // 可以对某个url进行特别处理,此url参数为this.$u.get(url)中的url值 - if (config.url == '/user/login') config.header.noToken = true; - return config; + if (config.url == '/user/login') config.header.noToken = true + return config } - // 响应拦截部分 Vue.prototype.$u.http.interceptor.response = (res) => { - return res; + return res } - // 手动实现超时控制 - const originalRequest = Vue.prototype.$u.http.request; + const originalRequest = Vue.prototype.$u.http.request Vue.prototype.$u.http.request = (options) => { return new Promise((resolve, reject) => { const timeout = 20000; // 10秒超时 const timer = setTimeout(() => { - resolve( { code: 500, msg: '请求超时' } ); - }, timeout); - + resolve( { code: 500, msg: '请求超时',} ) + }, timeout) // 执行原始请求 originalRequest.call(Vue.prototype.$u.http, options).then(response => { - clearTimeout(timer); - resolve(response); + clearTimeout(timer) + resolve(response) }).catch(error => { - clearTimeout(timer); - reject(error); - }); - }); - }; + clearTimeout(timer) + reject(error) + }) + }) + } } export default { diff --git a/page_fenbao/jiameng/addjiam.vue b/page_fenbao/jiameng/addjiam.vue index 9fc19e3..1998402 100644 --- a/page_fenbao/jiameng/addjiam.vue +++ b/page_fenbao/jiameng/addjiam.vue @@ -96,6 +96,12 @@ '查看车辆': 'device:view', '操作车辆': 'device:edit', // '查看订单金额':'order:view:amount', + '查看广告': 'ad:view', + '操作广告': 'ad:edit', + '查看套餐': 'suit:view', + '操作套餐': 'suit:edit', + '查看车型': 'model:view', + '操作车型': 'model:edit', '查看客服': 'customerService:view', '操作客服': 'customerService:edit', '查看卡券': 'vip:view', @@ -170,73 +176,113 @@ txt: 10 }, { - name: '查看客服', + name: '查看广告', tit: '是否允许', checked: false, txt: 11 }, { - name: '操作客服', + name: '操作广告', tit: '是否允许', checked: false, txt: 12 }, - { - name: '查看卡券', + name: '查看套餐', tit: '是否允许', checked: false, txt: 13 - },{ - name: '操作卡券', + }, + { + name: '操作套餐', tit: '是否允许', checked: false, txt: 14 - },{ - name: '查看卡券订单', + }, + { + name: '查看车型', tit: '是否允许', checked: false, txt: 15 - },{ - name: '操作卡券订单', + }, + { + name: '操作车型', tit: '是否允许', checked: false, txt: 16 - },{ - name: '查看用户卡券', + }, + { + name: '查看客服', tit: '是否允许', checked: false, txt: 17 - }, { - name: '操作用户卡券', + }, + { + name: '操作客服', tit: '是否允许', checked: false, txt: 18 }, { - name: '查看投诉', + name: '查看卡券', tit: '是否允许', checked: false, txt: 19 }, { - name: '操作投诉', + name: '操作卡券', tit: '是否允许', checked: false, txt: 20 }, { - name: '查看协议', + name: '查看卡券订单', tit: '是否允许', checked: false, txt: 21 }, { - name: '操作协议', + name: '操作卡券订单', tit: '是否允许', checked: false, txt: 22 }, + { + name: '查看用户卡券', + tit: '是否允许', + checked: false, + txt: 23 + }, + { + name: '操作用户卡券', + tit: '是否允许', + checked: false, + txt: 24 + }, + { + name: '查看投诉', + tit: '是否允许', + checked: false, + txt: 25 + }, + { + name: '操作投诉', + tit: '是否允许', + checked: false, + txt: 26 + }, + { + name: '查看协议', + tit: '是否允许', + checked: false, + txt: 27 + }, + { + name: '操作协议', + tit: '是否允许', + checked: false, + txt: 28 + }, ], } }, @@ -281,18 +327,24 @@ 'order:edit': 7, 'device:view': 8, 'device:edit': 9, - 'customerService:view': 10, - 'customerService:edit': 11, - 'vip:view': 12, - 'vip:edit': 13, - 'vipOrder:view': 14, - 'vipOrder:edit': 15, - 'vipUser:view': 16, - 'vipUser:edit': 17, - 'complaint:view': 18, - 'complaint:edit': 19, - 'agreement:view': 20, - 'agreement:edit': 21 + 'ad:view': 10, + 'ad:edit': 11, + 'suit:view': 12, + 'suit:edit': 13, + 'model:view': 14, + 'model:edit': 15, + 'customerService:view': 16, + 'customerService:edit': 17, + 'vip:view': 18, + 'vip:edit': 19, + 'vipOrder:view': 20, + 'vipOrder:edit': 21, + 'vipUser:view': 22, + 'vipUser:edit': 23, + 'complaint:view': 24, + 'complaint:edit': 25, + 'agreement:view': 26, + 'agreement:edit': 27 } permissions.forEach(permission => { diff --git a/page_fenbao/storedlist/trueorder.vue b/page_fenbao/storedlist/trueorder.vue index 7030168..894cbf1 100644 --- a/page_fenbao/storedlist/trueorder.vue +++ b/page_fenbao/storedlist/trueorder.vue @@ -158,7 +158,7 @@ 当前车辆未配置车型,请管理员前往车辆详情页配置! - + 超出计费{{taocanlist[fanganindex].startRule.timeoutPrice}}/ {{taocanlist[fanganindex].startRule.timeoutTime}} @@ -390,18 +390,40 @@ 费用说明 - - 起步计费: - {{taocanlist[fanganindex].startRule.startingPrice}}/ - {{taocanlist[fanganindex].startRule.startingTime}} - 小时分钟 + + + 起步计费: + {{taocanlist[fanganindex].startRule.startingPrice}}/ + {{taocanlist[fanganindex].startRule.startingTime}} + 小时分钟 + + + 超出计费:{{taocanlist[fanganindex].startRule.timeoutPrice}}元 + / + {{taocanlist[fanganindex].startRule.timeoutTime}} + 小时分钟 + - - 超出计费:{{taocanlist[fanganindex].startRule.timeoutPrice}}元 - / - {{taocanlist[fanganindex].startRule.timeoutTime}} - 小时分钟 + + + + + 区间计费: + + + {{rule.start == null ? '0' : rule.start}}-{{rule.end == null ? '不限' : rule.end}} + 小时分钟 + + {{rule.fee}}元 + / + {{rule.eachUnit}} + 小时 + 分钟 + + + + 免费骑行:{{actiobj.freeRideTime == null ? '0' : actiobj.freeRideTime}}分钟,需在停车点还车,地图可查看停车点 查看停车点 @@ -1664,8 +1686,8 @@ // 点击租车方案 btnfa(index, item) { this.actiobj = item - console.log(this.actiobj); this.fanganindex = index + console.log(this.actiobj,this.taocanlist[this.fanganindex]); this.instructions = item.instructions this.suitId = item.id this.getjisuan() diff --git a/page_fenbao/tousu/shtsxq.vue b/page_fenbao/tousu/shtsxq.vue index 69ff3bf..87b1aa7 100644 --- a/page_fenbao/tousu/shtsxq.vue +++ b/page_fenbao/tousu/shtsxq.vue @@ -29,7 +29,7 @@ 已退款金额¥ {{xqobj.refundAmount == null ? '0' : xqobj.refundAmount}} 投诉类型{{xqobj.title == null ? '--' : xqobj.title}} 投诉编号{{xqobj.no == null ? '' : xqobj.no}} - 投诉编号{{xqobj.orderNo == null ? '' : xqobj.orderNo}} + 订单编号{{xqobj.orderNo == null ? '' : xqobj.orderNo}} 投诉时间{{xqobj.createTime == null ? '--' : xqobj.createTime}} 投诉原因{{xqobj.content == null ? '暂无投诉原因' : xqobj.content}} @@ -152,7 +152,7 @@ - + + + + + 退款 + + + + 骑行费: + + {{orderxqobj.actualReceivedRidingFee}} + + + + + 调度费: + + {{orderxqobj.actualReceivedDispatchFee}} + + + + + 管理费: + + {{orderxqobj.actualReceivedManageFee}} + + + + + 车损费: + + {{orderxqobj.actualReceivedDeductionFee}} + + + + + 退款原因 + + + + + 当前操作总退款为¥{{ totalRefund }} + + + + 取消 + + + 确定 + + + + @@ -194,7 +247,14 @@ zsimg:[], msgList:[], showRefund: false, - refundAmount: '' + refundAmount: '', + orderxqobj:{}, + qxfei: '', + ddfei: '', + glfei: '', + csfei:'', + yuanyin:'', + tkje:true } }, onLoad(option) { @@ -202,7 +262,81 @@ this.getxq() this.getqiniuyun() }, + computed:{ + totalRefund() { + return ( + Number(this.qxfei) + + Number(this.ddfei) + + Number(this.glfei) + + Number(this.csfei) + ).toFixed(2); // 保留两位小数 + }, + }, methods: { + qxqx(){ + this.showRefund = false + }, + // 点击退款 + btntuikuan() { + uni.showLoading({ + title: '加载中...', + mask: true + }) + if (this.tkje == true) { + this.tkje = false + let refund = { + orderId: this.xqobj.orderId, + ridingRefund:this.qxfei == '' ? 0 : this.qxfei, + dispatchRefund:this.ddfei == '' ? 0 : this.ddfei, + manageRefund:this.glfei == '' ? 0 : this.glfei, + deductionRefund:this.csfei == '' ? 0 : this.csfei, + reason:this.yuanyin + } + let data = { + complaintId: this.id, + refund:refund + } + this.$u.post(`/bst/complaint/refund`, data).then(res => { + if (res.code == 200) { + uni.hideLoading() + uni.showToast({ + title: '退款成功', + icon: 'success', + duration: 2000 + }) + this.qxfei = '' + this.ddfei = '' + this.glfei = '' + this.csfei = '' + this.yuanyin = '' + this.showRefund = false + setTimeout(() => { + this.tkje = true + this.getxq() + }, 2000) + } else { + uni.hideLoading() + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + setTimeout(() => { + this.tkje = true + }, 1000) + } + }) + } else { + console.log(11); + } + }, + + // 点击跳转到订单详情 + btntz(){ + uni.navigateTo({ + url:'/page_shanghu/guanli/order_detail?orid=' + this.xqobj.orderId + }) + }, // 工具:是否右侧(用户) isRight(msg){ return String(msg.type) == '2' || String(msg.type) == '5' @@ -278,6 +412,7 @@ this.$u.get(`/bst/complaint/${this.id}?showMsg=true&showOrder=true`).then((res) => { if (res.code == 200) { this.xqobj = res.data || {} + this.getorderxq() this.zsimg = res.data && res.data.picture ? res.data.picture.split(',').filter(Boolean) : [] let list = (res.data && res.data.msgList) ? res.data.msgList : [] if (!Array.isArray(list) || list.length == 0) { @@ -292,6 +427,13 @@ } }) }, + getorderxq() { + this.$u.get(`/bst/order/${this.xqobj.orderId}?assembleOrderDeviceList=true`).then(res => { + if (res.code == 200) { + this.orderxqobj = res.data + } + }) + }, toggleExpand(){ this.expanded = !this.expanded @@ -357,45 +499,126 @@ }) }, // 提交退款申请 - submitRefund(){ - if (!this.refundAmount || this.refundAmount <= 0) { - uni.showToast({ title:'请输入有效的退款金额', icon:'none',duration:3000}) - return - } - const amount = parseFloat(this.refundAmount) - const maxAmount = this.getMaxRefundAmount() - if (amount > maxAmount) { - uni.showToast({ title:'退款金额不能超过可退款金额', icon:'none',duration:3000}) - return - } - let that = this - uni.showModal({ - title: '确认退款', - content: `确定要申请退款 ¥${amount} 吗?`, - success: function(res) { - if (res.confirm) { - that.$u.put(`/bst/complaint/refund`, { - complaintId: that.id, - refundAmount: amount - }).then((res) => { - if (res.code == 200) { - uni.showToast({ title:'退款申请成功', icon:'success',duration:3000}) - that.getxq() - that.showRefund = false - }else{ - uni.showToast({ title:res.msg, icon:'none',duration:3000}); - } - }) - that.showRefund = false - } - } - }) - } + // submitRefund(){ + // if (!this.refundAmount || this.refundAmount <= 0) { + // uni.showToast({ title:'请输入有效的退款金额', icon:'none',duration:3000}) + // return + // } + // const amount = parseFloat(this.refundAmount) + // const maxAmount = this.getMaxRefundAmount() + // if (amount > maxAmount) { + // uni.showToast({ title:'退款金额不能超过可退款金额', icon:'none',duration:3000}) + // return + // } + // let that = this + // uni.showModal({ + // title: '确认退款', + // content: `确定要申请退款 ¥${amount} 吗?`, + // success: function(res) { + // if (res.confirm) { + // that.$u.put(`/bst/complaint/refund`, { + // complaintId: that.id, + // refundAmount: amount + // }).then((res) => { + // if (res.code == 200) { + // uni.showToast({ title:'退款申请成功', icon:'success',duration:3000}) + // that.getxq() + // that.showRefund = false + // }else{ + // uni.showToast({ title:res.msg, icon:'none',duration:3000}); + // } + // }) + // that.showRefund = false + // } + // } + // }) + // } } } \ No newline at end of file diff --git a/page_shanghu/guanli/order_detail.vue b/page_shanghu/guanli/order_detail.vue index 985f03b..a6d234a 100644 --- a/page_shanghu/guanli/order_detail.vue +++ b/page_shanghu/guanli/order_detail.vue @@ -519,8 +519,7 @@ - + @@ -710,13 +709,19 @@ ddflag: false, fuzhuobj: {}, price:0, - youhuiobj:{} + youhuiobj:{}, + kstime:'', + endtime:'' } }, onLoad(e) { - this.sn = e.id + if(e.id){ + this.sn = e.id + } + this.kstime = e.ksitem + this.endtime = e.endTime == null ? this.formatCurrentTime() : e.endTime + console.log(e); this.orid = e.orid - this.deviceInfo() this.getorderxq() this.deptId = uni.getStorageSync('deptId') this.getyouhui() @@ -792,6 +797,16 @@ } }, methods: { + formatCurrentTimes() { + const date = new Date(); + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,补0 + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + const seconds = String(date.getSeconds()).padStart(2, '0'); + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + }, getyouhui(){ let data = { orderId:this.orid, @@ -980,7 +995,7 @@ const formattedStartTime = this.orderxqobj.startTime; const formattedEndTime = this.orderxqobj.endTime || this.formatCurrentTime(); // this.$u.get('/bst/locationLog/listByTime?sn=' + this.sn + '&startTime=' + formattedStartTime + '&endTime=' + formattedEndTime).then((res) => { - this.$u.get('/bst/locationLog/listAll?orderId=' + this.orid).then((res) => { + this.$u.get('/bst/locationLog/listAll?orderId=' + this.orid + '&timeRange=' + this.kstime + ',' + this.endtime).then((res) => { if (res.code === 200) { if (!res.data || res.data.length === 0) { uni.showToast({ @@ -1255,6 +1270,8 @@ getorderxq() { this.$u.get(`/bst/order/${this.orid}?assembleOrderDeviceList=true`).then(res => { if (res.code == 200) { + this.sn = res.data.deviceSn + this.deviceInfo() this.orderxqobj = res.data this.updateTrackData() this.suitSeconds = res.data.suitSeconds == null ? '--' : Math.ceil(res.data.suitSeconds / 3600) diff --git a/page_user/hcshenhe.vue b/page_user/hcshenhe.vue index 00497fd..791e78b 100644 --- a/page_user/hcshenhe.vue +++ b/page_user/hcshenhe.vue @@ -66,13 +66,16 @@ fajinobj:{}, orderAreaId:'', flag:'', - mac:'' + mac:'', + scdevlist:[] } }, onLoad(e) { this.orderId = e.orderid this.orderAreaId = e.orderAreaId this.flag = e.flag + this.scdevlist = e.macList.split(',') + console.log(e) if(e.mac){ this.mac = e.mac } @@ -80,7 +83,6 @@ }, onShow() { this.getQiniuToken() - // this.getuserInfo() }, methods: { // 点击缴纳罚金继续还车 @@ -130,9 +132,7 @@ if(res.data.manageFee > 0 || res.data.dispatchFee > 0){ uni.hideLoading() this.fjflag = true - // this.gethc() }else{ - // this.fjflag = true this.gethc() } }else{ @@ -156,7 +156,8 @@ picture:this.videoUrl, lon:this.lon, lat:this.lat, - requiredIot: this.flag + requiredIot: this.flag, + macList:this.scdevlist } this.$u.put(`/app/order/end`,data).then(res =>{ if (res.code == 200) { @@ -197,7 +198,8 @@ picture:this.videoUrl, lon:this.lon, lat:this.lat, - requiredIot: this.flag + requiredIot: this.flag, + macList:this.scdevlist } this.$u.put(`/app/order/end`,data).then(res =>{ if (res.code == 200) { @@ -245,26 +247,20 @@ }, getisInOrder() { - // uni.showLoading({ - - // }) this.orderinfo = {} if (this.userId) { this.$u.post('/app/user/isInOrder?userId=' + this.userId, ).then((res) => { - // uni.hideLoading() if (res.code === 200) { - // this.freList=res.rows this.orderinfo=res.data[0] } else { uni.showToast({ title: res.msg, icon: 'none', duration: 2000 - }); + }) } }) } - }, getuserInfo() { this.$u.get("/getAppInfo").then((res) => { @@ -275,27 +271,16 @@ this.getisInOrder() } else { - - } }) }, getQiniuToken() { - console.log('diaou'); - this.$u.get("/common/qiniuToken").then((res) => { - if (res.code == 200) { - this.token=res.data - // console.log(res,'resres'); - // this.upurl=res.domain - } - }); - // this.$u.get('https://v2.ielts.langsi.online/file/getToken').then(res => { - // console.log(res.data); - // this.token = res.data.token - // }).catch(err => { - // console.log(err) - // }) - + console.log('diaou') + this.$u.get("/common/qiniuToken").then((res) => { + if (res.code == 200) { + this.token = res.data + } + }) }, recordVideo() { // 调用录像API @@ -305,14 +290,14 @@ maxDuration: 15, // 最大录制时长(秒) success: (res) => { // 获取视频录制文件的临时路径 - this.videoPath = res.tempFilePath; - console.log(res.tempFilePath); + this.videoPath = res.tempFilePath + console.log(res.tempFilePath) this.upload() }, fail: (err) => { - console.log('录像失败:', err); + console.log('录像失败:', err) } - }); + }) }, upload(){ uni.showLoading({ @@ -335,9 +320,8 @@ console.log(str.key) _this.videoUrl = 'https://api.ccttiot.com/' + str.key console.log(_this.userImgs) - // _this.imglist.push(_this.userImgs) } - }); + }) } } } @@ -424,7 +408,6 @@ .page { width: 750rpx; border-radius: 0rpx 0rpx 0rpx 0rpx; - .tip_box { padding: 44rpx 36rpx; font-weight: 400; @@ -437,10 +420,8 @@ height: 370rpx; margin-top: 30rpx; .backimg{ - width: 672rpx; height: 370rpx; - } .tip_img{ position: absolute; @@ -464,14 +445,10 @@ height: 370rpx; background: rgba(255, 255, 255, 0.2); border-radius: 40rpx; - // box-shadow: 0 rgba(0, 0, 0, 0.1); backdrop-filter: blur(10rpx); -webkit-backdrop-filter: blur(10rpx); /* For Safari */ - // border: 1rpx solid rgba(255, 255, 255, 0.3); z-index: 10; - } - } .cont { width: 100%; @@ -482,21 +459,17 @@ font-size: 28rpx; color: #3D3D3D; } - .vadio_png { margin-top: 52rpx; - image { width: 672rpx; height: 370rpx; } } - .btn { position: fixed; bottom: 100rpx; left: 38rpx; - // margin-top: 128rpx; display: flex; align-items: center; justify-content: center; diff --git a/page_user/huanbike.vue b/page_user/huanbike.vue index 49fe6f5..576b7d6 100644 --- a/page_user/huanbike.vue +++ b/page_user/huanbike.vue @@ -87,14 +87,6 @@ 请对车辆部位拍摄视频 - @@ -103,7 +95,6 @@ 保持车辆录像的完整清晰,不要随意拍摄,确保视频中车辆出境,并且出现车牌号 - 提交 @@ -119,10 +110,7 @@ export default { backgroundColor: "#fff", }, textValue: '', - currentCount: 0, - imglist: [], token: '', - upurl: '', checkIdx: 1, videoUrl: '', ordersn:'', @@ -135,7 +123,8 @@ export default { longitude:'', videoPath:'', deviceid:'', - devicename:'' + devicename:'', + scdevlist:[] } }, onLoad(e) { @@ -147,6 +136,7 @@ export default { this.getfeiyong() this.deviceid = e.deviceid this.devicename = e.devicename + this.scdevlist = e.macList.split(',') }, onShow() { uni.getLocation({ @@ -169,6 +159,7 @@ export default { }, methods: { + // 点击调用录像功能 recordVideo() { // 调用录像API uni.chooseVideo({ @@ -184,14 +175,14 @@ export default { fail: (err) => { console.log('录像失败:', err); } - }); + }) }, upload(){ uni.showLoading({ title:'上传中' }) - let _this=this - let math='static/'+_this.$u.guid(20) + let _this = this + let math = 'static/'+_this.$u.guid(20) wx.uploadFile({ url: 'https://up-z2.qiniup.com', name: 'file', @@ -207,7 +198,7 @@ export default { console.log(str.key) _this.videoUrl = 'https://api.ccttiot.com/' + str.key } - }); + }) }, // 点击进行换车 subs(){ @@ -228,7 +219,8 @@ export default { faultDetail:this.textValue, faultPicture:this.videoUrl, lat:this.latitude, - lon:this.longitude + lon:this.longitude, + macList:this.scdevlist } this.$u.put(`/app/order/changeDevice`,data).then(res =>{ if(res.code == 200){ @@ -267,7 +259,7 @@ export default { uni.showToast({ title: res.msg, icon: 'none', - duration: 1000 + duration: 3000 }) } }) @@ -278,13 +270,14 @@ export default { if(res.code == 200){ if(res.data){ this.orderobj = res.data - if(res.data.startTime){ + if(res.data.startTime){ //拿到开始骑行时间计算已骑行多长时间 this.timeRemaining = this.calculateTimeRemaining() } } } }) }, + // 计算已骑行时间 calculateTimeRemaining() { const targetDate = new Date(this.orderobj.startTime) const now = new Date() @@ -305,6 +298,7 @@ export default { } }) }, + // 获取七牛云上传图片token getQiniuToken() { this.$u.get("/common/qiniuToken").then((res) => { if (res.code == 200) { @@ -312,32 +306,7 @@ export default { } }) }, - btn() { - let _this = this - let math = 'static/' + _this.$u.guid(20) - uni.chooseImage({ - count: 9, - type: 'all', - success(res) { - const tempFilePaths = res.tempFiles - wx.uploadFile({ - url: 'https://up-z2.qiniup.com', - name: 'file', - filePath: tempFilePaths[0].path, - formData: { - token: _this.token, //后端返回的token - key: 'smartmeter/img/' + math - }, - success: function (res) { - let str = JSON.parse(res.data) - _this.userImgs = 'https://api.ccttiot.com/' + str.key - _this.imglist.push(_this.userImgs) - } - }) - } - }) - }, - + // 点击进扫码解析 qrcode() { uni.scanCode({ onlyFromCamera: true, @@ -357,7 +326,8 @@ export default { console.error('扫描失败:', err) uni.showToast({ title: '扫描失败', - icon: 'none' + icon: 'none', + duration:3000 }) } }) @@ -372,10 +342,7 @@ page { .page { padding-bottom: 100rpx; - // width: 750rpx; width: 750rpx; - // height: 530rpx; - // background: linear-gradient( 180deg, #4297F3 0%, rgba(255,255,255,0) 100%), #FFFFFF; border-radius: 0rpx 0rpx 0rpx 0rpx; padding-bottom: 200rpx; @@ -522,10 +489,8 @@ page { .tipsimg { margin-top: 60rpx; display: flex; - // align-items: center; justify-content: center; width: 100%; - image { width: 554rpx; height: 262rpx; @@ -533,27 +498,23 @@ page { } } } - .maskpage1 { .top_info { width: 100%; display: flex; align-items: center; justify-content: center; - image { margin-right: 16rpx; width: 50rpx; height: 50rpx; } - .masktxt { font-weight: 500; font-size: 44rpx; color: #3D3D3D; } } - .masktips { margin-top: 20rpx; width: 100%; @@ -562,21 +523,17 @@ page { font-size: 32rpx; color: #3D3D3D; } - .tipsimg { margin-top: 60rpx; display: flex; - // align-items: center; justify-content: center; width: 100%; - image { width: 554rpx; height: 262rpx; } } - .btn_box { width: 750rpx; padding: 0 36rpx; @@ -586,9 +543,7 @@ page { display: flex; justify-content: space-between; align-items: center; - .btn3 { - // margin-right: 16rpx; display: flex; align-items: center; justify-content: center; @@ -596,12 +551,10 @@ page { height: 90rpx; background: #4C97E7; border-radius: 45rpx 45rpx 45rpx 45rpx; - font-weight: 500; font-size: 40rpx; color: #FFFFFF; } - .btn4 { display: flex; align-items: center; @@ -610,17 +563,13 @@ page { height: 90rpx; border-radius: 45rpx 45rpx 45rpx 45rpx; border: 2rpx solid #808080; - font-weight: 500; font-size: 40rpx; color: #808080; } } } - } - - .btns { position: fixed; bottom: 70rpx; @@ -637,7 +586,6 @@ page { border-radius: 54rpx 54rpx 54rpx 54rpx; z-index: 100; } - .iptbox { display: flex; align-items: center; @@ -649,34 +597,27 @@ page { background: #FFFFFF; box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15); border-radius: 20rpx 20rpx 20rpx 20rpx; - .qrcode { padding-right: 20rpx; border-right: 2rpx solid #D8D8D8; - image { width: 54rpx; height: 54rpx; } } - .ips { width: 630rpx; - } - image { width: 18rpx; height: 32rpx; } - .my-placeholder { font-weight: 400; font-size: 32rpx; color: #808080; } } - .conts_box { width: 680rpx; margin: 0 auto; @@ -689,7 +630,6 @@ page { box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0, 0, 0, 0.08); border-radius: 20rpx 20rpx 20rpx 20rpx; padding-bottom: 20rpx; - .txtss { margin-top: 18rpx; padding-left: 20rpx; @@ -698,14 +638,12 @@ page { font-size: 28rpx; color: #808080; } - .cont_li { width: 100%; display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; - .left { padding-left: 20rpx; display: flex; @@ -713,28 +651,23 @@ page { font-weight: 600; font-size: 36rpx; color: #3D3D3D; - .km { font-weight: 400; font-size: 28rpx; color: #3D3D3D; } - .speed { margin-top: 18rpx; width: 226rpx; height: 22rpx; background: #ccc; border-radius: 16rpx 16rpx 16rpx 16rpx; - .speeds { - // width: 90%; height: 100%; background: #4297F3; border-radius: 16rpx 16rpx 16rpx 16rpx; } } - .NO { width: 100%; font-weight: 400; @@ -743,22 +676,18 @@ page { margin-top: 18rpx; } } - .right { padding-right: 20rpx; font-weight: 600; font-size: 36rpx; color: #3D3D3D; - image { width: 244rpx; height: 196rpx; } } } - } - .tits { width: 680rpx; margin: 0 auto; @@ -774,9 +703,7 @@ page { height: 24rpx; } } - .cont_box { - margin: 0 auto; padding: 24rpx 32rpx; width: 680rpx; @@ -790,7 +717,6 @@ page { height: 340rpx; margin-top: 30rpx; .backimg{ - width: 100%; height: 340rpx; @@ -817,42 +743,32 @@ page { height: 340rpx; background: rgba(255, 255, 255, 0.2); border-radius: 40rpx; - // box-shadow: 0 rgba(0, 0, 0, 0.1); backdrop-filter: blur(10rpx); -webkit-backdrop-filter: blur(10rpx); /* For Safari */ - // border: 1rpx solid rgba(255, 255, 255, 0.3); z-index: 10; - } - } .tit { width: 100%; display: flex; flex-wrap: nowrap; align-items: center; - image { margin-right: 12rpx; width: 24rpx; height: 24rpx; } - } - .choose_li { margin-top: 34rpx; width: 100%; display: flex; flex-wrap: nowrap; align-items: center; - - // justify-content: space-between; .li_cont { width: 50%; display: flex; flex-wrap: nowrap; - .img_box { margin-right: 30rpx; width: 38rpx; @@ -862,25 +778,20 @@ page { } } } - .tip { display: flex; flex-wrap: nowrap; - // align-items: center; font-weight: 700; font-size: 32rpx; color: #3D3D3D; line-height: 44rpx; - .ipnt { margin-top: 10rpx; margin-right: 12rpx; color: #FF4444; font-size: 48rpx; - } } - .iptbox { display: flex; align-items: center; @@ -889,12 +800,10 @@ page { height: 80rpx; border-radius: 20rpx 20rpx 20rpx 20rpx; border: 2rpx solid #979797; - .ips { margin-left: 30rpx; width: 80%; } - .iptbtn { display: flex; align-items: center; @@ -903,42 +812,34 @@ page { height: 80rpx; background: #4297F3; border-radius: 20rpx 20rpx 20rpx 20rpx; - image { width: 37rpx; height: 37rpx; } } } - .txt { margin-top: 18rpx; font-weight: 400; font-size: 28rpx; color: #3D3D3D; } - .icon { display: flex; flex-wrap: wrap; align-items: center; margin-top: 40rpx; - .imgbox { width: 33%; - image { width: 142rpx; height: 142rpx; } } - } - .checkbox { display: flex; flex-wrap: wrap; - .check_li { position: relative; margin-right: 10rpx; @@ -950,7 +851,6 @@ page { height: 65rpx; border-radius: 20rpx 20rpx 20rpx 20rpx; border: 2rpx solid #C7C7C7; - image { position: absolute; right: 0; @@ -959,21 +859,15 @@ page { height: 20rpx; } } - .check_li:nth-child(4n) { margin-right: 0; } - .act1 { - // background-image: url(https://api.ccttiot.com/smartmeter/img/static/uaqN5qdoGNCs7Dumzr3F); width: 142rpx; height: 65rpx; - // background-size: cover; border: 2rpx solid #1E807A; - // background: #4C97E7; } } - .input-container { position: relative; width: 612rpx; @@ -987,17 +881,13 @@ page { box-sizing: border-box; border: 2rpx solid #C7C7C7; } - .placeholder { position: absolute; top: 18rpx; left: 38rpx; color: #999; - /* placeholder颜色 */ pointer-events: none; - /* 确保点击事件可以穿透到textarea上 */ } - .custom-textarea { width: 100%; height: 100%; @@ -1008,7 +898,6 @@ page { box-sizing: border-box; border: 1px solid #ccc; } - .word-count { position: absolute; right: 10px; @@ -1017,6 +906,5 @@ page { color: #999; } } - } \ No newline at end of file diff --git a/page_user/returnbike.vue b/page_user/returnbike.vue index 0cb7f22..9e34bb5 100644 --- a/page_user/returnbike.vue +++ b/page_user/returnbike.vue @@ -16,7 +16,7 @@ 车牌号:{{item.deviceVehicleNum == null ? '--' : item.deviceVehicleNum}} - 还车时间:{{item.createTime}} + 还车时间:{{item.endTime}} diff --git a/page_user/yongche/orderxq.vue b/page_user/yongche/orderxq.vue index 07a383f..52c3ded 100644 --- a/page_user/yongche/orderxq.vue +++ b/page_user/yongche/orderxq.vue @@ -24,7 +24,7 @@ 订单待支付 - 订单投诉 + 订单疑问 @@ -58,7 +58,7 @@ - + 骑行费 @@ -66,7 +66,7 @@ {{info.ridingFee == null ? '0.00' : info.ridingFee.toFixed(2)}}元 - + 停车点外调度费 @@ -74,7 +74,7 @@ {{info.manageFee == null ? '0.00' : info.manageFee.toFixed(2)}}元 - + 运营区外调度费 @@ -82,7 +82,7 @@ {{info.dispatchFee == null ? '0.00' : info.dispatchFee.toFixed(2)}}元 - + 合计 @@ -92,7 +92,7 @@ - + 预存金额 @@ -100,7 +100,7 @@ {{info.depositFee == null ? '0.00' : info.depositFee.toFixed(2)}}元 - + 结算支付 @@ -108,7 +108,7 @@ {{info.ridePayAmount == null ? '0.00' : info.ridePayAmount.toFixed(2)}}元 - + 退款总额 @@ -117,7 +117,7 @@ - + 优惠券 @@ -358,7 +358,7 @@ let data = { areaId: this.info.areaId }; - this.$u.get('/bst/areaSub/listByAreaId', data).then((res) => { + this.$u.get(`/app/areaSub/listByArea?areaId=${this.info.areaId}`).then((res) => { if (res.code === 200) { const filteredData = res.data.filter(item => item.status != 1); const type1Data = []; @@ -438,7 +438,7 @@ console.error("Area ID is missing"); return; } - this.$u.get(`/bst/area/${id}`).then((res) => { + this.$u.get(`/app/area/detail?id=${id}`).then((res) => { if(res.code == 200){ this.latitude = res.data.latitude this.longitude = res.data.longitude @@ -595,13 +595,9 @@ }, // 请求预估金额 getyugu() { - let data = { - orderId:this.id, - checkLocation:false - } - this.$u.post(`/app/order/calcFee`,data).then((res) => { + this.$u.get(`/app/order/calcPreRideFee?orderId=${this.id}`).then((res) => { if (res.code == 200) { - this.yugumoney = res.data.ridingFee + this.yugumoney = res.data.rideFee } }) }, @@ -869,7 +865,7 @@ .map { position: relative; width: 750rpx; - height: 752rpx; + height: 500rpx; .track { position: absolute; display: flex; diff --git a/pages.json b/pages.json index 5352116..0fdb8f0 100644 --- a/pages.json +++ b/pages.json @@ -47,13 +47,6 @@ "enablePullDownRefresh": false, "navigationStyle": "custom" } - },{ - "path": "pages/myorder/returned/index", - "style": { - "navigationBarTitleText": "", - "enablePullDownRefresh": false, - "navigationStyle": "custom" - } },{ "path": "pages/myorder/returned/tingche", "style": { @@ -671,13 +664,7 @@ "iconPath": "/static/tabbar/map.png", "pagePath": "pages/index/index", "text": "预约" - }, - { - "selectedIconPath": "/static/tabbar/map.png", - "iconPath": "/static/tabbar/map.png", - "pagePath": "pages/myorder/returned/index", - "text": "订单" - }, { + },{ "selectedIconPath": "/static/tabbar/map.png", "iconPath": "/static/tabbar/map.png", "pagePath": "pages/nearbystores/index", diff --git a/pages/agreement.vue b/pages/agreement.vue index 4f343d0..36cb7c2 100644 --- a/pages/agreement.vue +++ b/pages/agreement.vue @@ -19,12 +19,6 @@ 同意 - @@ -76,10 +70,9 @@ }, methods: { back(){ - uni.navigateBack({ delta: 1 // delta值为1时表示返回的页面层数 - }); + }) }, ok() { if(this.isread==false){ @@ -93,7 +86,7 @@ title: '请勾选同意', icon: 'none', duration: 1000 - }); + }) } else if(this.isread&&this.showxy){ uni.setStorageSync('xieyi',true) if(this.type == 1){ @@ -106,9 +99,9 @@ }) } } - }, quit() { + // 当点击不同意时退出小程序 uni.exitMiniProgram({ success: function() { console.log('退出小程序成功'); @@ -122,20 +115,19 @@ getagree() { this.$u.get(`/app/article/detail?id=${this.startArticleId}`).then((res) => { if (res.code === 200) { - this.info = res.data; - this.insertPhoneNumberAndDate(); + this.info = res.data + this.insertPhoneNumberAndDate() } else { uni.showToast({ title: res.msg, icon: 'none', duration: 2000 - }); + }) } - }); + }) }, insertPhoneNumberAndDate() { - // 替换所有的 为 \u00A0 this.info.content = this.info.content.replace(/ /g, '\u00A0'); } @@ -148,7 +140,6 @@ page { background-color: #fff; } - .page { width: 750rpx; padding-bottom: 250rpx; @@ -159,7 +150,6 @@ flex-wrap: nowrap; align-items: center; justify-content: center; - .yuans { margin-top: 2rpx; display: flex; @@ -169,26 +159,21 @@ height: 27rpx; border-radius: 50%; border: #808080 solid 2rpx; - image { width: 100%; height: 100%; border-radius: 50%; } } - .txt { - margin-left: 10rpx; font-weight: 400; font-size: 24rpx; color: #979797; - span { color: #3D3D3D; } } - } .bottom { position: fixed; @@ -200,7 +185,6 @@ flex-wrap: nowrap; align-items: center; justify-content: space-around; - // box-shadow: 12rpx 16rpx 40rpx 0rpx rgba(42,130,228,0.1); .act1{ background: #64B6A7 !important; } @@ -211,7 +195,6 @@ flex-wrap: nowrap; align-items: center; justify-content: center; - // border: 2rpx solid #000; border-radius: 40rpx; background: #ccc; color: #fff; @@ -225,21 +208,17 @@ flex-wrap: nowrap; align-items: center; justify-content: center; - // border: 2rpx solid #000; border-radius: 40rpx; background: #ccc; color: #fff; font-size: 28rpx; font-weight: 600; } - } - .cont { margin-top: 34rpx; margin: 0 auto; width: 634rpx; - } } \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 6a995b3..316d69f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,25 +1,28 @@ @@ -309,7 +356,7 @@ export default { data() { return { - iconobj:this.$store.state.iconobj, + iconobj: this.$store.state.iconobj, bgc: { backgroundColor: "", }, @@ -363,43 +410,45 @@ yyid: '', cachedPolyline: [], // 缓存多边形数据 cachedParkingData: {}, // 缓存停车区域数据 - isFirstLoad: true ,// 是否是首次加载 - parkingList:[], - shibainum:0, - jiance:false, + isFirstLoad: true, // 是否是首次加载 + parkingList: [], + shibainum: 0, + jiance: false, ver_dataflag: 1, mac: '', deviceid: '', devicename: '', - name:'', + name: '', devicesarr: [], findDeviceTimer: null, - uploadTimer: null, // 定时器ID - lastUploadTime: 0, // 上次上传时间戳 - isUploading: false,// 上传状态锁 + uploadTimer: null, // 定时器ID + lastUploadTime: 0, // 上次上传时间戳 + isUploading: false, // 上传状态锁 isRefreshing: false, - bluetoothData:{}, - lslat:'', - lslon:'', + bluetoothData: {}, + lslat: '', + lslon: '', orderDeviceTimer: null, // 订单设备定时器 - wenbentxt:'', - wenbentxtflag:false, + wenbentxt: '', + wenbentxtflag: false, percentage: 0, // 百分比数值 percentageTimer: null, // 百分比动画定时器 - ljsbflag:false, - chongshinum:'', - jieshuflag:true, + ljsbflag: false, + chongshinum: '', + jieshuflag: true, rideDurationText: '00:00', rideTimer: null, - huiyuanlist:[], - daohangflag:false, - distance:0, - chexq:{}, - caozuotext:'' + huiyuanlist: [], + daohangflag: false, + distance: 0, + chexq: {}, + caozuotext: '', + enableChange:false, + scdevlist:[] } }, onLoad() { - + }, onShow() { this.getorderdevice() @@ -421,14 +470,14 @@ this.getAone() this.covers = [] this.sockedata = '' - setTimeout(()=>{ + setTimeout(() => { this.setMapScale() - },500) + }, 500) this.polyline = [] this.isFirstLoad = true // 重置首次加载标志 - setTimeout(()=>{ + setTimeout(() => { this.toggleIconAndCallout() - },3000) + }, 3000) }, onUnload() { this.clearTimer() @@ -457,9 +506,9 @@ }, // 组件销毁时清除定时器 beforeDestroy() { - clearTimeout(this.uploadTimer) - this.stopOrderDeviceTimer() // 停止订单设备定时器 - this.stopPercentageAnimation() // 停止百分比动画 + clearTimeout(this.uploadTimer) + this.stopOrderDeviceTimer() // 停止订单设备定时器 + this.stopPercentageAnimation() // 停止百分比动画 }, watch: { wenbentxtflag(newVal) { @@ -508,33 +557,30 @@ this.startPercentageAnimation() }, 100) }, - // 点击查看费用详情 - btnfeiyong(){ - - }, - handleMarkerClick(e){ - // 规划路线 + // 规划路线 + handleMarkerClick(e) { console.log(e); this.getcha(e.markerId) this.daohangflag = true }, - getcha(id){ - this.$u.get(`/app/areaSub/detail?id=${id}`).then(res =>{ - if(res.code == 200){ + // 查询运营区信息 + getcha(id) { + this.$u.get(`/app/areaSub/detail?id=${id}`).then(res => { + if (res.code == 200) { this.chexq = res.data } }) }, // 点击跳转导航 - btndh(){ + btndh() { uni.openLocation({ latitude: this.chexq.latitude, //纬度-目的地/坐标点 longitude: this.chexq.longitude, //经度-目的地/坐标点 name: this.chexq.name, //地点名称 - address:this.chexq.name //详细地点名称 + address: this.chexq.name //详细地点名称 }) }, - + // 计算骑行时长显示(按时和分,不到一分钟显示一分钟) computeRideDurationText() { if (!this.orderobj || !this.orderobj.orderStartTime) { @@ -580,40 +626,40 @@ this.rideTimer = null } }, - // 点击查看教程 - btnjc(){ + // 点击查看蓝牙连接教程 + btnjc() { uni.navigateTo({ - url:'/page_user/yongche/index?type=2' + url: '/page_user/yongche/index?type=2' }) }, - // 点击重试 - btnchongshi(){ + // 点击进行操作重试 + btnchongshi() { this.ljsbflag = false - if(this.chongshinum == '解锁' || this.chongshinum == '锁车'){ + if (this.chongshinum == '解锁' || this.chongshinum == '锁车') { this.btnqd() - }else if(this.chongshinum == '还车'){ + } else if (this.chongshinum == '还车') { this.btnjsdd() - }else if(this.chongshinum == '换车'){ + } else if (this.chongshinum == '换车') { this.btnghbike() - }else if(this.chongshinum == '响铃'){ + } else if (this.chongshinum == '响铃') { this.btnxl() } }, - // 点击咨询客服 - btnkefu(){ + // 点击请求客服列表进行咨询 + 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){ + if (res.code == 200) { + if (res.rows.length > 0) { this.kefulist = res.rows this.kefuflag = true - }else{ + } else { uni.showToast({ title: '当前运营区暂无客服', icon: 'none', duration: 2000 }) } - }else{ + } else { uni.showToast({ title: res.msg, icon: 'none', @@ -622,9 +668,27 @@ } }) }, - // 点击响铃 - btnxl(){ - if(this.jiance == true){ + // 点击跳转导航寻车 + btnxunche() { + this.$u.get(`/app/device/detailByOrderId?orderId=${this.orderobj.orderId}&supportLocation=true`).then(( + res) => { + if (res.code == 200) { + uni.openLocation({ + latitude: res.data.latitude, //纬度-目的地/坐标点 + longitude: res.data.longitude, //经度-目的地/坐标点 + }) + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + } + }) + }, + // 点击车辆响铃 + btnxl() { + if (this.jiance == true) { xBlufi.initXBlufi(1) xBlufi.notifyStartDiscoverBle({ 'isStart': true @@ -644,7 +708,8 @@ console.error('获取位置失败:', err) } }) - this.$u.put(`/app/device/iot/ring?id=${this.orderobj.deviceId}&lat=${this.xllat}&lon=${this.xllng}`).then((res) => { + this.$u.put(`/app/device/iot/ring?id=${this.orderobj.deviceId}&lat=${this.xllat}&lon=${this.xllng}`).then(( + res) => { if (res.code == 200) { this.wenbentxt = '' this.wenbentxtflag = false @@ -656,7 +721,7 @@ } else if (res.code == 20001) { this.wenbentxt = '蓝牙响铃中...' let that = this - const findDevice = () =>{ + const findDevice = () => { that.ver_dataflag = 2 const matchedDevice = that.devicesarr.find(device => { return device.name.slice(-12) == that.mac.slice(-12) @@ -672,14 +737,14 @@ }) that.deviceid = matchedDevice.deviceId that.devicename = matchedDevice.name - setTimeout(()=>{ - if(that.ver_dataflag == 3){ + setTimeout(() => { + if (that.ver_dataflag == 3) { that.wenbentxt = '' that.wenbentxtflag = false xBlufi.notifySendCustomData({ customData: "11play1@" }) - }else{ + } else { that.chongshinum = '响铃' that.ver_dataflag = 1 that.shibainum = 0 @@ -687,12 +752,12 @@ that.wenbentxtflag = false that.ljsbflag = true } - },4000) + }, 4000) } else { - if(that.shibainum < 3){ + if (that.shibainum < 3) { that.shibainum++ - that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使用 bind 保持 this 上下文 - }else{ + that.findDeviceTimer = setTimeout(findDevice.bind(that),1000) // 使用 bind 保持 this 上下文 + } else { that.chongshinum = '响铃' that.ver_dataflag = 1 that.shibainum = 0 @@ -700,21 +765,21 @@ that.wenbentxtflag = false that.ljsbflag = true let lanya = '' - if(that.jiance == true){ + if (that.jiance == true) { lanya = '蓝牙未开启' - }else{ + } else { lanya = '蓝牙已开启' } let data = { - mac:that.mac, + mac: that.mac, orderId: that.orderobj.orderId, - reason:'用户蓝牙响铃失败' + lanya, - command:'11play1@', + reason: '用户蓝牙响铃失败' + lanya, + command: '11play1@', lat: that.lat, lon: that.lon, - result:'失败' + result: '失败' } - that.$u.post(`/app/commandLog/bluetooth`,data).then(res => {}) + that.$u.post(`/app/commandLog/bluetooth`, data).then(res => {}) } } } @@ -733,20 +798,20 @@ // 获取附近蓝牙设备列表 funListenDeviceMsgEvent: function(options) { switch (options.type) { - case xBlufi.XBLUFI_TYPE.TYPE_STATUS_CONNECTED: + case xBlufi.XBLUFI_TYPE.TYPE_STATUS_CONNECTED: //监听蓝牙是否断开 if (!options.result) { this.ver_dataflag = 1 - console.log(this.ver_dataflag,'断开断开'); + console.log(this.ver_dataflag, '断开断开'); clearTimeout(this.uploadTimer) //清除每十秒传一次的定时 this.jiance = true } break; - case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS: + case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS: //获取附近蓝牙设备列表 if (options.result) { this.devicesarr = options.data } break; - case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED: + case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED: //连接回调是否连接上蓝牙 console.log("连接回调:" + JSON.stringify(options)) if (options.result == true) { setTimeout(() => { @@ -757,162 +822,170 @@ }) this.deviceid = options.data.deviceId this.name = this.name - }else{ + } else { this.ver_dataflag = 1 } break; - case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA: + case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA: //接收蓝牙传输数据 console.log("1收到设备发来的自定义数据结果:", options.data) this.getlysj(options.data) break; - case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START: + case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START: //判断蓝牙是否初始化成功兼是否开启蓝牙 if (!options.result) { console.log('蓝牙未开启') this.jiance = true return - } + } break; } }, + // 解析接收的蓝牙数据 getlysj(data) { - if (!data) return; - // 1. 更健壮的数据解析 - const dataStr = data.toString(); - // console.log('原始数据:', dataStr); - const dataObj = {}; - // 判断数据格式:检查是否包含@或,分隔符 - let separator = ','; - if (dataStr.includes('@')) { - separator = '@'; - } - dataStr.split(separator).forEach(part => { - if (!part) return; // 忽略空字符串 - let key, value; - // 如果使用@分隔符,数据格式为 key-value 对,例如: status0@csq0@bat125@... - if (separator === '@') { - // 使用正则表达式分离键(字母)和值(数字) - const match = part.match(/^([a-zA-Z]+)(.*)$/); - if (!match) return; - key = match[1]; - value = match[2]; - } else { - // 如果使用,分隔符,数据格式为 key:value 对,例如: status:0,csq:0,bat:125,... - const [keyPart, valuePart] = part.split(':').map(item => item.trim()); - if (!keyPart || valuePart === undefined) return; - key = keyPart; - value = valuePart; + if (!data) return; + // 1. 更健壮的数据解析 + const dataStr = data.toString(); + // console.log('原始数据:', dataStr); + const dataObj = {}; + // 判断数据格式:检查是否包含@或,分隔符 + let separator = ','; + if (dataStr.includes('@')) { + separator = '@'; } - if (key && value !== undefined) { - switch (key) { - case 'status': - dataObj.status = value; - break; - case 'bat': - dataObj.bat = parseFloat(value); - break; - case 'csq': - dataObj.csq = parseInt(value, 10); - break; - case 'lat': - dataObj.lat = parseFloat(value); - break; - case 'lon': - dataObj.lon = parseFloat(value); - break; - case 'q': - dataObj.q = parseInt(value, 10); - break; - case 's': - dataObj.s = parseInt(value, 10); - break; - } - } - }); - // 2. 获取定位 - uni.getLocation({ - type: 'gcj02', - isHighAccuracy: true, - success: (res) => { - this.submitData({ - ...dataObj, - lon: res.longitude, - lat: res.latitude - }) - }, - fail: () => { - this.submitData({ - ...dataObj, - lon: dataObj.lon || 0, - lat: dataObj.lat || 0 - }) - } - }) + dataStr.split(separator).forEach(part => { + if (!part) return; // 忽略空字符串 + let key, value; + // 如果使用@分隔符,数据格式为 key-value 对,例如: status0@csq0@bat125@... + if (separator === '@') { + // 使用正则表达式分离键(字母)和值(数字) + const match = part.match(/^([a-zA-Z]+)(.*)$/); + if (!match) return; + key = match[1]; + value = match[2]; + } else { + // 如果使用,分隔符,数据格式为 key:value 对,例如: status:0,csq:0,bat:125,... + const [keyPart, valuePart] = part.split(':').map(item => item.trim()); + if (!keyPart || valuePart === undefined) return; + key = keyPart; + value = valuePart; + } + if (key && value !== undefined) { + switch (key) { + case 'status': + dataObj.status = value; + break; + case 'bat': + dataObj.bat = parseFloat(value); + break; + case 'csq': + dataObj.csq = parseInt(value, 10); + break; + case 'lat': + dataObj.lat = parseFloat(value); + break; + case 'lon': + dataObj.lon = parseFloat(value); + break; + case 'q': + dataObj.q = parseInt(value, 10); + break; + case 's': + dataObj.s = parseInt(value, 10); + break; + } + } + }) + // 2. 获取定位 + uni.getLocation({ + type: 'gcj02', + isHighAccuracy: true, + success: (res) => { + this.submitData({ + ...dataObj, + lon: res.longitude, + lat: res.latitude + }) + }, + fail: () => { + this.submitData({ + ...dataObj, + lon: dataObj.lon || 0, + lat: dataObj.lat || 0 + }) + } + }) + }, + // 处理所有蓝牙前缀 上传 + getmaclist(){ + this.scdevlist = this.devicesarr.map(item => { + const name = item.name || '' + return name.slice(-12) + }) }, // 3. 单独封装数据提交 submitData(data) { - const payload = { - mac: this.mac, - sys: { - bat: data.bat !== undefined && data.bat !== null ? Number(data.bat) : 0, - csq: data.csq !== undefined && data.csq !== null ? Number(data.csq) : 0, - s: data.s !== undefined && data.s !== null ? Number(data.s) : null, - q: data.q !== undefined && data.q !== null ? Number(data.q) : null, - status: String(data.status || '0'), - lon: data.lon !== undefined && data.lon !== null ? Number(data.lon) : 0, - lat: data.lat !== undefined && data.lat !== null ? Number(data.lat) : 0 - } - } - this.bluetoothData = payload - this.throttledUpload() + const payload = { + mac: this.mac, + sys: { + bat: data.bat !== undefined && data.bat !== null ? Number(data.bat) : 0, + csq: data.csq !== undefined && data.csq !== null ? Number(data.csq) : 0, + s: data.s !== undefined && data.s !== null ? Number(data.s) : null, + q: data.q !== undefined && data.q !== null ? Number(data.q) : null, + status: String(data.status || '0'), + lon: data.lon !== undefined && data.lon !== null ? Number(data.lon) : 0, + lat: data.lat !== undefined && data.lat !== null ? Number(data.lat) : 0 + } + } + this.bluetoothData = payload + this.throttledUpload() }, // 节流上传控制 throttledUpload() { - const now = Date.now() - const throttleInterval = 10000 // 10秒 - clearTimeout(this.uploadTimer) - // 如果距离上次上传超过10秒且没有正在上传的请求 - if (now - this.lastUploadTime >= throttleInterval && !this.isUploading) { - this.doUpload() - } else { - const remainingTime = throttleInterval - (now - this.lastUploadTime) - this.uploadTimer = setTimeout(() => { - this.doUpload() - }, remainingTime) - } + const now = Date.now() + const throttleInterval = 10000 // 10秒 + clearTimeout(this.uploadTimer) + // 如果距离上次上传超过10秒且没有正在上传的请求 + if (now - this.lastUploadTime >= throttleInterval && !this.isUploading) { + this.doUpload() + } else { + const remainingTime = throttleInterval - (now - this.lastUploadTime) + this.uploadTimer = setTimeout(() => { + this.doUpload() + }, remainingTime) + } }, // 实际执行上传 doUpload() { - if (!this.bluetoothData || this.isUploading) return - this.isUploading = true - this.lastUploadTime = Date.now() - this.$u.put(`/app/device/iot/bltUpload`, this.bluetoothData).then(res => { - if(res.code == 200) { - console.log('上传蓝牙数据成功',this.bluetoothData, new Date().toLocaleTimeString()) - } else { - console.log('上传蓝牙数据失败', res.msg) - } - }).catch(err => { - console.error('上传异常:', err) - }).finally(() => { - this.isUploading = false - }) - }, + if (!this.bluetoothData || this.isUploading) return + this.isUploading = true + this.lastUploadTime = Date.now() + this.$u.put(`/app/device/iot/bltUpload`, this.bluetoothData).then(res => { + if (res.code == 200) { + console.log('上传蓝牙数据成功', this.bluetoothData, new Date().toLocaleTimeString()) + } else { + console.log('上传蓝牙数据失败', res.msg) + } + }).catch(err => { + console.error('上传异常:', err) + }).finally(() => { + this.isUploading = false + }) + }, // 开坐垫锁 - btnkzds(){ + btnkzds() { uni.getLocation({ - type: 'gcj02', // 国内地图更兼容 + 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.lslat = null - } + accuracy: 'best', + success: (res) => { + // console.log('精确坐标:', res) + this.lslat = res.latitude + this.lslon = res.longitude + }, + fail: (err) => { + console.error('获取位置失败:', err) + this.lslat = null + this.lslat = null + } }) let that = this uni.showModal({ @@ -926,21 +999,21 @@ mask: true }) let data = { - orderId:that.orderobj.orderId, - lon:that.lslon, - lat:that.lslat, - requiredIot:true + orderId: that.orderobj.orderId, + lon: that.lslon, + lat: that.lslat, + requiredIot: true } - that.$u.put("/app/order/seat",data).then((res) => { + that.$u.put("/app/order/seat", data).then((res) => { if (res.code == 200) { uni.showToast({ title: '打开成功', icon: 'success', duration: 2000 }) - } else if(res.code == 20001){ + } else if (res.code == 20001) { uni.hideLoading() - if(that.ver_dataflag != 3){ + if (that.ver_dataflag != 3) { uni.showLoading({ title: '坐垫锁开启中...', mask: true @@ -960,28 +1033,28 @@ }) this.deviceid = matchedDevice.deviceId this.devicename = matchedDevice.name - setTimeout(()=>{ + setTimeout(() => { uni.hideLoading() xBlufi.notifySendCustomData({ customData: "11hpen@" }) - },4000) + }, 4000) } else { - if(this.shibainum < 3){ + if (this.shibainum < 3) { this.shibainum++ this.findDeviceTimer = setTimeout(this.findDevice.bind(this), 1000) // 使用 bind 保持 this 上下文 - }else{ + } else { this.ver_dataflag = 1 this.shibainum = 0 uni.showModal({ - title: '提示', + title: '提示', content: '开启坐垫锁失败,请重试', showCancel: false, success: function(res) { if (res.confirm) { - + } else if (res.cancel) { - + } } }) @@ -997,14 +1070,14 @@ }) } }) - } + } } }) }, - // 点击自定义返回 - btnfh(){ + // 点击自定义返回页面 + btnfh() { uni.reLaunch({ - url:'/pages/nearbystores/index?qbtype=1' + url: '/pages/nearbystores/index?qbtype=1' }) }, // 拖动查询中心点的数据 @@ -1018,47 +1091,48 @@ // } // } }, - debounceUpdate() { - if (this.updateTimer) { - clearTimeout(this.updateTimer) - } - this.updateTimer = setTimeout(() => { - this.getAone() - }, 300) // 延迟300ms执行更新 - }, - getNearbyMarkers(clickedLat, clickedLon) { - const nearbyMarkers = this.listData.filter(item => { - if (item.latitude && item.longitude) { - const distance = this.haversineDistance( - parseFloat(clickedLat), - parseFloat(clickedLon), - parseFloat(item.latitude), - parseFloat(item.longitude) - ); - return distance <= 100 - } - return false - }); - // 更新 circles 数组来绘制淡灰色的圆形区域 - this.circles = [{ - latitude: clickedLat, - longitude: clickedLon, - color: '#fff', // 圆形边框颜色(淡灰色) - fillColor: '#00000010', // 圆形填充颜色(淡灰色) - radius: 100, // 圆的半径(单位:米) - strokeWidth: 1 - }] - this.nearbyMarkers = nearbyMarkers - }, - haversineDistance(lat1, lon1, lat2, lon2) { - const R = 6371e3 // Earth radius in meters - const toRad = angle => angle * Math.PI / 180 - const dLat = toRad(lat2 - lat1) - const dLon = toRad(lon2 - lon1) - const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2) - const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)) - return R * c - }, + // debounceUpdate() { + // if (this.updateTimer) { + // clearTimeout(this.updateTimer) + // } + // this.updateTimer = setTimeout(() => { + // this.getAone() + // }, 300) // 延迟300ms执行更新 + // }, + // getNearbyMarkers(clickedLat, clickedLon) { + // const nearbyMarkers = this.listData.filter(item => { + // if (item.latitude && item.longitude) { + // const distance = this.haversineDistance( + // parseFloat(clickedLat), + // parseFloat(clickedLon), + // parseFloat(item.latitude), + // parseFloat(item.longitude) + // ); + // return distance <= 100 + // } + // return false + // }); + // // 更新 circles 数组来绘制淡灰色的圆形区域 + // this.circles = [{ + // latitude: clickedLat, + // longitude: clickedLon, + // color: '#fff', // 圆形边框颜色(淡灰色) + // fillColor: '#00000010', // 圆形填充颜色(淡灰色) + // radius: 100, // 圆的半径(单位:米) + // strokeWidth: 1 + // }] + // this.nearbyMarkers = nearbyMarkers + // }, + // haversineDistance(lat1, lon1, lat2, lon2) { + // const R = 6371e3 // Earth radius in meters + // const toRad = angle => angle * Math.PI / 180 + // const dLat = toRad(lat2 - lat1) + // const dLon = toRad(lon2 - lon1) + // const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2) + // const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)) + // return R * c + // }, + // 解析判断赋值车辆状态 status(item) { if (item.status == 0) { return '仓库中' @@ -1078,23 +1152,23 @@ return '禁用中' } }, - startTimer() { - this.timer = setInterval(() => { - this.count++ - // 这里替换为你的实际逻辑 - this.setMapScale() - }, 5000) - }, - + // startTimer() { + // this.timer = setInterval(() => { + // this.count++ //每次加一 + // // 这里替换为你的实际逻辑 + // this.setMapScale() + // }, 5000) + // }, // 清除定时器 clearTimer() { - if (this.timer) { - clearInterval(this.timer) - this.timer = null - console.log("定时器已清除") - } + if (this.timer) { + clearInterval(this.timer) + this.timer = null + console.log("定时器已清除") + } }, - btnjjqx(){ + // 点击继续骑行 + btnjjqx() { this.orderflag = true this.fjflag = false }, @@ -1149,19 +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', fontSize: 12, borderRadius: 8, - bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FF473E' : item.type == 3 ? '#FFC107' : '#3bbd55', + bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ?'#FF473E' : item.type == 3 ? '#FFC107' : '#3bbd55', padding: 4, display: 'ALWAYS' }, @@ -1170,7 +1238,7 @@ }) this.newMarkers = newMarkers this.$set(this, 'covers', [...this.covers, ...newMarkers]) - if(this.sockedata.latitude){ + if (this.sockedata.latitude) { this.covers.push({ latitude: this.sockedata.latitude, longitude: this.sockedata.longitude, @@ -1234,7 +1302,8 @@ }, // 点击结束订单 btnjsdd() { - if(this.jiance == true){ + this.getmaclist() + if (this.jiance == true) { xBlufi.initXBlufi(1) xBlufi.notifyStartDiscoverBle({ 'isStart': true @@ -1242,18 +1311,18 @@ xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent) } this.caozuotext = '还车前请将车辆停放于运营区和停车区内' - if(this.jieshuflag == true){ + if (this.jieshuflag == true) { this.jieshuflag = false this.$u.get("/app/order/mineProcessing").then((res) => { if (res.code == 200) { - if(res.data){ + if (res.data) { if (this.orderAreaReturnVerify == true) { - if(this.orderobj.deviceOnlineStatus == 0){ + if (this.orderobj.deviceOnlineStatus == 0) { this.jieshuflag = true this.wenbentxtflag = true this.wenbentxt = '蓝牙连接中...' let that = this - const findDevice = () =>{ + const findDevice = () => { that.ver_dataflag = 2 const matchedDevice = that.devicesarr.find(device => { return device.name.slice(-12) == that.mac.slice(-12) @@ -1269,15 +1338,15 @@ }) that.deviceid = matchedDevice.deviceId that.devicename = matchedDevice.name - setTimeout(()=>{ - if(that.ver_dataflag == 3){ + setTimeout(() => { + if (that.ver_dataflag == 3) { that.wenbentxt = '' that.wenbentxtflag = false let flag = false uni.navigateTo({ - url: '/page_user/hcshenhe?sn=' + that.orderobj.deviceSn + '&orderid=' + that.orderobj.orderId + '&orderAreaId=' + that.orderobj.orderAreaId + '&flag=' + flag + '&mac=' + that.mac + url: '/page_user/hcshenhe?sn=' +that.orderobj.deviceSn +'&orderid=' + that.orderobj.orderId + '&orderAreaId=' +that.orderobj.orderAreaId +'&flag=' + flag + '&mac=' + that.mac + '&macList=' + this.scdevlist }) - }else{ + } else { that.ver_dataflag = 1 that.shibainum = 0 that.wenbentxt = '' @@ -1285,12 +1354,12 @@ that.ljsbflag = true that.chongshinum = '还车' } - },4000) + }, 4000) } else { - if(that.shibainum < 3){ + if (that.shibainum < 3) { that.shibainum++ - that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使用 bind 保持 this 上下文 - }else{ + that.findDeviceTimer = setTimeout(findDevice.bind(that),1000) // 使用 bind 保持 this 上下文 + } else { that.ver_dataflag = 1 that.shibainum = 0 that.wenbentxt = '' @@ -1301,18 +1370,18 @@ } } findDevice() - }else{ + } else { this.jieshuflag = true uni.navigateTo({ - url: '/page_user/hcshenhe?sn=' + this.orderobj.deviceSn + '&orderid=' + this.orderobj.orderId + '&orderAreaId=' + this.orderobj.orderAreaId + '&flag=' + false + url: '/page_user/hcshenhe?sn=' + this.orderobj.deviceSn +'&orderid=' + this.orderobj.orderId + '&orderAreaId=' +this.orderobj.orderAreaId + '&flag=' + false + '&macList=' + this.scdevlist }) } } else { this.wenbentxt = '车辆还车中...' this.wenbentxtflag = true - console.log(this.devicesarr,'附近设备'); + console.log(this.devicesarr, '附近设备'); let that = this - const findDevice = () =>{ + const findDevice = () => { that.ver_dataflag = 2 const matchedDevice = that.devicesarr.find(device => { return device.name.slice(-12) == that.mac.slice(-12) @@ -1322,31 +1391,31 @@ that.wenbentxt = '' that.wenbentxtflag = false uni.getLocation({ - type: 'gcj02', // 国内地图更兼容 + type: 'gcj02', // 国内地图更兼容 isHighAccuracy: true, - accuracy:'best', - success: (res) => { - console.log('精确坐标:', res) - that.lat = res.latitude - that.lon = res.longitude + accuracy: 'best', + success: (res) => { + console.log('精确坐标:', res) + that.lat = res.latitude + that.lon = res.longitude that.lngsc = res.longitude that.latsc = res.latitude - that.getfeiyong() - }, - fail: (err) => { - console.error('获取位置失败:', err) - that.lat = null - that.lon = null + that.getfeiyong() + }, + fail: (err) => { + console.error('获取位置失败:', err) + that.lat = null + that.lon = null that.lngsc = null that.latsc = null - that.getfeiyong() // 降级处理 - } + that.getfeiyong() // 降级处理 + } }) } else { - if(that.shibainum < 3){ + if (that.shibainum < 3) { that.shibainum++ - that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使用 bind 保持 this 上下文 - }else{ + that.findDeviceTimer = setTimeout(findDevice.bind(that),1000) // 使用 bind 保持 this 上下文 + } else { console.log('不在旁边2'); that.ver_dataflag = 1 that.shibainum = 0 @@ -1359,13 +1428,13 @@ } findDevice() } - }else{ + } else { this.jieshuflag = true uni.navigateTo({ - url:'/page_user/yongche/orderxq?id=' + this.orderobj.orderId + url: '/page_user/yongche/orderxq?id=' + this.orderobj.orderId }) } - }else{ + } else { this.jieshuflag = true uni.showToast({ title: res.msg, @@ -1382,7 +1451,8 @@ orderId: this.orderobj.orderId, lon: this.lngsc, lat: this.latsc, - checkLocation:true + checkLocation: true, + macList:this.scdevlist } this.$u.post(`/app/order/calcFee`, data).then(res => { if (res.code == 200) { @@ -1396,15 +1466,15 @@ } else { this.gethuan() } - }else{ - setTimeout(()=>{ + } else { + setTimeout(() => { this.jieshuflag = true - },3000) + }, 3000) uni.showModal({ - title: '提示', - content: res.msg, - showCancel: false, - confirmText: '知道了' + title: '提示', + content: res.msg, + showCancel: false, + confirmText: '知道了' }) } }) @@ -1417,7 +1487,7 @@ gethuan() { let that = this uni.showModal({ - title: '提示', + title: '提示', content: '您确定要还车吗?', showCancel: true, success: function(res) { @@ -1430,7 +1500,8 @@ picture: that.imgs, lon: that.lngsc, lat: that.latsc, - requiredIot: true + requiredIot: true, + macList:that.scdevlist } that.$u.put(`/app/order/end`, data).then(res => { if (res.code == 200) { @@ -1443,42 +1514,43 @@ icon: 'success', duration: 2000 }) - setTimeout(()=>{ + setTimeout(() => { uni.navigateTo({ - url:'/page_user/yongche/orderxq?id=' + that.orderobj.orderId + url: '/page_user/yongche/orderxq?id=' +that.orderobj.orderId }) - },1000) - }else if(res.code == 20001){ - if(that.ver_dataflag == 3){ + }, 1000) + } else if (res.code == 20001) { + if (that.ver_dataflag == 3) { that.wenbentxt = '蓝牙还车中...' xBlufi.notifySendCustomData({ customData: "11llosesub300@" }) - setTimeout(()=>{ + setTimeout(() => { xBlufi.notifySendCustomData({ customData: "11reboot@" }) - },2000) + }, 2000) that.fjflag = false let data = { orderId: that.orderobj.orderId, picture: that.imgs, lon: that.lon, lat: that.lat, - requiredIot: false + requiredIot: false, + macList:that.scdevlist } that.$u.put(`/app/order/end`, data).then(res => { if (res.code == 200) { - setTimeout(()=>{ + setTimeout(() => { that.wenbentxt = '' that.wenbentxtflag = false - setTimeout(()=>{ + setTimeout(() => { uni.navigateTo({ - url:'/page_user/yongche/orderxq?id=' + that.orderobj.orderId + url: '/page_user/yongche/orderxq?id=' +that.orderobj.orderId }) - },1000) - },2000) - }else if(res.msg == null) { + }, 1000) + }, 2000) + } else if (res.msg == null) { that.wenbentxt = '' that.wenbentxtflag = false uni.showToast({ @@ -1495,17 +1567,17 @@ showCancel: false, success: function(res) { if (res.confirm) { - + } else if (res.cancel) { - + } } }) } }) - }else{ + } else { that.wenbentxt = '蓝牙还车中...' - const findDevice = () =>{ + const findDevice = () => { that.ver_dataflag = 2 const matchedDevice = that.devicesarr.find(device => { return device.name.slice(-12) == that.mac.slice(-12) @@ -1521,61 +1593,62 @@ }) that.deviceid = matchedDevice.deviceId that.devicename = matchedDevice.name - setTimeout(()=>{ - if(that.ver_dataflag == 3){ + setTimeout(() => { + if (that.ver_dataflag == 3) { that.fjflag = false let data = { orderId: that.orderobj.orderId, picture: that.imgs, lon: that.lon, lat: that.lat, - requiredIot: false + requiredIot: false, + macList:that.scdevlist } that.$u.put(`/app/order/end`, data).then(res => { - if (res.code == 200) { - xBlufi.notifySendCustomData({ - customData: "11close@" - }) - setTimeout(()=>{ + if (res.code == 200) { xBlufi.notifySendCustomData({ - customData: "11reboot@" + customData: "11close@" }) - that.wenbentxt = '' - that.wenbentxtflag = false - setTimeout(()=>{ - uni.navigateTo({ - url:'/page_user/yongche/orderxq?id=' + that.orderobj.orderId + setTimeout(() => { + xBlufi.notifySendCustomData({ + customData: "11reboot@" }) - },1000) - },2000) - } else if(res.msg == null) { - that.wenbentxt = '' - that.wenbentxtflag = false - that.orderflag = true - uni.showToast({ - title: '未知错误', - icon: 'none', - duration: 2000 - }) - } else { - that.wenbentxt = '' - that.wenbentxtflag = false - that.orderflag = true - uni.showModal({ - title: '提示', - content: res.msg, - showCancel: false, - success: function(res) { - if (res.confirm) { - - } else if (res.cancel) { - + that.wenbentxt ='' + that.wenbentxtflag =false + setTimeout(() => { + uni.navigateTo({ + url: '/page_user/yongche/orderxq?id=' +that.orderobj.orderId + }) + },1000) + }, 2000) + } else if (res.msg == null) { + that.wenbentxt = '' + that.wenbentxtflag =false + that.orderflag =true + uni.showToast({ + title: '未知错误', + icon: 'none', + duration: 2000 + }) + } else { + that.wenbentxt = '' + that.wenbentxtflag =false + that.orderflag =true + uni.showModal({ + title: '提示', + content: res.msg, + showCancel: false, + success: function(res) { + if (res.confirm) { + + } else if (res.cancel) { + + } } - } - }) - } - }) - }else{ + }) + } + }) + } else { that.ver_dataflag = 1 that.shibainum = 0 that.wenbentxt = '' @@ -1584,12 +1657,12 @@ that.ljsbflag = true that.chongshinum = '还车' } - },4000) + }, 4000) } else { - if(that.shibainum < 3){ + if (that.shibainum < 3) { that.shibainum++ that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使用 bind 保持 this 上下文 - }else{ + } else { that.ver_dataflag = 1 that.shibainum = 0 that.wenbentxt = '' @@ -1598,27 +1671,27 @@ that.ljsbflag = true that.chongshinum = '还车' let lanya = '' - if(that.jiance == true){ + if (that.jiance == true) { lanya = '蓝牙未开启' - }else{ + } else { lanya = '蓝牙已开启' } let data = { - mac:that.mac, + mac: that.mac, orderId: that.orderobj.orderId, - reason:'用户蓝牙还车失败' + lanya, - command:'11close@', + reason: '用户蓝牙还车失败' + lanya, + command: '11close@', lat: that.lat, lon: that.lon, - result:'失败' + result: '失败' } - that.$u.post(`/app/commandLog/bluetooth`,data).then(res => {}) + that.$u.post(`/app/commandLog/bluetooth`, data).then(res => {}) } } } findDevice() } - } else if(res.msg == null) { + } else if (res.msg == null) { that.wenbentxt = '' that.wenbentxtflag = false that.orderflag = true @@ -1637,9 +1710,9 @@ showCancel: false, success: function(res) { if (res.confirm) { - + } else if (res.cancel) { - + } } }) @@ -1658,213 +1731,284 @@ url: '/pages/myorder/returned/tingche?areaId=' + this.orderobj.orderAreaId }) }, - // 点击故障上报 - btnguzhang(){ + // 点击故障上报 + btnguzhang() { uni.navigateTo({ - url:'/page_user/guzhang/index?sn=' + this.orderobj.deviceSn + url: '/page_user/guzhang/index?sn=' + this.orderobj.deviceSn + }) + }, + // 点击去进行换车 + 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){ + if (this.jiance == true) { xBlufi.initXBlufi(1) xBlufi.notifyStartDiscoverBle({ 'isStart': true }) xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent) } - 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 - } - }) - let that = this - that.wenbentxt = '车辆锁车中...' - that.wenbentxtflag = true - let query = { - orderId: that.orderobj.orderId, - lat: that.lslat, - lon: that.lslon, - requiredIot: true - } - let url = '/app/order/closeDevice?' + that.$tansParams(query) - that.$u.put(url).then((res) => { - if (res.code == 200) { - that.wenbentxt = '' - that.wenbentxtflag = false - uni.showToast({ - title: '锁车成功', - icon: 'success', - duration: 2000 - }) - that.orderobj.deviceLockStatus = 0 - setTimeout(()=>{ - uni.navigateTo({ - url: '/page_user/huanbike?sn=' + that.orderobj.deviceSn + '&orderid=' + that.orderobj.orderId + '&deviceid=' + that.deviceid + '&devicename=' + that.devicename - }) - },1000) - } else if(res.code == 20001){ - if(that.ver_dataflag == 3){ - that.orderobj.deviceLockStatus = 0 - xBlufi.notifySendCustomData({ - customData: "11llosesub300@", - }) - setTimeout(()=>{ - // xBlufi.notifySendCustomData({ - // customData: "11reboot@" - // }) - that.wenbentxt = '' - that.wenbentxtflag = false - },2000) - let lanya = '' - if(that.jiance == true){ - lanya = '蓝牙未开启' - }else{ - lanya = '蓝牙已开启' + const findDevice = () => { + this.ver_dataflag = 2 + const matchedDevice = this.devicesarr.find(device => { + return device.name.slice(-12) == this.mac.slice(-12) + }) + if (matchedDevice) { + xBlufi.notifyStartDiscoverBle({ + 'isStart': false + }) + } else { + if (this.shibainum < 3) { + this.shibainum++ + this.findDeviceTimer = setTimeout(findDevice.bind(this), 1000) // 使用 bind 保持 this 上下文 + } else { + this.lslat = null + this.lslon = null + } + } + } + findDevice() + + let that = this + that.wenbentxt = '车辆锁车中...' + that.wenbentxtflag = true + let data = { + orderId: that.orderobj.orderId, + lat: that.lslat, + lon: that.lslon, + requiredIot: true, + macList:that.scdevlist + } + console.log(data,'datadata'); + that.$u.put(`/app/order/closeDevice`,data).then((res) => { + if (res.code == 200) { + that.wenbentxt = '' + that.wenbentxtflag = false + uni.showToast({ + title: '锁车成功', + icon: 'success', + duration: 2000 + }) + that.orderobj.deviceLockStatus = 0 + setTimeout(() => { + uni.navigateTo({ + url: '/page_user/huanbike?sn=' + that.orderobj.deviceSn +'&orderid=' + that.orderobj.orderId + '&deviceid=' + that.deviceid + '&devicename=' + that.devicename + '&macList=' + this.scdevlist + }) + }, 1000) + } else if (res.code == 20001) { + if (that.ver_dataflag == 3) { + uni.getLocation({ + type: 'gcj02', // 国内地图更兼容 + isHighAccuracy: true, + accuracy: 'best', + success: (res) => { + console.log('精确坐标:', res) + that.lslat = res.latitude + that.lslon = res.longitude + }, + fail: (err) => { + console.error('获取位置失败:', err) + that.lslat = null + that.lslon = null } - let data = { - mac:that.mac, - reason:'临时锁车' + lanya, - command:'11llosesub300@', - longitude:that.lslon, - latitude:that.lslat, - result:'失败' - } - that.$u.post(`/app/commandLog/bluetooth`,data).then(res => { - console.log(res,'蓝牙') + }) + that.orderobj.deviceLockStatus = 0 + xBlufi.notifySendCustomData({ + customData: "11llosesub300@", + }) + setTimeout(() => { + that.wenbentxt = '' + that.wenbentxtflag = false + }, 2000) + let lanya = '' + if (that.jiance == true) { + lanya = '蓝牙未开启' + } else { + lanya = '蓝牙已开启' + } + let data = { + mac: that.mac, + reason: '临时锁车' + lanya, + command: '11llosesub300@', + longitude: that.lslon, + latitude: that.lslat, + result: '失败' + } + that.$u.post(`/app/commandLog/bluetooth`, data).then(res => { + console.log(res, '蓝牙') + }) + let datas = { + orderId: that.orderobj.orderId, + lat: that.lslat, + lon: that.lslon, + requiredIot: true, + macList:that.scdevlist + } + that.$u.put(`/app/order/closeDevice`,datas).then((res) => {}) + uni.navigateTo({ + url: '/page_user/huanbike?sn=' + that.orderobj.deviceSn + '&orderid=' +that.orderobj.orderId + '&deviceid=' + that.deviceid + '&devicename=' +that.devicename + '&macList=' + this.scdevlist + }) + } else { + that.wenbentxt = '车辆锁车中...' + const findDevice = () => { + that.ver_dataflag = 2 + const matchedDevice = that.devicesarr.find(device => { + return device.name.slice(-12) == that.mac.slice(-12) }) - let query = { - orderId: that.orderobj.orderId, - lat: that.lslat, - lon: that.lslon, - requiredIot: false - } - let url = '/app/order/closeDevice?' + that.$tansParams(query) - that.$u.put(url).then((res) =>{}) - uni.navigateTo({ - url: '/page_user/huanbike?sn=' + that.orderobj.deviceSn + '&orderid=' + that.orderobj.orderId + '&deviceid=' + that.deviceid + '&devicename=' + that.devicename - }) - }else{ - that.wenbentxt = '车辆锁车中...' - const findDevice = () =>{ - that.ver_dataflag = 2 - const matchedDevice = that.devicesarr.find(device => { - return device.name.slice(-12) == that.mac.slice(-12) + if (matchedDevice) { + xBlufi.notifyStartDiscoverBle({ + 'isStart': false }) - if (matchedDevice) { - xBlufi.notifyStartDiscoverBle({ - 'isStart': false - }) - xBlufi.notifyConnectBle({ - isStart: true, - deviceId: matchedDevice.deviceId, - name: matchedDevice.name - }) - that.deviceid = matchedDevice.deviceId - that.devicename = matchedDevice.name - setTimeout(()=>{ - if(that.ver_dataflag == 3){ - that.orderobj.deviceLockStatus = 0 + xBlufi.notifyConnectBle({ + isStart: true, + deviceId: matchedDevice.deviceId, + name: matchedDevice.name + }) + that.deviceid = matchedDevice.deviceId + that.devicename = matchedDevice.name + setTimeout(() => { + if (that.ver_dataflag == 3) { + uni.getLocation({ + type: 'gcj02', // 国内地图更兼容 + isHighAccuracy: true, + accuracy: 'best', + success: (res) => { + console.log('精确坐标:', res) + that.lslat = res.latitude + that.lslon = res.longitude + }, + fail: (err) => { + console.error('获取位置失败:', err) + that.lslat = null + that.lslon = null + } + }) + that.orderobj.deviceLockStatus = 0 + xBlufi.notifySendCustomData({ + customData: "11llosesub300@", + }) + setTimeout(() => { xBlufi.notifySendCustomData({ - customData: "11llosesub300@", + customData: "11reboot@" }) - setTimeout(()=>{ - xBlufi.notifySendCustomData({ - customData: "11reboot@" - }) - that.wenbentxt = '' - that.wenbentxtflag = false - },2000) - let lanya = '' - if(that.jiance == true){ - lanya = '蓝牙未开启' - }else{ - lanya = '蓝牙已开启' - } - let data = { - mac:that.mac, - reason:'临时锁车' + lanya, - command:'11llosesub300@', - longitude:that.lslon, - latitude:that.lslat, - result:'失败' - } - that.$u.post(`/app/commandLog/bluetooth`,data).then(res => { - console.log(res,'蓝牙') - }) - let query = { - orderId: that.orderobj.orderId, - lat: that.lslat, - lon: that.lslon, - requiredIot: false - } - let url = '/app/order/closeDevice?' + that.$tansParams(query) - that.$u.put(url).then((res) =>{}) - uni.navigateTo({ - url: '/page_user/huanbike?sn=' + that.orderobj.deviceSn + '&orderid=' + that.orderobj.orderId + '&deviceid=' + that.deviceid + '&devicename=' + that.devicename - }) - }else{ - that.ver_dataflag = 1 - that.shibainum = 0 that.wenbentxt = '' that.wenbentxtflag = false - that.ljsbflag = true - that.chongshinum = '换车' + }, 2000) + let lanya = '' + if (that.jiance == true) { + lanya = '蓝牙未开启' + } else { + lanya = '蓝牙已开启' } - },4000) - } else { - if(that.shibainum < 3){ - that.shibainum++ - that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使用 bind 保持 this 上下文 - }else{ + let data = { + mac: that.mac, + reason: '临时锁车' + lanya, + command: '11llosesub300@', + longitude: that.lslon, + latitude: that.lslat, + result: '成功' + } + that.$u.post(`/app/commandLog/bluetooth`, data).then( + res => { + console.log(res, '蓝牙') + }) + let datas = { + orderId: that.orderobj.orderId, + lat: that.lslat, + lon: that.lslon, + requiredIot: true, + macList:that.scdevlist + } + that.$u.put(`/app/order/closeDevice`,datas).then((res) => {}) + uni.navigateTo({ + url: '/page_user/huanbike?sn=' + that.orderobj.deviceSn + '&orderid=' + that.orderobj.orderId + '&deviceid=' + that.deviceid +'&devicename=' + that.devicename + '&macList=' + this.scdevlist + }) + } else { that.ver_dataflag = 1 that.shibainum = 0 that.wenbentxt = '' that.wenbentxtflag = false that.ljsbflag = true that.chongshinum = '换车' - let lanya = '' - if(that.jiance == true){ - lanya = '蓝牙未开启' - }else{ - lanya = '蓝牙已开启' - } - let data = { - mac:that.mac, - orderId: that.orderobj.orderId, - reason:'用户蓝牙临时锁车失败' + lanya, - command:'11llosesub300@', - lat: that.lslat, - lon: that.lslon, - result:'失败' - } - that.$u.post(`/app/commandLog/bluetooth`,data).then(res => {}) } + }, 4000) + } else { + if (that.shibainum < 3) { + that.shibainum++ + that.findDeviceTimer = setTimeout(findDevice.bind(that),1000) // 使用 bind 保持 this 上下文 + } else { + uni.getLocation({ + type: 'gcj02', // 国内地图更兼容 + isHighAccuracy: true, + accuracy: 'best', + success: (res) => { + console.log('精确坐标:', res) + that.lslat = res.latitude + that.lslon = res.longitude + }, + fail: (err) => { + console.error('获取位置失败:', err) + that.lslat = null + that.lslon = null + } + }) + that.ver_dataflag = 1 + that.shibainum = 0 + that.wenbentxt = '' + that.wenbentxtflag = false + that.ljsbflag = true + that.chongshinum = '换车' + let lanya = '' + if (that.jiance == true) { + lanya = '蓝牙未开启' + } else { + lanya = '蓝牙已开启' + } + let data = { + mac: that.mac, + orderId: that.orderobj.orderId, + reason: '用户蓝牙临时锁车失败' + lanya, + command: '11llosesub300@', + lat: that.lslat, + lon: that.lslon, + result: '失败' + } + that.$u.post(`/app/commandLog/bluetooth`, data).then(res => {}) } } - findDevice() } - } else { - that.wenbentxt = '' - that.wenbentxtflag = false - uni.showToast({ - title: res.msg, - icon: 'none', - duration: 2000 - }) - } - }) + findDevice() + } + } else { + that.wenbentxt = '' + that.wenbentxtflag = false + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + } + }) }, // 点击跳转导航 danghang() { @@ -1885,8 +2029,9 @@ }, // 点击启动and关闭 btnqd() { + this.getmaclist() this.caozuotext = '骑行前请检查车轿刹车是否灵敏,安全骑行' - if(this.jiance == true){ + if (this.jiance == true) { xBlufi.initXBlufi(1) xBlufi.notifyStartDiscoverBle({ 'isStart': true @@ -1895,34 +2040,34 @@ } this.$u.get("/app/orderDevice/mineUsing").then((res) => { if (res.code == 200) { - if(res.data){ - if(res.data.deviceStatus == 9){ + if (res.data) { + if (res.data.deviceStatus == 9) { uni.showModal({ - title: '提示', + title: '提示', content: '超出运营区车辆已被强制锁车,请返回运营区或联系客服', showCancel: false, success: function(res) { if (res.confirm) { - + } } }) - }else{ + } else { if (res.data.deviceLockStatus == 0) { - uni.getLocation({ - type: 'gcj02', // 国内地图更兼容 + 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 - } + 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 + } }) let that = this uni.showModal({ @@ -1939,7 +2084,8 @@ lon: that.lslon, requiredIot: true } - let url = '/app/order/openDevice?' + that.$tansParams(query) + let url = '/app/order/openDevice?' + that.$tansParams( + query) that.$u.put(url).then((res) => { if (res.code == 200) { that.wenbentxt = '' @@ -1950,76 +2096,76 @@ duration: 2000 }) that.orderobj.deviceLockStatus = 1 - } else if(res.code == 20001){ + } else if (res.code == 20001) { that.wenbentxt = '蓝牙解锁中...' - const findDevice = () =>{ + const findDevice = () => { that.ver_dataflag = 2 const matchedDevice = that.devicesarr.find(device => { - return device.name.slice(-12) == that.mac.slice(-12) - }) + return device.name.slice(-12) ==that.mac.slice(-12) + }) if (matchedDevice) { xBlufi.notifyStartDiscoverBle({ - 'isStart': false - }) + 'isStart': false + }) xBlufi.notifyConnectBle({ isStart: true, deviceId: matchedDevice.deviceId, name: matchedDevice.name }) - that.deviceid = matchedDevice.deviceId - that.devicename = matchedDevice.name - setTimeout(()=>{ - if(that.ver_dataflag == 3){ + that.deviceid =matchedDevice.deviceId + that.devicename =matchedDevice.name + setTimeout(() => { + if (that.ver_dataflag ==3) { xBlufi.notifySendCustomData({ customData: "11opensub5@" }) - that.wenbentxt = '' - that.wenbentxtflag = false - that.orderobj.deviceLockStatus = 1 + that.wenbentxt ='' + that.wenbentxtflag =false + that.orderobj.deviceLockStatus =1 let query = { orderId: that.orderobj.orderId, lat: that.lslat, lon: that.lslon, requiredIot: false } - let url = '/app/order/openDevice?' + that.$tansParams(query) - that.$u.put(url).then((res) =>{}) - }else{ - that.ver_dataflag = 1 - that.shibainum = 0 - that.wenbentxt = '' - that.wenbentxtflag = false + let url ='/app/order/openDevice?' +that.$tansParams(query) + that.$u.put(url).then((res) => {}) + } else { + that.ver_dataflag =1 + that.shibainum =0 + that.wenbentxt ='' + that.wenbentxtflag =false uni.hideLoading() - that.ljsbflag = true - that.chongshinum = '解锁' + that.ljsbflag =true + that.chongshinum ='解锁' } - },4000) + }, 4000) } else { - if(that.shibainum < 3){ + if (that.shibainum < 3) { that.shibainum++ - that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使用 bind 保持 this 上下文 - }else{ + that.findDeviceTimer = setTimeout(findDevice.bind(that),1000) // 使用 bind 保持 this 上下文 + } else { that.ver_dataflag = 1 that.shibainum = 0 that.wenbentxt = '' - that.wenbentxtflag = false + that.wenbentxtflag =false uni.hideLoading() that.ljsbflag = true that.chongshinum = '解锁' let lanya = '' - if(that.jiance == true){ + if (that.jiance ==true) { lanya = '蓝牙未开启' - }else{ + } else { lanya = '蓝牙已开启' } let data = { - mac:that.mac, + mac: that.mac, orderId: that.orderobj.orderId, - reason:'用户蓝牙解锁失败' + lanya, - command:'11opensub5@', + reason: '用户蓝牙解锁失败' +lanya, + command: '11opensub5@', lat: that.lslat, lon: that.lslon, - result:'失败', + result: '失败', } that.$u.post(`/app/commandLog/bluetooth`,data).then(res => {}) } @@ -2040,19 +2186,19 @@ }) } else if (res.data.deviceLockStatus == 1) { uni.getLocation({ - type: 'gcj02', // 国内地图更兼容 + 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 - } + 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 + } }) let that = this uni.showModal({ @@ -2063,15 +2209,15 @@ if (res.confirm) { that.wenbentxt = '车辆临时锁车中...' that.wenbentxtflag = true - let query = { + let data = { orderId: that.orderobj.orderId, lat: that.lslat, lon: that.lslon, - requiredIot: true + requiredIot: true, + macList:that.scdevlist } - let url = '/app/order/closeDevice?' + that.$tansParams(query) - that.$u.put(url).then((res) => { - if (res.code == 200) { + that.$u.put(`/app/order/closeDevice`,data).then((res) => { + if (res.code == 200) { that.wenbentxt = '' that.wenbentxtflag = false uni.showToast({ @@ -2080,12 +2226,12 @@ duration: 2000 }) that.orderobj.deviceLockStatus = 0 - } else if(res.code == 20001){ + } else if (res.code == 20001) { that.wenbentxt = '蓝牙临时锁车中...' - const findDevice = () =>{ + const findDevice = () => { that.ver_dataflag = 2 const matchedDevice = that.devicesarr.find(device => { - return device.name.slice(-12) == that.mac.slice(-12) + return device.name.slice(-12) ==that.mac.slice(-12) }) if (matchedDevice) { xBlufi.notifyStartDiscoverBle({ @@ -2096,47 +2242,45 @@ deviceId: matchedDevice.deviceId, name: matchedDevice.name }) - that.deviceid = matchedDevice.deviceId - that.devicename = matchedDevice.name - setTimeout(()=>{ - if(that.ver_dataflag == 3){ - that.orderobj.deviceLockStatus = 0 + that.deviceid =matchedDevice.deviceId + that.devicename =matchedDevice.name + setTimeout(() => { + if (that.ver_dataflag ==3) { + that.orderobj.deviceLockStatus =0 xBlufi.notifySendCustomData({ - customData: "11llosesub300@", + customData: "11llosesub300@", }) - setTimeout(()=>{ + setTimeout(() => { xBlufi.notifySendCustomData({ customData: "11reboot@" }) - that.wenbentxt = '' - that.wenbentxtflag = false + that.wenbentxt ='' + that.wenbentxtflag =false },2000) - let lanya = '' - if(that.jiance == true){ - lanya = '蓝牙未开启' - }else{ - lanya = '蓝牙已开启' + let lanya ='' + if (that.jiance ==true) { + lanya ='蓝牙未开启' + } else { + lanya ='蓝牙已开启' } let data = { - mac:that.mac, - reason:'临时锁车' + lanya, - command:'11llosesub300@', - longitude:that.lslon, - latitude:that.lslat, - result:'失败' + mac: that.mac, + reason: '临时锁车' +lanya, + command: '11llosesub300@', + longitude: that.lslon, + latitude: that.lslat, + result: '失败' } - that.$u.post(`/app/commandLog/bluetooth`,data).then(res => { - console.log(res,'蓝牙') - }) - let query = { + that.$u.post(`/app/commandLog/bluetooth`,data).then(res =>{console.log(res,'蓝牙')}) + let datas = { orderId: that.orderobj.orderId, lat: that.lslat, lon: that.lslon, - requiredIot: false + requiredIot: true, + macList:that.scdevlist } - let url = '/app/order/closeDevice?' + that.$tansParams(query) - that.$u.put(url).then((res) =>{}) - }else{ + that.$u.put(`/app/order/closeDevice`,datas).then((res) => {}) + } else { that.ver_dataflag = 1 that.shibainum = 0 that.wenbentxt = '' @@ -2144,12 +2288,12 @@ that.ljsbflag = true that.chongshinum = '锁车' } - },4000) + }, 4000) } else { - if(that.shibainum < 3){ + if (that.shibainum < 3) { that.shibainum++ - that.findDeviceTimer = setTimeout(findDevice.bind(that), 1000) // 使用 bind 保持 this 上下文 - }else{ + that.findDeviceTimer = setTimeout(findDevice.bind(that),1000) // 使用 bind 保持 this 上下文 + } else { that.ver_dataflag = 1 that.shibainum = 0 that.wenbentxt = '' @@ -2157,19 +2301,19 @@ that.ljsbflag = true that.chongshinum = '锁车' let lanya = '' - if(that.jiance == true){ + if (that.jiance == true) { lanya = '蓝牙未开启' - }else{ + } else { lanya = '蓝牙已开启' } let data = { - mac:that.mac, + mac: that.mac, orderId: that.orderobj.orderId, - reason:'用户蓝牙临时锁车失败' + lanya, - command:'11llosesub300@', + reason: '用户蓝牙临时锁车失败' +lanya, + command: '11llosesub300@', lat: that.lslat, lon: that.lslon, - result:'失败' + result: '失败' } that.$u.post(`/app/commandLog/bluetooth`,data).then(res => {}) } @@ -2191,16 +2335,16 @@ } } }) - } + } } - }else{ + } else { uni.navigateTo({ - url:'/page_user/yongche/orderxq?id=' + this.orderobj.orderId + url: '/page_user/yongche/orderxq?id=' + this.orderobj.orderId }) } - }else if(res.code == 40001){ + } else if (res.code == 40001) { uni.navigateTo({ - url:'/page_user/yongche/orderxq?id=' + this.orderobj.orderId + url: '/page_user/yongche/orderxq?id=' + this.orderobj.orderId }) } }) @@ -2216,13 +2360,14 @@ this.areaId = res.data.orderAreaId this.deviceMac = res.data.deviceMac this.mac = res.data.deviceMac - this.orderflag = true + this.orderflag = true this.isPageActive = true this.gethuiyuan() this.getMyLocation() this.initWebSocket() //WebSocket接受数据 this.$u.get(`/app/area/detail?id=${this.orderAreaId}`).then((res) => { if (res.code == 200) { + this.enableChange = res.data.enableChange const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr) this.polyline.push(polylines) this.getParking() @@ -2233,7 +2378,7 @@ this.startOrderDeviceTimer() } else { uni.reLaunch({ - url:'/pages/nearbystores/index' + url: '/pages/nearbystores/index' }) this.orderAreaId = '' this.orderflag = false @@ -2248,24 +2393,23 @@ }) }, // 请求会员卡列表 - gethuiyuan(){ - this.$u.get(`/app/vip/listByArea?areaId=${this.areaId}`).then(res=>{ - if(res.code == 200){ + gethuiyuan() { + this.$u.get(`/app/vip/listByArea?areaId=${this.areaId}`).then(res => { + if (res.code == 200) { this.huiyuanlist = res.data } - }) + }) }, // 点击跳转到购买会员列表 - btnhuiyuan(){ + btnhuiyuan() { uni.navigateTo({ - url:'/page_fenbao/huiyuan/index?areaId=' + this.areaId + url: '/page_fenbao/huiyuan/index?areaId=' + this.areaId }) }, // 启动订单设备定时器 startOrderDeviceTimer() { // 先清除可能存在的定时器 this.stopOrderDeviceTimer() - // 创建新的定时器,每分钟执行一次 this.orderDeviceTimer = setInterval(() => { // 检查页面是否活跃 @@ -2273,7 +2417,6 @@ this.stopOrderDeviceTimer() return } - // 执行获取订单设备的请求 this.$u.get("/app/orderDevice/mineUsing").then((res) => { if (res.code == 200) { @@ -2310,7 +2453,6 @@ }) }, 60000) // 60000毫秒 = 1分钟 }, - // 停止订单设备定时器 stopOrderDeviceTimer() { if (this.orderDeviceTimer) { @@ -2319,20 +2461,12 @@ 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 => { if (res.code == 200) { this.taocanflag = false - uni.setStorageSync('user',res.user) + uni.setStorageSync('user', res.user) uni.navigateTo({ url: '/page_fenbao/storedlist/trueorder?modelId=' + this.cheobj.modelId + '&sn=' + this.cheobj.sn }) @@ -2356,7 +2490,8 @@ }, // 点击响铃寻车 btnxlxc() { - this.$u.put(`/app/device/iot/ring?id=${this.cheobj.id}&lat=${this.xllat}&lon=${this.xllng}`).then((res) => { + this.$u.put(`/app/device/iot/ring?id=${this.cheobj.id}&lat=${this.xllat}&lon=${this.xllng}`).then(( + res) => { if (res.code == 200) { uni.showToast({ title: '操作成功', @@ -2392,7 +2527,6 @@ this.taocanflag = false this.newMarkers = '' }, - // 点击选择骑行套餐 btntcxz(index) { this.tcindex = index @@ -2404,17 +2538,17 @@ }) }, // 点击拨打平台客服电话 - btnptkf(tel){ - uni.makePhoneCall({ - phoneNumber: tel, - success: function(res) { - console.log('拨打电话成功', res) - }, - fail: function(err) { - console.error('拨打电话失败', err) - } - }) - }, + btnptkf(tel) { + uni.makePhoneCall({ + phoneNumber: tel, + success: function(res) { + console.log('拨打电话成功', res) + }, + fail: function(err) { + console.error('拨打电话失败', err) + } + }) + }, // 点击跳转到租车门店 btnmendain() { uni.navigateTo({ @@ -2473,7 +2607,7 @@ this.covers = [] this.listData = [] this.$set(this, 'covers', [...this.covers, ...this.newMarkers]) - if(this.sockedata.latitude){ + if (this.sockedata.latitude) { this.covers.push({ latitude: this.sockedata.latitude, longitude: this.sockedata.longitude, @@ -2486,8 +2620,7 @@ 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, @@ -2550,13 +2683,13 @@ console.error('边界数据不是数组:', boundaries) return [] } - + const polylines = boundaries.map(boundary => { if (!boundary) { console.warn('边界数据为空') return null } - + let coords try { coords = JSON.parse(boundary) @@ -2564,12 +2697,12 @@ 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) @@ -2580,12 +2713,12 @@ longitude: parseFloat(coord[0]) } }).filter(point => point !== null) - + if (points.length < 3) { console.warn('有效坐标点不足3个,无法构成多边形') return null } - + // 根据类型设置不同的样式 let style = {} if (num == 1) { // 停车区 @@ -2612,7 +2745,7 @@ zIndex: 1, isOperationArea: false } - }else if (num == 4) { // 景区 + } else if (num == 4) { // 景区 style = { fillColor: "#4abd2040", strokeColor: "#4abd20", @@ -2621,13 +2754,13 @@ isOperationArea: false } } - + return { points: points, ...style } }).filter(polyline => polyline !== null) - + return polylines }, toggleIconAndCallout() { @@ -2660,7 +2793,8 @@ color: '#ffffff', fontSize: 12, borderRadius: 8, - bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FF473E' : item.type == 3 ? '#FFC107' : '#3bbd55', + bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FF473E' : item + .type == 3 ? '#FFC107' : '#3bbd55', padding: 4, display: 'ALWAYS' }, @@ -2679,34 +2813,35 @@ this.$u.get(`/app/areaSub/listByArea?areaId=${this.areaId}`).then((res) => { if (res.code === 200 && Array.isArray(res.data)) { // 缓存数据 - const filteredData = res.data.filter(item => item.status != 1); + const filteredData = res.data.filter(item => item.status != 1); this.cachedParkingData[this.areaId] = filteredData - + 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) + 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) }) - + const processBoundaries = (data, type) => { const validBoundaries = data .map(row => row.boundaryStr) - .filter(boundary => boundary && typeof boundary === 'string' && boundary.trim() !== '') - - if(validBoundaries.length > 0) { + .filter(boundary => boundary && typeof boundary === 'string' && boundary + .trim() !== '') + + if (validBoundaries.length > 0) { const polylines = this.convertBoundaryToPolylines(validBoundaries, type) - if(polylines && polylines.length > 0) { + if (polylines && polylines.length > 0) { return polylines } } return [] } - + // 先处理所有边界数据 const type1Polylines = processBoundaries(type1Data, 1) const type2Polylines = processBoundaries(type2Data, 2) @@ -2714,7 +2849,7 @@ const type4Polylines = processBoundaries(type4Data, 4) // 保留现有的运营区边界 const operationAreaPolylines = this.polyline.filter(p => p.isOperationArea) - + // 合并所有边界数据 const allPolylines = [ ...operationAreaPolylines, @@ -2723,10 +2858,10 @@ ...type3Polylines, ...type4Polylines ] - + // 缓存多边形数据 this.cachedPolyline = allPolylines - + // 更新显示 this.polyline = allPolylines this.parkingList = filteredData @@ -2737,13 +2872,13 @@ updatePolylineFromCache() { // 保留现有的运营区边界 const operationAreaPolylines = this.polyline.filter(p => p.isOperationArea) - + // 从缓存中获取其他边界数据 const otherPolylines = this.cachedPolyline.filter(p => !p.isOperationArea) - + // 合并数据 const allPolylines = [...operationAreaPolylines, ...otherPolylines] - + // 更新显示 this.polyline = allPolylines }, @@ -2751,6 +2886,7 @@ getArea() { this.polyline = [] this.$u.get(`/app/area/detail?id=${this.areaId}`).then((res) => { + this.enableChange = res.data.enableChange if (res.code == 200) { const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr) this.polyline.push(polylines) @@ -2761,19 +2897,19 @@ // 第一次请求运营区停车点,禁行区, getAone() { this.$u.get(`/getInfo`).then(res => { - if(res.code == 200){ + if (res.code == 200) { this.user = res.user this.$u.get(`/app/area/nearby?id=${res.user.areaId == null ? '' : res.user.areaId}&radius=1000¢er=${this.jingweidu}&appId=${this.$store.state.appid}`).then((resp) => { if (resp.code == 200) { - if(resp.data){ + if (resp.data) { this.yyid = resp.data.id } - if(resp.data && resp.data.boundaryStr) { + if (resp.data && resp.data.boundaryStr) { const polylines = this.convertBoundaryToPolyline(resp.data.boundaryStr) - if(polylines) { + if (polylines) { this.polyline = [polylines] this.getParking() - if(resp.data && resp.data.id){ + if (resp.data && resp.data.id) { this.loadNearbyDevices(resp.data.id) } } @@ -2783,7 +2919,7 @@ } }) }, - + loadNearbyDevices(areaId) { if (this.rtindex == 2) { this.$u.get(`/app/device/listNearBy?radius=10000¢er=${this.jingweidu}&areaId=${areaId}`).then((res) => { @@ -2794,15 +2930,13 @@ }) } }, - + updateMarkers() { const newMarkers = [] this.listData.forEach(item => { - if(item.latitude && item.longitude) { + if (item.latitude && item.longitude) { const marker = { - 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: parseFloat(item.latitude), longitude: parseFloat(item.longitude), width: 35, @@ -2824,7 +2958,7 @@ this.tempCovers = newMarkers this.covers = this.tempCovers }, - + getIconPath() { if (this.rtindex == 1) { return 'https://api.ccttiot.com/smartmeter/img/static/upX2lLilhrRi4tttdHlo' @@ -2857,10 +2991,17 @@ background: #fff; border-radius: 0rpx 0rpx 0rpx 0rpx; } - @keyframes gifLoop { - 0% { opacity: 1; } - 100% { opacity: 1; } - } + + @keyframes gifLoop { + 0% { + opacity: 1; + } + + 100% { + opacity: 1; + } + } + .active { image { z-index: 99 !important; @@ -2870,31 +3011,35 @@ border: 1px solid #4297F3 !important; } } - .daohang{ - width: 750rpx; - height: 652rpx; - background: #FFFFFF; - box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0,0,0,0.08); - position: fixed; - left: 0; - bottom: 0; - border-radius: 30rpx 30rpx 0 0; - padding: 44rpx 38rpx; - box-sizing: border-box; - .cha{ - font-size: 60rpx; - font-weight: 600; - position: absolute; - top: 30rpx; - right: 34rpx; - } - .name{ - font-weight: 600; - font-size: 44rpx; - color: #3D3D3D; + + .daohang { + width: 750rpx; + height: 652rpx; + background: #FFFFFF; + box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0, 0, 0, 0.08); + position: fixed; + left: 0; + bottom: 0; + border-radius: 30rpx 30rpx 0 0; + padding: 44rpx 38rpx; + box-sizing: border-box; + + .cha { + font-size: 60rpx; + font-weight: 600; + position: absolute; + top: 30rpx; + right: 34rpx; + } + + .name { + font-weight: 600; + font-size: 44rpx; + color: #3D3D3D; display: flex; align-items: center; - text{ + + text { padding: 6rpx 10rpx; background-color: #0D75E5; color: #fff; @@ -2902,31 +3047,35 @@ border-radius: 6rpx; font-size: 26rpx; } - } - .shuom{ - font-weight: 600; - font-size: 32rpx; - color: #808080; - margin-top: 22rpx; - } - image{ - width: 680rpx; - height: 234rpx; - margin-top: 30rpx; - } - .anniu{ - width: 682rpx; - height: 90rpx; - background: #4C97E7; - border-radius: 54rpx 54rpx 54rpx 54rpx; - font-weight: 600; - font-size: 40rpx; - color: #FFFFFF; - text-align: center; - line-height: 90rpx; - margin-top: 62rpx; - } - } + } + + .shuom { + font-weight: 600; + font-size: 32rpx; + color: #808080; + margin-top: 22rpx; + } + + image { + width: 680rpx; + height: 234rpx; + margin-top: 30rpx; + } + + .anniu { + width: 682rpx; + height: 90rpx; + background: #4C97E7; + border-radius: 54rpx 54rpx 54rpx 54rpx; + font-weight: 600; + font-size: 40rpx; + color: #FFFFFF; + text-align: center; + line-height: 90rpx; + margin-top: 62rpx; + } + } + @keyframes fadeIn { from { opacity: 0; @@ -2936,25 +3085,32 @@ opacity: 1; } } + @keyframes rotate360 { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } } + @keyframes pulse { - 0%, 100% { - transform: scale(1); - opacity: 1; - } - 50% { - transform: scale(1.1); - opacity: 0.8; - } + + 0%, + 100% { + transform: scale(1); + opacity: 1; + } + + 50% { + transform: scale(1.1); + opacity: 0.8; + } } - .tongyi{ + + .tongyi { width: 100%; height: 580rpx; background: #FFFFFF; @@ -2966,12 +3122,14 @@ z-index: 97; border-radius: 30rpx 30rpx 0 0; text-align: center; - .anniu{ + + .anniu { width: 100%; display: flex; justify-content: space-between; margin-top: 30rpx; - .lx{ + + .lx { width: 338rpx; height: 90rpx; border-radius: 10rpx; @@ -2981,7 +3139,8 @@ font-size: 40rpx; color: #808080; } - .zx{ + + .zx { width: 338rpx; height: 90rpx; background: #4C97E7; @@ -2992,20 +3151,24 @@ color: #FFFFFF; } } - .top{ + + .top { display: flex; justify-content: center; align-items: center; margin-top: 30rpx; - image{ + + image { width: 50rpx; height: 50rpx; margin-right: 8rpx; animation: rotate360 1.2s linear infinite; } + font-weight: 600; font-size: 32rpx; color: #3D3D3D; + .percentage-text { margin-left: 10rpx; font-size: 36rpx; // 增大字体,与前方文字保持一致 @@ -3014,105 +3177,219 @@ animation: pulse 1.5s ease-in-out infinite; cursor: pointer; transition: all 0.3s ease; + &:hover { color: #000; // 悬停时变为黑色 transform: scale(1.05); } } } - .tops{ + + .tops { margin-top: 30rpx; - image{ + + image { width: 50rpx; height: 50rpx; margin-right: 8rpx; } } - .ddc{ + + // 蓝牙连接失败样式 + .bluetooth-error-container { + padding: 40rpx 30rpx; + text-align: left; + + .error-header { + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 40rpx; + + .error-icon { + width: 40rpx; + height: 40rpx; + margin-right: 16rpx; + } + + .error-title { + font-weight: 600; + font-size: 36rpx; + color: #333; + } + } + + .error-steps { + margin-bottom: 40rpx; + + .step-item { + display: flex; + align-items: center; + margin-bottom: 24rpx; + padding: 20rpx; + background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); + border-radius: 16rpx; + border-left: 6rpx solid #4C97E7; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); + transition: all 0.3s ease; + + &:hover { + transform: translateX(8rpx); + box-shadow: 0 8rpx 20rpx rgba(76, 151, 231, 0.15); + } + + .step-number { + width: 48rpx; + height: 48rpx; + background: linear-gradient(135deg, #4C97E7 0%, #6BB6FF 100%); + color: #fff; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-weight: 600; + font-size: 28rpx; + margin-right: 20rpx; + box-shadow: 0 4rpx 12rpx rgba(76, 151, 231, 0.3); + } + + .step-text { + flex: 1; + font-size: 30rpx; + color: #333; + line-height: 1.5; + font-weight: 500; + } + } + } + + .tutorial-link { + display: flex; + align-items: center; + justify-content: center; + padding: 24rpx 32rpx; + background: linear-gradient(135deg, #4C97E7 0%, #6BB6FF 100%); + border-radius: 50rpx; + box-shadow: 0 8rpx 24rpx rgba(76, 151, 231, 0.3); + transition: all 0.3s ease; + cursor: pointer; + + &:hover { + transform: translateY(-4rpx); + box-shadow: 0 12rpx 32rpx rgba(76, 151, 231, 0.4); + } + + &:active { + transform: translateY(-2rpx); + } + + .tutorial-text { + color: #fff; + font-size: 32rpx; + font-weight: 600; + margin-right: 12rpx; + } + + .tutorial-arrow { + color: #fff; + font-size: 32rpx; + font-weight: 600; + transition: transform 0.3s ease; + } + + &:hover .tutorial-arrow { + transform: translateX(8rpx); + } + } + } + + .ddc { width: 610rpx; height: 314rpx; margin-top: 40rpx; animation: gifLoop 1s infinite; } } - .fixdivce { - padding: 12rpx 22rpx 12rpx 22rpx; - position: fixed; - left: 0; - top: 34vh; - width: 280rpx; - height: 40vh; - background: #FFFFFF10; - border-radius: 0 40rpx 40rpx 0; - box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.3); - - .scrollable-content::-webkit-scrollbar { - display: none; - } - - .scrollable-content { - height: 100%; - overflow-y: auto; - - .divce_li:last-child { - border-bottom: 1rpx solid #fff; - } - - .divce_li { - padding: 10rpx 0; - display: flex; - flex-wrap: nowrap; - align-items: center; - border-bottom: 1rpx solid #D8D8D8; - - .left_img { - image { - width: 44rpx; - height: 70rpx; - } - } - - .right_cont { - margin-left: 20rpx; - display: flex; - flex-wrap: wrap; - font-weight: 400; - font-size: 24rpx; - color: #3D3D3D; - - .right_top { - width: 100%; - display: flex; - flex-wrap: nowrap; - align-items: center; - - .right_top_left { - margin-left: auto; - display: flex; - flex-wrap: nowrap; - align-items: center; - - image { - margin-right: 6rpx; - width: 12rpx; - height: 26rpx; - } - } - - .right_top_right {} - } - - .right_bot { - width: 100%; - display: flex; - flex-wrap: nowrap; - justify-content: space-between; - margin-top: 8rpx; - } - } - } - } - } + + .fixdivce { + padding: 12rpx 22rpx 12rpx 22rpx; + position: fixed; + left: 0; + top: 34vh; + width: 280rpx; + height: 40vh; + background: #FFFFFF10; + border-radius: 0 40rpx 40rpx 0; + box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.3); + + .scrollable-content::-webkit-scrollbar { + display: none; + } + + .scrollable-content { + height: 100%; + overflow-y: auto; + + .divce_li:last-child { + border-bottom: 1rpx solid #fff; + } + + .divce_li { + padding: 10rpx 0; + display: flex; + flex-wrap: nowrap; + align-items: center; + border-bottom: 1rpx solid #D8D8D8; + + .left_img { + image { + width: 44rpx; + height: 70rpx; + } + } + + .right_cont { + margin-left: 20rpx; + display: flex; + flex-wrap: wrap; + font-weight: 400; + font-size: 24rpx; + color: #3D3D3D; + + .right_top { + width: 100%; + display: flex; + flex-wrap: nowrap; + align-items: center; + + .right_top_left { + margin-left: auto; + display: flex; + flex-wrap: nowrap; + align-items: center; + + image { + margin-right: 6rpx; + width: 12rpx; + height: 26rpx; + } + } + + .right_top_right {} + } + + .right_bot { + width: 100%; + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + margin-top: 8rpx; + } + } + } + } + } + .mask { width: 100%; height: 100vh; @@ -3144,7 +3421,7 @@ .fj { width: 320rpx; height: 90rpx; - border-radius:10rpx; + border-radius: 10rpx; border: 2rpx solid #808080; font-weight: 600; font-size: 32rpx; @@ -3214,7 +3491,8 @@ transform: translateX(-50%); bottom: 0; padding-bottom: 30rpx; - box-sizing: border-box; + box-sizing: border-box; + .orderzt { display: flex; align-items: center; @@ -3224,7 +3502,8 @@ padding: 0 54rpx; position: relative; background-color: #fff; - .qixing{ + + .qixing { width: 100%; height: 130rpx; position: absolute; @@ -3232,19 +3511,22 @@ left: 0; z-index: -1; } + .NO { font-weight: 600; font-size: 32rpx; color: #3D3D3D; display: flex; align-items: center; - image{ + + image { width: 58rpx; height: 70rpx; margin-right: 8rpx; } } - .huanche{ + + .huanche { width: 150rpx; height: 60rpx; background-color: #0D75E5; @@ -3254,10 +3536,12 @@ font-size: 32rpx; border-radius: 30rpx; } - .icon{ + + .icon { display: flex; align-items: center; - image{ + + image { width: 30rpx; height: 36rpx; } @@ -3289,14 +3573,16 @@ display: flex; align-items: center; justify-content: space-between; - image{ + + image { width: 90rpx; height: 88rpx; } - .jsdd{ + + .jsdd { width: 190rpx; height: 88rpx; - background: rgba(76,151,231,0); + background: rgba(76, 151, 231, 0); border-radius: 20rpx 20rpx 20rpx 20rpx; border: 2rpx solid #A8A8A8; text-align: center; @@ -3305,6 +3591,7 @@ font-size: 36rpx; color: #3D3D3D; } + .lssc { font-weight: 600; font-size: 36rpx; @@ -3317,32 +3604,38 @@ border-radius: 20rpx 20rpx 20rpx 20rpx; } } - .botbtn{ + + .botbtn { display: flex; width: 100%; justify-content: space-between; margin-top: 30rpx; padding: 0 30rpx; } - .imgpic{ + + .imgpic { display: flex; margin-top: 10rpx; padding: 0 54rpx; - image{ + + image { width: 152rpx; height: 38rpx; margin-right: 16rpx; } - .gzimg{ + + .gzimg { width: 152rpx; height: 38rpx; margin-right: 16rpx; } - .hcimg{ + + .hcimg { width: 162rpx; height: 38rpx; } } + .cont_li { width: 100%; display: flex; @@ -3352,35 +3645,42 @@ margin-top: 20rpx; padding: 0 54rpx; background-color: #fff; - .one{ + + .one { text-align: center; - .oneone{ + + .oneone { font-weight: 600; font-size: 52rpx; color: #3D3D3D; margin-top: 30rpx; - text{ + + text { font-size: 24rpx; } } - .twotwo{ + + .twotwo { font-weight: 600; font-size: 24rpx; color: #3D3D3D; margin-top: 10rpx; - image{ + + image { width: 32rpx; height: 32rpx; margin-left: 10rpx; } } } + .left { font-weight: 600; font-size: 36rpx; color: #3D3D3D; - width: 70%; - .guzhang{ + width: 70%; + + .guzhang { width: 240rpx; text-align: center; color: #fff !important; @@ -3392,6 +3692,7 @@ font-size: 28rpx; margin-top: 10rpx; } + .km { font-weight: 400; font-size: 28rpx; @@ -3413,7 +3714,7 @@ } } - + } .right { @@ -3790,24 +4091,29 @@ color: #0D75E5; margin-right: 20rpx; } + .dizhi { font-size: 28rpx; color: #808080; } } + .top { display: flex; justify-content: space-between; + .name { font-size: 32rpx; color: #3D3D3D; font-weight: 600; } + .zu { font-size: 24rpx; color: #3D3D3D; display: flex; align-items: center; + image { width: 22rpx; height: 22rpx; @@ -3815,6 +4121,7 @@ } } } + .rticon { position: fixed; right: 28rpx; @@ -3827,10 +4134,12 @@ margin-top: 32rpx; } } + .lticon { position: fixed; right: 20rpx; bottom: 940rpx; + image { width: 88rpx; height: 88rpx; @@ -3838,17 +4147,21 @@ margin-top: 32rpx; } } + .map { width: 100%; height: 130vh; position: absolute; top: -30vh; + .center-marker { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -80%); /* 定位在中心点上方 */ - pointer-events: none; /* 使其不可点击 */ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -80%); + /* 定位在中心点上方 */ + pointer-events: none; + /* 使其不可点击 */ } } \ No newline at end of file diff --git a/pages/my.vue b/pages/my.vue index 8a5f276..2fca1c5 100644 --- a/pages/my.vue +++ b/pages/my.vue @@ -85,12 +85,6 @@ - @@ -179,8 +173,6 @@ }, onShow() { this.getareaList() - // this.getkefu() - // this.getlunbo() }, methods: { btnguanli(){ @@ -252,21 +244,20 @@ }) }, - handleSearch(e) { - const value = e.detail.value; - console.log(e,value); + const value = e.detail.value + console.log(e,value) if (!value) { // 搜索框为空时显示全部数据 - this.displayList = this.list; + this.displayList = this.list } else { // 有搜索内容时过滤数据 this.displayList = this.list.filter(item => { - const label = String(item.label || '').toLowerCase(); - const deptName = String(item.deptName || '').toLowerCase(); - const searchValue = String(value || '').toLowerCase(); - return label.includes(searchValue) || deptName.includes(searchValue); - }); + const label = String(item.label || '').toLowerCase() + const deptName = String(item.deptName || '').toLowerCase() + const searchValue = String(value || '').toLowerCase() + return label.includes(searchValue) || deptName.includes(searchValue) + }) } }, selectItem(item) { @@ -391,7 +382,7 @@ }else if(num == 10){ //运维人员 this.totype = 1 if (this.list.length < 2) { - uni.setStorageSync('adminAreaid', this.list[0].value); + uni.setStorageSync('adminAreaid', this.list[0].value) uni.navigateTo({ url: '/page_shanghu/fix_index' }) @@ -400,15 +391,15 @@ } }else if(num == 11){ //管理人员 this.totype = 2 - console.log(this.list.length,this.list); + console.log(this.list.length,this.list) if (this.list.length < 2) { - console.log(111); - uni.setStorageSync('adminAreaid', this.list[0].value); + console.log(111) + uni.setStorageSync('adminAreaid', this.list[0].value) uni.navigateTo({ url: `/page_shanghu/guanli/admin_worke?id=${this.list[0].value}` }) } else { - console.log(222); + console.log(222) this.show = true } }else if(num == 12){ @@ -421,13 +412,13 @@ try { uni.clearStorageSync() // 同步清除 console.log('所有缓存已清除') - uni.showToast({ title: '缓存已清除', icon: 'success' }) + uni.showToast({ title: '缓存已清除', icon: 'success',duration:3000}) uni.reLaunch({ url:'/pages/login/login' }) } catch (e) { console.error('清除失败:', e) - uni.showToast({ title: '清除失败', icon: 'none' }) + uni.showToast({ title: '清除失败', icon: 'none',duration:3000}) } } else if (res.cancel) { console.log('取消'); // 用户点击取消 diff --git a/pages/myorder/returned/index.vue b/pages/myorder/returned/index.vue deleted file mode 100644 index bf7ec57..0000000 --- a/pages/myorder/returned/index.vue +++ /dev/null @@ -1,2286 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/nearbystores/index.vue b/pages/nearbystores/index.vue index 4097ea1..6927e05 100644 --- a/pages/nearbystores/index.vue +++ b/pages/nearbystores/index.vue @@ -150,7 +150,16 @@ - + + + + + + + + + + @@ -412,20 +421,26 @@ this.adminflag = true } }) - if(res.roles != null || res.roles.length > 0){ + console.log('000000000000000000000000000000000000000000000000000000'); + // if(res.roles != null || res.roles.length > 0){ this.$u.get('/bst/area/list?pageNum=1&pageSize=999').then((res) => { if (res.code == 200) { - this.guanliflag = true - this.list = res.rows.map(item => ({ - value: item.id, - label: item.name, - deptName: item.userName - })) - this.displayList = this.list; // 重置显示列表 - console.log(this.displayList,'0000'); + console.log('1111111111111111111111111111111111111111111111111111111111'); + if(res.rows.length > 0){ + this.guanliflag = true + this.list = res.rows.map(item => ({ + value: item.id, + label: item.name, + deptName: item.userName + })) + this.displayList = this.list; // 重置显示列表 + console.log(this.displayList,'0000'); + }else{ + this.guanliflag = false + } } }) - } + // } }else if(res.code == 401){ this.getlogo() } @@ -513,7 +528,7 @@ onlyFromCamera: true, scanType: ['qrCode'], success: res => { - console.log(res); + console.log(res) function getQueryParam(url, paramName) { let regex = new RegExp(`[?&]${paramName}=([^&]*)`) let results = regex.exec(url) @@ -530,29 +545,29 @@ }) }else{ this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => { - if (res.code == 200) { - if(res.data){ - this.modelId = res.data.modelId - uni.navigateTo({ - url:'/page_fenbao/storedlist/trueorder?modelId=' + this.modelId + '&sn=' + this.sn - }) - }else{ - uni.showModal({ - title: '提示', - content: '当前车辆不可用', - showCancel: false, - confirmText: '知道了' - }) - } - }else{ - console.log('系统'); - uni.showModal({ - title: '提示', - content: res.msg, - showCancel: false, - confirmText: '知道了' + if (res.code == 200) { + if(res.data){ + this.modelId = res.data.modelId + uni.navigateTo({ + url:'/page_fenbao/storedlist/trueorder?modelId=' + this.modelId + '&sn=' + this.sn }) + }else{ + uni.showModal({ + title: '提示', + content: '当前车辆不可用', + showCancel: false, + confirmText: '知道了' + }) } + }else{ + console.log('系统'); + uni.showModal({ + title: '提示', + content: res.msg, + showCancel: false, + confirmText: '知道了' + }) + } }) } } @@ -631,7 +646,7 @@ url:'/page_user/yongche/orderxq?id=' + that.weizhifuid }) } else if (res.cancel) { - console.log('取消'); // 用户点击取消 + console.log('取消') // 用户点击取消 } } }) @@ -647,36 +662,19 @@ if(res.code == 200){ this.lists = [] this.tiaozhuanlist = res.data - if(res.data.length > 0 && res.data[0] != null){ - res.data.forEach(item =>{ - this.lists.push({ - image:item.picture, - title: item.adId - }) - }) - }else{ - this.lists.push({ - image:"https://api.ccttiot.com/smartmeter/img/static/uTZBBRuyRexKd6c4VE9d", - title: "" - }) - } - }else{ - this.lists.push({ - image:"https://api.ccttiot.com/smartmeter/img/static/uTZBBRuyRexKd6c4VE9d", - title: "" - }) } }) }, // 点击跳转轮播图跳转 - btnshangjia(e){ - if(this.tiaozhuanlist[e].urlType == 1){ + btnshangjia(item,index){ + console.log(item,index,'000'); + if(item.urlType == 1){ uni.navigateTo({ - url: '/page_fenbao/webview?url=' + this.tiaozhuanlist[e].url + url: '/page_fenbao/webview?url=' + item.url }) }else{ uni.navigateTo({ - url: '/' + this.tiaozhuanlist[e].url + url: '/' + item.url }) } }, @@ -757,7 +755,7 @@ this.nearbyMarkers = nearbyMarkers }, haversineDistance(lat1, lon1, lat2, lon2) { - const R = 6371e3 // Earth radius in meters + const R = 6371e3 // 地球半径/米 const toRad = angle => angle * Math.PI / 180 const dLat = toRad(lat2 - lat1) const dLon = toRad(lon2 - lon1) @@ -791,7 +789,6 @@ this.setMapScale() }, 5000) }, - // 清除定时器 clearTimer() { if (this.timer) { @@ -802,7 +799,7 @@ }, // 点击地图中的店铺操作 handleMarkerClick(e) { - console.log(e); + console.log(e,'45454545454545'); if(this.orderflag == true){ uni.showToast({ title: '当前已有进行中订单', @@ -870,7 +867,6 @@ } } }, - getcha(id){ this.$u.get(`/app/areaSub/detail?id=${id}`).then(res =>{ if(res.code == 200){ @@ -887,7 +883,6 @@ address:this.chexq.name //详细地点名称 }) }, - // 请求会员卡列表 gethuiyuan(){ this.$u.get(`/app/vip/listByArea?areaId=${this.areaId}`).then(res=>{ @@ -941,6 +936,7 @@ }, // 点击响铃寻车 btnxlxc() { + // 响铃获取自身经纬度判断是否在车辆旁边 uni.getLocation({ type: 'gcj02', success: (res) => { @@ -989,12 +985,10 @@ this.taocanflag = false this.newMarkers = '' }, - // 点击选择骑行套餐 btntcxz(index) { this.tcindex = index }, - // 点击拨打平台客服电话 btnptkf(contact) { uni.makePhoneCall({ @@ -1019,11 +1013,6 @@ uni.navigateTo({ url:'/page_user/luru/daolan' }) - // uni.showToast({ - // title: '导览暂未开放', - // icon: 'none', - // duration: 2000 - // }) } else { this.covers = [] this.rtindex = num @@ -1046,7 +1035,7 @@ } }) }) - }; + } await setScale() mapContext.moveToLocation({ success: (res) => { @@ -1056,7 +1045,6 @@ } }) }, - // 请求附近车辆and门店 getqingqiu() { if (this.rtindex == 1) { @@ -1122,7 +1110,6 @@ } }) }, - convertBoundaryToPolyline(boundary) { if (!boundary) return null const points = JSON.parse(boundary).map(coord => ({ @@ -1144,13 +1131,11 @@ console.error('边界数据不是数组:', boundaries) return [] } - const polylines = boundaries.map(boundary => { if (!boundary) { console.warn('边界数据为空') return null } - let coords try { coords = JSON.parse(boundary) @@ -1158,12 +1143,10 @@ 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) @@ -1179,7 +1162,6 @@ console.warn('有效坐标点不足3个,无法构成多边形') return null } - // 根据类型设置不同的样式 let style = {} if (num == 1) { // 停车区 @@ -1215,13 +1197,11 @@ isOperationArea: false } } - return { points: points, ...style } }).filter(polyline => polyline !== null) - return polylines }, toggleIconAndCallout(num) { @@ -1246,13 +1226,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', @@ -1273,24 +1247,22 @@ } } }, + // 获取停车点的所有数据 getParking() { if(!this.yyid) { console.warn('用户区域ID不存在,无法获取停车区域数据') 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)) { // 缓存数据 const filteredData = res.data.filter(item => item.status != 1); this.cachedParkingData[this.yyid] = filteredData - const type1Data = [] const type2Data = [] const type3Data = [] @@ -1301,12 +1273,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) { @@ -1315,7 +1283,6 @@ } return [] } - // 先处理所有边界数据 const type1Polylines = processBoundaries(type1Data, 1) const type2Polylines = processBoundaries(type2Data, 2) @@ -1323,7 +1290,6 @@ const type4Polylines = processBoundaries(type4Data, 4) // 保留现有的运营区边界 const operationAreaPolylines = this.polyline.filter(p => p.isOperationArea) - // 合并所有边界数据 const allPolylines = [ ...operationAreaPolylines, @@ -1332,10 +1298,8 @@ ...type3Polylines, ...type4Polylines ] - // 缓存多边形数据 this.cachedPolyline = allPolylines - // 更新显示 this.polyline = allPolylines this.parkingList = filteredData @@ -1343,16 +1307,14 @@ } }) }, + // 计算运营区边界线条 updatePolylineFromCache() { // 保留现有的运营区边界 const operationAreaPolylines = this.polyline.filter(p => p.isOperationArea) - // 从缓存中获取其他边界数据 const otherPolylines = this.cachedPolyline.filter(p => !p.isOperationArea) - // 合并数据 const allPolylines = [...operationAreaPolylines, ...otherPolylines] - // 更新显示 this.polyline = allPolylines }, @@ -1369,7 +1331,7 @@ }, // 第一次请求运营区停车点,禁行区, getAone() { - this.$u.get(`/app/area/nearby?id=${this.user.areaId == null ? '' : this.user.areaId}&radius=1000¢er=${this.jingweidu}&appId=${this.$store.state.appid}`).then((resp) => { + this.$u.get(`/app/area/nearby?id=${this.user.areaId == null ? '' : this.user.areaId}&radius=10000¢er=${this.jingweidu}&appId=${this.$store.state.appid}`).then((resp) => { if (resp.code == 200) { if(resp.data){ this.yyid = resp.data.id @@ -1387,7 +1349,6 @@ } }) }, - loadNearbyDevices(areaId) { if (this.rtindex == 2) { this.$u.get(`/app/device/listNearBy?radius=10000¢er=${this.jingweidu}&areaId=${areaId}`).then((res) => { @@ -1398,15 +1359,12 @@ }) } }, - updateMarkers() { const newMarkers = [] this.listData.forEach(item => { if(item.latitude && item.longitude) { const marker = { - 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: parseFloat(item.latitude), longitude: parseFloat(item.longitude), width: 35, @@ -1428,7 +1386,6 @@ this.tempCovers = newMarkers this.covers = this.tempCovers }, - getIconPath() { if (this.rtindex == 1) { return 'https://api.ccttiot.com/smartmeter/img/static/upX2lLilhrRi4tttdHlo' @@ -1439,19 +1396,16 @@ } return null }, - updatePolyline(newPolylines) { // 使用Vue的响应式更新 this.tempPolyline = [...newPolylines] this.polyline = this.tempPolyline }, - updateCovers(newCovers) { // 使用Vue的响应式更新 this.tempCovers = [...newCovers] this.covers = this.tempCovers }, - } } @@ -1461,22 +1415,18 @@ background: #fff; border-radius: 0rpx 0rpx 0rpx 0rpx; } - .active { image { z-index: 99 !important; } - .bike_item { border: 1px solid #4297F3 !important; } } - @keyframes fadeIn { from { opacity: 0; } - to { opacity: 1; } @@ -1563,7 +1513,6 @@ background: rgba(0, 0, 0, 0.5); z-index: 999; } - .select-content { position: fixed; left: 0; @@ -1573,28 +1522,23 @@ border-radius: 20rpx 20rpx 0 0; z-index: 1000; height: 50vh; // 最大高度 - // min-height: 400rpx; // 添加最小高度 display: flex; flex-direction: column; padding-bottom: 20rpx; - .select-header { padding: 20rpx 30rpx; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; - .close { font-size: 40rpx; color: #999; } } - .search-box { padding: 15rpx 20rpx; border-bottom: 1px solid #eee; - input { width: 100%; height: 60rpx; @@ -1604,12 +1548,10 @@ font-size: 28rpx; } } - .select-list { flex: 1; max-height: calc(50vh - 140rpx); min-height: 260rpx; // 为列表添加最小高度 - .select-item { display: flex; justify-content: space-between; @@ -1617,12 +1559,10 @@ padding: 20rpx 30rpx; border-bottom: 1px solid #eee; font-size: 28rpx; - &.highlight { background-color: #f0f9ff; color: #2d8cf0; } - &:active { background: #f5f5f5; } @@ -1710,11 +1650,6 @@ bottom: -80rpx; right: 10rpx; } - ::v-deep .u-swiper-image{ - width: 700rpx !important; - height: 180rpx !important; - border-radius: 10rpx; - } } .botbox{ position: fixed; @@ -1763,7 +1698,6 @@ left: 36rpx; z-index: 99; } - .noticetc{ width: 680rpx; height: 950rpx; @@ -1869,33 +1803,27 @@ background: #FFFFFF10; border-radius: 0 40rpx 40rpx 0; box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.3); - .scrollable-content::-webkit-scrollbar { display: none; } - .scrollable-content { height: 100%; overflow-y: auto; - .divce_li:last-child { border-bottom: 1rpx solid #fff; } - .divce_li { padding: 10rpx 0; display: flex; flex-wrap: nowrap; align-items: center; border-bottom: 1rpx solid #D8D8D8; - .left_img { image { width: 44rpx; height: 70rpx; } } - .right_cont { margin-left: 20rpx; display: flex; @@ -1903,29 +1831,23 @@ font-weight: 400; font-size: 24rpx; color: #3D3D3D; - .right_top { width: 100%; display: flex; flex-wrap: nowrap; align-items: center; - .right_top_left { margin-left: auto; display: flex; flex-wrap: nowrap; align-items: center; - image { margin-right: 6rpx; width: 12rpx; height: 26rpx; } } - - .right_top_right {} } - .right_bot { width: 100%; display: flex; @@ -1946,7 +1868,6 @@ background-color: rgba(0, 0, 0, .3); z-index: 9; } - .tingchetc { width: 624rpx; height: 610rpx; @@ -1959,12 +1880,10 @@ z-index: 99; padding: 28rpx 36rpx; box-sizing: border-box; - .btnan { display: flex; justify-content: space-between; margin-top: 40rpx; - .fj { width: 252rpx; height: 72rpx; @@ -1976,7 +1895,6 @@ text-align: center; line-height: 72rpx; } - .qx { width: 252rpx; height: 72rpx; @@ -1990,30 +1908,25 @@ color: #FFFFFF; } } - .tcimg { width: 552rpx; height: 300rpx; margin-top: 28rpx; } - .shuom { font-size: 26rpx; color: #3D3D3D; margin-top: 18rpx; - text { color: #4C97E7; } } - .topname { font-weight: 600; font-size: 36rpx; color: #3D3D3D; display: flex; align-items: center; - image { width: 48rpx; height: 48rpx; @@ -2021,7 +1934,6 @@ } } } - .conts_box { width: 680rpx; height: 360rpx; @@ -2039,7 +1951,6 @@ left: 50%; transform: translateX(-50%); bottom: 220rpx; - .orderzt { display: flex; justify-content: space-between; @@ -2048,7 +1959,6 @@ box-sizing: border-box; width: 100%; } - .txtss { margin-top: 18rpx; padding-left: 20rpx; @@ -2057,7 +1967,6 @@ font-size: 28rpx; color: #808080; } - .dh { width: 160rpx; height: 60rpx; @@ -2068,11 +1977,9 @@ padding-top: 10rpx; box-sizing: border-box; } - .suocheanniu { display: flex; align-items: center; - .lssc { width: 160rpx; height: 60rpx; @@ -2088,7 +1995,6 @@ justify-content: center; } } - .cont_li { width: 100%; display: flex; @@ -2097,34 +2003,29 @@ justify-content: space-between; padding: 0 20rpx; box-sizing: border-box; - .left { display: flex; flex-wrap: wrap; font-weight: 600; font-size: 36rpx; color: #3D3D3D; - .km { font-weight: 400; font-size: 28rpx; color: #3D3D3D; } - .speed { margin-top: 18rpx; width: 226rpx; height: 22rpx; background: #ccc; border-radius: 16rpx 16rpx 16rpx 16rpx; - .speeds { height: 100%; background: #4297F3; border-radius: 16rpx 16rpx 16rpx 16rpx; } } - .NO { width: 100%; font-weight: 400; @@ -2133,13 +2034,11 @@ margin-top: 18rpx; } } - .right { width: 70%; padding-right: 20rpx; font-size: 24rpx; color: #333; - image { width: 160rpx; height: 110rpx; @@ -2147,7 +2046,6 @@ } } } - .picimg { width: 46rpx; height: 76rpx; @@ -2157,7 +2055,6 @@ top: 30%; z-index: 99; } - .kefutc { animation: fadeIn 0.5s ease-in-out forwards; position: fixed; @@ -2165,24 +2062,20 @@ left: 50%; transform: translateX(-50%); z-index: 99; - .bot { margin-top: 30rpx; - .wz { margin-top: 10rpx; font-weight: 600; font-size: 28rpx; color: #3D3D3D; } - .wzs { margin-top: 10rpx; font-size: 24rpx; color: #7C7C7C; } } - .top { width: 538rpx; height: 122rpx; @@ -2195,7 +2088,6 @@ padding-right: 14rpx; box-sizing: border-box; margin-top: 20rpx; - .dianhua { font-weight: 600; font-size: 28rpx; @@ -2203,7 +2095,6 @@ padding-left: 26rpx; box-sizing: border-box; } - .boda { width: 94rpx; height: 94rpx; @@ -2212,14 +2103,12 @@ text-align: center; padding-top: 8rpx; box-sizing: border-box; - text { display: block; } } } } - .mask { width: 100%; height: 100vh; @@ -2229,7 +2118,6 @@ top: 0; left: 0; } - .clmask { width: 100%; height: 100vh; @@ -2239,7 +2127,6 @@ top: 0; left: 0; } - .biketc { position: fixed; left: 50%; @@ -2252,7 +2139,6 @@ margin: auto; padding-bottom: 60rpx; box-sizing: border-box; - .topfor { width: 100%; margin: auto; @@ -2277,14 +2163,11 @@ font-size: 70rpx; font-weight: 600; } - .biketaocan { display: flex; overflow: scroll; - .bikelist { margin-right: 22rpx; - .bike_item { border: 1px solid #fff; margin-top: 36rpx; @@ -2299,7 +2182,6 @@ border-radius: 26rpx 26rpx 26rpx 26rpx; position: relative; overflow: hidden; - image { width: 82rpx; height: 50rpx; @@ -2308,13 +2190,11 @@ right: 0; z-index: -1; } - .name { font-weight: 600; font-size: 32rpx; color: #3D3D3D; } - .qibu { display: flex; justify-content: space-between; @@ -2322,7 +2202,6 @@ color: #3D3D3D; margin-top: 16rpx; } - .ckxq { width: 368rpx; height: 58rpx; @@ -2339,53 +2218,44 @@ } } } - .bikesy { width: 100%; margin-top: 30rpx; padding-top: 36rpx; box-sizing: border-box; display: flex; - .bikelt { width: 50%; text-align: center; - .bikegongli { font-weight: 600; font-size: 48rpx; color: #3D3D3D; } - .bikets { font-size: 28rpx; color: #808080; margin-top: 18rpx; } - image { width: 48rpx; height: 36rpx; margin-right: 18rpx; } } - .bikert { width: 50%; text-align: center; - .bikegongli { font-weight: 600; font-size: 48rpx; color: #3D3D3D; } - .bikets { font-size: 28rpx; color: #808080; margin-top: 18rpx; } - image { width: 22rpx; height: 48rpx; @@ -2394,7 +2264,6 @@ } } } - .anniuks { width: 100%; height: 90rpx; @@ -2422,7 +2291,6 @@ } } } - .shoptc { position: fixed; width: 696rpx; @@ -2434,17 +2302,14 @@ transform: translateX(-50%); padding: 28rpx 34rpx; box-sizing: border-box; - .cont { margin-top: 40rpx; display: flex; - .shuoming { .name { font-size: 28rpx; color: #3D3D3D; } - .price { font-size: 24rpx; color: #FF1C1C; @@ -2455,19 +2320,16 @@ } } } - image { width: 166rpx; height: 128rpx; margin-right: 26rpx; } } - .juli { display: flex; align-items: center; margin-top: 12rpx; - .mi { padding: 0 10rpx; box-sizing: border-box; @@ -2479,29 +2341,24 @@ color: #0D75E5; margin-right: 20rpx; } - .dizhi { font-size: 28rpx; color: #808080; } } - .top { display: flex; justify-content: space-between; - .name { font-size: 32rpx; color: #3D3D3D; font-weight: 600; } - .zu { font-size: 24rpx; color: #3D3D3D; display: flex; align-items: center; - image { width: 22rpx; height: 22rpx; @@ -2509,12 +2366,10 @@ } } } - .rticon { position: fixed; right: 28rpx; bottom: 600rpx; - image { width: 78rpx; height: 96rpx; @@ -2522,12 +2377,10 @@ margin-top: 32rpx; } } - .lticon { position: fixed; left: 28rpx; top: 300rpx; - image { width: 88rpx; height: 88rpx; @@ -2535,7 +2388,6 @@ margin-top: 32rpx; } } - .map { width: 100%; height: 130vh; diff --git a/store/index.js b/store/index.js index 65c01ae..e9d8b9f 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创享 + appid:'1',//1小鹿 6创享 2嵛山岛 // 电动车图标 iconobj:{ tabcion:'https://api.ccttiot.com/smartmeter/img/static/uIiSizdNVb65ATEXvxfT', //底部导航栏图标