电子商城测试版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 {fetchData:delShopFetchData} = DelShoppingCartApi()
|
||||||
const delSelect = () => {
|
const delSelect = () => {
|
||||||
|
getSelectId()
|
||||||
|
if(selectIds.current.length <= 0) return alert.none('请选择要删除的面料!')
|
||||||
Taro.showModal({
|
Taro.showModal({
|
||||||
content: '删除所选商品?',
|
content: '删除所选商品?',
|
||||||
success: async function (res) {
|
success: async function (res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
getSelectId()
|
|
||||||
const res = await delShopFetchData({id:selectIds.current})
|
const res = await delShopFetchData({id:selectIds.current})
|
||||||
if(res.success) {
|
if(res.success) {
|
||||||
getShoppingCart()
|
getShoppingCart()
|
||||||
|
@ -22,6 +22,7 @@ type Param = {
|
|||||||
onSelect?: (val:any) => void, //选择地址
|
onSelect?: (val:any) => void, //选择地址
|
||||||
disabled?: false|true, //true禁用后只用于展示
|
disabled?: false|true, //true禁用后只用于展示
|
||||||
onChangeShipmentMode?: (val: number) => void, //返回收货方式
|
onChangeShipmentMode?: (val: number) => void, //返回收货方式
|
||||||
|
onLogistics?: () => void, //查看物流
|
||||||
status?: 1|2, //1确认订单时使用, 2订单流程
|
status?: 1|2, //1确认订单时使用, 2订单流程
|
||||||
orderInfo?: {
|
orderInfo?: {
|
||||||
id?: number //订单id
|
id?: number //订单id
|
||||||
@ -34,9 +35,8 @@ 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>()
|
const [addressInfo, setAddressInfo] = useState<any>()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(orderInfo) {
|
if(orderInfo) {
|
||||||
@ -155,7 +155,7 @@ export default memo(forwardRef(({onSelect, onChangeShipmentMode, orderInfo, stat
|
|||||||
</View>
|
</View>
|
||||||
<View style={{transform: receivingStatus==1?'translateX(0)':'translateX(100%)'}} className={classnames(styles.updateBtn_select)}></View>
|
<View style={{transform: receivingStatus==1?'translateX(0)':'translateX(100%)'}} className={classnames(styles.updateBtn_select)}></View>
|
||||||
</View>||
|
</View>||
|
||||||
<View className={styles.logisticsBtn}>
|
<View className={styles.logisticsBtn} onClick={onLogistics}>
|
||||||
查看物流
|
查看物流
|
||||||
</View>}
|
</View>}
|
||||||
</View>
|
</View>
|
||||||
|
@ -7,7 +7,7 @@ import { GetOrderPayApi } from "@/api/orderPay";
|
|||||||
import { AddShoppingCartApi } from "@/api/shopCart";
|
import { AddShoppingCartApi } from "@/api/shopCart";
|
||||||
import { alert, goLink } from "@/common/common";
|
import { alert, goLink } from "@/common/common";
|
||||||
import { ORDER_STATUS } from "@/common/enum";
|
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 OrderBtns from "@/components/orderBtns";
|
||||||
import Popup from "@/components/popup";
|
import Popup from "@/components/popup";
|
||||||
import SearchInput from "@/components/searchInput";
|
import SearchInput from "@/components/searchInput";
|
||||||
@ -206,7 +206,16 @@ import styles from './index.module.scss'
|
|||||||
setRefundShow(false)
|
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)
|
const [showCart, setShowCart] = useState(false)
|
||||||
@ -243,8 +252,8 @@ import styles from './index.module.scss'
|
|||||||
return (
|
return (
|
||||||
<View className={styles.order_main}>
|
<View className={styles.order_main}>
|
||||||
<OrderState orderInfo={orderDetail} onRefresh={refresh}/>
|
<OrderState orderInfo={orderDetail} onRefresh={refresh}/>
|
||||||
<View >
|
<View>
|
||||||
<AddressInfoDetail orderInfo={defaultAddress} onSelect={getAddress} onChangeShipmentMode={getShipmentMode} ref={addressRef} />
|
<AddressInfoDetail orderInfo={defaultAddress} onLogistics={getLogistics} onSelect={getAddress} onChangeShipmentMode={getShipmentMode} ref={addressRef} />
|
||||||
</View>
|
</View>
|
||||||
<KindList order={formatPreViewOrderMemo}/>
|
<KindList order={formatPreViewOrderMemo}/>
|
||||||
<View className={styles.order_info} >
|
<View className={styles.order_info} >
|
||||||
|
Loading…
x
Reference in New Issue
Block a user