2 Commits
Author SHA1 Message Date
lifizer b348412c74 Refactor(千县):图片增加懒加载,优化渲染速度
(cherry picked from commit 23f3d8b994)
2026-07-29 17:44:40 +08:00
linxi 82455f87ce Fix:抽奖送礼还能选择优惠券
(cherry picked from commit 80078cae78)
2026-07-28 11:15:21 +08:00
4 changed files with 73 additions and 16 deletions
+18 -8
View File
@@ -32,9 +32,9 @@
<image :src="webUrl+'/20210806121714655368.png'" mode="" style="width: 36rpx;height: 36rpx;"></image> <image :src="webUrl+'/20210806121714655368.png'" mode="" style="width: 36rpx;height: 36rpx;"></image>
</view> </view>
</view> </view>
<view v-if="couponListLimit2ToShow.length > 0 || attr.productSelect.earnPoints" class="v12-mt-1 v12-mb-1"> <view v-if="(!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0) || attr.productSelect.earnPoints" class="v12-mt-1 v12-mb-1">
<view class="cell flex jc-between ai-center"> <view class="cell flex jc-between ai-center">
<view v-if="couponListLimit2ToShow.length > 0" class="v12-justify-start"> <view v-if="!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0" class="v12-justify-start">
<view <view
v-for="(item, index) in couponListLimit2ToShow" v-for="(item, index) in couponListLimit2ToShow"
:key="index" :key="index"
@@ -48,7 +48,7 @@
</view> </view>
<view <view
v-if="couponListLimit2ToShow.length > 0" v-if="!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0"
class="value value2 v12-font-24 v12-primary-text" class="value value2 v12-font-24 v12-primary-text"
@click="changeCoupons()" @click="changeCoupons()"
> >
@@ -201,7 +201,7 @@
</view> </view>
<!-- v9 优惠券开始 --> <!-- v9 优惠券开始 -->
<u-popup :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()"> <u-popup v-if="!isCountyLotteryGoodsDetail()" :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()">
<CouponsPopup <CouponsPopup
:two-list="couponList" :two-list="couponList"
@ok="setCoupon" @ok="setCoupon"
@@ -1519,12 +1519,17 @@ export default {
that.isOpen = false that.isOpen = false
that.attr.cartAttr = false that.attr.cartAttr = false
if (news === 1) { if (news === 1) {
const orderQuery = {
id: res.data.cartId,
discount: that.storeInfo.discount,
}
if (that.source === 'countyLottery') {
orderQuery.from = 'countyLottery'
orderQuery.drawActivityId = Number(that.activityId || 0)
}
that.$yrouter.push({ that.$yrouter.push({
path: "/pages/order/OrderSubmission/index", path: "/pages/order/OrderSubmission/index",
query: { query: orderQuery
id: res.data.cartId,
discount: that.storeInfo.discount,
}
}) })
setTimeout(() => { setTimeout(() => {
that.submitActionLock = false that.submitActionLock = false
@@ -1599,11 +1604,16 @@ export default {
listenerActionClose() { listenerActionClose() {
this.posters = false this.posters = false
}, },
isCountyLotteryGoodsDetail() {
return this.source === 'countyLottery' && Number(this.activityId || 0) > 0
},
// v9-2 // v9-2
changeCoupons(e) { changeCoupons(e) {
if (this.isCountyLotteryGoodsDetail()) return
this.show = !this.show this.show = !this.show
}, },
setCoupon(couponId) { setCoupon(couponId) {
if (this.isCountyLotteryGoodsDetail()) return
this.couponId = couponId this.couponId = couponId
}, },
async checkFavorite() { async checkFavorite() {
+11
View File
@@ -24,6 +24,7 @@
:src="countyFamousTopImage" :src="countyFamousTopImage"
class="img" class="img"
mode="widthFix" mode="widthFix"
:lazy-load="true"
/> />
<view v-if="list.length > 0" class="province-wrap" id="province-wrap"> <view v-if="list.length > 0" class="province-wrap" id="province-wrap">
<view <view
@@ -39,6 +40,7 @@
<image <image
:src="item.icon" :src="item.icon"
class="img" class="img"
:lazy-load="true"
/> />
<view class="name one-t"> <view class="name one-t">
{{ item.provinceName }} {{ item.provinceName }}
@@ -61,6 +63,7 @@
<image <image
:src="webUrl + '/page/qianxian/icon-06.png'" :src="webUrl + '/page/qianxian/icon-06.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
</view> </view>
</view> </view>
@@ -95,11 +98,13 @@
<image <image
:src="county.logo" :src="county.logo"
class="county-img" class="county-img"
:lazy-load="true"
/> />
<view class="county-name"> <view class="county-name">
<image <image
:src="webUrl + '/home/icon-location.png'" :src="webUrl + '/home/icon-location.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
<view class="county-txt one-t"> <view class="county-txt one-t">
{{ county.countyName }} {{ county.countyName }}
@@ -118,11 +123,13 @@
<image <image
:src="county.logo" :src="county.logo"
class="county-img" class="county-img"
:lazy-load="true"
/> />
<view class="county-name"> <view class="county-name">
<image <image
:src="webUrl + '/home/icon-location.png'" :src="webUrl + '/home/icon-location.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
<view class="county-txt one-t"> <view class="county-txt one-t">
{{ county.countyName }} {{ county.countyName }}
@@ -140,11 +147,13 @@
<image <image
:src="county.logo" :src="county.logo"
class="county-img" class="county-img"
:lazy-load="true"
/> />
<view class="county-name"> <view class="county-name">
<image <image
:src="webUrl + '/home/icon-location.png'" :src="webUrl + '/home/icon-location.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
<view class="county-txt one-t"> <view class="county-txt one-t">
{{ county.countyName }} {{ county.countyName }}
@@ -160,6 +169,7 @@
:src="webUrl + '/home/no-data-bg.png'" :src="webUrl + '/home/no-data-bg.png'"
mode="widthFix" mode="widthFix"
class="loadend" class="loadend"
:lazy-load="true"
/> />
</view> </view>
<image <image
@@ -167,6 +177,7 @@
:src="webUrl + '/orderIcon/nodata.png'" :src="webUrl + '/orderIcon/nodata.png'"
class="img-nodata v12-mt-16" class="img-nodata v12-mt-16"
mode="scaleToFill" mode="scaleToFill"
:lazy-load="true"
/> />
</view> </view>
<goo-skeleton <goo-skeleton
+13 -1
View File
@@ -224,7 +224,7 @@
@click.stop="handleInfoHotelClick(item)" @click.stop="handleInfoHotelClick(item)"
> >
<view class="info-shop-logo"> <view class="info-shop-logo">
<image :src="item.linkHotelLogo" mode="aspectFill" /> <image :src="item.linkHotelLogo" mode="aspectFill" :lazy-load="true" />
</view> </view>
<view class="info-shop-main"> <view class="info-shop-main">
<view class="info-shop-name"> <view class="info-shop-name">
@@ -245,6 +245,7 @@
<image <image
:src="webUrl + '/20230803152147141807.png'" :src="webUrl + '/20230803152147141807.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text> <text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
</view> </view>
@@ -253,12 +254,14 @@
v-if="!item.hasZan" v-if="!item.hasZan"
:src="webUrl + '/page/hotel/zan-off-2.png'" :src="webUrl + '/page/hotel/zan-off-2.png'"
class="zan-off-icon" class="zan-off-icon"
:lazy-load="true"
@click="likeInfoItemHandle(item, index, item.zan + 1, true)" @click="likeInfoItemHandle(item, index, item.zan + 1, true)"
/> />
<image <image
v-else v-else
:src="webUrl + '/page/hotel/zan-on-2.png'" :src="webUrl + '/page/hotel/zan-on-2.png'"
class="zan-on-icon" class="zan-on-icon"
:lazy-load="true"
@click="likeInfoItemHandle(item, index, item.zan - 1, false)" @click="likeInfoItemHandle(item, index, item.zan - 1, false)"
/> />
<text <text
@@ -390,6 +393,7 @@
<image <image
:src="item" :src="item"
class="img" class="img"
:lazy-load="true"
@click="showPic(index)" @click="showPic(index)"
/> />
</view> </view>
@@ -413,6 +417,7 @@
:src="item.image" :src="item.image"
mode="widthFix" mode="widthFix"
class="img" class="img"
:lazy-load="true"
/> />
<view class="info-wrap"> <view class="info-wrap">
<view class="time"> <view class="time">
@@ -470,6 +475,7 @@
<image <image
:src="webUrl + '/page/qianxian/icon-02.png'" :src="webUrl + '/page/qianxian/icon-02.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
重点项目 重点项目
</view> </view>
@@ -486,6 +492,7 @@
<image <image
:src="webUrl + '/page/qianxian/icon-05.png'" :src="webUrl + '/page/qianxian/icon-05.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
</view> </view>
</view> </view>
@@ -503,6 +510,7 @@
<image <image
:src="webUrl + '/page/qianxian/icon-02.png'" :src="webUrl + '/page/qianxian/icon-02.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
招商政策 招商政策
</view> </view>
@@ -525,6 +533,7 @@
<image <image
:src="webUrl + '/page/qianxian/icon-05.png'" :src="webUrl + '/page/qianxian/icon-05.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
</view> </view>
</view> </view>
@@ -605,11 +614,13 @@
<image <image
:src="shop.cover + (shop.coverType === 2 ? '?vframe/jpg/offset/1' : '')" :src="shop.cover + (shop.coverType === 2 ? '?vframe/jpg/offset/1' : '')"
class="img" class="img"
:lazy-load="true"
/> />
<view class="location"> <view class="location">
<image <image
:src="webUrl + '/page/qianxian/icon-08.png'" :src="webUrl + '/page/qianxian/icon-08.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
<view class="addr one-t"> <view class="addr one-t">
{{ shop.address }} {{ shop.address }}
@@ -624,6 +635,7 @@
<image <image
:src="shop.logo" :src="shop.logo"
class="logo" class="logo"
:lazy-load="true"
/> />
<view class="name one-t"> <view class="name one-t">
{{ shop.name }} {{ shop.name }}
+31 -7
View File
@@ -95,7 +95,7 @@
<text class="v12-dark-text v12-font-30">{{ computedResult.discountPrice }}</text> <text class="v12-dark-text v12-font-30">{{ computedResult.discountPrice }}</text>
</view> </view>
</view> </view>
<view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1"> <view v-if="!isCountyLotteryGift" class="v12-justify-between v12-align-center v12-font-28 v12-mt-1">
<view class="v12-font-24 v12-dark-text v12-align-center"> <view class="v12-font-24 v12-dark-text v12-align-center">
<view class=""> <view class="">
优惠券 优惠券
@@ -163,6 +163,7 @@
@confirm="onPayConfirm" @confirm="onPayConfirm"
/> />
<u-popup <u-popup
v-if="!isCountyLotteryGift"
:show="showPopup" :show="showPopup"
:round="10" :round="10"
mode="bottom" mode="bottom"
@@ -281,6 +282,13 @@ export default {
}, },
watch: { watch: {
async couponId(value) { async couponId(value) {
if (this.isCountyLotteryGift) {
this.couponTitle = ''
if (Number(value || 0) !== 0) {
this.couponId = 0
return
}
}
this.couponIndex = this.couponList['usable']?.findIndex(item => item.id === +value) this.couponIndex = this.couponList['usable']?.findIndex(item => item.id === +value)
this.couponTitle = this.couponList['usable']?.[this.couponIndex]?.couponTitle this.couponTitle = this.couponList['usable']?.[this.couponIndex]?.couponTitle
if(this.isGroupBuy) { if(this.isGroupBuy) {
@@ -324,6 +332,10 @@ export default {
} }
}, },
methods: { methods: {
getCouponId() {
if (this.isCountyLotteryGift) return 0
return this.couponId || 0
},
adjustCoverListForProductStory(coverList, productInfo, defaultTemplate) { adjustCoverListForProductStory(coverList, productInfo, defaultTemplate) {
if (!productInfo || !productInfo.productStory) { if (!productInfo || !productInfo.productStory) {
return { return {
@@ -356,14 +368,19 @@ export default {
computedTravelGroupPrice(useDefaultCouponId) { computedTravelGroupPrice(useDefaultCouponId) {
const params = { const params = {
key: this.orderKey, key: this.orderKey,
couponId: this.couponId couponId: this.getCouponId()
} }
computedSojoumGroupBuyGiftOrderPrice(params).then(res => { computedSojoumGroupBuyGiftOrderPrice(params).then(res => {
this.computedResult = res.data.result this.computedResult = res.data.result
this.couponList = res.data.result.couponList this.couponList = res.data.result.couponList
this.payPrice = res.data.result.payPrice this.payPrice = res.data.result.payPrice
this.$forceUpdate() this.$forceUpdate()
if(useDefaultCouponId) { if (this.isCountyLotteryGift) {
this.couponTitle = ''
if (this.couponId !== 0) {
this.couponId = 0
}
} else if(useDefaultCouponId) {
this.couponId = res.data.result.defaultCouponId || 0 this.couponId = res.data.result.defaultCouponId || 0
} }
}) })
@@ -372,6 +389,7 @@ export default {
this.showCoverPicker = true this.showCoverPicker = true
}, },
showCouponsPopup() { showCouponsPopup() {
if (this.isCountyLotteryGift) return
if (this.couponList.usable && this.couponList.usable.length === 0) return if (this.couponList.usable && this.couponList.usable.length === 0) return
if(this.isPayOk) return if(this.isPayOk) return
this.showPopup = !this.showPopup this.showPopup = !this.showPopup
@@ -380,6 +398,7 @@ export default {
this.showPopup = !this.showPopup this.showPopup = !this.showPopup
}, },
changeCoupons(item) { changeCoupons(item) {
if (this.isCountyLotteryGift) return
if(!item) return if(!item) return
if (this.couponList.usable && this.couponList.usable.length === 0) return if (this.couponList.usable && this.couponList.usable.length === 0) return
this.showPopup = !this.showPopup this.showPopup = !this.showPopup
@@ -448,7 +467,7 @@ export default {
computedPrice(num, f) { computedPrice(num, f) {
const params = { const params = {
cartId: this.cartId, cartId: this.cartId,
couponId: this.couponId, couponId: this.getCouponId(),
cartNum : num cartNum : num
} }
if(this.discount) { if(this.discount) {
@@ -456,7 +475,12 @@ export default {
} }
getGiftCardSendOrderAmount(this.orderKey, params).then(res => { getGiftCardSendOrderAmount(this.orderKey, params).then(res => {
this.couponList = res.data.result.couponList this.couponList = res.data.result.couponList
if(!f) { if (this.isCountyLotteryGift) {
this.couponTitle = ''
if (this.couponId !== 0) {
this.couponId = 0
}
} else if(!f) {
this.couponId = res.data.result.defaultCouponId || 0 this.couponId = res.data.result.defaultCouponId || 0
this.$forceUpdate() this.$forceUpdate()
} }
@@ -564,13 +588,13 @@ export default {
message : this.message || '礼笺轻启,礼藏心意', message : this.message || '礼笺轻启,礼藏心意',
canTransfer: this.canTransfer ? 1 : 0, canTransfer: this.canTransfer ? 1 : 0,
passwordPay: this.payPassword || '', passwordPay: this.payPassword || '',
couponId: this.couponId, couponId: this.getCouponId(),
payType: this.payType, payType: this.payType,
} : { } : {
orderKey: this.orderKey, orderKey: this.orderKey,
from: 'routine', from: 'routine',
cartId: this.cartId, cartId: this.cartId,
couponId: this.couponId, couponId: this.getCouponId(),
recipientsNum: this.goodsInfo.cartNum, recipientsNum: this.goodsInfo.cartNum,
templateId: this.templateId, templateId: this.templateId,
message : this.message || '礼笺轻启,礼藏心意', message : this.message || '礼笺轻启,礼藏心意',