功能(小程序):同步用户体验流程到小程序
This commit is contained in:
@@ -52,6 +52,7 @@ const { getSignedUrl, resolveImageList, previewImagesSafely } = require('../../u
|
||||
const { DEFAULT_PRODUCT_IMAGE } = require('../../utils/config')
|
||||
const { formatPrice, getProductTitle, splitCsv } = require('../../utils/format')
|
||||
const { runWithLoading } = require('../../utils/loading')
|
||||
const { saveBuyNowContext } = require('../../utils/buy-now')
|
||||
|
||||
/**
|
||||
* Purpose: parseTimeRange supports index.js by holding or executing the parse time range page or API role.
|
||||
@@ -208,7 +209,9 @@ Page({
|
||||
...product,
|
||||
displayTitle: getProductTitle(product),
|
||||
priceText: `¥${formatPrice(product.price)}`,
|
||||
descriptionText: product.description || '商家还没有补充作品说明。'
|
||||
descriptionText: product.description || '商家还没有补充作品说明。',
|
||||
targetAudienceText: product.targetAudience || '',
|
||||
precautionsText: product.precautions || ''
|
||||
}
|
||||
|
||||
this.setData({
|
||||
@@ -303,7 +306,10 @@ Page({
|
||||
return
|
||||
}
|
||||
|
||||
previewImagesSafely(current, this.data.productImages)
|
||||
previewImagesSafely(current, this.data.productImages, {
|
||||
failMessage: '图片可能已过期,请重试;仍失败时可以返回作品列表重新进入。',
|
||||
emptyMessage: '这件作品暂时没有可预览图片,可以返回作品列表查看其他款式。'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -488,6 +494,7 @@ Page({
|
||||
message: '操作进行中,请勿重复点击'
|
||||
})
|
||||
await getApp().updateCartBadge()
|
||||
saveBuyNowContext(product.id)
|
||||
wx.switchTab({
|
||||
url: '/pages/cart/index'
|
||||
})
|
||||
|
||||
@@ -79,6 +79,16 @@
|
||||
<view class="section-title">款式说明</view>
|
||||
<view class="desc-text">{{product.descriptionText}}</view>
|
||||
</view>
|
||||
<view wx:if="{{product.targetAudienceText || product.precautionsText}}" class="guidance-grid">
|
||||
<view wx:if="{{product.targetAudienceText}}" class="guidance-block">
|
||||
<view class="section-title">适合人群</view>
|
||||
<view class="desc-text">{{product.targetAudienceText}}</view>
|
||||
</view>
|
||||
<view wx:if="{{product.precautionsText}}" class="guidance-block">
|
||||
<view class="section-title">注意事项</view>
|
||||
<view class="desc-text">{{product.precautionsText}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-card comment-card">
|
||||
|
||||
@@ -164,6 +164,19 @@
|
||||
font-size: 26rpx;
|
||||
line-height: 1.8;
|
||||
color: #5d4b55;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.guidance-grid {
|
||||
display: grid;
|
||||
gap: 18rpx;
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
|
||||
.guidance-block {
|
||||
padding: 22rpx;
|
||||
border-radius: 22rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
}
|
||||
|
||||
.comment-card {
|
||||
|
||||
Reference in New Issue
Block a user