From af2a86dbbe05d74b00a6e7bdc426e26bb0453654 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期三, 31 七月 2024 11:35:34 +0800
Subject: [PATCH] fix bug

---
 sub_pages/customer/self/history.vue |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/sub_pages/customer/self/history.vue b/sub_pages/customer/self/history.vue
index d6513f6..d32372e 100644
--- a/sub_pages/customer/self/history.vue
+++ b/sub_pages/customer/self/history.vue
@@ -59,7 +59,7 @@
 				if (item.status == 'UP') {
 
 				} else {
-					this.$message.showToast('已失效,无法查看详情')
+					this.$message.showToast('商品已下架,无法查看详情')
 					return
 				}
 				uni.navigateTo({
@@ -70,8 +70,8 @@
 				//提交到购物车中
 				// this.$message.showLoading()
 				const res = await this.$store.dispatch('submitShopping', dto);
-				console.log('res',res)
-				if (res&&res.code == 0){
+				console.log('res', res)
+				if (res && res.code == 0) {
 					dto.shopnum = res.data || 0
 					this.$forceUpdate()
 				}
@@ -101,14 +101,14 @@
 					var t = parseInt(res.content)
 					if (isNaN(t) || t < 0) {
 						this.$message.showToast('数目需要大于等于0')
-						
+
 					} else {
-						if(!item.stock || t>item.stock){
+						if (!item.stock || t > item.stock) {
 							this.$message.showToast('库存不足无法修改')
 							return
 						}
 						this.addnum(item, (t - item.shopnum))
-						
+
 					}
 				} else {
 
@@ -128,7 +128,7 @@
 				if (!item.stock) {
 					item.stock = 0
 				}
-				if (item.shopnum + addnum > item.stock) {
+				if (addnum > 0 & item.shopnum + addnum > item.stock) {
 					this.$message.showToast('库存不足,无法修改')
 					return
 				}
@@ -189,10 +189,10 @@
 			@cancel="order_show=false"></u-picker>
 
 		<view class="trade-list-container">
-			<view class="trade-info-container flex" v-for="(dto,index) of list" :key="index"
-				>
+			<view class="trade-info-container flex"  :class="[dto.status]"
+			v-for="(dto,index) of list" :key="index">
 				<image class="img img100 br-4 m-r-10" :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image>
-				<view class="flex1" >
+				<view class="flex1">
 					<view class="flex" @click.stop="toDetail(dto)">
 						<view class="title">
 							<span class="m-r-5" style="display: inline-block;"
@@ -217,7 +217,8 @@
 							<view class="m-r-0 flex" v-if="dto.shopnum">
 								<uni-icons v-if="dto.shopnum&&dto.shopnum>=1" type="minus" size="32"
 									@click.stop="addnum(dto,-1)"></uni-icons>
-								<view class="curnums" @click.stop="updateItemNum(dto)" v-if="dto.shopnum&&dto.shopnum>=1">
+								<view class="curnums" @click.stop="updateItemNum(dto)"
+									v-if="dto.shopnum&&dto.shopnum>=1">
 									{{ dto.shopnum }}
 								</view>
 								<uni-icons v-if="!dto.shopnum||dto.shopnum<=999" type="plus-filled" size="32"
@@ -268,6 +269,13 @@
 
 		}
 
+		.trade-info-container.UP {
+			.title {
+				color: #000000;
+
+			}
+		}
+
 		.trade-info-container {
 			background-color: #fff;
 			border-radius: 20rpx;
@@ -286,7 +294,7 @@
 				font-weight: 600;
 				font-size: 28rpx;
 
-				color: #000000;
+				color: #333;
 				line-height: 40rpx;
 
 				.level {

--
Gitblit v1.9.3