From d68fb476c248c6c3ab974ea6b18d6bba638f12d8 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 06 十一月 2025 12:35:37 +0800
Subject: [PATCH] 页面优化

---
 pages/product/m-buy/goods.vue |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/pages/product/m-buy/goods.vue b/pages/product/m-buy/goods.vue
index 128c85c..fdf0f55 100644
--- a/pages/product/m-buy/goods.vue
+++ b/pages/product/m-buy/goods.vue
@@ -4,8 +4,8 @@
 			<!-- 鍟嗗搧 -->
 			<view class="goods-box bottom">
 				<view class="goods-header">
-					<view class="goods-img">
-						<!-- <u-image width="200rpx" border-radius="20" class="uimage" height="200rpx" :src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image> -->
+					<view class="goods-img" v-if="goodsDetail.specList && goodsDetail.specList.length > 0 && goodsDetail.specList[0].specImage.length > 0" @click="previewImageSpec">
+						<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx" :src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
 					</view>
 					<view class="goods-skus">
 						<!-- 鏈夋椿鍔ㄥ晢鍝佷环鏍� -->
@@ -986,7 +986,20 @@
 				this.selectedImages = [];
 			}
 		},
-		
+		// 棰勮妯℃澘鍥剧墖
+		previewImageSpec() {
+			// 鍙瑙堝綋鍓嶉�変腑鐨勫浘鐗�
+			const url = this.selectedSpecImg ? this.selectedSpecImg : this.goodsDetail.thumbnail
+			const urls = [url];
+			
+			// 璋冪敤uniapp鍘熺敓API棰勮鍥剧墖
+			uni.previewImage({
+				current: 0, // 褰撳墠鏄剧ず鍥剧墖鐨勭储寮曪紙鍙湁涓�寮犲浘鐗囷紝鎵�浠ユ槸0锛�
+				urls: urls, // 闇�瑕侀瑙堢殑鍥剧墖閾炬帴鍒楄〃
+				indicator: 'default', // 鏄剧ず绱㈠紩鎸囩ず鍣�
+				loop: false // 鍙湁涓�寮犲浘鐗囷紝涓嶉渶瑕佸惊鐜瑙�
+			});
+		},
 		// 棰勮妯℃澘鍥剧墖
 		previewImage(imgObject, index) {
 			// 鍙瑙堝綋鍓嶉�変腑鐨勫浘鐗�

--
Gitblit v1.8.0