From 7c758f6896f58bc894d806643cbd19a8dc0bb661 Mon Sep 17 00:00:00 2001 From: czm <2192718639@qq.com> Date: Thu, 23 Jun 2022 11:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B5=E5=AD=90=E5=95=86=E5=9F=8E=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=89=88v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/shopCart/index.tsx | 4 +++- .../components/addressInfoDetail/index.tsx | 6 +++--- src/pages/order/index.tsx | 17 +++++++++++++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/components/shopCart/index.tsx b/src/components/shopCart/index.tsx index 497e587..2af1202 100644 --- a/src/components/shopCart/index.tsx +++ b/src/components/shopCart/index.tsx @@ -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() diff --git a/src/pages/order/components/addressInfoDetail/index.tsx b/src/pages/order/components/addressInfoDetail/index.tsx index 46cc399..f7194be 100644 --- a/src/pages/order/components/addressInfoDetail/index.tsx +++ b/src/pages/order/components/addressInfoDetail/index.tsx @@ -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,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() useEffect(() => { if(orderInfo) { @@ -155,7 +155,7 @@ export default memo(forwardRef(({onSelect, onChangeShipmentMode, orderInfo, stat || - + 查看物流 } diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx index 388a4e2..fae2191 100644 --- a/src/pages/order/index.tsx +++ b/src/pages/order/index.tsx @@ -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 ( - - + +