From 20984811d7e1015bee7d8347d75418119891b6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 11 Aug 2025 16:11:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(share):=20=E6=9B=B4=E6=96=B0=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E6=A0=87=E9=A2=98=E5=92=8C=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将"云上商店"改为"网宿小店"作为分享标题的一部分 -优化商品详情页的分享逻辑- 调整订单确认页的样式 - 移除购物车页面的冗余代码 --- src/pages/cart/cart.tsx | 4 ++-- src/pages/index/BestSellers.tsx | 2 +- src/pages/index/index.tsx | 4 ++-- src/shop/goodsDetail/index.tsx | 6 +++--- src/shop/orderConfirm/index.tsx | 26 +++++++++++++------------- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/pages/cart/cart.tsx b/src/pages/cart/cart.tsx index 6d01e58..eccd816 100644 --- a/src/pages/cart/cart.tsx +++ b/src/pages/cart/cart.tsx @@ -28,13 +28,13 @@ function Cart() { useShareTimeline(() => { return { - title: '购物车 - 云上商店' + title: '购物车 - 网宿小店' }; }); useShareAppMessage(() => { return { - title: '购物车 - 云上商店', + title: '购物车 - 网宿小店', success: function (res) { console.log('分享成功', res); }, diff --git a/src/pages/index/BestSellers.tsx b/src/pages/index/BestSellers.tsx index 4e7839a..5ba552a 100644 --- a/src/pages/index/BestSellers.tsx +++ b/src/pages/index/BestSellers.tsx @@ -49,7 +49,7 @@ const BestSellers = () => { // 分享到朋友圈 useShareTimeline(() => { return { - title: `${goods?.name || '精选商品'} - 云上商店`, + title: `${goods?.name || '精选商品'} - 网宿小店`, path: `/shop/goodsDetail/index?id=${goods?.goodsId}`, imageUrl: goods?.image }; diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 4bfaca3..bb5d525 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -17,14 +17,14 @@ function Home() { useShareTimeline(() => { return { - title: '云上商店 - 网宿软件', + title: '网宿小店 - 网宿软件', path: `/pages/index/index` }; }); useShareAppMessage(() => { return { - title: '云上商店 - 网宿软件', + title: '网宿小店 - 网宿软件', path: `/pages/index/index`, success: function (res) { console.log('分享成功', res); diff --git a/src/shop/goodsDetail/index.tsx b/src/shop/goodsDetail/index.tsx index a4b0e9f..b5f4f35 100644 --- a/src/shop/goodsDetail/index.tsx +++ b/src/shop/goodsDetail/index.tsx @@ -22,7 +22,7 @@ const GoodsDetail = () => { const [skus, setSkus] = useState([]); const [showSpecSelector, setShowSpecSelector] = useState(false); const [specAction, setSpecAction] = useState<'cart' | 'buy'>('cart'); - const [selectedSku, setSelectedSku] = useState(null); + // const [selectedSku, setSelectedSku] = useState(null); const [loading, setLoading] = useState(false); const router = Taro.getCurrentInstance().router; const goodsId = router?.params?.id; @@ -83,7 +83,7 @@ const GoodsDetail = () => { // 规格选择确认回调 const handleSpecConfirm = (sku: ShopGoodsSku, quantity: number, action: 'cart' | 'buy') => { - setSelectedSku(sku); + // setSelectedSku(sku); setShowSpecSelector(false); if (action === 'cart') { @@ -180,7 +180,7 @@ const GoodsDetail = () => { // 分享到朋友圈 useShareTimeline(() => { return { - title: `${goods?.name || '精选商品'} - 云上商店`, + title: `${goods?.name || '精选商品'} - 网宿小店`, path: `/shop/goodsDetail/index?id=${goodsId}`, imageUrl: goods?.image }; diff --git a/src/shop/orderConfirm/index.tsx b/src/shop/orderConfirm/index.tsx index cc66fed..7d5ed79 100644 --- a/src/shop/orderConfirm/index.tsx +++ b/src/shop/orderConfirm/index.tsx @@ -35,8 +35,7 @@ const OrderConfirm = () => { setPayments(paymentList?.map((d, _) => { return { type: d.type, - name: d.name, - description: d.comments + name: d.name } })) setPayment(paymentList[0]) @@ -114,12 +113,13 @@ const OrderConfirm = () => { address && ( Taro.navigateTo({url: '/user/address/index'})}> - + - - 送至 - {address.province} {address.city} {address.region} {address.address} + + 送至 + + {address.province} {address.city} {address.region} {address.address} + {address.name} {address.phone} @@ -159,12 +159,12 @@ const OrderConfirm = () => { {'¥' + goods.price}}/> - {/**/} - {/* -¥0.00*/} - {/* */} - {/* */} - {/*)}/>*/} + + -¥0.00 + + + )}/> {/**/}