电子商城测试版v2
This commit is contained in:
parent
fe0d7c7432
commit
7c758f6896
@ -136,11 +136,13 @@ export default ({show = false, onClose}: param) => {
|
||||
//删除购物车内容
|
||||
const {fetchData:delShopFetchData} = DelShoppingCartApi()
|
||||
const delSelect = () => {
|
||||
getSelectId()
|
||||
if(selectIds.current.length <= 0) return alert.none('请选择要删除的面料!')
|
||||
Taro.showModal({
|
||||
content: '删除所选商品?',
|
||||
success: async function (res) {
|
||||
if (res.confirm) {
|
||||
getSelectId()
|
||||
|
||||
const res = await delShopFetchData({id:selectIds.current})
|
||||
if(res.success) {
|
||||
getShoppingCart()
|
||||
|
@ -22,6 +22,7 @@ type Param = {
|
||||
onSelect?: (val:any) => void, //选择地址
|
||||
disabled?: false|true, //true禁用后只用于展示
|
||||
onChangeShipmentMode?: (val: number) => void, //返回收货方式
|
||||
onLogistics?: () => void, //查看物流
|
||||
status?: 1|2, //1确认订单时使用, 2订单流程
|
||||
orderInfo?: {
|
||||
id?: number //订单id
|
||||
@ -34,8 +35,7 @@ type Param = {
|
||||
}
|
||||
}
|
||||
|
||||
export default memo(forwardRef(({onSelect, onChangeShipmentMode, orderInfo, status = 2, disabled = false}: Param, ref) => {
|
||||
|
||||
export default memo(forwardRef(({onSelect, onChangeShipmentMode, orderInfo, status = 2, disabled = false, onLogistics}: Param, ref) => {
|
||||
|
||||
const [addressInfo, setAddressInfo] = useState<any>()
|
||||
useEffect(() => {
|
||||
@ -155,7 +155,7 @@ export default memo(forwardRef(({onSelect, onChangeShipmentMode, orderInfo, stat
|
||||
</View>
|
||||
<View style={{transform: receivingStatus==1?'translateX(0)':'translateX(100%)'}} className={classnames(styles.updateBtn_select)}></View>
|
||||
</View>||
|
||||
<View className={styles.logisticsBtn}>
|
||||
<View className={styles.logisticsBtn} onClick={onLogistics}>
|
||||
查看物流
|
||||
</View>}
|
||||
</View>
|
||||
|
@ -7,7 +7,7 @@ import { GetOrderPayApi } from "@/api/orderPay";
|
||||
import { AddShoppingCartApi } from "@/api/shopCart";
|
||||
import { alert, goLink } from "@/common/common";
|
||||
import { ORDER_STATUS } from "@/common/enum";
|
||||
import { formatDateTime, formatPriceDiv } from "@/common/fotmat";
|
||||
import { formatDateTime, formatImgUrl, formatPriceDiv } from "@/common/fotmat";
|
||||
import OrderBtns from "@/components/orderBtns";
|
||||
import Popup from "@/components/popup";
|
||||
import SearchInput from "@/components/searchInput";
|
||||
@ -206,7 +206,16 @@ import styles from './index.module.scss'
|
||||
setRefundShow(false)
|
||||
}, [])
|
||||
|
||||
|
||||
//查看物流
|
||||
const getLogistics = useCallback(() => {
|
||||
const list = orderDetail?.delivery_appendix_url.map(item => {
|
||||
return formatImgUrl(item)
|
||||
})
|
||||
Taro.previewImage({
|
||||
current: list[0], // 当前显示
|
||||
urls: list // 需要预览的图片http链接列表
|
||||
})
|
||||
}, [orderDetail])
|
||||
|
||||
//添加购物车
|
||||
const [showCart, setShowCart] = useState(false)
|
||||
@ -243,8 +252,8 @@ import styles from './index.module.scss'
|
||||
return (
|
||||
<View className={styles.order_main}>
|
||||
<OrderState orderInfo={orderDetail} onRefresh={refresh}/>
|
||||
<View >
|
||||
<AddressInfoDetail orderInfo={defaultAddress} onSelect={getAddress} onChangeShipmentMode={getShipmentMode} ref={addressRef} />
|
||||
<View>
|
||||
<AddressInfoDetail orderInfo={defaultAddress} onLogistics={getLogistics} onSelect={getAddress} onChangeShipmentMode={getShipmentMode} ref={addressRef} />
|
||||
</View>
|
||||
<KindList order={formatPreViewOrderMemo}/>
|
||||
<View className={styles.order_info} >
|
||||
|
Loading…
x
Reference in New Issue
Block a user