From 86f9ba9278682d7c117c2e95654c836b6cae36ff Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期二, 09 四月 2024 00:45:21 +0800 Subject: [PATCH] # --- pages/phyz/order/orderCar.vue | 39 ++++++++++++++++++++++++++++++--------- 1 files changed, 30 insertions(+), 9 deletions(-) diff --git a/pages/phyz/order/orderCar.vue b/pages/phyz/order/orderCar.vue index 3913f89..cc94ab8 100644 --- a/pages/phyz/order/orderCar.vue +++ b/pages/phyz/order/orderCar.vue @@ -1,6 +1,6 @@ <template> <view> - <view class="list list-font-color shop-car" :class="orderDetl.color" v-for="orderDetl in orderCarList" > + <view class="list list-font-color shop-car" :class="orderDetl.color" v-for="(orderDetl,index) in orderCarList" :key="index"> <view class="list-left"> <view class="detl-threeCode">{{orderDetl.threeCode}}</view> <view>涓诲崟鍙凤細{{orderDetl.orderNo}}</view> @@ -9,7 +9,7 @@ <view>鎬绘暟閲忥細{{orderDetl.anfme}}</view> <view>鍏ュ簱鏁伴噺锛歿{orderDetl.pakinQty}}</view> </view> - <view class="list-right" @click="chageDetl(orderDetl)"> + <view class="list-right" @click="chageDetl(index)"> <uni-icons type="settings" size="25" color="#fff"></uni-icons> </view> </view> @@ -29,8 +29,8 @@ <uni-number-box :value="count" :step='1' :max="9999999" color="#747474" @change="changeValue" /> </view> <view class="btn"> - <view class="btn-left" @click="addClose">鍙栨秷</view> - <view class="btn-right" @click="addConfirm()">娣诲姞</view> + <view class="btn-left" @click="remove()">绉婚櫎鐗╂枡</view> + <view class="btn-right" @click="changeCount()">淇敼鏁伴噺</view> </view> </view> </uni-popup> @@ -42,7 +42,9 @@ export default { data() { return { - orderCarList: [] + orderCarList: [], + count: 0, + index: 0 } }, onShow() { @@ -58,9 +60,28 @@ }) }, methods: { - chageDetl() { - - } + chageDetl(index) { + this.index = index + this.$refs.chageDetl.open() + }, + // 淇敼鏁伴噺 + changeCount() { + if (this.count > this.orderCarList[this.index].anfme) { + uni.showToast({ title: '鏁伴噺涓嶅悎娉曪紒', icon: "none", position: 'top' }) + return + } + this.orderCarList[this.index].pakinQty = this.count + this.$forceUpdate() // 寮哄埗鍒锋柊 + this.$refs.chageDetl.close() + }, + // 绉婚櫎鐗╂枡 + remove() { + this.orderCarList.splice(this.index, 1) + this.$refs.chageDetl.close() + }, + changeValue(value) { + this.count = value + }, } } </script> @@ -129,7 +150,7 @@ height: 100%; justify-content: center; align-items: center; - color: #606266; + color: #e2231a; border-right: 1px solid #DCDFE6; } .btn-right { -- Gitblit v1.9.1