杂务:整理文档并收口 YumiNail 修复
This commit is contained in:
@@ -7,7 +7,8 @@ const wishlistApi = require('../../api/wishlist')
|
||||
const actionGuard = require('../../utils/action-guard')
|
||||
const auth = require('../../utils/auth')
|
||||
const navigation = require('../../utils/navigation')
|
||||
const { resolveImageList } = require('../../utils/file')
|
||||
const theme = require('../../utils/theme')
|
||||
const { getSignedUrl, resolveImageList } = require('../../utils/file')
|
||||
const { DEFAULT_PRODUCT_IMAGE } = require('../../utils/config')
|
||||
const { formatPrice, getProductTitle, splitCsv } = require('../../utils/format')
|
||||
const { runWithLoading } = require('../../utils/loading')
|
||||
@@ -83,7 +84,7 @@ function estimateEarliestBookable(businessHours) {
|
||||
* Call guide: page data drives the WXML template, and each method is called by user events or lifecycle callbacks.
|
||||
*/
|
||||
Page({
|
||||
data: {
|
||||
data: Object.assign(theme.pageThemeData(getApp().globalData.shopTheme), {
|
||||
loading: true,
|
||||
loadError: '',
|
||||
productId: '',
|
||||
@@ -97,7 +98,7 @@ Page({
|
||||
isLiked: false,
|
||||
artistCountText: '门店安排',
|
||||
earliestBookableText: '以门店安排为准'
|
||||
},
|
||||
}),
|
||||
|
||||
/**
|
||||
* `onLoad` page method. Use this from WXML event bindings or lifecycle hooks.
|
||||
@@ -139,6 +140,18 @@ Page({
|
||||
const product = await productApi.getProductById(productId)
|
||||
const productImages = await resolveImageList(product.imageFileIds, DEFAULT_PRODUCT_IMAGE)
|
||||
const shopInfo = product.shopId ? await shopApi.getShopById(product.shopId) : null
|
||||
if (shopInfo) {
|
||||
const shopTheme = theme.resolveShopTheme(shopInfo)
|
||||
this.setData(theme.pageThemeData(shopTheme))
|
||||
if (shopTheme.backgroundImageFileId) {
|
||||
try {
|
||||
const backgroundImageUrl = await getSignedUrl(shopTheme.backgroundImageFileId)
|
||||
if (backgroundImageUrl) {
|
||||
this.setData(theme.pageThemeData(shopTheme, backgroundImageUrl))
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
}
|
||||
const artistCount = typeof product.availableBookableArtistCount === 'number'
|
||||
? product.availableBookableArtistCount
|
||||
: splitCsv(product.bookableArtists).length
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<navigation-bar title="{{product ? product.displayTitle : '作品详情'}}" showBack="{{true}}" fallbackPath="/pages/products/index" color="#2d2430" background="#fff7f8"></navigation-bar>
|
||||
<navigation-bar title="{{product ? product.displayTitle : '作品详情'}}" showBack="{{true}}" fallbackPath="/pages/products/index" color="#2d2430" background="{{navThemeBackground || '#FFF7F9'}}"></navigation-bar>
|
||||
|
||||
<view class="page-shell detail-page">
|
||||
<view class="page-shell detail-page" style="{{themeVars}}">
|
||||
<view wx:if="{{loadError}}" class="page-content">
|
||||
<view class="page-card empty-card">
|
||||
<text class="empty-title">暂时无法查看作品详情</text>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
.detail-page {
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 160rpx);
|
||||
background: var(--theme-page-bg);
|
||||
}
|
||||
|
||||
.media-box {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: 0 0 40rpx 40rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
}
|
||||
|
||||
.media-swiper,
|
||||
@@ -51,7 +53,7 @@
|
||||
margin-top: 12rpx;
|
||||
font-size: 38rpx;
|
||||
font-weight: 700;
|
||||
color: #d5536f;
|
||||
color: var(--theme-accent);
|
||||
}
|
||||
|
||||
.product-brief {
|
||||
@@ -74,7 +76,7 @@
|
||||
margin-top: 28rpx;
|
||||
padding: 24rpx;
|
||||
border-radius: 24rpx;
|
||||
background: linear-gradient(135deg, #fff8fa 0%, #fff1f5 100%);
|
||||
background: var(--theme-gradient-soft);
|
||||
}
|
||||
|
||||
.shop-box-head {
|
||||
@@ -92,7 +94,7 @@
|
||||
|
||||
.shop-link {
|
||||
font-size: 24rpx;
|
||||
color: #c6597d;
|
||||
color: var(--theme-primary);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@@ -117,15 +119,15 @@
|
||||
height: 68rpx;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #fbf5f7;
|
||||
color: #7a5262;
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-accent);
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.action-pill.active {
|
||||
background: #fde8ef;
|
||||
color: #c6597d;
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-primary);
|
||||
}
|
||||
|
||||
.tags-wrap {
|
||||
@@ -141,8 +143,8 @@
|
||||
justify-content: center;
|
||||
padding: 10rpx 18rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #fbecf1;
|
||||
color: #c6597d;
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-primary);
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
@@ -181,7 +183,7 @@
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #fff8fa;
|
||||
background: var(--theme-primary-soft);
|
||||
}
|
||||
|
||||
.comment-input {
|
||||
@@ -201,7 +203,7 @@
|
||||
.comment-submit,
|
||||
.comment-reply-btn {
|
||||
font-size: 24rpx;
|
||||
color: #c6597d;
|
||||
color: var(--theme-primary);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@@ -212,7 +214,7 @@
|
||||
text-align: center;
|
||||
border-radius: 999rpx;
|
||||
color: #ffffff;
|
||||
background: #c6597d;
|
||||
background: var(--theme-primary);
|
||||
}
|
||||
|
||||
.comment-empty {
|
||||
@@ -252,7 +254,7 @@
|
||||
margin-top: 14rpx;
|
||||
padding: 16rpx;
|
||||
border-radius: 18rpx;
|
||||
background: #faf4f6;
|
||||
background: var(--theme-primary-soft);
|
||||
}
|
||||
|
||||
.reply-item {
|
||||
@@ -293,11 +295,11 @@
|
||||
}
|
||||
|
||||
.footer-btn.secondary {
|
||||
background: #fbf5f7;
|
||||
color: #7a5262;
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-accent);
|
||||
}
|
||||
|
||||
.footer-btn.primary {
|
||||
background: linear-gradient(135deg, #ff8cb0 0%, #c6597d 100%);
|
||||
background: var(--theme-gradient);
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user