From 79993be468244e6cc16ce9c1d7e8736bd359c600 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期五, 05 五月 2023 14:48:51 +0800 Subject: [PATCH] 样式全面修改,所有页面焕然一新 --- pages/public-page/forward/forward.vue | 70 +++++++++++++++++++++-------------- 1 files changed, 42 insertions(+), 28 deletions(-) diff --git a/pages/public-page/forward/forward.vue b/pages/public-page/forward/forward.vue index 70f2284..e1a090f 100644 --- a/pages/public-page/forward/forward.vue +++ b/pages/public-page/forward/forward.vue @@ -11,7 +11,7 @@ <u-form-item label="杈撳叆鏁伴噺" labelWidth="20%" ref="item1"> <view class="forward-card-amount"> <view class="forward-card-amount-input"><u--input v-model="val.carNum" placeholder="璇疯緭鍏ヨ浆鍙戞暟閲�"></u--input></view> - <u-checkbox-group v-model="val.checkboxValue1" placement="column" @change="v => checkboxChange(v, index)"> + <u-checkbox-group v-model="val.checkboxValue1" placement="column" @change="v => checkboxChange(v, index, val)"> <u-checkbox :customStyle="{ marginBottom: '8px' }" size="30" labelSize="30" label="鍏ㄩ儴杞彂" name="鍏ㄩ儴杞彂" :disabled="val.ischecked"></u-checkbox> </u-checkbox-group> </view> @@ -125,20 +125,15 @@ index: '', checkboxValue1: '', selectPopupShow: false, - list1: [ - { - name: '杞﹂槦' - }, - { - name: '璐т唬' - } - ], + list1: [{ name: '杞﹂槦' }, { name: '璐т唬' }], tabHuoDai: false, carNumSurplus1: '', cars2: '', carNum: '', carNumSurplusHuodai: '', - formNum: 1 + formNum: 1, + // 涓汉杞彂鏁版嵁 + personalForward: {} }; }, onShow() { @@ -153,15 +148,14 @@ return uni.getStorageSync('roleType'); }, text() { - return `宸查鍙�${this.cars2}寮犳棩璁″垝鍗�,鍓╀綑${this.carNumSurplus1}寮犳棩璁″垝鍗昤; + return `宸查鍙�${this.cars2}寮犳彁鐓ゅ崟,鍓╀綑${this.carNumSurplus1}寮犳彁鐓ゅ崟`; }, text1() { - return `宸叉嫢鏈�${this.carNum}寮犳棩璁″垝鍗�,鍓╀綑${this.carNumSurplusHuodai}寮犳棩璁″垝鍗昤; + return `宸叉嫢鏈�${this.carNum}寮犳彁鐓ゅ崟,鍓╀綑${this.carNumSurplusHuodai}寮犳彁鐓ゅ崟`; } }, methods: { init() { - console.log('roleType', this.roleType); switch (this.roleType) { case 1: this.getAllHuoDaiByCustomerId(); @@ -177,22 +171,22 @@ allrelay(x, y) { let a = 0; if (y != 0) { - a = x + y; + a = Number(x) + Number(y); return a; } else { - return x; + return Number(x); } }, allrelayto(x, y) { let a = 0; if (y != 0) { - a = x - y; + a = Number(x) - Number(y); return a; } else { - return x; + return Number(x); } }, - checkboxChange(value, index) { + checkboxChange(value, index, v) { uni.setStorageSync('allrelay', this.jhOrderPlanForwardList[index].carNum); this.jhOrderPlanForwardList = this.jhOrderPlanForwardList.map((v, i) => { return { @@ -203,17 +197,31 @@ if (value.length != 0) { let tempforwardSurplus = this.forwardSurplus; let tempcarNumSurplus1 = this.carNumSurplus1; - // 璁$畻鍏ㄩ儴杞彂鏁� - // 瀹㈡埛 - if (this.roleType == 1) { - this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.jhOrderPlanForwardList[index].carNum, tempcarNumSurplus1); + if (v.id) { + this.$reqGet('jhorderplanforward', { forwardId: v.id }).then(res => { + this.personalForward = res.data; + // 璁$畻鍏ㄩ儴杞彂鏁� + // 瀹㈡埛 + if (this.roleType == 1) { + this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.personalForward.carNum, tempcarNumSurplus1); + } + tempcarNumSurplus1 = 0; + // 璐т唬 + if (this.roleType == 2) { + this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.personalForward.carNum, tempforwardSurplus); + } + tempforwardSurplus = 0; + }); + } else { + if (this.roleType == 1) { + this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.jhOrderPlanForwardList[index].carNum, this.carNumSurplus1); + } + tempcarNumSurplus1 = 0; + if (this.roleType == 2) { + this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.jhOrderPlanForwardList[index].carNum, this.forwardSurplus); + } + tempforwardSurplus = 0; } - tempcarNumSurplus1 = 0; - // 璐т唬 - if (this.roleType == 2) { - this.jhOrderPlanForwardList[index].carNum = this.allrelay(this.jhOrderPlanForwardList[index].carNum, tempforwardSurplus); - } - tempforwardSurplus = 0; // 閫夋嫨涓�涓悗鍏朵綑绂佹澶嶉�� this.jhOrderPlanForwardList.forEach((v, i) => { if (i !== index) { @@ -226,10 +234,16 @@ // 璐т唬 if (this.roleType == 2) { this.jhOrderPlanForwardList[index].carNum = this.allrelayto(this.jhOrderPlanForwardList[index].carNum, this.forwardSurplus); + if (this.jhOrderPlanForwardList[index].carNum <= 0) { + this.jhOrderPlanForwardList[index].carNum = 0; + } } // 瀹㈡埛 if (this.roleType == 1) { this.jhOrderPlanForwardList[index].carNum = this.allrelayto(this.jhOrderPlanForwardList[index].carNum, this.carNumSurplus1); + if (this.jhOrderPlanForwardList[index].carNum <= 0) { + this.jhOrderPlanForwardList[index].carNum = 0; + } } } }, -- Gitblit v1.9.1