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 @@ 账户明细 </view> </view> - <view class="cont" @click="topage(7)" > + <view class="cont" @click="topage(7)" v-if="userinfo.role !=4"> <image src="https://lxnapi.ccttiot.com/bike/img/static/u47okd0YdEQBsyhLlQIt" mode="" style="width: 50rpx;height: 50rpx;"></image> <view class="text"> 故障审核 </view> </view> - <view class="cont" @click="topage(9)" > + <view class="cont" @click="topage(9)" v-if="userinfo.role !=4"> <image src="https://lxnapi.ccttiot.com/bike/img/static/ufE1T9RDOm7OmhLgTzXi" mode="" style="width: 100%;height: 100%;"></image> <!-- <view class="text"> 故障审核 </view> --> </view> - <view class="cont" @click="topage(10)" > + <view class="cont" @click="topage(10)" v-if="userinfo.role !=4"> <image src="https://lxnapi.ccttiot.com/bike/img/static/uqG3ZQWu986qU0gU9vbb" mode="" style="width: 100%;height: 100%;"></image> <!-- <view class="text"> 故障审核 </view> --> </view> - <view class="cont" @click="topage(11)" style="width: 96rpx;height: 96rpx;"> + <view class="cont" @click="topage(11)" style="width: 96rpx;height: 96rpx;" v-if="userinfo.role !=4"> <image src="https://lxnapi.ccttiot.com/bike/img/static/uqCr4GrXEx6irmRNNsfM" mode="" style="width: 96rpx;height: 96rpx;"></image> <!-- <view class="text"> 故障审核 diff --git a/pages_adminSet/ChargingDetail.vue b/pages_adminSet/ChargingDetail.vue index 9512ce1..1f398ac 100644 --- a/pages_adminSet/ChargingDetail.vue +++ b/pages_adminSet/ChargingDetail.vue @@ -294,7 +294,9 @@ } }, sub() { - if (!this.data.name) { + console.log(this.data); + + if (this.data.name === undefined || this.data.name === null || this.data.name === '') { uni.showToast({ title: '请填写套餐名称', icon: 'none', @@ -302,7 +304,7 @@ }); return; // 阻止请求继续执行 } - if (!this.data.instructions) { + if (this.data.instructions === undefined || this.data.instructions === null || this.data.instructions === '') { uni.showToast({ title: '请填写套餐说明', icon: 'none', @@ -310,7 +312,7 @@ }); return; // 阻止请求继续执行 } - if (!this.data.freeRideTime) { + if (this.data.freeRideTime === undefined || this.data.freeRideTime === null || this.data.freeRideTime === '') { uni.showToast({ title: '请填写免费骑行时间', icon: 'none', @@ -318,15 +320,17 @@ }); return; // 阻止请求继续执行 } - if (!this.data.autoRefundDeposit) { + + if (this.data.autoRefundDeposit === undefined || this.data.autoRefundDeposit === null || this.data.autoRefundDeposit === '') { uni.showToast({ - title: '请填写换车结算时间', + title: '请填写还车结算时间', icon: 'none', duration: 2000 }); return; // 阻止请求继续执行 } - if (!this.startingPrice) { + + if (this.startingPrice === undefined || this.startingPrice === null || this.startingPrice === '') { uni.showToast({ title: '请填写起步价', icon: 'none', @@ -334,7 +338,7 @@ }); return; // 阻止请求继续执行 } - if (!this.startingTime) { + if (this.startingTime === undefined || this.startingTime === null || this.startingTime === '') { uni.showToast({ title: '请填写起步价包含的时间', icon: 'none', @@ -343,7 +347,7 @@ return; // 阻止请求继续执行 } - if (!this.timeoutPrice) { + if (this.timeoutPrice === undefined || this.timeoutPrice === null || this.timeoutPrice === '') { uni.showToast({ title: '请填写超出价', icon: 'none', @@ -351,7 +355,8 @@ }); return; // 阻止请求继续执行 } - if (!this.timeoutTime) { + + if (this.timeoutTime === undefined || this.timeoutTime === null || this.timeoutTime === '') { uni.showToast({ title: '请填写超出价的时间', icon: 'none', @@ -359,7 +364,8 @@ }); return; // 阻止请求继续执行 } - if (!this.data.chargingCycleValue) { + + if (this.data.chargingCycleValue === undefined || this.data.chargingCycleValue === null || this.data.chargingCycleValue === '') { uni.showToast({ title: '请填写计费周期', icon: 'none', @@ -367,7 +373,8 @@ }); return; // 阻止请求继续执行 } - if (!this.data.cappedAmount) { + + if (this.data.cappedAmount === undefined || this.data.cappedAmount === null || this.data.cappedAmount === '') { uni.showToast({ title: '请填写封顶金额', icon: 'none', diff --git a/pages_adminSet/modelMt.vue b/pages_adminSet/modelMt.vue index b5b7a76..bfcf192 100644 --- a/pages_adminSet/modelMt.vue +++ b/pages_adminSet/modelMt.vue @@ -59,7 +59,7 @@ <span> KM</span> </view> </view> - + <view class="card_li"> <view class="card_left"> 低电量提醒 @@ -106,17 +106,17 @@ </view> --> <view class="card"> - + <view class="card_li1"> <view class="card_top" @click="showpart=true"> <view class="card_left"> 收费模版 </view> <view class="card_right"> - - + + <view class="iconfont icon-xiangyou1 " style="color: #CBCBCB;"> - + </view> </view> </view> @@ -124,34 +124,35 @@ {{getAccessoryNames()}} </view> --> <view class="taocan" v-if="data.ruleIds"> - <view v-for="(name, index) in getAccessoryNames()" :key="index" style="width: 100%; display: flex;margin-top: 10rpx;"> - + <view v-for="(name, index) in getAccessoryNames()" :key="index" + style="width: 100%; display: flex;margin-top: 10rpx;"> + <view class="tc_li"> - {{ name }} + {{ name }} </view> - </view> + </view> </view> <!-- <span v-if="data.ruleIds">{{getAccessoryNames()}}</span> --> </view> </view> - <u-mask :show="showpart" :z-index='100' @click="closepart()"/> + <u-mask :show="showpart" :z-index='100' @click="closepart()" /> <view class="choose_part" v-if="showpart"> <view class="tit"> 选择收费方式 </view> - <view class="part_box"> - <view class="" v-for="(item, index) in Accessorylist" :key="index" @click="chooseAcc(item.ruleId)" style="width: 100%; display: flex;margin-top: 10rpx;"> - <view class="part" - :class="data.ruleIds.includes(item.ruleId) ? 'act' : ''"> - {{item.name}} - <image src="https://lxnapi.ccttiot.com/bike/img/static/uJNlGEGmN0F4AuPJmOZn" mode="" - v-if="data.ruleIds.includes(item.ruleId)"> - </image> + <view class="part_box"> + <view class="" v-for="(item, index) in Accessorylist" :key="index" @click="chooseAcc(item.ruleId)" + style="width: 100%; display: flex;margin-top: 10rpx;"> + <view class="part" :class="data.ruleIds.includes(item.ruleId) ? 'act' : ''"> + {{item.name}} + <image src="https://lxnapi.ccttiot.com/bike/img/static/uJNlGEGmN0F4AuPJmOZn" mode="" + v-if="data.ruleIds.includes(item.ruleId)"> + </image> + </view> </view> + </view> - - </view> <view class="btn" @click="subacc()"> 确定 </view> @@ -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(); // }); - + } } }