From 0e4b49f4bee160790b1830e6a8606e739b32fc3b Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期三, 11 三月 2026 09:09:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 mini-program/pages/details/details.vue |  135 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 127 insertions(+), 8 deletions(-)

diff --git a/mini-program/pages/details/details.vue b/mini-program/pages/details/details.vue
index 1941b7a..a90e2d8 100644
--- a/mini-program/pages/details/details.vue
+++ b/mini-program/pages/details/details.vue
@@ -1,7 +1,7 @@
 <template>
 	<view class="details" v-if="info">
 		<template v-if="info.isdeleted === 0">
-			<u-swiper :list="info.banner" height="375" @click="preview"></u-swiper>
+			<u-swiper :list="info.banner" height="375" indicator indicatorMode="dot" @click="preview"></u-swiper>
 			<view class="info">
 				<view class="info-title">
 					{{info.name}}
@@ -12,12 +12,12 @@
 						<text>.{{info.minPrice[1]}}</text>
 					</view>
 					<view class="commodity-item-box-price-b">
-						鍘熶环楼{{info.linePrice}}
+						鍘熶环楼{{info.linePrice || 0}}
 					</view>
 				</view>
 				<view class="info-num">
-					<text>宸插敭 {{info.saleNum + info.realSaleNum}}+</text>
-					<text>搴撳瓨 {{info.stock}}</text>
+					<text>宸插敭 {{info.shou}}+</text>
+					<text>搴撳瓨 {{info.stock >= 0 ? info.stock : '涓嶉檺鍒�'}}</text>
 				</view>
 			</view>
 			<view class="content">
@@ -48,7 +48,7 @@
 					</view>
 					<view class="edit-btn">
 						<template v-if="info.status === 0">
-							<view class="edit-btn-a" @click="addCard(info)">鍔犲叆璐墿杞�</view>
+							<view class="edit-btn-a" @click="openCart">鍔犲叆璐墿杞�</view>
 							<view class="edit-btn-b" @click="submit">绔嬪嵆璐拱</view>
 						</template>
 						<template v-else>
@@ -66,6 +66,31 @@
 			</view>
 		</template>
 		<Login ref="login" />
+		<u-popup :show="show" mode="bottom" round="20" closeable @close="show = false">
+			<view class="cart">
+				<view class="goods">
+					<view class="goods-image">
+						<image :src="info.imgurl" mode="widthFix"></image>
+					</view>
+					<view class="goods-info">
+						<view class="commodity-item-box-price">
+							<view class="commodity-item-box-price-a">
+								<text>{{info.minPrice[0]}}</text>
+								<text>.{{info.minPrice[1]}}</text>
+							</view>
+							<view class="commodity-item-box-price-b">
+								鍘熶环楼{{info.linePrice}}
+							</view>
+						</view>
+						<view class="goods-info-kc">
+							搴撳瓨 {{info.stock >= 0 ? info.stock : '涓嶉檺鍒�'}}
+						</view>
+						<u-number-box v-model="num"></u-number-box>
+					</view>
+				</view>
+				<view class="cart-btn" @click="addCard(info)">鍔犲叆璐墿杞�</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -81,7 +106,9 @@
 			return {
 				id: null,
 				info: null,
-				cardObj: null
+				cardObj: null,
+				show: false,
+				num: 1
 			};
 		},
 		onLoad(option) {
@@ -132,18 +159,22 @@
 					url: '/pages/confirm-order/confirm-order'
 				})
 			},
-			addCard(e) {
+			openCart() {
 				if (!this.userInfo) {
 					this.$refs.login.open()
 					return
 				}
+				this.show = true
+			},
+			addCard(e) {
 				this.$u.api.addCart({
 					goodsId: e.id,
 					goodsSkuId: e.goodsSkuResponseList[0].id,
-					num: 1
+					num: this.num
 				}).then(res => {
 					if (res.code === 200) {
 						this.cardNum()
+						this.show = false
 						uni.showToast({ title: '娣诲姞鎴愬姛', icon: 'success', mask: true })
 					}
 				})
@@ -183,6 +214,7 @@
 							if (res.data.goodBannerMultiFiles && res.data.goodBannerMultiFiles.length > 0) {
 								res.data.banner = res.data.goodBannerMultiFiles.map(item => item.fileurlfull)
 							}
+							res.data.shou = (res.data.salenum  || 0) + (res.data.realSaleNum || 0)
 							this.info = res.data
 						}
 					})
@@ -202,6 +234,93 @@
 <style lang="scss" scoped>
 	.details {
 		width: 100%;
+		.cart {
+			width: 100%;
+			padding: 40rpx 30rpx;
+			box-sizing: border-box;
+			display: flex;
+			flex-direction: column;
+			.goods {
+				width: 100%;
+				display: flex;
+				align-items: center;
+				.goods-image {
+					flex-shrink: 0;
+					margin-right: 30rpx;
+					width: 200rpx;
+					height: 200rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					overflow: hidden;
+					background: #FFFFFF;
+					border-radius: 8rpx;
+					border: 1rpx solid #EEEEEE;
+					image {
+						width: 100%;
+					}
+				}
+				.goods-info {
+					flex: 1;
+					height: 200rpx;
+					display: flex;
+					flex-direction: column;
+					justify-content: space-between;
+					.goods-info-kc {
+						font-weight: 400;
+						font-size: 24rpx;
+						color: #999999;
+					}
+					.commodity-item-box-price {
+						width: 100%;
+						display: flex;
+						align-items: baseline;
+						margin-top: 8rpx;
+						.commodity-item-box-price-a {
+							display: flex;
+							align-items: baseline;
+							margin-right: 8rpx;
+							text {
+								&:nth-child(1) {
+									font-weight: bold;
+									font-size: 48rpx;
+									color: #E4001D;
+									&::before {
+										content: '锟�';
+										font-weight: 400;
+										font-size: 26rpx;
+										color: #E4001D;
+									}
+								}
+								&:nth-child(2) {
+									font-weight: 400;
+									font-size: 26rpx;
+									color: #E4001D;
+								}
+							}
+						}
+						.commodity-item-box-price-b {
+							font-weight: 400;
+							font-size: 24rpx;
+							color: #999999;
+							text-decoration: line-through;
+						}
+					}
+				}
+			}
+			.cart-btn {
+				width: 100%;
+				height: 88rpx;
+				line-height: 88rpx;
+				text-align: center;
+				background: #004096;
+				border-radius: 44rpx;
+				font-weight: 500;
+				font-size: 32rpx;
+				color: #FFFFFF;
+				margin-top: 80rpx;
+			}
+		}
 		.wuImg {
 			width: 100%;
 			display: flex;

--
Gitblit v1.9.3