@@ -16,6 +16,7 @@ import ShareNavButton from '../../components/ShareNavButton';
|
||||
import StoreRedeemMarquee from '../../components/StoreRedeemMarquee';
|
||||
import WechatShareReady from '../../components/WechatShareReady';
|
||||
import { request, toast } from '../../lib/api';
|
||||
import { toMoneyNumber } from '../../lib/money';
|
||||
import { maskPhone, toDialablePhone } from '../../lib/phone';
|
||||
import { track } from '../../lib/analytics';
|
||||
import { formatShanghaiDateTime } from '../../lib/datetime';
|
||||
@@ -116,9 +117,8 @@ function formatPackagePriceYuan(price: string | number) {
|
||||
return n.toFixed(2).replace(/\.?0+$/, '');
|
||||
}
|
||||
|
||||
function formatRedeemAmountYuan(amount: number | string) {
|
||||
const n = typeof amount === 'number' ? amount : Number(amount);
|
||||
if (!Number.isFinite(n)) return '0';
|
||||
function formatRedeemAmountYuan(amount: unknown) {
|
||||
const n = toMoneyNumber(amount);
|
||||
if (Math.abs(n - Math.round(n)) < 1e-9) return String(Math.round(n));
|
||||
return n.toFixed(2).replace(/\.?0+$/, '');
|
||||
}
|
||||
@@ -323,6 +323,8 @@ export default function StoreDetailPage() {
|
||||
|
||||
const envPhotos = envPhotoUrls(store);
|
||||
const heroImages = uniqueUrls([store.coverUrl, ...(store.carouselUrls || [])]);
|
||||
/** 预览相册:封面 + 环境图(去重),页面展示仍分开 */
|
||||
const previewAlbum = uniqueUrls([store.coverUrl, ...envPhotos]);
|
||||
const packages = store.packages ?? [];
|
||||
|
||||
const intro = store.intro?.trim() || '';
|
||||
@@ -337,10 +339,12 @@ export default function StoreDetailPage() {
|
||||
}
|
||||
|
||||
function previewEnv(index: number) {
|
||||
if (!envPhotos.length) return;
|
||||
const current = envPhotos[index];
|
||||
if (!current) return;
|
||||
const urls = previewAlbum.length ? previewAlbum : envPhotos;
|
||||
Taro.previewImage({
|
||||
current: envPhotos[index],
|
||||
urls: envPhotos,
|
||||
current,
|
||||
urls,
|
||||
}).catch(() => toast('无法预览图片'));
|
||||
}
|
||||
|
||||
@@ -362,6 +366,7 @@ export default function StoreDetailPage() {
|
||||
variant="store"
|
||||
previewable
|
||||
imageFit="contain"
|
||||
previewUrls={previewAlbum}
|
||||
/>
|
||||
</View>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user