From 6a0a2c52a4ea8049909b8d7a40d0c2d098b5e74c Mon Sep 17 00:00:00 2001
From: Jacob <hlnie@tohours.com>
Date: 星期五, 23 十月 2026 13:19:18 +0800
Subject: [PATCH] fix:解决专区图片拉伸问题

---
 pages/zone/index.vue |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/pages/zone/index.vue b/pages/zone/index.vue
index bf7dbc7..9d4b6d0 100644
--- a/pages/zone/index.vue
+++ b/pages/zone/index.vue
@@ -72,7 +72,8 @@
 				</view>
 			</view>
 			<view @click="goLottery" class="lottery_banner" v-if="info && info.isLottery && info.lotteryBanner">
-				<image class="lottery_bannerImg" :src="info.lotteryBanner" mode="widthFix">
+				<image class="lottery_bannerImg" :src="info.lotteryBanner" mode="widthFix"
+					:style="{ height: lotteryBannerHeight }">
 				</image>
 			</view>
 			<view class="tag-img-container" v-if="info.zoneType == 7">
@@ -622,6 +623,7 @@
 			stockEmpty: true,
 			urlOption: {},
 			homeTop: '200',
+			lotteryBannerHeight: '', //鎶藉banner棰勮绠楅珮搴︼紙rpx锛夛紝绌哄瓧绗︿覆琛ㄧず鏈彇鍒帮紝鎸夊師閫昏緫鑷�傚簲
 			hasNewPop: false,
 			leftCoupon: {},
 			rightCoupon: {},
@@ -1449,6 +1451,21 @@
 				this.$refs.popNewuserRef.show()
 			}
 		},
+		// 棰勫彇鎶藉banner鐪熷疄瀹介珮锛岃绠楀嚭楂樺害鍚庡啀娓叉煋锛岄伩鍏嶅姞杞藉墠琚粍浠堕粯璁ら珮搴�(225px)鎾戝ぇ
+		setLotteryBannerSize(info) {
+			let that = this
+			that.lotteryBannerHeight = ''
+			if (!info || !info.isLottery || !info.lotteryBanner) return
+			uni.getImageInfo({
+				src: info.lotteryBanner,
+				success: (img) => {
+					if (img.width > 0 && img.height > 0) {
+						that.lotteryBannerHeight = (690 * img.height / img.width).toFixed(2) + 'rpx'
+					}
+				},
+				fail: () => { }
+			})
+		},
 		getZoneDetail: function () {
 			let that = this;
 			let belong = this.$store.getters.belong;
@@ -1456,6 +1473,11 @@
 			console.log('涓撳尯璇︽儏鍏ュ弬锛氾細', params)
 			getZoneDetail(that.id, params).then(res => {
 				that.info = res.data;
+<<<<<<< Updated upstream
+=======
+				//that.info.zoneType=8;
+				that.setLotteryBannerSize(res.data);
+>>>>>>> Stashed changes
 				that.updateZoneShareMenu();
 				if (res.data.zoneType == 6) {
 					that.setYueyangZone()

--
Gitblit v1.4.0