小程序产品页面优化,及添加忽略文件

This commit is contained in:
Dev
2026-09-21 16:27:14 +08:00
parent 8591e5e99f
commit bd24456aa3
24 changed files with 513 additions and 768 deletions
+41 -16
View File
@@ -1,6 +1,8 @@
<view class="goods-detail-page">
<view class="goods-head">
<t-swiper wx:if="{{details.images.length > 0}}" height="750rpx" current="{{current}}" autoplay="{{autoplay}}" duration="{{duration}}" interval="{{interval}}" navigation="{{navigation}}" list="{{details.images}}"></t-swiper>
<view class="goods-gallery">
<t-swiper wx:if="{{details.images.length > 0}}" height="750rpx" current="{{current}}" autoplay="{{autoplay}}" duration="{{duration}}" interval="{{interval}}" navigation="{{navigation}}" list="{{details.images}}"></t-swiper>
</view>
<view class="goods-info">
<view class="goods-number">
<view class="goods-price">
@@ -8,8 +10,9 @@
<view class="goods-price-up">起</view>
<price wr-class="class-goods-del" price="{{maxLinePrice}}" type="delthrough" />
</view>
<view class="sold-num">已售{{soldNum}}</view>
<view class="sold-num" wx:if="{{soldNum > 0}}">已售 {{soldNum}}</view>
</view>
<view wx:if="{{activityList.length > 0}}" class="goods-activity" bindtap="showPromotionPopup">
<view class="tags-container">
<view wx:for="{{activityList}}" data-promotionId="{{item.promotionId}}" wx:key="index" wx:if="{{index<4}}">
@@ -21,28 +24,37 @@
<t-icon name="chevron-right" size="42rpx" />
</view>
</view>
<view class="goods-title">
<view class="goods-name">{{details.title}}</view>
<view class="goods-tag">
<t-button open-type="share" t-class="shareBtn" variant="text">
<view class="btn-icon">
<t-icon name="share" size="40rpx" color="#000" />
<t-icon name="share" size="40rpx" color="#4E5969" />
<view class="share-text">分享</view>
</view>
</t-button>
</view>
</view>
<view class="goods-intro">{{intro}}</view>
<view class="goods-service">
<t-icon name="check-circle" size="28rpx" color="#00B578" />
<text class="goods-service__text">3分钟客服响应 · 平台监管售后</text>
</view>
<view class="goods-intro" wx:if="{{details.intro}}">{{details.intro}}</view>
</view>
<view class="spu-select" bindtap="showSkuSelectPopup">
<view class="spu-select" bindtap="onSelectSkuTap">
<view class="label">已选</view>
<view class="content">
<view class="{{!selectedAttrStr ? 'tintColor' : ''}}">
{{selectedAttrStr ? buyNum : ''}}{{selectedAttrStr || '请选择'}}
<view class="content-text {{!selectedAttrStr ? 'tintColor' : ''}}">
{{selectedAttrStr ? buyNum : ''}}{{selectedAttrStr || '请选择规格'}}
</view>
<t-icon name="chevron-right" size="40rpx" color="#BBBBBB" />
</view>
</view>
<view wx:if="{{ commentsStatistics.commentCount > 0 }}" class="comments-wrap">
<view class="comments-head" bindtap="navToCommentsListPage">
<view class="comments-title-wrap">
@@ -66,20 +78,16 @@
</view>
</view>
</view>
<view class="desc-content">
<view class="desc-content__title" wx:if="{{details.desc.length > 0}}">
<t-image t-class="img" src="{{recLeftImg}}" />
<span class="desc-content__title--text">详情介绍</span>
<t-image t-class="img" src="{{recRightImg}}" />
</view>
<!-- <view wx:if="{{details.desc.length > 0}}" wx:for="{{details.desc}}" wx:key="index">
<t-image t-class="desc-content__img" src="{{item}}" mode="widthFix" />
</view> -->
<!-- 视频列表 -->
<view class="video-container">
<block wx:for="{{details.videos}}" wx:key="index">
<view wx:if="{{item}}" class="video-item">
<!-- 视频组件 -->
<video src="{{item}}" enable-play-gesture binderror="onVideoError" class="video-player" />
</view>
</block>
@@ -88,17 +96,34 @@
<rich-text nodes="{{details.desc}}"></rich-text>
</view>
</view>
<view class="goods-bottom-operation">
<buy-bar jumpArray="{{jumpArray}}" soldout="{{soldout}}" isStock="{{isStock}}" shopCartNum="{{cartNum}}" buttonType="{{buttonType}}" bind:toAddCart="toAddCart" bind:toNav="toNav" bind:toBuyNow="buyItNow" class="goods-details-card" />
<buy-bar soldout="{{soldout}}" isStock="{{isStock}}" buttonType="{{buttonType}}" bind:toBuyNow="buyItNow" />
</view>
<goods-specs-popup id="goodsSpecsPopup" show="{{isSpuSelectPopupShow}}" title="{{details.title || ''}}" src="{{specImg ? specImg : primaryImage}}" specList="{{details.specList || []}}" skuList="{{skuArray}}" limitBuyInfo="{{details.limitInfo[0].text || ''}}" bind:closeSpecsPopup="handlePopupHide" bind:change="chooseSpecItem" bind:changeNum="changeNum" bind:addCart="addCart" bind:buyNow="gotoBuy" bind:specsConfirm="specsConfirm" isStock="{{isStock}}" outOperateStatus="{{outOperateStatus}}">
<goods-specs-popup
id="goodsSpecsPopup"
show="{{isSpuSelectPopupShow}}"
title="{{details.title || ''}}"
src="{{specImg ? specImg : primaryImage}}"
specList="{{details.specList || []}}"
skuList="{{skuArray}}"
limitBuyInfo="{{details.limitInfo[0].text || ''}}"
bind:closeSpecsPopup="handlePopupHide"
bind:change="chooseSpecItem"
bind:changeNum="changeNum"
bind:buyNow="gotoBuy"
bind:specsConfirm="specsConfirm"
isStock="{{isStock}}"
outOperateStatus="{{outOperateStatus}}"
>
<view slot="goods-price">
<view class="popup-sku__price">
<price wx:if="{{!isAllSelectedSku || (!promotionSubCode && isAllSelectedSku)}}" price="{{selectSkuSellsPrice ? selectSkuSellsPrice : minSalePrice }}" wr-class="popup-sku__price-num" symbol-class="popup-sku__price-symbol" />
<price wx:if="{{!isAllSelectedSku || (!promotionSubCode && isAllSelectedSku)}}" price="{{selectSkuSellsPrice ? selectSkuSellsPrice : minSalePrice}}" wr-class="popup-sku__price-num" symbol-class="popup-sku__price-symbol" />
<price wx:if="{{selectSkuSellsPrice === 0 && minSalePrice !== maxSalePrice && !isAllSelectedSku}}" price="{{maxSalePrice}}" wr-class="popup-sku__price-del" type="delthrough" />
</view>
</view>
</goods-specs-popup>
<promotion-popup list="{{list}}" bind:closePromotionPopup="closePromotionPopup" show="{{isShowPromotionPop}}" bind:promotionChange="promotionChange" />
</view>
<t-toast id="t-toast" />
<t-toast id="t-toast" />