forked from gxwebsoft/mp-10550
refactor(share): 更新分享标题和内容
- 将"云上商店"改为"网宿小店"作为分享标题的一部分 -优化商品详情页的分享逻辑- 调整订单确认页的样式 - 移除购物车页面的冗余代码
This commit is contained in:
@@ -28,13 +28,13 @@ function Cart() {
|
|||||||
|
|
||||||
useShareTimeline(() => {
|
useShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
title: '购物车 - 云上商店'
|
title: '购物车 - 网宿小店'
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return {
|
return {
|
||||||
title: '购物车 - 云上商店',
|
title: '购物车 - 网宿小店',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log('分享成功', res);
|
console.log('分享成功', res);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const BestSellers = () => {
|
|||||||
// 分享到朋友圈
|
// 分享到朋友圈
|
||||||
useShareTimeline(() => {
|
useShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
title: `${goods?.name || '精选商品'} - 云上商店`,
|
title: `${goods?.name || '精选商品'} - 网宿小店`,
|
||||||
path: `/shop/goodsDetail/index?id=${goods?.goodsId}`,
|
path: `/shop/goodsDetail/index?id=${goods?.goodsId}`,
|
||||||
imageUrl: goods?.image
|
imageUrl: goods?.image
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ function Home() {
|
|||||||
|
|
||||||
useShareTimeline(() => {
|
useShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
title: '云上商店 - 网宿软件',
|
title: '网宿小店 - 网宿软件',
|
||||||
path: `/pages/index/index`
|
path: `/pages/index/index`
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return {
|
return {
|
||||||
title: '云上商店 - 网宿软件',
|
title: '网宿小店 - 网宿软件',
|
||||||
path: `/pages/index/index`,
|
path: `/pages/index/index`,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log('分享成功', res);
|
console.log('分享成功', res);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const GoodsDetail = () => {
|
|||||||
const [skus, setSkus] = useState<ShopGoodsSku[]>([]);
|
const [skus, setSkus] = useState<ShopGoodsSku[]>([]);
|
||||||
const [showSpecSelector, setShowSpecSelector] = useState(false);
|
const [showSpecSelector, setShowSpecSelector] = useState(false);
|
||||||
const [specAction, setSpecAction] = useState<'cart' | 'buy'>('cart');
|
const [specAction, setSpecAction] = useState<'cart' | 'buy'>('cart');
|
||||||
const [selectedSku, setSelectedSku] = useState<ShopGoodsSku | null>(null);
|
// const [selectedSku, setSelectedSku] = useState<ShopGoodsSku | null>(null);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const router = Taro.getCurrentInstance().router;
|
const router = Taro.getCurrentInstance().router;
|
||||||
const goodsId = router?.params?.id;
|
const goodsId = router?.params?.id;
|
||||||
@@ -83,7 +83,7 @@ const GoodsDetail = () => {
|
|||||||
|
|
||||||
// 规格选择确认回调
|
// 规格选择确认回调
|
||||||
const handleSpecConfirm = (sku: ShopGoodsSku, quantity: number, action: 'cart' | 'buy') => {
|
const handleSpecConfirm = (sku: ShopGoodsSku, quantity: number, action: 'cart' | 'buy') => {
|
||||||
setSelectedSku(sku);
|
// setSelectedSku(sku);
|
||||||
setShowSpecSelector(false);
|
setShowSpecSelector(false);
|
||||||
|
|
||||||
if (action === 'cart') {
|
if (action === 'cart') {
|
||||||
@@ -180,7 +180,7 @@ const GoodsDetail = () => {
|
|||||||
// 分享到朋友圈
|
// 分享到朋友圈
|
||||||
useShareTimeline(() => {
|
useShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
title: `${goods?.name || '精选商品'} - 云上商店`,
|
title: `${goods?.name || '精选商品'} - 网宿小店`,
|
||||||
path: `/shop/goodsDetail/index?id=${goodsId}`,
|
path: `/shop/goodsDetail/index?id=${goodsId}`,
|
||||||
imageUrl: goods?.image
|
imageUrl: goods?.image
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,8 +35,7 @@ const OrderConfirm = () => {
|
|||||||
setPayments(paymentList?.map((d, _) => {
|
setPayments(paymentList?.map((d, _) => {
|
||||||
return {
|
return {
|
||||||
type: d.type,
|
type: d.type,
|
||||||
name: d.name,
|
name: d.name
|
||||||
description: d.comments
|
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
setPayment(paymentList[0])
|
setPayment(paymentList[0])
|
||||||
@@ -114,12 +113,13 @@ const OrderConfirm = () => {
|
|||||||
address && (
|
address && (
|
||||||
<Cell className={'address-bottom-line'} onClick={() => Taro.navigateTo({url: '/user/address/index'})}>
|
<Cell className={'address-bottom-line'} onClick={() => Taro.navigateTo({url: '/user/address/index'})}>
|
||||||
<Space>
|
<Space>
|
||||||
<Location/>
|
<Location className={'text-gray-500'}/>
|
||||||
<View className={'flex flex-col w-full justify-between items-start'}>
|
<View className={'flex flex-col w-full justify-between items-start'}>
|
||||||
<Space className={'flex flex-row w-full font-medium'}>
|
<Space className={'flex flex-row w-full'}>
|
||||||
<View className={'flex-wrap text-nowrap whitespace-nowrap'}>送至</View>
|
<View className={'flex-wrap text-nowrap whitespace-nowrap text-gray-500'}>送至</View>
|
||||||
<View style={{width: '64%'}}
|
<View className={'font-medium text-sm flex items-center w-full'}>
|
||||||
className={'line-clamp-1 relative'}>{address.province} {address.city} {address.region} {address.address}
|
<View style={{width: '64%'}}>{address.province} {address.city} {address.region} {address.address}</View>
|
||||||
|
<ArrowRight className={'text-gray-500'} size={14} />
|
||||||
</View>
|
</View>
|
||||||
</Space>
|
</Space>
|
||||||
<View className={'pt-1 pb-3 text-gray-500'}>{address.name} {address.phone}</View>
|
<View className={'pt-1 pb-3 text-gray-500'}>{address.name} {address.phone}</View>
|
||||||
@@ -159,12 +159,12 @@ const OrderConfirm = () => {
|
|||||||
|
|
||||||
<CellGroup>
|
<CellGroup>
|
||||||
<Cell title={`商品总价(共1件)`} extra={<View className={'font-medium'}>{'¥' + goods.price}</View>}/>
|
<Cell title={`商品总价(共1件)`} extra={<View className={'font-medium'}>{'¥' + goods.price}</View>}/>
|
||||||
{/*<Cell title={'优惠券'} extra={(*/}
|
<Cell title={'优惠券'} extra={(
|
||||||
{/* <View className={'flex justify-between items-center'}>*/}
|
<View className={'flex justify-between items-center'}>
|
||||||
{/* <View className={'text-red-500 text-sm mr-1'}>-¥0.00</View>*/}
|
<View className={'text-red-500 text-sm mr-1'}>-¥0.00</View>
|
||||||
{/* <ArrowRight className={'text-gray-400'} size={14}/>*/}
|
<ArrowRight className={'text-gray-400'} size={14}/>
|
||||||
{/* </View>*/}
|
</View>
|
||||||
{/*)}/>*/}
|
)}/>
|
||||||
{/*<Cell title={'配送费'} extra={'¥' + 10}/>*/}
|
{/*<Cell title={'配送费'} extra={'¥' + 10}/>*/}
|
||||||
<Cell title={'订单备注'} extra={(
|
<Cell title={'订单备注'} extra={(
|
||||||
<Input placeholder={'选填,请先和商家协商一致'} style={{padding: '0'}}/>
|
<Input placeholder={'选填,请先和商家协商一致'} style={{padding: '0'}}/>
|
||||||
|
|||||||
Reference in New Issue
Block a user