From 88d43463f7b33233470f34ae053ccf515c683db1 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期二, 09 四月 2024 01:01:08 +0800
Subject: [PATCH] #
---
pages/phyz/order/orderCar.vue | 40 +++++++++++++++++++++++++++++++---------
1 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/pages/phyz/order/orderCar.vue b/pages/phyz/order/orderCar.vue
index 3913f89..4d6216e 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,29 @@
})
},
methods: {
- chageDetl() {
-
- }
+ chageDetl(index) {
+ this.index = index
+ this.count = this.orderCarList[index].pakinQty
+ 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 +151,7 @@
height: 100%;
justify-content: center;
align-items: center;
- color: #606266;
+ color: #e2231a;
border-right: 1px solid #DCDFE6;
}
.btn-right {
--
Gitblit v1.9.1