From e6fea61c05d96ed2e6aa1aff9e7026e48b046332 Mon Sep 17 00:00:00 2001
From: Jacob <hlnie@tohours.com>
Date: 星期五, 23 十月 2026 13:33:08 +0800
Subject: [PATCH] fix: 清理专区详情合并冲突残留代码恢复抽奖banner尺寸设置
---
pages/zone/index.vue | 33 +++++++++++++++++++++++++++++++--
1 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/pages/zone/index.vue b/pages/zone/index.vue
index bf7dbc7..1fed09e 100644
--- a/pages/zone/index.vue
+++ b/pages/zone/index.vue
@@ -71,8 +71,10 @@
</view>
</view>
</view>
- <view @click="goLottery" class="lottery_banner" v-if="info && info.isLottery && info.lotteryBanner">
- <image class="lottery_bannerImg" :src="info.lotteryBanner" mode="widthFix">
+ <view @click="goLottery" class="lottery_banner"
+ v-if="info && info.isLottery && info.lotteryBanner && lotteryBannerReady">
+ <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 +624,8 @@
stockEmpty: true,
urlOption: {},
homeTop: '200',
+ lotteryBannerHeight: '', //鎶藉banner棰勮绠楅珮搴︼紙rpx锛夛紝绌哄瓧绗︿覆琛ㄧず鏈彇鍒帮紝鎸夊師閫昏緫鑷�傚簲
+ lotteryBannerReady: false, //鏄惁宸叉嬁鍒癰anner灏哄锛堟垨宸茬‘璁ゆ嬁涓嶅埌锛夛紝鏈氨缁墠涓嶆覆鏌擄紝閬垮厤棣栧抚鎾戦珮
hasNewPop: false,
leftCoupon: {},
rightCoupon: {},
@@ -1449,6 +1453,29 @@
this.$refs.popNewuserRef.show()
}
},
+ // 棰勫彇鎶藉banner鐪熷疄瀹介珮锛岃绠楀嚭楂樺害鍚庡啀娓叉煋锛岄伩鍏嶅姞杞藉墠琚粍浠堕粯璁ら珮搴�(225px)鎾戝ぇ
+ setLotteryBannerSize(info) {
+ let that = this
+ that.lotteryBannerHeight = ''
+ that.lotteryBannerReady = false
+ if (!info || !info.isLottery || !info.lotteryBanner) {
+ that.lotteryBannerReady = true
+ 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'
+ }
+ that.lotteryBannerReady = true
+ },
+ fail: (err) => {
+ console.warn('鎶藉banner灏哄棰勫彇澶辫触锛屽洖閫�涓鸿嚜閫傚簲', err)
+ that.lotteryBannerReady = true
+ }
+ })
+ },
getZoneDetail: function () {
let that = this;
let belong = this.$store.getters.belong;
@@ -1456,6 +1483,8 @@
console.log('涓撳尯璇︽儏鍏ュ弬锛氾細', params)
getZoneDetail(that.id, params).then(res => {
that.info = res.data;
+ //that.info.zoneType=8;
+ that.setLotteryBannerSize(res.data);
that.updateZoneShareMenu();
if (res.data.zoneType == 6) {
that.setYueyangZone()
--
Gitblit v1.4.0