diff --git a/project.private.config.json b/project.private.config.json index af25df0..3deeee0 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -197,6 +197,41 @@ "query": "", "launchMode": "default", "scene": null + }, + { + "name": "", + "pathName": "pages/applyGoods/index", + "query": "orderId=31700", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/customerManagement/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/applyMoney/index", + "query": "orderId=31712", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/applyGoods/index", + "query": "orderId=31708", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/refundMoneyDetail/index", + "query": "id=697", + "launchMode": "default", + "scene": null } ] } diff --git a/src/api/order.ts b/src/api/order.ts index d0ae148..c7ed4af 100644 --- a/src/api/order.ts +++ b/src/api/order.ts @@ -25,7 +25,7 @@ export const OrderListApi = () => { */ export const ClientListApi = () => { return useRequest({ - url: `/v1/mp/purchaser/list`, + url: `/v2/mp/purchaser/list`, method: "get" }) } diff --git a/src/components/BottomBtns/index.tsx b/src/components/BottomBtns/index.tsx index 3ad9f96..ce28384 100644 --- a/src/components/BottomBtns/index.tsx +++ b/src/components/BottomBtns/index.tsx @@ -16,7 +16,8 @@ interface prosObj { showTuiGoods?: boolean, handApplyGoods?: () => void, handApplyMoney?: () => void, - showDetail?: boolean + showDetail?: boolean, + goodsObj?: any } export default memo(forwardRef((props: prosObj, ref) => { @@ -35,7 +36,8 @@ export default memo(forwardRef((props: prosObj, ref) => { handSureGoods, handApplyGoods, handApplyMoney, - showDetail = false + showDetail = false, + goodsObj = {} } = props //判断显示取消订单 @@ -109,11 +111,11 @@ export default memo(forwardRef((props: prosObj, ref) => { //判断显示申请退货 const showTuihuo = useMemo(() => { if ( - (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 0) || - (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 1) || - (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 2) || - (obj.sale_mode === 0 && obj.status == 9 && obj.settle_mode == 3) || - (obj.sale_mode === 2 && obj.status == 9) + (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 0 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 1 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 2 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 0 && obj.status == 9 && obj.settle_mode == 3 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 2 && obj.status == 9 && goodsObj?.av_return_product?.length) ) { return true } else return false @@ -121,16 +123,16 @@ export default memo(forwardRef((props: prosObj, ref) => { //判断显示申请退款 const showTuikuan = useMemo(() => { if ( - (obj.sale_mode === 0 && obj.status == 2 && obj.collect_status == 1) || - (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 0) || - (obj.sale_mode === 0 && obj.status == 11 && (obj.collect_status == 1 || obj.collect_status == 2)) || - (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 0) || - (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2) || - (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1) || - (obj.sale_mode === 1 && obj.status == 0) || - (obj.sale_mode === 1 && obj.status == 9) || - (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 1) || - (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 2) + (obj.sale_mode === 0 && obj.status == 2 && obj.collect_status == 1 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 0 && 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.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 1 && obj.status == 0 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 1 && obj.status == 9 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 1 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 2 && goodsObj?.av_return_product?.length) ) { return true } else return false @@ -149,6 +151,9 @@ export default memo(forwardRef((props: prosObj, ref) => { if (canBuy) { nums = nums + 1 } + if (showBuy) { + nums = nums + 1 + } return nums }, [obj]) diff --git a/src/components/goodsItem/index.tsx b/src/components/goodsItem/index.tsx index f4394a2..c8d4ea8 100644 --- a/src/components/goodsItem/index.tsx +++ b/src/components/goodsItem/index.tsx @@ -72,7 +72,7 @@ export default memo((props: props) => { 剩:{props.value?.roll}件 - ¥{props?.modeFont === 0 ? Number(props.value?.bulk_price) / 100 : props.modeFont === 1 ? Number(props.value?.length_cut_price) / 100 : Number(props.value?.weight_cut_price) / 100}{props.modeFont === 0 ? '/Kg' : '/m'} + ¥{props?.modeFont === 0 ? Number(props.value?.bulk_price) / 100 : props.modeFont === 1 ? Number(props.value?.length_cut_price) / 100 : Number(props.value?.weight_cut_price) / 100}{props.modeFont != 1 ? '/Kg' : '/m'} { props.value.showInput && { props.clickReduce?.(props.value) }}> diff --git a/src/components/shoppingCart/index.tsx b/src/components/shoppingCart/index.tsx index b33a8ca..e1f77f4 100644 --- a/src/components/shoppingCart/index.tsx +++ b/src/components/shoppingCart/index.tsx @@ -9,202 +9,207 @@ import BottomCustomer from "@/components/BottomCustomer" import VirtualList from '@tarojs/components/virtual-list' import DotLoading from "@/components/dotLoading" import Divider from '../divider'; +import { useDidShow } from '@tarojs/taro'; interface prosObj { - showPopup?: false | true, - closePopup?: () => void, - goodList?: any[], - typeList?: any[], - handCheck?: (any) => void, - addNums?: (any) => void - reduceNums?: (any) => void - // oninputEvent?: (e: string, res: object) => void, - getSearchData: (any) => void, - handPlus: (any) => void, - handSure: () => void, - obj?: { - code?: string, - name?: string, + showPopup?: false | true, + closePopup?: () => void, + goodList?: any[], + typeList?: any[], + handCheck?: (any) => void, + addNums?: (any) => void + reduceNums?: (any) => void + // oninputEvent?: (e: string, res: object) => void, + getSearchData: (any) => void, + handPlus: (any) => void, + handSure: () => void, + obj?: { + code?: string, + name?: string, - }, - modeFont: Number | string, - clientName: string, - clientId: Number, - hasBottom?: true | false, //默认不占位底部 - onBlur?: (e: string, res: object) => void + }, + modeFont: Number | string, + clientName: string, + clientId: Number, + hasBottom?: true | false, //默认不占位底部 + onBlur?: (e: string, res: object) => void } export default memo(forwardRef((props: prosObj, ref) => { - const { - showPopup = false, - closePopup, - goodList = [], - typeList = [], - handCheck, - addNums, - reduceNums, - // oninputEvent, - getSearchData, - handPlus, - obj = {}, - modeFont = 0, - clientName = '', - clientId = -1, - handSure, - hasBottom = true, - onBlur - } = props - - useImperativeHandle(ref, () => ({ - Object: props, - typeList: typeList - })) + const { + showPopup = false, + closePopup, + goodList = [], + typeList = [], + handCheck, + addNums, + reduceNums, + // oninputEvent, + getSearchData, + handPlus, + obj = {}, + modeFont = 0, + clientName = '', + clientId = -1, + handSure, + hasBottom = true, + onBlur + } = props + const SearchRef = useRef() - //判断选择的类型 - const showModefont = useMemo(() => { - const modeObj = typeList.filter(item => { - return item.checked - }) - if (modeObj[0].id === 0) { - return '条' - } else { - return '米' - } - }, [typeList]) - - //已选的颜色 - const selectTotal = useMemo(() => { - const totalArr = goodList.filter(item => { - return item.showInput - }) - return totalArr.length - }, [goodList]) - - //选择的条数或者米数 - const selectNums = useMemo(() => { - let arr: any = [] - goodList.forEach(item => { - if (item.showInput) { - arr.push(Number(item.nums)) - } - }) - let hate = sum(arr) - return hate - }, [goodList]) - // onInputEven={(e, item) => oninputEvent?.(e, item)} - - function sum(arr) { - var s = 0; - for (var i = arr.length - 1; i >= 0; i--) { - s += arr[i]; - } - return s; - } + useImperativeHandle(ref, () => ({ + Object: props, + typeList: typeList, + SearchRef + })) - const rows = memo(({ id, index, style, data }: any) => { - let item = data[index] - return ( - <> - onBlur?.(e, id)} - modeFont={(modeFont as number)} - handPlus={(item) => handPlus?.(item)} - value={item || {}} - clickAdd={(item) => addNums?.(item)} - clickReduce={(item) => { reduceNums?.(item) }} - goodList={goodList} - > - - ) + //判断选择的类型 + const showModefont = useMemo(() => { + const modeObj = typeList.filter(item => { + return item.checked }) + if (modeObj[0].id === 0) { + return '条' + } else { + return '米' + } + }, [typeList]) + //已选的颜色 + const selectTotal = useMemo(() => { + const totalArr = goodList.filter(item => { + return item.showInput + }) + return totalArr.length + }, [goodList]) + + //选择的条数或者米数 + const selectNums = useMemo(() => { + let arr: any = [] + goodList.forEach(item => { + if (item.showInput) { + arr.push(Number(item.nums)) + } + }) + let hate = sum(arr) + return hate + }, [goodList]) + // onInputEven={(e, item) => oninputEvent?.(e, item)} + + function sum(arr) { + var s = 0; + for (var i = arr.length - 1; i >= 0; i--) { + s += arr[i]; + } + return s; + } + + + const rows = memo(({ id, index, style, data }: any) => { + let item = data[index] return ( - closePopup?.()}> - - - - {obj?.code}# {obj?.name} - - - 已选 1 种面料,{selectTotal} 个颜色,共 {selectNums} {showModefont} - - - 布料类型 - - {typeList.map((item, index) => { - return ( - { - handCheck?.(item) - }} - key={index} - className={classnames(item.checked ? styles.activemodeFont : styles.modeFont)}> - {item.name} - - ) - })} - - - - - 颜色分类({goodList?.length}) - - {modeFont == 0 ? '大货' : modeFont == 1 ? '剪版' : '散剪'}单位:{showModefont} - - - - - - - {goodList.length > 0 && ( - <> - - - {rows} - - + <> + onBlur?.(e, id)} + modeFont={(modeFont as number)} + handPlus={(item) => handPlus?.(item)} + value={item || {}} + clickAdd={(item) => addNums?.(item)} + clickReduce={(item) => { reduceNums?.(item) }} + goodList={goodList} + > + + ) + }) - - - )} - {goodList.length === 0 && ( - <> - - 加载中 - + return ( + closePopup?.()}> + + + + {obj?.code}# {obj?.name} + + + 已选 1 种面料,{selectTotal} 个颜色,共 {selectNums} {showModefont} + + + 布料类型 + + {typeList.map((item, index) => { + return ( + { + handCheck?.(item) + }} + key={index} + className={classnames(item.checked ? styles.activemodeFont : styles.modeFont)}> + {item.name} - - )} - {!hasBottom && } - - 0 && clientName !== '' ? false : true} - handSure={() => { - handSure() - }}> + ) + })} + + + + + 颜色分类({goodList?.length}) + + {modeFont == 0 ? '大货' : modeFont == 1 ? '剪版' : '散剪'}单位:{showModefont} + + + + - - - ) + {goodList.length > 0 && ( + <> + + + {rows} + + + + + + )} + {goodList.length === 0 && ( + <> + + 加载中 + + + + )} + {!hasBottom && } + + 0 && clientName !== '' ? false : true} + handSure={() => { + handSure() + }}> + + + + + ) })) diff --git a/src/pages/addAddress/index.tsx b/src/pages/addAddress/index.tsx index b6aff3e..66a339e 100644 --- a/src/pages/addAddress/index.tsx +++ b/src/pages/addAddress/index.tsx @@ -216,7 +216,7 @@ export default () => { //新增地址 const { fetchData: addAddressFetch } = mppurchaseraddress() const handAdd = async () => { - if (!btnDisabled) return false + // if (!btnDisabled) return false let res = await addAddressFetch({ ...getFilterData(formData), purchaser_id: Number(router.params.purchaser_id) }) if (res.data) { Taro.showToast({ @@ -234,7 +234,7 @@ export default () => { // 编辑地址 const { fetchData: putFetch } = mppurchaseraddressput() const handEdit = async () => { - if (!btnDisabled) return false + // if (!btnDisabled) return false let res = await putFetch({ ...getFilterData(formData), purchaser_id: Number(router.params.purchaser_id), id: Number(infoObj?.id) }) if (res.msg === 'success') { Taro.showToast({ @@ -259,7 +259,7 @@ export default () => { Taro.showLoading({ title: '请稍等...' }) - const result = await deleteFetch({ id: Number(router.params.purchaser_id) }); + const result = await deleteFetch({ id: Number(formData.id) }); if (result.success) { alert.success("删除成功"); Taro.hideLoading() diff --git a/src/pages/applyGoods/index.module.scss b/src/pages/applyGoods/index.module.scss index 297d683..5d11299 100644 --- a/src/pages/applyGoods/index.module.scss +++ b/src/pages/applyGoods/index.module.scss @@ -40,7 +40,7 @@ margin-right: 42px; width: 108px; height: 108px; - background: #322F2F; + // background: #322F2F; border-radius: 8px; } @@ -174,7 +174,7 @@ margin-right: 42px; width: 108px; height: 108px; - background: #322F2F; + // background: #322F2F; border-radius: 8px; } @@ -432,6 +432,7 @@ } .popupBox { + height: 500px; padding-bottom: env(safe-area-inset-bottom); diff --git a/src/pages/applyGoods/index.tsx b/src/pages/applyGoods/index.tsx index a6914d9..b2562e8 100644 --- a/src/pages/applyGoods/index.tsx +++ b/src/pages/applyGoods/index.tsx @@ -1,4 +1,4 @@ -import { View, Input, Button, Image, Text, Textarea } from '@tarojs/components' +import { View, Input, Button, Image, Text, Textarea, ScrollView } from '@tarojs/components' import { useCallback, useEffect, useMemo, useRef, useState, ReactNode, memo } from 'react' import styles from "./index.module.scss" import classnames from "classnames"; @@ -17,9 +17,9 @@ import UploadImage from '@/components/uploadImage' export default () => { const router = useRouter() - useDidShow(() => { + useEffect(() => { getDetail() - }) + }, []) const { fetchData: infoFetch } = mpsaleOrder() const [infoObj, setInfoObj] = useState({}) const [ListArr, setListArr] = useState([]) @@ -77,8 +77,8 @@ export default () => { ListArr.forEach(item => { item.av_product_color.map(it => { if (it.sale_order_detail_id === val.sale_order_detail_id) { - if (val.nums === 1) { - // it.isTui = false + if (val.nums == 1) { + it.isTui = false it.nums = 1 } else { it.nums-- @@ -389,6 +389,14 @@ export default () => { //确认退货 const { fetchData: sureFetch } = mpreturnApplyOrder() const handSure = () => { + if (Query.reasonNameTwo == '其他问题' && TextareaValue == '') { + Taro.showToast({ + title: '请填写其他说明', + icon: 'error', + duration: 3000 + }) + return false + } const arr: any = []; ListArr.forEach((item) => { item.av_product_color.forEach((it) => { @@ -507,72 +515,75 @@ export default () => { value={TextareaValue} // style='background:#f6f6f6;height:210px;padding:15rpx 24rpx 24rpx 24rpx;border-radius: 8rpx;' placeholderStyle='font-size: 28rpx;font-weight: 400;' - placeholder={'选填/退货说明中选择时(其他问题)必填'} + placeholder={'选填/退货原因中选择时(其他问题)必填'} > - { setshowPopup?.(false) }}> - - - 退货原因 - - { - ReasonList.map((item, index) => { - return ( - { handReasonOne(item) }} className={classnames(item.default ? styles.activemodeBox : styles.modeBox)} key={index}>{item.name} - ) - }) - } + + + + 退货原因 + + { + ReasonList.map((item, index) => { + return ( + { handReasonOne(item) }} className={classnames(item.default ? styles.activemodeBox : styles.modeBox)} key={index}>{item.name} + ) + }) + } + - - - 退货理由 - - { - ReasonListTwo.map((item, index) => { - return ( - { handReasonTwo(item) }} className={classnames(item.default ? styles.activemodeBox : styles.modeBox)} key={index}>{item.name} - ) - }) - } + + 退货理由 + + { + ReasonListTwo.map((item, index) => { + return ( + { handReasonTwo(item) }} className={classnames(item.default ? styles.activemodeBox : styles.modeBox)} key={index}>{item.name} + ) + }) + } + - - - + + - - + + + - + { setDescPopup?.(false) }}> - - - 货物情况 - - { - GoodStatusList.map((item, index) => { - return ( - { handStatus(item) }} className={classnames(item.default ? styles.activemodeBox : styles.modeBox)} key={index}>{item.name} - ) - }) - } + + + + 货物情况 + + { + GoodStatusList.map((item, index) => { + return ( + { handStatus(item) }} className={classnames(item.default ? styles.activemodeBox : styles.modeBox)} key={index}>{item.name} + ) + }) + } + + + + + + + - - - - - - - + ) @@ -620,7 +631,8 @@ const GoodsItem = memo((porps: PropGoods) => { item.av_product_color.map((it, inx) => { return ( - + + {/* */} {it.product_color_code} {it.product_color_name} diff --git a/src/pages/applyMoney/index.module.scss b/src/pages/applyMoney/index.module.scss index 5a42953..890f58b 100644 --- a/src/pages/applyMoney/index.module.scss +++ b/src/pages/applyMoney/index.module.scss @@ -40,7 +40,7 @@ margin-right: 42px; width: 108px; height: 108px; - background: #322F2F; + // background: #322F2F; border-radius: 8px; } @@ -174,7 +174,7 @@ margin-right: 42px; width: 108px; height: 108px; - background: #322F2F; + // background: #322F2F; border-radius: 8px; } @@ -413,6 +413,7 @@ } .popupBox { + height: 500px; padding-bottom: env(safe-area-inset-bottom); diff --git a/src/pages/applyMoney/index.tsx b/src/pages/applyMoney/index.tsx index 4b0ae3a..2304514 100644 --- a/src/pages/applyMoney/index.tsx +++ b/src/pages/applyMoney/index.tsx @@ -1,4 +1,4 @@ -import { View, Input, Button, Image, Text, Textarea } from '@tarojs/components' +import { View, Input, Button, Image, Text, Textarea, ScrollView } from '@tarojs/components' import { useCallback, useEffect, useMemo, useRef, useState, ReactNode, memo } from 'react' import styles from "./index.module.scss" import classnames from "classnames"; @@ -78,7 +78,7 @@ export default () => { item.av_product_color.map(it => { if (it.sale_order_detail_id === val.sale_order_detail_id) { if (val.nums === 1) { - // it.isTui = false + it.isTui = false it.nums = 1 } else { it.nums-- @@ -263,6 +263,14 @@ export default () => { //确认退款 const { fetchData: sureFetch } = mpreturnApplyOrder() const handSure = () => { + if (queryRef.current.reasonName == '其他问题' && TextareaValue == '') { + Taro.showToast({ + title: '请填写其他说明', + icon: 'error', + duration: 3000 + }) + return false + } let arr: any = []; if (infoObj.sale_mode == 0 && infoObj.status == 9) { ListArr.forEach((item) => { @@ -386,8 +394,7 @@ export default () => { value={TextareaValue} // style='background:#f6f6f6;height:210px;padding:15rpx 24rpx 24rpx 24rpx;border-radius: 8rpx;' placeholderStyle='font-size: 28rpx;font-weight: 400;' - autoFocus - placeholder={'选填/退货说明中选择时(其他问题)必填'} + placeholder={'选填/退款说明中选择(其他问题)必填'} > @@ -406,27 +413,28 @@ export default () => { { setshowPopup?.(false) }}> + + + + 退款原因 + + { + List.map((item, index) => { + return ( + { handReasonOne(item) }} className={classnames(item.default ? styles.activemodeBox : styles.modeBox)} key={index}>{item.name} + ) + }) + } + + + + - - - 退款原因 - - { - List.map((item, index) => { - return ( - { handReasonOne(item) }} className={classnames(item.default ? styles.activemodeBox : styles.modeBox)} key={index}>{item.name} - ) - }) - } + + - - - - - - - + ) @@ -471,7 +479,8 @@ const GoodsItem = memo((porps: PropGoods) => { item.av_product_color.map((it, inx) => { return ( - + + {/* */} {it.product_color_code} {it.product_color_name} diff --git a/src/pages/collectionDetail/index.module.scss b/src/pages/collectionDetail/index.module.scss index affc068..ff655b5 100644 --- a/src/pages/collectionDetail/index.module.scss +++ b/src/pages/collectionDetail/index.module.scss @@ -12,6 +12,7 @@ justify-content: space-between; position: relative; border-bottom: 1px solid #f7f7f7; + padding-bottom: 47px; .textAreaLeft { font-size: 28px; @@ -79,6 +80,7 @@ align-items: center; flex-direction: column; overflow: hidden; + .topFont { margin-top: 32px; font-size: 28px; diff --git a/src/pages/collectionDetail/index.tsx b/src/pages/collectionDetail/index.tsx index 4ec0561..9332231 100644 --- a/src/pages/collectionDetail/index.tsx +++ b/src/pages/collectionDetail/index.tsx @@ -123,14 +123,17 @@ export default () => { 备注信息 - + { + Query.remark !== '' && + } + {/* {`${typeof (Query.nums) == 'undefined' ? 0 : Query.nums}/64`} */} diff --git a/src/pages/customerDetails/index.module.scss b/src/pages/customerDetails/index.module.scss index 95776f4..71f89c5 100644 --- a/src/pages/customerDetails/index.module.scss +++ b/src/pages/customerDetails/index.module.scss @@ -82,16 +82,17 @@ justify-content: space-between; .item_add { + margin-left: 20px; line-height: 45px; // font-size: 40px; - margin-left: 8px; + // margin-left: 8px; } .item_add_font { font-size: 24px; font-weight: 500; color: #4581FF; - margin-right: 10px; + margin-right: 15px; } } } diff --git a/src/pages/customerEditor/index.tsx b/src/pages/customerEditor/index.tsx index 4a74d3f..3c7ea6c 100644 --- a/src/pages/customerEditor/index.tsx +++ b/src/pages/customerEditor/index.tsx @@ -210,7 +210,7 @@ export default () => { const { fetchData: putFetch } = mppurchaserput() //提交 const handSure = async () => { - if (!isDisabled) return false + // if (!isDisabled) return false let query = { ...formData, remark: remarkDesc, diff --git a/src/pages/customerManagement/components/ChoseCity/index.tsx b/src/pages/customerManagement/components/ChoseCity/index.tsx index be28da0..82aa835 100644 --- a/src/pages/customerManagement/components/ChoseCity/index.tsx +++ b/src/pages/customerManagement/components/ChoseCity/index.tsx @@ -10,13 +10,15 @@ import { GetAddressListApi } from "@/api/addressList"; import Tabs from "../tabs" import IconFont from '@/components/iconfont/iconfont'; interface Props { - handCity?: (province: any, city: any) => void + handCity?: (province: any, city: any) => void, + value?: any } export default memo(forwardRef((props: Props, ref) => { useImperativeHandle(ref, () => ({ - close + close, + DropDownItemRef })) const DropDownItemRef = useRef() diff --git a/src/pages/customerManagement/components/ItemList/index.module.scss b/src/pages/customerManagement/components/ItemList/index.module.scss index 5ae1029..d02dcf5 100644 --- a/src/pages/customerManagement/components/ItemList/index.module.scss +++ b/src/pages/customerManagement/components/ItemList/index.module.scss @@ -73,11 +73,12 @@ display: flex; .phoneFont { - margin-right: 40px; + // margin-right: 40px; margin-left: 16px; font-size: 24px; font-weight: 400; color: #4581FF; + width: 100rpx; } } } diff --git a/src/pages/customerManagement/components/ItemList/index.tsx b/src/pages/customerManagement/components/ItemList/index.tsx index 9c00b72..f278839 100644 --- a/src/pages/customerManagement/components/ItemList/index.tsx +++ b/src/pages/customerManagement/components/ItemList/index.tsx @@ -29,19 +29,29 @@ export default memo((props: Props) => { handNav()}> - {props.obj.name[0]} + + {props.obj.name[0]} + {props.obj.name} {props.obj.phone} - 二批 + {props.obj.purchaser_type_name || '暂无'} {props.obj.sale_user_name || '暂无'} + { + props.obj?.label_list?.map(item => { + return ( + {item.label_name} + ) + }) + } handPhone(e)}> + 联系TA diff --git a/src/pages/customerManagement/components/Sort/index.tsx b/src/pages/customerManagement/components/Sort/index.tsx index 21c4b5a..65e3916 100644 --- a/src/pages/customerManagement/components/Sort/index.tsx +++ b/src/pages/customerManagement/components/Sort/index.tsx @@ -1,5 +1,5 @@ import { View } from '@tarojs/components' -import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode } from 'react' +import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode, forwardRef, useImperativeHandle } from 'react' import styles from "./index.module.scss" import classnames from "classnames"; import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro'; @@ -7,31 +7,51 @@ import { alert } from '@/common/common' import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format' import DropDownItem from '@/components/dropDown-item' interface Props { - handSort?: (any) => void + handSort?: (any) => void, + value?: any } -export default memo((props: Props) => { +export default memo(forwardRef((props: Props, ref) => { const DropDownItemRef = useRef() // const close = () => { // DropDownItemRef.current.closePopup() // } + useImperativeHandle(ref, () => ({ + DropDownItemRef + })) + const [list, setlist] = useState([ { - name: '下单时间', + name: '下单时间正序', id: '1', checked: false }, { - name: '创建时间', + name: '创建时间正序', id: '2', checked: false }, { - name: '更新时间', + name: '更新时间正序', id: '3', checked: false + }, + { + name: '下单时间倒序', + id: '-1', + checked: false + }, + { + name: '创建时间倒序', + id: '-2', + checked: false + }, + { + name: '更新时间倒序', + id: '-3', + checked: false } ]) @@ -74,4 +94,4 @@ export default memo((props: Props) => { ) -}) \ No newline at end of file +})) \ No newline at end of file diff --git a/src/pages/customerManagement/components/Tag/index.tsx b/src/pages/customerManagement/components/Tag/index.tsx index 991c656..15670b3 100644 --- a/src/pages/customerManagement/components/Tag/index.tsx +++ b/src/pages/customerManagement/components/Tag/index.tsx @@ -1,5 +1,5 @@ import { View } from '@tarojs/components' -import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode } from 'react' +import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode, forwardRef, useImperativeHandle } from 'react' import styles from "./index.module.scss" import classnames from "classnames"; import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro'; @@ -9,13 +9,16 @@ import DropDownItem from '@/components/dropDown-item' import { mppurchaserlist } from "@/api/customer" interface Props { handType: (any) => void, - handTags: (any) => void + handTags: (any) => void, + value?: any } -export default memo((props: Props) => { +export default memo(forwardRef((props: Props, ref) => { const DropDownItemRef = useRef() - + useImperativeHandle(ref, () => ({ + DropDownItemRef + })) const [currentValue, setCurrentValue] = useState(-1) const [list, setlist] = useState([ @@ -99,4 +102,4 @@ export default memo((props: Props) => { ) -}) \ No newline at end of file +})) \ No newline at end of file diff --git a/src/pages/customerManagement/index.tsx b/src/pages/customerManagement/index.tsx index 99d3674..352890b 100644 --- a/src/pages/customerManagement/index.tsx +++ b/src/pages/customerManagement/index.tsx @@ -92,6 +92,9 @@ export default () => { setSearchField((val) => ({ ...val, size: 10, abstract_sort_key: e })) }, []) + const SortRef = useRef() + const TagRef = useRef() + //筛选城市 const ChoseCityRef = useRef() const handCity = useCallback((provinceVal, cityVal) => { @@ -127,6 +130,7 @@ export default () => { setSearchField((val) => ({ ...val, size: 10, label_ids: arr.length === 0 ? '' : arr })) }, []) + return ( @@ -134,9 +138,9 @@ export default () => { - + - + 共 {orderData?.total || 0} 个客户 @@ -155,8 +159,8 @@ export default () => { - goLink('/pages/customerEditor/index?type=add')}>新建用户 + goLink('/pages/customerEditor/index?type=add')}>新建客户 - + ) } \ No newline at end of file diff --git a/src/pages/customerPage/index.module.scss b/src/pages/customerPage/index.module.scss index 3afac6d..74b52ca 100644 --- a/src/pages/customerPage/index.module.scss +++ b/src/pages/customerPage/index.module.scss @@ -21,7 +21,7 @@ page { } .listBox { - height: 100vh; + height: calc(100vh - 170px); } .itemBox { diff --git a/src/pages/customerPage/index.tsx b/src/pages/customerPage/index.tsx index ee8379f..0f0251b 100644 --- a/src/pages/customerPage/index.tsx +++ b/src/pages/customerPage/index.tsx @@ -15,7 +15,7 @@ export default () => { const [search, setSearch] = useState({ - name: null, + name_phone_or_sale_user: null, page: 1, size: 10, }) @@ -36,17 +36,17 @@ export default () => { const getSearchData = useCallback((eq) => { pageNum.current.page = 1 setClientlist(() => ({ list: [], total: 0 })) - setSearch((e) => ({ ...e, name: eq, size: 10 })) + setSearch((e) => ({ ...e, name_phone_or_sale_user: eq, size: 10 })) }, []) const router = useRouter() useEffect(() => { - if (search.name === '') { - setSearch((e) => ({ ...e, name: null })) + if (search.name_phone_or_sale_user === '') { + setSearch((e) => ({ ...e, name_phone_or_sale_user: null })) } - if (search.name !== '') getCuss() + if (search.name_phone_or_sale_user !== '') getCuss() }, [search]) //上拉加载数据 @@ -68,7 +68,7 @@ export default () => { setSearch((val) => ({ ...val, size: 10 })) } const getCuss = async () => { - let res = await clitentFetch({ name: search.name === null ? '' : search.name, page: search.page, size: search.size }) + let res = await clitentFetch({ name_phone_or_sale_user: search.name_phone_or_sale_user === null ? '' : search.name_phone_or_sale_user, page: search.page, size: search.size }) if (router?.params.clientId) { res.data.list.map(item => { if (item.id == router?.params.clientId) { diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 8f774f7..aa40a81 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -125,6 +125,7 @@ export default () => { setSearchObj((e) => ({ ...e, goodsId: item.id })) setShowShopCart(true) setGoodsobj(item) + ShopCartRef.current.SearchRef.current.clearInput() } const getGoodList = async () => { diff --git a/src/pages/orderDetails/components/BottomApply/index.tsx b/src/pages/orderDetails/components/BottomApply/index.tsx index fe08c48..cae6ae0 100644 --- a/src/pages/orderDetails/components/BottomApply/index.tsx +++ b/src/pages/orderDetails/components/BottomApply/index.tsx @@ -12,6 +12,7 @@ interface prosObj { } handApplyGoods?: () => void, handApplyMoney?: () => void, + goodsObj?: any // handSureGoods?: () => void, } @@ -26,17 +27,18 @@ export default memo((props: prosObj) => { }, handApplyGoods, handApplyMoney, + goodsObj = {} // handSureGoods } = props //判断显示申请退货 const showTuihuo = useMemo(() => { if ( - (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 0) || - (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 1) || - (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 2) || - (obj.sale_mode === 0 && obj.status == 9 && obj.settle_mode == 3) || - (obj.sale_mode === 2 && obj.status == 9) + (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 0 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 1 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 2 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 0 && obj.status == 9 && obj.settle_mode == 3 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 2 && obj.status == 9 && goodsObj?.av_return_product?.length) ) { return true } else return false @@ -44,16 +46,16 @@ export default memo((props: prosObj) => { //判断显示申请退款 const showTuikuan = useMemo(() => { if ( - (obj.sale_mode === 0 && obj.status == 2 && obj.collect_status == 1) || - (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 0) || - (obj.sale_mode === 0 && obj.status == 11 && (obj.collect_status == 1 || obj.collect_status == 2)) || - (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 0) || - (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2) || - (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1) || - (obj.sale_mode === 1 && obj.status == 0) || - (obj.sale_mode === 1 && obj.status == 9) || - (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 1) || - (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 2) + (obj.sale_mode === 0 && obj.status == 2 && obj.collect_status == 1 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 0 && 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.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 1 && obj.status == 0 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 1 && obj.status == 9 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 1 && goodsObj?.av_return_product?.length) || + (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 2 && goodsObj?.av_return_product?.length) ) { return true } else return false diff --git a/src/pages/orderDetails/index.tsx b/src/pages/orderDetails/index.tsx index f3107ef..05ebbcf 100644 --- a/src/pages/orderDetails/index.tsx +++ b/src/pages/orderDetails/index.tsx @@ -598,9 +598,9 @@ export default () => { const BottomBtnsRef = useRef() const [showOther, setshowOther] = useState(false) - const testOther = useMemo(() => { + useMemo(() => { Taro.nextTick(() => { - if (BottomBtnsRef.current?.itemNums >= 2) { + if (BottomBtnsRef.current?.itemNums >= 3) { setshowOther(true) return true } else { @@ -641,14 +641,14 @@ export default () => { 合计金额 - {formatPriceDiv(infoObj.bill_total_sale_price)} + ¥{formatPriceDiv(infoObj.bill_total_sale_price)} 实付金额 - {formatPriceDiv(infoObj.actual_amount)} + ¥{formatPriceDiv(infoObj.actual_amount)} @@ -656,7 +656,7 @@ export default () => { {/* */} - {formatPriceDiv(infoObj.wait_pay_amount)} + ¥{formatPriceDiv(infoObj.wait_pay_amount)} @@ -707,6 +707,7 @@ export default () => { showMore && handApplyGood?.()} handApplyMoney={() => handApplyMoney?.()} > @@ -719,6 +720,7 @@ export default () => { cancle?.(e, infoObj)} diff --git a/src/pages/refundDetail/index.module.scss b/src/pages/refundDetail/index.module.scss index 32d87f0..fec1afe 100644 --- a/src/pages/refundDetail/index.module.scss +++ b/src/pages/refundDetail/index.module.scss @@ -205,7 +205,7 @@ // margin-right: 42px; width: 108px; height: 108px; - background: #322F2F; + // background: #322F2F; border-radius: 8px; } @@ -272,7 +272,7 @@ // margin-right: 42px; width: 108px; height: 108px; - background: #322F2F; + // background: #322F2F; border-radius: 8px; } diff --git a/src/pages/refundDetail/index.tsx b/src/pages/refundDetail/index.tsx index 23c96ba..677794a 100644 --- a/src/pages/refundDetail/index.tsx +++ b/src/pages/refundDetail/index.tsx @@ -17,6 +17,7 @@ import Popup from '@/components/popup'; import UploadImage from '@/components/uploadImage' import { alert } from '@/common/common'; import RefundCodelist from "@/components/RefundCodelist" +import LabAndImg from "@/components/LabAndImg" export default () => { //页面下拉刷新 usePullDownRefresh(() => { @@ -50,7 +51,7 @@ export default () => { if (it.leftTitle === '退货说明:') { it.rightTitle = res.data.return_explain_name } - if (it.leftTitle === '其他什么:') { + if (it.leftTitle === '其他说明:') { it.rightTitle = res.data.reason_describe } if (it.leftTitle === '货物状况:') { @@ -100,7 +101,7 @@ export default () => { rightTitle: '------', }, { - leftTitle: '其他什么:', + leftTitle: '其他说明:', rightTitle: '------', }, { @@ -378,6 +379,10 @@ interface PropGoods { } const GoodsItem = memo((porps: PropGoods) => { const { list = [], obj = {} } = porps + + const labAndImgObj = useCallback((item) => { + return { lab: item.lab, rgb: item.rgb, texture_url: item.texture_url } + }, []) return ( <> { @@ -389,7 +394,16 @@ const GoodsItem = memo((porps: PropGoods) => { item.product_colors.map((it, inx) => { return ( - + { + it.texture_url === '' && + + } + { + it.texture_url !== '' && + + + + } diff --git a/src/pages/refundMoneyDetail/index.module.scss b/src/pages/refundMoneyDetail/index.module.scss index c627e87..518cf17 100644 --- a/src/pages/refundMoneyDetail/index.module.scss +++ b/src/pages/refundMoneyDetail/index.module.scss @@ -205,7 +205,7 @@ // margin-right: 42px; width: 108px; height: 108px; - background: #322F2F; + // background: #322F2F; border-radius: 8px; } @@ -271,7 +271,7 @@ // margin-right: 42px; width: 108px; height: 108px; - background: #322F2F; + // background: #322F2F; border-radius: 8px; } diff --git a/src/pages/refundMoneyDetail/index.tsx b/src/pages/refundMoneyDetail/index.tsx index efdc82c..f8867a8 100644 --- a/src/pages/refundMoneyDetail/index.tsx +++ b/src/pages/refundMoneyDetail/index.tsx @@ -2,7 +2,7 @@ import { View, Input, Button, Image } from '@tarojs/components' import { useCallback, useEffect, useMemo, useRef, useState, ReactNode, memo } from 'react' import styles from "./index.module.scss" import classnames from "classnames"; -import Taro, { faceVerifyForPay, useDidShow, useRouter } from '@tarojs/taro' +import Taro, { faceVerifyForPay, useDidShow, useRouter, usePullDownRefresh } from '@tarojs/taro' import ItemList from './components/itemList' import { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, formatWeightDiv } from '@/common/format' import { @@ -14,11 +14,18 @@ import OrderState from './components/orderState' // import AddressDetailBox from './components/addressDetailBox' import { IMG_CND_Prefix } from "@/common/constant"; import RefundCodelist from "@/components/RefundCodelist" +import LabAndImg from "@/components/LabAndImg" export default () => { const router = useRouter() useEffect(() => { getDetail() }, []) + //页面下拉刷新 + usePullDownRefresh(() => { + getDetail() + }) + + //获取详情 const { fetchData: detailFetch } = mpreturnApplyOrder() const [DeatailObj, setDeatailObj] = useState({}) @@ -43,7 +50,7 @@ export default () => { if (it.leftTitle === '退货说明:') { it.rightTitle = res.data.return_explain_name } - if (it.leftTitle === '其他什么:') { + if (it.leftTitle === '其他说明:') { it.rightTitle = res.data.reason_describe } // if (it.leftTitle === '货物状况:') { @@ -54,6 +61,7 @@ export default () => { } }) setOrderMsg([...orderMsg]) + Taro.stopPullDownRefresh(); // setPicList([...res.data?.accessory_url !== null ? res.data?.accessory_url : []]) Taro.hideLoading() } @@ -61,10 +69,10 @@ export default () => { //分辨用质检中还是质检前的数组 const productList = useMemo(() => { - if (DeatailObj.stage == 0 || DeatailObj.type == 3) { - return DeatailObj.product_list + if (DeatailObj?.stage == 0 || DeatailObj?.type == 3) { + return DeatailObj?.product_list } else { - return DeatailObj.quality_check_pass_product + return DeatailObj?.quality_check_pass_product } }, [DeatailObj]) @@ -90,7 +98,7 @@ export default () => { rightTitle: '------', }, { - leftTitle: '其他什么:', + leftTitle: '其他说明:', rightTitle: '------', }, // { @@ -346,6 +354,9 @@ interface PropGoods { } const GoodsItem = memo((porps: PropGoods) => { const { list = [], obj = {} } = porps + const labAndImgObj = useCallback((item) => { + return { lab: item.lab, rgb: item.rgb, texture_url: item.texture_url } + }, []) return ( <> { @@ -354,10 +365,20 @@ const GoodsItem = memo((porps: PropGoods) => { {item.code}# {item.name} { - item.product_colors.map((it, inx) => { + item?.product_colors.map((it, inx) => { return ( - + { + it.texture_url === '' && + + } + { + it.texture_url !== '' && + + + + } + {/* */} diff --git a/src/pages/refundPage/components/itemList/index.tsx b/src/pages/refundPage/components/itemList/index.tsx index 13eccfd..a5c5df0 100644 --- a/src/pages/refundPage/components/itemList/index.tsx +++ b/src/pages/refundPage/components/itemList/index.tsx @@ -1,11 +1,11 @@ -import { ScrollView, View } from '@tarojs/components' +import { ScrollView, View, Image } from '@tarojs/components' import { memo, useCallback, useEffect, useMemo, useState } from 'react' import styles from './index.module.scss' import classnames from 'classnames' // import BottomBtns from '@/components/BottomBtns' import { formatPriceDiv } from '@/common/format' import Taro from '@tarojs/taro' - +import LabAndImg from "@/components/LabAndImg" interface propsObj { obj: any, cancle?: (arg: any, obj: any) => void, @@ -29,6 +29,9 @@ export default memo((props: propsObj) => { } + const labAndImgObj = useCallback((item) => { + return { lab: item.lab, rgb: item.rgb, texture_url: item.texture_url } + }, []) return ( @@ -41,7 +44,17 @@ export default memo((props: propsObj) => { - + + { + props?.obj?.product_list[0]?.texture_url === '' && + + } + { + props?.obj?.product_list[0]?.texture_url !== '' && + <> + + + } 颜色 ({props?.obj?.total_colors}) @@ -99,11 +112,10 @@ export default memo((props: propsObj) => { } 种颜色,共 {props?.obj?.sale_mode === 0 ? props?.obj?.total_number : props?.obj?.total_number / 100} {props?.obj?.sale_mode === 0 ? '条' : 'm'} { - (props?.obj.stage == 5 || props?.obj.stage == 6 || props?.obj.stage == 3) && + (props?.obj.stage == 3) && 退款金额: ¥{formatPriceDiv(props?.obj?.refund_amount)} - } { diff --git a/src/pages/refundPage/index.tsx b/src/pages/refundPage/index.tsx index 710544b..76a5681 100644 --- a/src/pages/refundPage/index.tsx +++ b/src/pages/refundPage/index.tsx @@ -395,13 +395,12 @@ export default () => { - - - - - - + + + + + {/* */} diff --git a/src/pages/searchPage/index.tsx b/src/pages/searchPage/index.tsx index 4691765..873ff4b 100644 --- a/src/pages/searchPage/index.tsx +++ b/src/pages/searchPage/index.tsx @@ -175,11 +175,13 @@ export default memo(() => { }, []) const [goodObj, setGoodsobj] = useState({}) + const ShopCartRef = useRef() //点击对应商品显示购物车 const showCart = async (item) => { setSearchObj((e) => ({ ...e, goodsId: item.id })) setShowShopCart(true) setGoodsobj(item) + ShopCartRef.current.SearchRef.current.clearInput() } //点击加展示输入框 @@ -396,7 +398,9 @@ export default memo(() => { } } - handSure()} + handSure()} clientName={clientObj?.clientName} clientId={clientObj?.clientId} modeFont={search.modeId} diff --git a/src/pages/submitOrder/index.tsx b/src/pages/submitOrder/index.tsx index 4400559..5fed400 100644 --- a/src/pages/submitOrder/index.tsx +++ b/src/pages/submitOrder/index.tsx @@ -186,7 +186,7 @@ export default () => { {/* */} - {formatPriceDiv(infoObj.estimate_amount)} + ¥{formatPriceDiv(infoObj.estimate_amount)} `} clickNode={() => setShowDesc(true)}>