v3.5.4 规格主图、门店使用规则与收银台 logo
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,10 +16,10 @@ import {
|
||||
saveWechatLoginResult,
|
||||
} from '../../lib/pay-wechat';
|
||||
import { applyWechatLoginResult } from '../../lib/wechat-auth';
|
||||
import { getBrandAssetsSync, loadBrandAssets } from '../../lib/brand-assets';
|
||||
import { isWechatEnv } from '../../lib/weixin';
|
||||
import { goLogin } from '../../lib/auth-nav';
|
||||
import { request, toast } from '../../lib/api';
|
||||
import payLogo from '../../assets/logo2.png';
|
||||
|
||||
export default function PayPage() {
|
||||
const router = useRouter();
|
||||
@@ -31,7 +31,6 @@ export default function PayPage() {
|
||||
const [orderNo, setOrderNo] = useState('');
|
||||
const [payAmount, setPayAmount] = useState('—');
|
||||
const [deliveryType, setDeliveryType] = useState('');
|
||||
const [brandMarkUrl, setBrandMarkUrl] = useState(() => getBrandAssetsSync().brandLogoMarkUrl);
|
||||
|
||||
const returnPath = orderId
|
||||
? `/pages/pay/index?orderId=${orderId}`
|
||||
@@ -51,10 +50,6 @@ export default function PayPage() {
|
||||
void refreshPayReadiness();
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
void loadBrandAssets().then((brand) => setBrandMarkUrl(brand.brandLogoMarkUrl));
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!orderId) return;
|
||||
if (process.env.TARO_ENV === 'weapp') {
|
||||
@@ -178,7 +173,7 @@ export default function PayPage() {
|
||||
<View className="sub-page-body">
|
||||
<View className="pay-status">
|
||||
<View className="pay-status-icon">
|
||||
<Image className="pay-status-brand" src={brandMarkUrl} mode="aspectFit" />
|
||||
<Image className="pay-status-brand" src={payLogo} mode="aspectFit" />
|
||||
</View>
|
||||
<Text className="pay-status-title">
|
||||
{needsWechatAuth ? '需完成微信授权' : '待支付'}
|
||||
|
||||
@@ -165,6 +165,12 @@ export default function ProductDetailPage() {
|
||||
allowOnSitePickup: activeSku.allowOnSitePickup,
|
||||
}
|
||||
: product;
|
||||
const carouselImages = (() => {
|
||||
const base = getProductCarouselImages(product);
|
||||
const skuImg = activeSku?.imageUrl?.trim();
|
||||
if (!skuImg) return base;
|
||||
return [skuImg, ...base.filter((url) => url !== skuImg)];
|
||||
})();
|
||||
|
||||
const sharePayload = useMemo(
|
||||
() =>
|
||||
@@ -172,9 +178,9 @@ export default function ProductDetailPage() {
|
||||
path: `/pages/product-detail/index?id=${productId}`,
|
||||
dynamicTitle: product?.name,
|
||||
dynamicDesc: product?.subtitle,
|
||||
dynamicImageUrl: product ? getProductMainImage(product) : undefined,
|
||||
dynamicImageUrl: (activeSku?.imageUrl?.trim() || (product ? getProductMainImage(product) : undefined)),
|
||||
}),
|
||||
[product, productId],
|
||||
[product, productId, activeSku],
|
||||
);
|
||||
|
||||
useShareAppMessage(() => toWeappShareMessage(sharePayload));
|
||||
@@ -249,7 +255,6 @@ export default function ProductDetailPage() {
|
||||
|
||||
const allowOnline = canBuyOnline(fulfillment ?? {});
|
||||
const allowOnSite = canPickupOnSite(fulfillment ?? {});
|
||||
const carouselImages = getProductCarouselImages(product);
|
||||
const detailImages = getProductDetailImages(product);
|
||||
const detail = product.detailContent ?? {};
|
||||
const features = detail.features ?? [];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { View, Text, Image } from '@tarojs/components';
|
||||
import { View, Text, Image, ScrollView } from '@tarojs/components';
|
||||
import '../../styles/store-detail.css';
|
||||
import Taro, {
|
||||
useDidShow,
|
||||
@@ -444,17 +444,19 @@ export default function StoreDetailPage() {
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{intro ? (
|
||||
{benefitRule ? (
|
||||
<View className="store-detail-section">
|
||||
<Text className="store-detail-section-title">门店详情</Text>
|
||||
<Text className="store-detail-intro">{intro}</Text>
|
||||
<Text className="store-detail-section-title store-detail-section-title--rule">使用规则</Text>
|
||||
<Text className="store-detail-intro">{benefitRule}</Text>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{benefitRule ? (
|
||||
{intro ? (
|
||||
<View className="store-detail-section">
|
||||
<Text className="store-detail-section-title">好客权益使用规则</Text>
|
||||
<Text className="store-detail-intro">{benefitRule}</Text>
|
||||
<Text className="store-detail-section-title">门店详情</Text>
|
||||
<ScrollView className="store-detail-intro-scroll" scrollY showScrollbar>
|
||||
<Text className="store-detail-intro">{intro}</Text>
|
||||
</ScrollView>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user