forked from gxwebsoft/mp-10550
feat(shop): 更新商品价格显示及订单状态逻辑
- 修改商品列表和详情页价格展示,增加会员价和原价显示 - 调整订单确认收货状态值从30改为20 - 恢复订单列表中查看物流按钮功能 - 更新二维码接口域名地址 - 统一使用Taro组件替换部分原生HTML标签
This commit is contained in:
@@ -81,7 +81,7 @@ const SimpleQRCodeModal: React.FC<SimpleQRCodeModalProps> = ({
|
|||||||
{qrContent ? (
|
{qrContent ? (
|
||||||
<View className={'flex flex-col justify-center'}>
|
<View className={'flex flex-col justify-center'}>
|
||||||
<img
|
<img
|
||||||
src={`https://cms-api.websoft.top/api/qr-code/create-encrypted-qr-image?size=300x300&expireMinutes=60&businessType=gift&data=${encodeURIComponent(qrContent)}`}
|
src={`https://mp-api.websoft.top/api/qr-code/create-encrypted-qr-image?size=300x300&expireMinutes=60&businessType=gift&data=${encodeURIComponent(qrContent)}`}
|
||||||
alt="二维码"
|
alt="二维码"
|
||||||
style={{width: '200px', height: '200px'}}
|
style={{width: '200px', height: '200px'}}
|
||||||
className="mx-auto"
|
className="mx-auto"
|
||||||
|
|||||||
@@ -124,6 +124,8 @@ const BestSellers = (props: {onStickyChange?: (isSticky: boolean) => void}) => {
|
|||||||
<View className={'flex text-red-500 text-xl items-baseline'}>
|
<View className={'flex text-red-500 text-xl items-baseline'}>
|
||||||
<Text className={'text-xs'}>¥</Text>
|
<Text className={'text-xs'}>¥</Text>
|
||||||
<Text className={'font-bold text-2xl'}>{item.price}</Text>
|
<Text className={'font-bold text-2xl'}>{item.price}</Text>
|
||||||
|
<Text className={'text-xs px-1'}>会员价</Text>
|
||||||
|
<Text className={'text-xs text-gray-400 line-through'}>¥{item.salePrice}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View className={'buy-btn'}>
|
<View className={'buy-btn'}>
|
||||||
<View className={'cart-icon items-center hidden'}>
|
<View className={'cart-icon items-center hidden'}>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import {Image} from '@nutui/nutui-react-taro'
|
import {Image} from '@nutui/nutui-react-taro'
|
||||||
import {Share} from '@nutui/icons-react-taro'
|
import {Share} from '@nutui/icons-react-taro'
|
||||||
|
import {View, Text} from '@tarojs/components'
|
||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
import './GoodsList.scss'
|
import './GoodsList.scss'
|
||||||
|
|
||||||
@@ -8,43 +9,45 @@ const GoodsList = (props: any) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={'py-3'}>
|
<View className={'py-3'}>
|
||||||
<div className={'flex flex-col justify-between items-center rounded-lg px-2'}>
|
<View className={'flex flex-col justify-between items-center rounded-lg px-2'}>
|
||||||
{props.data?.map((item, index) => {
|
{props.data?.map((item: any, index: number) => {
|
||||||
return (
|
return (
|
||||||
<div key={index} className={'flex flex-col rounded-lg bg-white shadow-sm w-full mb-5'}>
|
<View key={index} className={'flex flex-col rounded-lg bg-white shadow-sm w-full mb-5'}>
|
||||||
<Image src={item.image} mode={'aspectFit'} lazyLoad={false}
|
<Image src={item.image} mode={'aspectFit'} lazyLoad={false}
|
||||||
radius="10px 10px 0 0" height="180"
|
radius="10px 10px 0 0" height="180"
|
||||||
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/>
|
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/>
|
||||||
<div className={'flex flex-col p-2 rounded-lg'}>
|
<View className={'flex flex-col p-2 rounded-lg'}>
|
||||||
<div>
|
<View>
|
||||||
<div className={'car-no text-sm'}>{item.name}</div>
|
<View className={'car-no text-sm'}>{item.name}</View>
|
||||||
<div className={'flex justify-between text-xs py-1'}>
|
<View className={'flex justify-between text-xs py-1'}>
|
||||||
<span className={'text-orange-500'}>{item.comments}</span>
|
<Text className={'text-orange-500'}>{item.comments}</Text>
|
||||||
<span className={'text-gray-400'}>已售 {item.sales}</span>
|
<Text className={'text-gray-400'}>已售 {item.sales}</Text>
|
||||||
</div>
|
</View>
|
||||||
<div className={'flex justify-between items-center py-2'}>
|
<View className={'flex justify-between items-center py-2'}>
|
||||||
<div className={'flex text-red-500 text-xl items-baseline'}>
|
<View className={'flex text-red-500 text-xl items-baseline'}>
|
||||||
<span className={'text-xs'}>¥</span>
|
<Text className={'text-xs'}>¥</Text>
|
||||||
<span className={'font-bold text-2xl'}>{item.price}</span>
|
<Text className={'font-bold text-2xl'}>{item.price}</Text>
|
||||||
</div>
|
<Text className={'text-xs px-1'}>会员价</Text>
|
||||||
<div className={'buy-btn'}>
|
<Text className={'text-xs text-gray-400 line-through'}>¥{item.salePrice}</Text>
|
||||||
<div className={'cart-icon'}>
|
</View>
|
||||||
|
<View className={'buy-btn'}>
|
||||||
|
<View className={'cart-icon'}>
|
||||||
<Share size={20} className={'mx-4 mt-2'}
|
<Share size={20} className={'mx-4 mt-2'}
|
||||||
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/>
|
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/>
|
||||||
</div>
|
</View>
|
||||||
<div className={'text-white pl-4 pr-5'}
|
<View className={'text-white pl-4 pr-5'}
|
||||||
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}>购买
|
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}>购买
|
||||||
</div>
|
</View>
|
||||||
</div>
|
</View>
|
||||||
</div>
|
</View>
|
||||||
</div>
|
</View>
|
||||||
</div>
|
</View>
|
||||||
</div>
|
</View>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</View>
|
||||||
</div>
|
</View>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,8 +280,10 @@ const GoodsDetail = () => {
|
|||||||
<>
|
<>
|
||||||
<View className={'flex justify-between'}>
|
<View className={'flex justify-between'}>
|
||||||
<View className={'flex text-red-500 text-xl items-baseline'}>
|
<View className={'flex text-red-500 text-xl items-baseline'}>
|
||||||
<span className={'text-xs'}>¥</span>
|
<Text className={'text-xs'}>¥</Text>
|
||||||
<span className={'font-bold text-2xl'}>{goods.price}</span>
|
<Text className={'font-bold text-2xl'}>{goods.price}</Text>
|
||||||
|
<Text className={'text-xs px-1'}>会员价</Text>
|
||||||
|
<Text className={'text-xs text-gray-400 line-through'}>¥{goods.salePrice}</Text>
|
||||||
</View>
|
</View>
|
||||||
<span className={"text-gray-400 text-xs"}>已售 {goods.sales}</span>
|
<span className={"text-gray-400 text-xs"}>已售 {goods.sales}</span>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ function OrderList(props: OrderListProps) {
|
|||||||
|
|
||||||
await updateShopOrder({
|
await updateShopOrder({
|
||||||
...orderToConfirmReceive,
|
...orderToConfirmReceive,
|
||||||
deliveryStatus: 30, // 已收货
|
deliveryStatus: 20, // 已收货
|
||||||
orderStatus: 1 // 已完成
|
orderStatus: 1 // 已完成
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -748,10 +748,10 @@ function OrderList(props: OrderListProps) {
|
|||||||
{/* 待收货状态:显示查看物流和确认收货 */}
|
{/* 待收货状态:显示查看物流和确认收货 */}
|
||||||
{item.deliveryStatus === 20 && item.orderStatus !== 2 && (
|
{item.deliveryStatus === 20 && item.orderStatus !== 2 && (
|
||||||
<Space>
|
<Space>
|
||||||
{/*<Button size={'small'} onClick={(e) => {*/}
|
<Button size={'small'} onClick={(e) => {
|
||||||
{/* e.stopPropagation();*/}
|
e.stopPropagation();
|
||||||
{/* viewLogistics(item);*/}
|
viewLogistics(item);
|
||||||
{/*}}>查看物流</Button>*/}
|
}}>查看物流</Button>
|
||||||
<Button size={'small'} type="primary" onClick={(e) => {
|
<Button size={'small'} type="primary" onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
confirmReceive(item);
|
confirmReceive(item);
|
||||||
|
|||||||
Reference in New Issue
Block a user