diff --git a/project.private.config.json b/project.private.config.json index c96a9a8..98b365a 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -155,6 +155,13 @@ "query": "purchaser_id=642&sale_mode=1&shopping_cart_product_color_list%5B2%5D=58994&shopping_cart_product_color_list%5B3%5D=58995", "launchMode": "default", "scene": null + }, + { + "name": "", + "pathName": "pages/applyGoods/index", + "query": "orderId=28503", + "launchMode": "default", + "scene": null } ] } diff --git a/src/components/BottomBtns/index.tsx b/src/components/BottomBtns/index.tsx index d3cb210..e32b5fa 100644 --- a/src/components/BottomBtns/index.tsx +++ b/src/components/BottomBtns/index.tsx @@ -6,7 +6,8 @@ interface prosObj { sale_mode?: Number, collect_status?: Number | string, status?: Number, - payment_method?: Number + payment_method?: Number, + settle_mode?: Number | string, } cancle?: (any) => void, nextBuy?: (any) => void, @@ -20,22 +21,27 @@ export default memo((props: prosObj) => { collect_status: '', status: '', payment_method: 0, + settle_mode: '' }, cancle, nextBuy, toPay } = props //判断显示取消订单 + const showCancel = useMemo(() => { if ( (obj.sale_mode === 0 && obj.status === 0) || (obj.sale_mode === 0 && obj.status === 1) || - (obj.sale_mode === 0 && obj.status === 2) || - (obj.sale_mode === 0 && obj.status === 11 && obj.collect_status == 0) || + (obj.sale_mode === 0 && obj.status === 2 && obj.collect_status == 0) || (obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 0) || - (obj.sale_mode === 0 && obj.status === 3 && (obj.payment_method == 3 || obj.payment_method == 5)) || + (obj.sale_mode === 0 && obj.status === 11 && obj.collect_status == 0) || + (obj.sale_mode === 0 && obj.status === 11 && obj.settle_mode == 3) || + (obj.sale_mode === 0 && obj.status === 3 && obj.settle_mode == 3) || (obj.sale_mode === 1 && obj.status === 10) || - (obj.sale_mode === 2 && obj.status === 10) + (obj.sale_mode === 2 && obj.status === 10) || + (obj.sale_mode === 2 && obj.status === 0 && (obj.collect_status == 1 || obj.collect_status == 2)) || + (obj.sale_mode === 2 && obj.status === 0 && obj.collect_status == 0) ) { return true } else return false @@ -58,6 +64,7 @@ export default memo((props: prosObj) => { (obj.sale_mode === 0 && obj.status === 3 && (obj.payment_method == 3 || obj.payment_method == 5)) || (obj.sale_mode === 0 && obj.status === 8 && (obj.payment_method == 3 || obj.payment_method == 5 || obj.collect_status == 1)) || (obj.sale_mode === 0 && obj.status === 9 && (obj.payment_method == 3 || obj.payment_method == 5 || obj.collect_status == 1)) || + (obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 0) || (obj.sale_mode === 2 && obj.status === 7) ) { return true diff --git a/src/components/goodsItem/index.tsx b/src/components/goodsItem/index.tsx index 49ad56e..a6f4731 100644 --- a/src/components/goodsItem/index.tsx +++ b/src/components/goodsItem/index.tsx @@ -32,11 +32,17 @@ export default memo((props: props) => { const onInputEven = (e) => { let res = e.detail.value - if (props.modeFont !== 2) { - if (Number(res) == 0 || Number(res) < 1) { + if (props.modeFont == 0) { + if (Number(res) < 0) { setValue({ count: 1 }) } - } else { + } + if (props.modeFont == 1) { + if (Number(res) < 0) { + setValue({ count: 0.5 }) + } + } + if (props.modeFont == 2) { if (Number(res) == 0 || Number(res) < 3) { setValue({ count: 3 }) } diff --git a/src/components/popup/index.tsx b/src/components/popup/index.tsx index 4907caa..2d35596 100644 --- a/src/components/popup/index.tsx +++ b/src/components/popup/index.tsx @@ -1,7 +1,7 @@ import { View } from '@tarojs/components' import style from './index.module.scss' import classnames from 'classnames' -import { memo, ReactNode, useEffect, useMemo, useRef } from 'react' +import { memo, ReactNode, useEffect, useMemo, useRef, useState } from 'react' import CloseBtnIcon from '@/components/closeBtn' export interface Params { @@ -13,10 +13,11 @@ export interface Params { // IconButton?: ReactNode, // showIconButton?: false | true //是否显示关闭按钮 position?: 'bottom' | 'top' | 'right' //弹出位置 - animationEnd?: () => void //弹出动画结束 + animationEnd?: () => void, //弹出动画结束 + isFixed?: boolean //二次弹窗触发 } export default memo( - ({ title = '标题', show = false, showTitle = true, onClose, showIconButton = false, children, position = 'bottom', animationEnd }: Params) => { + ({ title = '标题', show = false, showTitle = true, isFixed = false, onClose, showIconButton = false, children, position = 'bottom', animationEnd }: Params) => { const animationTime = useRef(null) useEffect(() => { if (show) { @@ -30,16 +31,19 @@ export default memo( useEffect(() => { return () => { + clearTimeout(animationTime.current) } }, []) + const [ShowContext, setShowContext] = useState(false) return ( <> onClose?.()}> e.stopPropagation()}> {showTitle && {title}} @@ -48,7 +52,6 @@ export default memo( onClose?.()} /> )} - {children} diff --git a/src/components/shoppingCart/index.tsx b/src/components/shoppingCart/index.tsx index af101c9..6e16f53 100644 --- a/src/components/shoppingCart/index.tsx +++ b/src/components/shoppingCart/index.tsx @@ -141,7 +141,7 @@ export default memo(forwardRef((props: prosObj, ref) => { {modeFont == 0 ? '大货' : modeFont == 1 ? '剪版' : '散剪'}单位:{showModefont} - + { goodList.length > 0 && <> diff --git a/src/components/uploadImage/index.module.scss b/src/components/uploadImage/index.module.scss index ce972de..3eaf064 100644 --- a/src/components/uploadImage/index.module.scss +++ b/src/components/uploadImage/index.module.scss @@ -65,6 +65,18 @@ } } + + + +} + +.bigBoxThree { + width: 100%; + // position: fixed; + // bottom: 0px; + // z-index: 999; + height: 150px; + .itemBox { width: 100%; height: 88px; diff --git a/src/components/uploadImage/index.tsx b/src/components/uploadImage/index.tsx index 16af902..f27220f 100644 --- a/src/components/uploadImage/index.tsx +++ b/src/components/uploadImage/index.tsx @@ -84,30 +84,35 @@ const PictureItem = memo(({ onChange, defaultList, onlyRead = false } return ( - - {imageList?.map((item, index) => ( - - - {!onlyRead && delImage(index)} className={classnames(styles.miconfont_close, 'iconfont icon-guanbi')}>} + <> + + {imageList?.map((item, index) => ( + + + {!onlyRead && delImage(index)} className={classnames(styles.miconfont_close, 'iconfont icon-guanbi')}>} + + ))} + {!onlyRead && ( + + + {/* 上传照片 */} + + )} + + + setshowPopup(false)} isFixed={true}> + + { + List.map((item, index) => { + return ( + handItem(item)}>{item.name} + ) + }) + } - ))} - {!onlyRead && ( - - - {/* 上传照片 */} - - )} - setshowPopup(false)}> - { - List.map((item, index) => { - return ( - handItem(item)}>{item.name} - ) - }) - } - + ) }) diff --git a/src/pages/applyGoods/index.tsx b/src/pages/applyGoods/index.tsx index 7570256..bd355d2 100644 --- a/src/pages/applyGoods/index.tsx +++ b/src/pages/applyGoods/index.tsx @@ -25,16 +25,23 @@ export default () => { const [ListArr, setListArr] = useState([]) //获取订单详情 const getDetail = async () => { - const res = await infoFetch({ id: router.params.orderId }) - res.data.av_return_product.forEach(item => { - item.av_product_color.map(it => { - it.isTui = false - it.nums = 1 - }) - return item + Taro.showLoading({ + title: '请稍等...', + mask: true }) - setListArr(res.data.av_return_product) - setInfoObj(res.data) + const res = await infoFetch({ id: router.params.orderId }) + if (res.data) { + res.data.av_return_product.forEach(item => { + item.av_product_color.map(it => { + it.isTui = false + it.nums = 1 + }) + return item + }) + setListArr(res.data.av_return_product) + setInfoObj(res.data) + Taro.hideLoading() + } } //点击退货 @@ -176,9 +183,10 @@ export default () => { //判断是否允许提交 const isDisabled = useMemo(() => { + console.log(Query, 8888) if (Query.GoodStatus !== '' && Query.return_explain !== '' && - totalNums !== 0 && + totalNums > 0 && Query.GoodStatus !== '' ) { return false @@ -236,7 +244,8 @@ export default () => { }) setReasonListTwo([...ReasonListTwo]) // queryRef.current.reasonNameTwo = item.name - setQuery({ return_explain: item.id }) + setQuery((val) => ({ ...val, return_explain: item.id })) + // queryRef.current.return_explain = item.id } @@ -265,10 +274,10 @@ export default () => { //判断选择原因 const selectIsDisabled = useMemo(() => { - if (Query.return_explain == '') { - return true - } else { + if (Query.return_explain !== '') { return false + } else { + return true } }, [Query]) @@ -362,12 +371,15 @@ export default () => { const arr: any = []; ListArr.forEach((item) => { item.av_product_color.forEach((it) => { - arr.push({ - product_color_id: it.sale_mode == 0 ? it.product_color_id : '', - product_id: it.sale_mode == 0 ? it.product_id : '', - product_roll: it.sale_mode == 0 ? it.nums : 0, - sale_order_detail_id: it.sale_order_detail_id, - }); + if (it.isTui) { + arr.push({ + product_color_id: it.sale_mode == 0 ? it.product_color_id : '', + product_id: it.sale_mode == 0 ? it.product_id : '', + product_roll: it.sale_mode == 0 ? it.nums : 0, + sale_order_detail_id: it.sale_order_detail_id, + }); + } + }); }); const query = { @@ -380,6 +392,7 @@ export default () => { roll_list: arr, sale_order_id: Number(infoObj.id), } + Taro.showModal({ content: "确认退货吗?", confirmText: "确认", @@ -409,7 +422,9 @@ export default () => { } }) } - + useEffect(() => { + setQuery(Query) + }, [Query]) //备注信息 const [TextareaValue, setTextareaValue] = useState('') @@ -471,7 +486,6 @@ 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={'选填/退货说明中选择时(其他问题)必填'} > diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 8c2e0cf..ff5b540 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -75,7 +75,7 @@ export default () => { setHasMore(true) setRefresherTriggeredStatus(true) } - + const onj = JSON.parse(Taro.getStorageSync('userInfo') || '{}') const [search, setSearchObj] = useState({ modeId: 0, @@ -117,10 +117,15 @@ export default () => { const res = await colorlistFetch({ product_id: search.goodsId, sale_mode: search.modeId, code_or_name: search.code_or_name, physical_warehouse: 1 }) res.data.list.map((item) => { item.showInput = false - if (search.modeId !== 2) { + if (search.modeId == 0) { item.nums = 1 item.buyNums = 1 - } else { + } + if (search.modeId == 1) { + item.nums = 0.5 + item.buyNums = 0.5 + } + if (search.modeId == 2) { item.nums = 3 item.buyNums = 3 } @@ -158,9 +163,13 @@ export default () => { goodList.map((it) => { if (item.id === it.id) { item.nums-- - if (search.modeId !== 2) { + if (search.modeId == 0) { if (item.nums < 1) it.showInput = false, it.nums = 1 - } else { + } + if (search.modeId == 1) { + if (item.nums < 0.5) it.showInput = false, it.nums = 0.5 + } + if (search.modeId == 2) { if (item.nums < 3) it.showInput = false, it.nums = 3 } @@ -174,9 +183,7 @@ export default () => { const handPlus = useCallback((item) => { goodList.map((it) => { if (item.id === it.id) { - // if (it.nums > item.buyNums) { it.nums++ - // } } return item }) @@ -213,8 +220,8 @@ export default () => { const list: any[] = [] arr.forEach(it => { list.push({ - roll: search.modeId === 0 ? it.nums : 0, - length: search.modeId !== 0 ? it.nums * 100 : 0, + roll: search.modeId === 0 ? Number(it.nums) : 0, + length: search.modeId !== 0 ? Number(it.nums) * 100 : 0, product_color_id: Number(it.id) }) }) @@ -240,7 +247,6 @@ export default () => { return item }) setGoodlist([...goodList]) - console.log(search, '000000.0.0.') Taro.hideLoading() } else { Taro.hideLoading() @@ -254,13 +260,32 @@ export default () => { const onBlur = (e, id) => { goodList.map((item) => { if (item.id == id) { - item.nums = e.detail.value + if (search.modeId == 0 && (e.detail.value == '' || Number(e.detail.value) == 0)) { + item.nums = 1 + item.showInput = false + } else { + item.nums = e.detail.value + } + if (search.modeId == 1 && Number(e.detail.value) < 0.5) { + item.nums = 0.5 + item.showInput = false + } else { + item.nums = e.detail.value + } + if (search.modeId == 2) { + item.nums = e.detail.value + } + } return item }) setGoodlist([...goodList]) } + useEffect(() => { + setGoodlist(goodList) + }, [goodList]) + return ( // setShowShopCart(showShopCart)}> diff --git a/src/pages/order/components/PayPopup/index.tsx b/src/pages/order/components/PayPopup/index.tsx index e874859..8574e91 100644 --- a/src/pages/order/components/PayPopup/index.tsx +++ b/src/pages/order/components/PayPopup/index.tsx @@ -117,7 +117,7 @@ export default memo((props: Props) => { 订单金额 - ¥{formatPriceDiv(obj.total_sale_price)} + ¥{formatPriceDiv(obj.wait_pay_amount)} diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx index 92136de..0aa4f1d 100644 --- a/src/pages/order/index.tsx +++ b/src/pages/order/index.tsx @@ -143,7 +143,6 @@ export default () => { clientName: '', sale_user_id: '', saleuserName: '', - // order_no: '', sale_mode: undefined, shipment_mode: undefined }) @@ -159,10 +158,7 @@ export default () => { }) } } - // //订单号输入框 - // const handInput = (eq) => { - // setsearchObj((e) => ({ ...e, order_no: eq.detail.value })) - // } + //订单类型 const [modeList, setModeList] = useState([{ id: -1, name: '不限' }, { id: 0, name: '大货' }, { id: 1, name: '剪版' }, { id: 2, name: '散剪' }]) @@ -243,8 +239,7 @@ export default () => { const handScan = () => { Taro.scanCode({ success(res) { - // setsearchObj((e) => ({ ...e, order_no: res.result })) - setSearchField({ ...searchField, order_no: res.result }) + setSearchField((val) => ({ ...val, order_no: res.result })) }, fail(res) { console.log(res); @@ -596,7 +591,7 @@ export default () => { return ( - handScan()} showScan placeholder='搜索商品/名称/颜色/订单号' showBtn={false} changeOnSearch={getSearchData} debounceTime={300}> + handScan()} defaultValue={searchField.order_no} showScan placeholder='搜索商品/名称/颜色/订单号' showBtn={false} changeOnSearch={getSearchData} debounceTime={300}> showSelctPopup()}> {/* */} diff --git a/src/pages/orderDetails/components/addressDetailBox/index.module.scss b/src/pages/orderDetails/components/addressDetailBox/index.module.scss index 3c97015..1470373 100644 --- a/src/pages/orderDetails/components/addressDetailBox/index.module.scss +++ b/src/pages/orderDetails/components/addressDetailBox/index.module.scss @@ -35,14 +35,14 @@ font-family: PingFangSC-Medium, PingFang SC; font-weight: 500; color: #000000; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - /*这里设置几行*/ - overflow: hidden; margin-right: 41px; display: flex; align-items: center; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; /*这里设置几行*/ + overflow: hidden; + } .icon_more { diff --git a/src/pages/orderDetails/components/addressDetailBox/index.tsx b/src/pages/orderDetails/components/addressDetailBox/index.tsx index 6901334..c0f6a43 100644 --- a/src/pages/orderDetails/components/addressDetailBox/index.tsx +++ b/src/pages/orderDetails/components/addressDetailBox/index.tsx @@ -21,7 +21,7 @@ export default memo((props: propsObj) => { if (receivingStatus == 1) { return obj.take_goods_address } else { - return obj.province_name + obj.city_name + obj.district_name + return obj.province_name + obj.city_name + obj.district_name + obj.address_detail } }, [obj, receivingStatus]) diff --git a/src/pages/orderDetails/components/remark/index.tsx b/src/pages/orderDetails/components/remark/index.tsx index db4b68f..6549365 100644 --- a/src/pages/orderDetails/components/remark/index.tsx +++ b/src/pages/orderDetails/components/remark/index.tsx @@ -1,14 +1,14 @@ import Popup from "@/components/popup" import { Textarea, View } from "@tarojs/components" import { useCallback, useEffect, useState } from "react" -import styles from './index.module.scss' +import styles from './index.module.scss' type Param = { - onBlur?: (val:any) => void + onBlur?: (val: any) => void onSave?: (val: string) => void defaultValue?: string } -export default ({onBlur, onSave, defaultValue = ''}:Param) => { +export default ({ onBlur, onSave, defaultValue = '' }: Param) => { const [descData, setDescData] = useState({ number: 0, value: '', @@ -21,10 +21,10 @@ export default ({onBlur, onSave, defaultValue = ''}:Param) => { const getDesc = (value) => { let res = value - if(value.length > descData.count) { + if (value.length > descData.count) { res = value.slice(0, descData.count) } - setDescData({...descData, number:res.length, value: res}) + setDescData({ ...descData, number: res.length, value: res }) } const setSave = () => { diff --git a/src/pages/orderDetails/index.module.scss b/src/pages/orderDetails/index.module.scss index 93b6ee0..38cb458 100644 --- a/src/pages/orderDetails/index.module.scss +++ b/src/pages/orderDetails/index.module.scss @@ -199,6 +199,7 @@ page { } + .itemGoods:last-child { margin-top: 24px; display: flex; @@ -367,4 +368,18 @@ page { transform: rotate(135deg); box-shadow: 2px -2px 2px #ccc; } +} + +.order_save_address { + height: 82px; + background: #007aff; + border-radius: 40px; + width: 668px; + text-align: center; + line-height: 82px; + color: #fff; + margin-top: 20px; + margin-left: 24px; + margin-right: 24px; + margin-bottom: 20px; } \ No newline at end of file diff --git a/src/pages/orderDetails/index.tsx b/src/pages/orderDetails/index.tsx index ff881f7..89a09e0 100644 --- a/src/pages/orderDetails/index.tsx +++ b/src/pages/orderDetails/index.tsx @@ -5,7 +5,7 @@ import classnames from "classnames"; import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro'; import AdvanceOrderState from './components/advanceOrderState' import AddressDetailBox from './components/addressDetailBox' -import Remark from './components/remark' +import Remark from '@/components/textareaEnhance' import Popup from '@/components/popup' import BottomBtns from '@/components/BottomBtns'; import BottomApply from './components/BottomApply'; @@ -72,11 +72,19 @@ export default () => { setReceivingStatus(value) getDetail() } else { - Taro.hideLoading() - Taro.showToast({ - title: '请先去新增地址', - icon: 'error' - }) + if (res.data.code == 70029) { + Taro.hideLoading() + Taro.showToast({ + title: res.msg, + icon: 'error' + }) + } else { + Taro.hideLoading() + Taro.showToast({ + title: '请先去新增地址', + icon: 'error' + }) + } } }, 300) @@ -106,6 +114,8 @@ export default () => { }) setOrderMsg([...orderMsg]) setReceivingStatus(res.data.shipment_mode) + // 小程序提供的api,通知页面停止下拉刷新效果 + Taro.stopPullDownRefresh(); Taro.hideLoading() } //复制功能 @@ -148,8 +158,8 @@ export default () => { //备注操作 const [showDesc, setShowDesc] = useState(false) const { fetchData: remarkFetch } = mpsaleOrderput() - const getRemark = useCallback(async (e) => { - const res = await remarkFetch({ remark: e, id: Number(router.params.id) }) + const getRemark = async () => { + const res = await remarkFetch({ remark: infoObj.remark, id: Number(router.params.id) }) if (res.msg === 'success') { Taro.showToast({ title: '成功', @@ -158,7 +168,7 @@ export default () => { setShowDesc(false) getDetail() } - }, []) + } //更多按钮查看操作 const [showMore, setShowMore] = useState(false) @@ -476,7 +486,7 @@ export default () => { title: '请稍等...', mask: true }) - const restult = await obj.status !== 10 ? payOneFetch({ id: Number(obj.should_collect_order_id), payment_method: Number(arr[0]?.id) }) : payTwoFetch({ id: Number(obj.pre_collect_order_id), payment_method: Number(arr[0]?.id) }) + let restult = await obj.status !== 10 ? payOneFetch({ id: Number(obj.should_collect_order_id), payment_method: Number(arr[0]?.id) }) : payTwoFetch({ id: Number(obj.pre_collect_order_id), payment_method: Number(arr[0]?.id) }) if (restult?.msg === 'success') { Taro.showToast({ title: '交易成功' @@ -548,7 +558,7 @@ export default () => { title: '请稍等...', mask: true }) - const res = await receveFetch({ id: Number(infoObj.id) }) + const res = await receveFetch({ sale_order_id: Number(infoObj.id) }) if (res?.msg === 'success') { Taro.showToast({ title: '成功' @@ -569,6 +579,13 @@ export default () => { }) } + const onChange = (e) => { + setInfoObj((val) => ({ ...val, remark: e })) + } + + useEffect(() => { + setInfoObj(infoObj) + }, [infoObj]) return ( {(infoObj?.status != 10 && )} @@ -636,11 +653,22 @@ export default () => { } - `} clickNode={() => setShowDesc(true)}> - {infoObj.remark === '' ? '暂无' : infoObj.remark} - - setShowDesc(false)}> - getRemark(e)} defaultValue={infoObj.remark} /> + { + (infoObj.status != 11 && infoObj.status != 3 && infoObj.status != 8 && infoObj.status != 9 && infoObj.status != 4 + ) && `} clickNode={() => setShowDesc(true)}> + {infoObj.remark === '' ? '暂无' : infoObj.remark} + + } + + setShowDesc(false)}> + + getRemark(e)} + onChange={(e) => onChange(e)} + defaultValue={infoObj.remark} /> + getRemark()}>保存 + + diff --git a/src/pages/refundDetail/index.tsx b/src/pages/refundDetail/index.tsx index 3fcac7e..d23fbda 100644 --- a/src/pages/refundDetail/index.tsx +++ b/src/pages/refundDetail/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 { @@ -15,8 +15,12 @@ import AddressDetailBox from './components/addressDetailBox' import { IMG_CND_Prefix } from "@/common/constant"; import Popup from '@/components/popup'; import UploadImage from '@/components/uploadImage' - +import { alert } from '@/common/common'; export default () => { + //页面下拉刷新 + usePullDownRefresh(() => { + getDetail() + }) const router = useRouter() useEffect(() => { getDetail() @@ -58,6 +62,8 @@ export default () => { setOrderMsg([...orderMsg]) setPicList([...res.data?.accessory_url !== null ? res.data?.accessory_url : []]) Taro.hideLoading() + // 小程序提供的api,通知页面停止下拉刷新效果 + Taro.stopPullDownRefresh(); } } @@ -179,7 +185,10 @@ export default () => { const { fetchData: sureFetch } = returnApplyOrderuploadAccessory() const handSure = () => { let arr: any = [] - arr = [...picUrl.current, ...PicList] + arr = [...picUrl.current] + if (arr == 0) { + return alert.error('请先添加附件') + } Taro.showModal({ content: "确定要提交吗?", confirmText: "确认", @@ -193,8 +202,9 @@ export default () => { }) if (res.msg === 'success') { Taro.showToast({ - title: '取消成功' + title: '成功' }) + setShowPic(false) Taro.hideLoading() getDetail() } else { @@ -285,11 +295,13 @@ export default () => { } setShowPic(false)}> - - { + <> + + { - !onlyRead && handSure()}>确认修改 - } + !onlyRead && handSure()}>确认修改 + } + ) diff --git a/src/pages/refundPage/index.tsx b/src/pages/refundPage/index.tsx index 3c67025..3cf0c3f 100644 --- a/src/pages/refundPage/index.tsx +++ b/src/pages/refundPage/index.tsx @@ -48,7 +48,7 @@ export default () => { //监听筛选条件变化 useEffect(() => { getOrderList() - }, [searchField.size, searchField.name]) + }, [searchField.size, searchField.name, searchField.status]) //获取订单列表 const { fetchData: listFetchData, state: orderState } = mpreturnApplyOrderlist() @@ -61,7 +61,7 @@ export default () => { }) setOrderData((e) => ({ ...e, list: res.data?.list, total: res.data?.total })) // setshowPopup(false) - setRefresherTriggeredStatus(() => false) + setRefresherTriggeredStatus(false) } @@ -81,6 +81,7 @@ export default () => { pageNum.current.size = 1 setRefresherTriggeredStatus(true) setSearchField((val) => ({ ...val, size: 10 })) + getOrderList() } //数据加载状态 const statusMore = useMemo(() => { @@ -111,6 +112,7 @@ export default () => { pageNum.current.page = 1 setOrderData(() => ({ list: [], total: 0 })) setSearchField((val) => ({ ...val, size: 10, status: item.id })) + // getOrderList() }) } @@ -126,7 +128,7 @@ export default () => { } //订单类型 - const [modeList, setModeList] = useState([{ id: -1, name: '不限' }, { id: 0, name: '大货' }, { id: 1, name: '剪版' }, { id: 2, name: '散剪' }]) + const [modeList, setModeList] = useState([{ id: '', name: '不限' }, { id: 0, name: '大货' }, { id: 1, name: '剪版' }, { id: 2, name: '散剪' }]) //选择订单类型 const handCheckMode = (item) => { modeList.map(it => { diff --git a/src/pages/searchPage/index.tsx b/src/pages/searchPage/index.tsx index 0207be9..94323ee 100644 --- a/src/pages/searchPage/index.tsx +++ b/src/pages/searchPage/index.tsx @@ -64,10 +64,15 @@ export default memo(() => { const res = await colorlistFetch({ product_id: search.goodsId, sale_mode: search.modeId, code_or_name: search.code_or_name, physical_warehouse: 1 }) res.data.list.map((item) => { item.showInput = false - if (search.modeId !== 2) { + if (search.modeId == 0) { item.nums = 1 item.buyNums = 1 - } else { + } + if (search.modeId == 1) { + item.nums = 0.5 + item.buyNums = 0.5 + } + if (search.modeId == 2) { item.nums = 3 item.buyNums = 3 } @@ -167,9 +172,13 @@ export default memo(() => { goodList.map((it) => { if (item.id === it.id) { item.nums-- - if (search.modeId !== 2) { + if (search.modeId == 0) { if (item.nums < 1) it.showInput = false, it.nums = 1 - } else { + } + if (search.modeId == 1) { + if (item.nums < 0.5) it.showInput = false, it.nums = 0.5 + } + if (search.modeId == 2) { if (item.nums < 3) it.showInput = false, it.nums = 3 } @@ -262,7 +271,22 @@ export default memo(() => { const onBlur = (e, id) => { goodList.map((item) => { if (item.id == id) { - item.nums = e.detail.value + if (search.modeId == 0 && (e.detail.value == '' || Number(e.detail.value) == 0)) { + item.nums = 1 + item.showInput = false + } else { + item.nums = e.detail.value + } + if (search.modeId == 1 && Number(e.detail.value) < 0.5) { + item.nums = 0.5 + item.showInput = false + } else { + item.nums = e.detail.value + } + if (search.modeId == 2) { + item.nums = e.detail.value + } + } return item }) diff --git a/src/pages/submitOrder/index.tsx b/src/pages/submitOrder/index.tsx index 53016b8..c71fe46 100644 --- a/src/pages/submitOrder/index.tsx +++ b/src/pages/submitOrder/index.tsx @@ -22,16 +22,16 @@ export default () => { //获取选择的客户 let pages = Taro.getCurrentPages(); let currPage = pages[pages.length - 1]; // 获取当前页面 - - setInfoObj({ - ...infoObj, - province_name: currPage.data.addressObj.province_name, - address_id: currPage.data.addressObj.id, - city_name: currPage.data.addressObj.city_name, - district_name: currPage.data.addressObj.district_name, - target_user_name: currPage.data.addressObj.name, - purchaser_phone: currPage.data.addressObj.phone, - }) + setInfoObj((val) => ({ + ...val, + province_name: currPage.data?.addressObj?.province_name, + address_id: currPage.data?.addressObj?.id, + city_name: currPage.data?.addressObj?.city_name, + address_detail: currPage.data?.addressObj?.address_detail, + district_name: currPage.data?.addressObj?.district_name, + target_user_name: currPage.data?.addressObj?.name, + purchaser_phone: currPage.data?.addressObj?.phone, + })) }) useEffect(() => { getDetail() @@ -152,6 +152,10 @@ export default () => { } }) } + + useEffect(() => { + setInfoObj(infoObj) + }, [infoObj]) return (