From 2510e7ac93e3f3c6b80a79949d3cfaee39be1b9d Mon Sep 17 00:00:00 2001 From: xuan Date: Mon, 3 Apr 2023 14:59:50 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(ID1001621):=20=E3=80=90?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E3=80=91-=E5=BE=85?= =?UTF-8?q?=E5=8F=91=E8=B4=A7=E7=8A=B6=E6=80=81=E4=B8=94=E8=B4=A7=E5=88=B0?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E7=8A=B6=E6=80=81=E6=97=B6=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E7=94=B3=E8=AF=B7=E9=80=80=E6=AC=BE=EF=BC=8C=E6=98=AF?= =?UTF-8?q?=E2=80=9C=E5=8F=96=E6=B6=88=E8=AE=A2=E5=8D=95=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【【订单详情】-待发货状态且货到付款状态时,不是申请退款,是“取消订单”】 https://www.tapd.cn/53459131/bugtrace/bugs/view/1153459131001001621 --- src/common/constant.ts | 4 +- src/components/shoppingCart/index.module.scss | 28 +++--- src/components/shoppingCart/index.tsx | 90 +++++++++++++------ .../components/BottomApply/index.tsx | 5 +- 4 files changed, 87 insertions(+), 40 deletions(-) diff --git a/src/common/constant.ts b/src/common/constant.ts index ec7e9ea..7792dcf 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -1,10 +1,10 @@ -export const BASE_URL = CURRENT_BASE_URL +// export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = `http://192.168.0.75:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:40001/lymarket` // export const BASE_URL = 'https://test.zzfzyc.com/lymarket' // 测试环境 -// export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布 +export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布 // export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境 // export const BASE_URL = 'https://www.zzfzyc.com/lymarket' // 正式环境 // export const BASE_URL = 'http://192.168.1.7:50002/lymarket' // 添 diff --git a/src/components/shoppingCart/index.module.scss b/src/components/shoppingCart/index.module.scss index c06747a..2a51bd5 100644 --- a/src/components/shoppingCart/index.module.scss +++ b/src/components/shoppingCart/index.module.scss @@ -5,7 +5,7 @@ font-size: 32px; font-weight: 500; color: #000000; - margin-top: 24px; + padding-top: 24px; margin-bottom: 8px; } @@ -97,14 +97,10 @@ margin-bottom: 32px; } - .scrollviewBig { - .scrollview { - // height: 300px; - - .kongBox { - height: 181px; - width: 100%; - } + .virtualList { + .kongBox { + height: 181px; + width: 100%; } } @@ -135,8 +131,20 @@ } } -.scrllStyle { +.popupHeight { + display: flex; + flex-flow: column nowrap; height: 75vh; + .shopcartBox { + flex: 1 1 auto; + display: flex; + flex-flow: column nowrap; + overflow: hidden; + .virtualListContainer { + flex: 1 1 auto; + overflow: auto; + } + } } // 底部按钮 .bottomBox { diff --git a/src/components/shoppingCart/index.tsx b/src/components/shoppingCart/index.tsx index f103859..0fe5d46 100644 --- a/src/components/shoppingCart/index.tsx +++ b/src/components/shoppingCart/index.tsx @@ -1,6 +1,6 @@ import { Button, ScrollView, View } from '@tarojs/components' -import Taro, { useDidShow } from '@tarojs/taro' -import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react' +import Taro, { nextTick, useDidShow } from '@tarojs/taro' +import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react' import classnames from 'classnames' import VirtualList from '@tarojs/components/virtual-list' import Divider from '../divider' @@ -154,10 +154,48 @@ const ShoppingCart = (props: prosObj, ref) => { }) } + const [virtualListHeight, setVirtualListHeight] = useState(400) + + useLayoutEffect(() => { + console.log('useEffect') + if (showPopup && goodList.length !== 0) { + getVirtualListHeight() + } + }, [showPopup, goodList]) + + const getVirtualListHeight = () => { + nextTick(() => { + const query = Taro.createSelectorQuery() + query.select('#virtualListContainer').boundingClientRect((res) => { + console.log(res) + const virtualListHeight = res.height + console.log('setVirtualListHeight res', res) + setVirtualListHeight(virtualListHeight) + }) + query.exec() + }) + } + + // useLayoutEffect(() => { + // console.log('useLayoutEffect') + // if (showPopup) { + // const query = Taro.createSelectorQuery() + // query.select('#shopCartBox').boundingClientRect() + // query.select('#virtualList').boundingClientRect() + // query.exec((res) => { + // console.log(res) + // const shopCartBoxHeight = res[0].height + // const virtualListTop = res[1].top + // console.log('setVirtualListHeight res', res) + // setVirtualListHeight(shopCartBoxHeight - virtualListTop) + // }) + // } + // }, [showPopup]) + return ( closePopup?.()}> - - + + {formatHashTag(obj?.code, obj?.name)} @@ -198,12 +236,12 @@ const ShoppingCart = (props: prosObj, ref) => { /> - {goodList.length > 0 && ( - <> - + + {goodList.length > 0 && ( + <> { > {Rows} - - - - )} + {/* */} + + )} + {goodList.length === 0 && ( 暂无更多 {/* */} )} - {!hasBottom && } + {/* {!hasBottom && } */} + + + + + 当前客户: + {clientName === '' ? '请选择客户 >' : `${clientName} >`} + + + 立即购买 + 加入购物车 + + - - - - - 当前客户: - {clientName === '' ? '请选择客户 >' : `${clientName} >`} - - - 立即购买 - 加入购物车 - - ) diff --git a/src/pages/orderDetails/components/BottomApply/index.tsx b/src/pages/orderDetails/components/BottomApply/index.tsx index addbca6..741d55a 100644 --- a/src/pages/orderDetails/components/BottomApply/index.tsx +++ b/src/pages/orderDetails/components/BottomApply/index.tsx @@ -63,7 +63,7 @@ const BottomApply = (props: prosObj) => { || (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 2 && goodsObj?.av_return_product?.length) || (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 3 && goodsObj?.av_return_product?.length) || (obj.sale_mode === 0 && obj.status == 11 && (obj.collect_status == 1 || obj.collect_status == 2) && goodsObj?.av_return_product?.length) - || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 0 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up) + // || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 0 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up) || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up) || (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up) || (obj.sale_mode === 1 && obj.status == 0 && goodsObj?.av_return_product?.length) @@ -129,7 +129,8 @@ const BottomApply = (props: prosObj) => { || (obj.sale_mode === 2 && obj.status === 0 && obj.collect_status == 0) || (obj.sale_mode === 1 && obj.status === 10) || (obj.sale_mode === 2 && obj.status === 10) - || (obj.sale_mode === 0 && obj.status === 13) + || (obj.sale_mode === 0 && obj.status === 13) + || (obj.collect_status == 0) ) { return true }