杂务:整理文档并收口 YumiNail 修复
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const shopApi = require('../../api/shop')
|
||||
const navigation = require('../../utils/navigation')
|
||||
const { resolveImageList } = require('../../utils/file')
|
||||
const theme = require('../../utils/theme')
|
||||
const { getSignedUrl, resolveImageList } = require('../../utils/file')
|
||||
const { DEFAULT_SHOP_IMAGE } = require('../../utils/config')
|
||||
|
||||
/**
|
||||
@@ -8,7 +9,7 @@ const { DEFAULT_SHOP_IMAGE } = require('../../utils/config')
|
||||
* 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: '',
|
||||
shopId: '',
|
||||
@@ -16,7 +17,7 @@ Page({
|
||||
shopInfo: null,
|
||||
distanceText: '',
|
||||
shopImages: []
|
||||
},
|
||||
}),
|
||||
|
||||
/**
|
||||
* `onLoad` page method. Use this from WXML event bindings or lifecycle hooks.
|
||||
@@ -56,6 +57,16 @@ Page({
|
||||
try {
|
||||
const shopInfo = await shopApi.getShopById(this.data.shopId)
|
||||
const shopImages = await resolveImageList(shopInfo.imageFileIds || shopInfo.coverImageFileId, DEFAULT_SHOP_IMAGE)
|
||||
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) {}
|
||||
}
|
||||
this.setData({
|
||||
shopInfo,
|
||||
shopImages,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<navigation-bar title="{{shopInfo ? shopInfo.shopName : '门店详情'}}" showBack="{{true}}" fallbackPath="{{returnTo || '/pages/home/index'}}" color="#ffffff" background="transparent" safeAreaMode="overlay"></navigation-bar>
|
||||
|
||||
<view class="page-shell shop-page">
|
||||
<view class="page-shell shop-page" style="{{themeVars}}">
|
||||
<view class="shop-hero">
|
||||
<image wx:if="{{shopImages.length}}" class="shop-hero-image" src="{{shopImages[0]}}" mode="aspectFill" lazy-load="{{true}}"></image>
|
||||
<view class="shop-hero-mask"></view>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.shop-page {
|
||||
background: linear-gradient(180deg, #f4dbe3 0%, #fff8fa 220rpx, #fffdfc 100%);
|
||||
background: var(--theme-page-bg);
|
||||
}
|
||||
|
||||
.shop-hero {
|
||||
@@ -8,7 +8,7 @@
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 320rpx;
|
||||
background: linear-gradient(135deg, #c6597d 0%, #8d4763 100%);
|
||||
background: var(--theme-gradient);
|
||||
}
|
||||
|
||||
.shop-hero-image {
|
||||
@@ -79,19 +79,22 @@
|
||||
}
|
||||
|
||||
.copy-row {
|
||||
display: flex;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 16rpx;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
|
||||
.map-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 16rpx;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.copy-row .ghost-btn,
|
||||
.map-btn {
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -105,5 +108,5 @@
|
||||
width: calc(50% - 9rpx);
|
||||
height: 240rpx;
|
||||
border-radius: 24rpx;
|
||||
background: #f6edf1;
|
||||
background: var(--theme-primary-soft);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user