From f92a62302bc89818ec812ec13dca0064c8566263 Mon Sep 17 00:00:00 2001 From: tx <2622874537@qq.com> Date: Thu, 31 Oct 2024 17:46:59 +0800 Subject: [PATCH] 11 --- common/http.interceptor.js | 6 +- manifest.json | 2 +- page_user/agreement.vue | 20 +++- pages/index/index.vue | 2 +- pages_admin/admin_worke.vue | 8 +- pages_adminSet/ChargingDetail.vue | 29 +++-- pages_adminSet/modelMt.vue | 170 ++++++++++++++++-------------- pages_adminSet/sysSet.vue | 39 ++++--- 8 files changed, 158 insertions(+), 118 deletions(-) diff --git a/common/http.interceptor.js b/common/http.interceptor.js index af7f478..a3900d5 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -1,15 +1,15 @@ const install = (Vue, vm) => { - uni.setStorageSync('deptId', 100); + uni.setStorageSync('deptId', 101); Vue.prototype.$u.http.setConfig({ // baseUrl: 'http://61.174.243.28:15861', // baseUrl: 'http://192.168.2.46:8080', // baseUrl: 'https://che.chuangtewl.com/prod-api', // 测试环境 - // baseUrl: 'https://dianche.chuantewulian.cn/prod-api', + baseUrl: 'https://dianche.chuantewulian.cn/prod-api', // 俞山岛 - baseUrl: 'https://dche.ccttiot.com/prod-api', + // baseUrl: 'https://dche.ccttiot.com/prod-api', // 创特 loadingText: '努力加载中~', loadingTime: 10000, diff --git a/manifest.json b/manifest.json index 392f89e..87c076b 100644 --- a/manifest.json +++ b/manifest.json @@ -51,7 +51,7 @@ /* 小程序特有相关 */ "mp-weixin" : { "libVersion" : "latest", - "appid" : "wx3428c498d5061192", + "appid" : "wx4d178f8c80348214", "setting" : { "urlCheck" : false, "minified" : true, diff --git a/page_user/agreement.vue b/page_user/agreement.vue index 6d481d0..3fa6c25 100644 --- a/page_user/agreement.vue +++ b/page_user/agreement.vue @@ -40,7 +40,8 @@ qParam:'', isread:false, showxy:false, - showbot:false + showbot:false, + areaId:'' } }, onLoad(e) { @@ -49,6 +50,9 @@ this.showbot = true this.qParam=e.qParam } + if(e.areaId){ + this.areaId=e.areaId + } }, onReachBottom() { @@ -101,9 +105,17 @@ }, getagree() { - - - this.$u.get(`/app/article/9`).then((res) => { + let data ={ + tag:'agreement', + areaId:this.areaId + } + let deptId = uni.getStorageSync('deptId'); + if(deptId==101){ + data.areaId=14 + } + // console.log(data,'dadadad'); + // this.$u.get(`/app/article/9`,).then((res) => { + this.$u.get(`/app/article/agreement`,data).then((res) => { if (res.code === 200) { this.info = res.data; this.insertPhoneNumberAndDate(); diff --git a/pages/index/index.vue b/pages/index/index.vue index b3b2ae9..1ae7dd3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3779,7 +3779,7 @@ toxy() { this.seeDetail = true uni.navigateTo({ - url: '/page_user/agreement' + url: '/page_user/agreement?areaId='+this.deviceInfos.areaId }) }, diff --git a/pages_admin/admin_worke.vue b/pages_admin/admin_worke.vue index 0d62c8f..d741311 100644 --- a/pages_admin/admin_worke.vue +++ b/pages_admin/admin_worke.vue @@ -60,25 +60,25 @@ 账户明细 - + 故障审核 - + - + - + - + 收费模版 - - + + - + @@ -124,34 +124,35 @@ {{getAccessoryNames()}} --> - - + + - {{ name }} + {{ name }} - + - + 选择收费方式 - - - - {{item.name}} - - + + + + {{item.name}} + + + + - - 确定 @@ -184,8 +185,8 @@ lowVoltage: "", fullEndurance: "", ruleIds: [], - lowBatteryReminder:'20', - lowBatteryReminderSwitch:false + lowBatteryReminder: '20', + lowBatteryReminderSwitch: false // deposit: "", // picture: "", // description: "", @@ -194,7 +195,7 @@ token: '', upurl: '', modelId: '', - areaId:'' + areaId: '' } }, onLoad(e) { @@ -205,8 +206,8 @@ } if (uni.getStorageSync('adminAreaid')) { this.areaId = uni.getStorageSync('adminAreaid') - - + + } // this.getQiniuToken() }, @@ -216,30 +217,30 @@ }, methods: { - closepart(){ - this.showpart=false + closepart() { + this.showpart = false }, getmodelInfo() { - - this.$u.get("system/model/"+ this.modelId ).then((res) => { + + this.$u.get("system/model/" + this.modelId).then((res) => { if (res.code == 200) { this.data = res.data this.data.ruleIds = res.ruleIds - console.log(this.data,'this.datathis.data'); - + console.log(this.data, 'this.datathis.data'); + } }); }, - backpage(){ + backpage() { uni.redirectTo({ - url:'/pages_adminSet/CarModel' + url: '/pages_adminSet/CarModel' }) }, sub() { - - - if (!this.data.model) { + + + if (this.data.model === undefined || this.data.model === null || this.data.model === '') { uni.showToast({ title: '请填写车型名称', icon: 'none', @@ -247,7 +248,9 @@ }); return; // 阻止请求继续执行 } - if (!this.data.fullVoltage) { + + if (this.data.fullVoltage === undefined || this.data.fullVoltage === null || this.data.fullVoltage === + '') { uni.showToast({ title: '请填写满电电压', icon: 'none', @@ -255,7 +258,8 @@ }); return; } - if (!this.data.lowVoltage) { + + if (this.data.lowVoltage === undefined || this.data.lowVoltage === null || this.data.lowVoltage === '') { uni.showToast({ title: '请填写亏电电压', icon: 'none', @@ -263,7 +267,9 @@ }); return; } - if (!this.data.fullEndurance) { + + if (this.data.fullEndurance === undefined || this.data.fullEndurance === null || this.data + .fullEndurance === '') { uni.showToast({ title: '请填写续航公里数', icon: 'none', @@ -271,7 +277,7 @@ }); return; } - if (this.data.ruleIds.length<1) { + if (this.data.ruleIds.length < 1) { uni.showToast({ title: '请选择收费模版', icon: 'none', @@ -279,8 +285,8 @@ }); return; } - if(this.modelId){ - this.data.areaId=this.areaId + if (this.modelId) { + this.data.areaId = this.areaId this.$u.put("/system/model", this.data).then((res) => { if (res.code == 200) { uni.showToast({ @@ -291,11 +297,11 @@ setTimeout(() => { uni.navigateBack() }, 1200) - + } }); - }else{ - this.data.areaId=this.areaId + } else { + this.data.areaId = this.areaId this.$u.post("/system/model", this.data).then((res) => { if (res.code == 200) { uni.showToast({ @@ -306,28 +312,28 @@ setTimeout(() => { uni.navigateBack() }, 1200) - + } }); } - + }, - + subacc() { this.showpart = false console.log(this.chooseIdxArr); }, chooseAcc(ruleId) { - - const index = this.data.ruleIds.indexOf(ruleId); - if (index > -1) { - // 如果 ruleId 已经存在于 ruleIds 中,则从数组中删除 - this.data.ruleIds.splice(index, 1); - } else { - // 如果 ruleId 不存在,则添加到 ruleIds 中 - this.data.ruleIds.push(ruleId); - } - console.log( this.data.ruleIds,' this.data.ruleIds'); + + const index = this.data.ruleIds.indexOf(ruleId); + if (index > -1) { + // 如果 ruleId 已经存在于 ruleIds 中,则从数组中删除 + this.data.ruleIds.splice(index, 1); + } else { + // 如果 ruleId 不存在,则添加到 ruleIds 中 + this.data.ruleIds.push(ruleId); + } + console.log(this.data.ruleIds, ' this.data.ruleIds'); }, getAccessoryNames(accessoryIds) { // 根据 accessoryIds 找到 Accessorylist 中对应的 name 字段 @@ -340,24 +346,24 @@ // // 拼接 name 字符串,过滤掉空值 // return accessoryNames.filter(name => name).join(', '); - - // 根据 accessoryIds 找到 Accessorylist 中对应的 name 字段 - const accessoryNames = this.data.ruleIds.map(id => { - const item = this.Accessorylist.find(accessory => accessory.ruleId === id); - return item ? item.name : ''; - }); - - // 过滤掉空值并返回数组 - return accessoryNames.filter(name => name); + + // 根据 accessoryIds 找到 Accessorylist 中对应的 name 字段 + const accessoryNames = this.data.ruleIds.map(id => { + const item = this.Accessorylist.find(accessory => accessory.ruleId === id); + return item ? item.name : ''; + }); + + // 过滤掉空值并返回数组 + return accessoryNames.filter(name => name); }, getAccessorylist() { - let data ={ - areaId:this.areaId + let data = { + areaId: this.areaId } - this.$u.get(`/app/fee/list?`,data ).then((res) => { + this.$u.get(`/app/fee/list?`, data).then((res) => { if (res.code == 200) { this.Accessorylist = res.data - + } else { // 处理接口返回错误的情况 } @@ -511,19 +517,22 @@ .card_li:last-child { border-bottom: 1rpx solid #fff; } - .card_li1{ + + .card_li1 { padding-top: 24rpx; display: flex; flex-wrap: wrap; - .taocan{ + + .taocan { margin-top: 10rpx; padding-bottom: 20rpx; display: flex; flex-wrap: wrap; - .tc_li{ + + .tc_li { padding: 8rpx 14rpx; margin-right: 20rpx; - + background: #DCEDFF; border-radius: 6rpx 6rpx 6rpx 6rpx; font-weight: 400; @@ -531,7 +540,8 @@ color: #4297F3; } } - .card_top{ + + .card_top { display: flex; flex-wrap: nowrap; align-content: center; @@ -539,23 +549,24 @@ width: 100%; border-bottom: 1rpx solid #D8D8D8; padding-bottom: 18rpx; + .card_left { font-weight: 400; font-size: 30rpx; color: #3D3D3D; } - + .card_right { display: flex; flex-wrap: nowrap; align-items: center; - + span { font-weight: 400; font-size: 30rpx; color: #3D3D3D; } - + .input { text-align: right; /* 输入框内容靠右显示 */ @@ -563,6 +574,7 @@ } } } + .card_li { padding-top: 24rpx; display: flex; diff --git a/pages_adminSet/sysSet.vue b/pages_adminSet/sysSet.vue index 134c4da..0f5467f 100644 --- a/pages_adminSet/sysSet.vue +++ b/pages_adminSet/sysSet.vue @@ -432,7 +432,7 @@ }, backpage() { uni.redirectTo({ - url:'/pages_admin/admin_worke' + url: '/pages_admin/admin_worke' }) }, getdept() { @@ -443,7 +443,7 @@ if (res.code == 200) { this.deptInfo = res.data // this.list = res.data - + } else { // 处理接口返回错误的情况 } @@ -463,7 +463,7 @@ } }, sub() { - if (!this.form.areaName) { + if (this.form.areaName === undefined || this.form.areaName === null || this.form.areaName === '') { uni.showToast({ title: '请填写运营期名称', icon: 'none', @@ -471,7 +471,9 @@ }); return; // 阻止请求继续执行 } - if (!this.form.dispatchFee) { + + if (this.form.dispatchFee === undefined || this.form.dispatchFee === null || this.form.dispatchFee === + '') { uni.showToast({ title: '请填写运营区外调度费', icon: 'none', @@ -479,8 +481,9 @@ }); return; // 阻止请求继续执行 } - - if (!this.form.vehicleManagementFee) { + + if (this.form.vehicleManagementFee === undefined || this.form.vehicleManagementFee === null || this.form + .vehicleManagementFee === '') { uni.showToast({ title: '请填写停车点外调度费', icon: 'none', @@ -488,7 +491,8 @@ }); return; // 阻止请求继续执行 } - if (!this.form.error) { + + if (this.form.error === undefined || this.form.error === null || this.form.error === '') { uni.showToast({ title: '请填写还车误差', icon: 'none', @@ -496,7 +500,8 @@ }); return; // 阻止请求继续执行 } - if (!this.form.deposit) { + + if (this.form.deposit === undefined || this.form.deposit === null || this.form.deposit === '') { uni.showToast({ title: '请填写骑行押金', icon: 'none', @@ -504,7 +509,9 @@ }); return; // 阻止请求继续执行 } - if (!this.form.undercharge) { + + if (this.form.undercharge === undefined || this.form.undercharge === null || this.form.undercharge === + '') { uni.showToast({ title: '请填写骑行最低电量', icon: 'none', @@ -512,7 +519,9 @@ }); return; // 阻止请求继续执行 } - if (!this.form.autoReplacementOrder) { + + if (this.form.autoReplacementOrder === undefined || this.form.autoReplacementOrder === null || this.form + .autoReplacementOrder === '') { uni.showToast({ title: '请填写自动生成换电工单电量', icon: 'none', @@ -536,7 +545,7 @@ data.isDepositDeduction = data.isDepositDeduction ? "1" : "0"; data.returnVerify = data.returnVerify ? "1" : "0"; if (data.isDepositDeduction === "1" && data.returnVerify === "1") { - + uni.showToast({ title: '押金抵扣和拍照审核不能同时开启', icon: 'none' @@ -552,7 +561,7 @@ title: '押金抵扣和拍照审核不能同时开启', icon: 'none' }); - + return; } if (data.serviceName1 == "" && data.servicePhone1 == "") { @@ -560,10 +569,10 @@ title: '最少添加一个客服电话', icon: 'none' }); - + return; } - + console.log(data, 'mmmmmmmmmmmmm'); this.$u.put(`appVerify/areaEdit`, data).then((res) => { if (res.code == 200) { @@ -592,7 +601,7 @@ // this.mapopen = false; // this.getList(); // }); - + } } }