From ff5b5a5fe2518c5e6015b9d90736c7ebb65a4c09 Mon Sep 17 00:00:00 2001 From: Haiyi <1021441632@qq.com> Date: Wed, 21 Sep 2022 19:14:31 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=E7=94=B3=E8=AF=B7=E9=80=80?= =?UTF-8?q?=E8=B4=A780%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.private.config.json | 7 + src/api/order.ts | 30 + src/app.config.ts | 6 + src/pages/applyGoods/index.config.ts | 4 + src/pages/applyGoods/index.module.scss | 575 ++++++++++++++++++ src/pages/applyGoods/index.tsx | 536 ++++++++++++++++ .../components/BottomApply/index.tsx | 1 - src/pages/orderDetails/index.tsx | 57 +- src/pages/refundDetail/index.tsx | 12 +- src/pages/refundMoneyDetail/index.module.scss | 1 + src/pages/refundMoneyDetail/index.tsx | 147 ++--- src/styles/iconfont.scss | 2 +- 12 files changed, 1300 insertions(+), 78 deletions(-) create mode 100644 src/pages/applyGoods/index.config.ts create mode 100644 src/pages/applyGoods/index.module.scss create mode 100644 src/pages/applyGoods/index.tsx diff --git a/project.private.config.json b/project.private.config.json index d783659..01b49e2 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -106,6 +106,13 @@ "query": "id=607", "launchMode": "default", "scene": null + }, + { + "name": "", + "pathName": "pages/applyGoods/index", + "query": "orderId=28114", + "launchMode": "default", + "scene": null } ] } diff --git a/src/api/order.ts b/src/api/order.ts index 314b211..a6f47ab 100644 --- a/src/api/order.ts +++ b/src/api/order.ts @@ -137,3 +137,33 @@ export const mpsearchHistory = () => { method: "post", }) } +//确认收货 +export const mpsaleOrderreceive = () => { + return useRequest({ + url: `/v1/mp/saleOrder/receive`, + method: "put", + }) +} +//退货原因 +export const mpenumreturnOrderreturnReason = () => { + return useRequest({ + url: `/v1/mp/enum/returnOrder/returnReason`, + method: "get", + }) +} +//二次选择退货原因 +export const mpenumreturnExplain = () => { + return useRequest({ + url: `/v1/mp/enum/returnExplain`, + method: "get", + }) +} +//货物状况 +export const mpenumreturngoodsStatus = () => { + return useRequest({ + url: `/v1/mp/enum/return/goodsStatus`, + method: "get", + }) +} + + diff --git a/src/app.config.ts b/src/app.config.ts index 4350d24..c21693a 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -93,6 +93,12 @@ export default defineAppConfig({ pages: [ "index" ] + }, + { + root: "pages/applyGoods", + pages: [ + "index" + ] } ], }) diff --git a/src/pages/applyGoods/index.config.ts b/src/pages/applyGoods/index.config.ts new file mode 100644 index 0000000..b5d56d6 --- /dev/null +++ b/src/pages/applyGoods/index.config.ts @@ -0,0 +1,4 @@ +export default { + navigationBarTitleText: '申请退货', + enableShareAppMessage: true, +} diff --git a/src/pages/applyGoods/index.module.scss b/src/pages/applyGoods/index.module.scss new file mode 100644 index 0000000..7607095 --- /dev/null +++ b/src/pages/applyGoods/index.module.scss @@ -0,0 +1,575 @@ +.main {} + +.bgBox { + margin: 24px; + background: #FFFFFF; + border-radius: 16px; + overflow: hidden; +} + + + +.goodsBox { + margin-top: 24px; + overflow: hidden; + border-bottom: 8px solid #F7F7F7; + + .goodsProduct { + font-size: 28px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #000000; + margin-left: 32px; + } + + .goodsLine { + width: 638px; + height: 1px; + background: #000000; + opacity: 0.1; + margin-left: 32px; + margin-top: 24px; + } + + .itemGoods { + margin-top: 24px; + display: flex; + + .itemPic { + margin-left: 32px; + margin-right: 42px; + width: 108px; + height: 108px; + background: #322F2F; + border-radius: 8px; + } + + .itemRight { + padding-bottom: 24px; + width: 495px; + border-bottom: 1px solid #f7f7f7; + + .item_right_top { + margin-bottom: 41px; + display: flex; + align-items: center; + justify-content: space-between; + + .itemName { + font-size: 28px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #000000; + } + + .itemNums { + font-size: 28px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #000000; + } + } + + .item_right_Bottom { + display: flex; + align-items: center; + justify-content: space-between; + + .itemMoney { + font-size: 28px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #000000; + } + + .itemMoneyOne { + font-size: 28px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #000000; + } + + .btn { + width: 120px; + height: 64px; + border-radius: 8px; + border: 1px solid #337FFF; + font-size: 28px; + font-weight: 400; + color: #337FFF; + text-align: center; + line-height: 64px; + } + + .btnOne { + width: 204px; + height: 64px; + border-radius: 8px; + border: 1px solid #337FFF; + font-size: 28px; + font-weight: 400; + color: #337FFF; + text-align: center; + line-height: 64px; + } + + .inputBox { + width: 189px; + height: 64px; + border-radius: 8px; + border: 1px solid #337FFF; + display: flex; + + .redceBox { + width: 64px; + height: 64px; + border-radius: 8px 0px 0px 8px; + border-right: 1px solid #337FFF; + display: flex; + align-items: center; + justify-content: center; + + .reduce { + width: 20px; + height: 2px; + background: #337FFF; + } + } + + .inputBig { + width: 61px; + height: 64px; + display: flex; + align-items: center; + justify-content: center; + text-align: center; + font-size: 24px; + font-weight: 400; + color: #337FFF; + } + + .addBox { + width: 64px; + height: 64px; + border-left: 1px solid #337FFF; + display: flex; + align-items: center; + justify-content: center; + font-size: 40px; + color: #337FFF; + } + } + } + } + + + } + + .itemGoods:last-child { + margin-top: 24px; + display: flex; + + .itemPic { + margin-left: 32px; + margin-right: 42px; + width: 108px; + height: 108px; + background: #322F2F; + border-radius: 8px; + } + + .itemRight { + padding-bottom: 24px; + width: 495px; + border-bottom: none; + + .item_right_top { + margin-bottom: 41px; + display: flex; + align-items: center; + justify-content: space-between; + + .itemName { + font-size: 28px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #000000; + } + + .itemNums { + font-size: 28px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #000000; + } + } + + .item_right_Bottom { + display: flex; + align-items: center; + justify-content: space-between; + + .itemMoney { + font-size: 28px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #000000; + } + + .itemMoneyOne { + font-size: 28px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #000000; + } + + .btn { + width: 120px; + height: 64px; + border-radius: 8px; + border: 1px solid #337FFF; + font-size: 28px; + font-weight: 400; + color: #337FFF; + text-align: center; + line-height: 64px; + } + + .btnOne { + width: 204px; + height: 64px; + border-radius: 8px; + border: 1px solid #337FFF; + font-size: 28px; + font-weight: 400; + color: #337FFF; + text-align: center; + line-height: 64px; + } + } + } + + + } +} + +.goodsBox { + border-bottom: none; +} + + + +.hasSelect { + margin-left: 32px; + margin-right: 32px; + height: 54px; + background: #FEF9F4; + border-radius: 8px; + display: flex; + align-items: center; + font-size: 24px; + font-weight: 600; + color: #F79B31; + padding-left: 20px; + margin-bottom: 24px; +} + +.resonBig { + overflow: hidden; + margin: 0 24px; + background: #FFFFFF; + border-radius: 16px 16px 0px 0px; + + + .reasonItem { + display: flex; + align-items: center; + border-bottom: 1px solid #f7f7f7; + margin: 32px; + padding-bottom: 32px; + justify-content: space-between; + + .reasonLeft { + display: flex; + align-items: center; + + .reasonFont { + font-size: 28px; + font-weight: 500; + color: #000000; + } + + .xing { + font-size: 28px; + font-weight: 500; + color: #E42945; + } + + .selectFont { + font-size: 28px; + font-weight: 400; + color: #000000; + margin-left: 40px; + } + } + + .chakanquanbukehu { + font-size: 50px; + } + } + + .picBig { + display: flex; + margin-top: 32px; + display: flex; + padding-bottom: 32px; + + .picFont { + width: 130px; + font-size: 28px; + font-weight: 500; + color: #000000; + margin-left: 32px; + } + + // .rightPic { + // margin-right: 32px; + // } + } +} + +.descBox { + margin: 32px; + background: #FFFFFF; + border-radius: 16px 16px 0px 0px; + overflow: hidden; + + .title { + font-size: 28px; + font-weight: 500; + color: #000000; + margin-top: 24px; + margin-left: 32px; + } + + .textBox { + padding-top: 15px; + padding-left: 24px; + padding-right: 24px; + padding-bottom: 24px; + margin-right: 32px; + margin-top: 24px; + margin-left: 32px; + height: 210px; + background: #f6f6f6; + border-radius: 8px; + font-size: 28px; + font-weight: 400; + color: #000000; + margin-bottom: 32px; + } + + +} + +.bottomBox { + width: 750px; + height: 160px; + background: #FFFFFF; + position: fixed; + bottom: 0; + z-index: 99; + display: flex; + padding-top: 16px; + justify-content: space-between; + + .resetBox { + margin-left: 48px; + width: 311px; + height: 80px; + border-radius: 44px; + border: 1px solid #087EFF; + font-size: 28px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #337FFF; + text-align: center; + line-height: 80px; + } + + .button { + margin-right: 32px; + width: 311px; + height: 80px; + background: #68b4ff; + border-radius: 44px; + font-size: 32px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #FFFFFF; + text-align: center; + line-height: 80px; + } + + .activeButton { + margin-right: 32px; + width: 311px; + height: 80px; + background: #337FFF; + border-radius: 44px; + font-size: 32px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #fff; + text-align: center; + line-height: 80px; + } +} + +.safeBox { + height: 160px; + width: 100%; +} + +.popupBox { + padding-bottom: env(safe-area-inset-bottom); + + + + + .thirdBox { + margin-top: 20px; + padding-left: 48px; + + .thirdTopfont { + font-size: 28px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #000000; + } + + .timeBox2 { + margin-top: 24px; + background-color: #f6f6f6; + height: 68px; + background: #E9E9E9; + border-radius: 8px; + margin-right: 48px; + text-align: center; + line-height: 68px; + position: relative; + font-size: 28px; + font-weight: 400; + color: #000000; + + .more { + position: absolute; + right: 30px; + top: 5px; + font-size: 40px; + } + } + + .flexModebox { + margin-top: 24px; + display: flex; + flex-wrap: wrap; + + .activemodeBox { + margin-bottom: 16px; + margin-right: 16px; + // width: 152px; + // height: 68px; + padding: 17px 34px 17px 34px; + background: rgba(51, 127, 255, 0.1); + border-radius: 8px; + font-size: 28px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #337FFF; + text-align: center; + // line-height: 68px; + border: 1px solid #337FFF; + box-sizing: border-box; + } + + .modeBox { + margin-bottom: 16px; + margin-right: 16px; + padding: 17px 34px 17px 34px; + // width: 152px; + // height: 68px; + background: #f6f6f6; + border-radius: 8px; + font-size: 28px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #000000; + border: 1px solid #f6f6f6; + text-align: center; + // line-height: 68px; + box-sizing: border-box; + // opacity: 0.4; + } + } + } + + .bottomBox1 { + width: 750px; + height: 160px; + background: #FFFFFF; + position: fixed; + bottom: 0; + z-index: 99; + display: flex; + padding-top: 16px; + justify-content: space-between; + + .resetBox1 { + margin-left: 48px; + width: 311px; + height: 80px; + border-radius: 44px; + border: 1px solid #087EFF; + font-size: 28px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #337FFF; + text-align: center; + line-height: 80px; + } + + .button1 { + margin-right: 32px; + width: 311px; + height: 80px; + background: #68b4ff; + border-radius: 44px; + font-size: 32px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #FFFFFF; + text-align: center; + line-height: 80px; + } + + .activeButton1 { + margin-right: 32px; + width: 311px; + height: 80px; + background: #337FFF; + border-radius: 44px; + font-size: 32px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #fff; + text-align: center; + line-height: 80px; + } + } + + // .areaBox { + // height: calc($customTabBarHeight + env(safe-area-inset-bottom)); + // width: 100%; + // } +} \ No newline at end of file diff --git a/src/pages/applyGoods/index.tsx b/src/pages/applyGoods/index.tsx new file mode 100644 index 0000000..54be4be --- /dev/null +++ b/src/pages/applyGoods/index.tsx @@ -0,0 +1,536 @@ +import { View, Input, Button, Image, Text, Textarea } 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 { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, formatWeightDiv } from '@/common/format' +import { + mpsaleOrder, + mpenumreturnOrderreturnReason, + mpenumreturnExplain, + mpenumreturngoodsStatus +} from "@/api/order" +import Popup from '@/components/popup' +import UploadImage from '@/components/uploadImage' + +export default () => { + + const router = useRouter() + useDidShow(() => { + getDetail() + }) + const { fetchData: infoFetch } = mpsaleOrder() + const [infoObj, setInfoObj] = useState({}) + 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 + }) + setListArr(res.data.av_return_product) + setInfoObj(res.data) + } + + //点击退货 + const handTui = (val) => { + let res = ListArr + res.forEach(item => { + item.av_product_color?.map(it => { + if (it.sale_order_detail_id == val.sale_order_detail_id) { + it.isTui = true + } + return it + }) + + }) + setListArr([...res]) + + } + //点击取消退货 + const handCancel = (val) => { + ListArr.forEach(item => { + item.av_product_color.map(it => { + if (it.sale_order_detail_id === val.sale_order_detail_id) { + it.isTui = false + } + return it + }) + }) + setListArr([...ListArr]) + } + + //点击减 + const handReduce = (val) => { + 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 + it.nums = 1 + } else { + it.nums-- + } + } + return it + }) + }) + setListArr([...ListArr]) + } + + const onInputEven = (e, val) => { + ListArr.forEach(item => { + item.av_product_color.map(it => { + if (it.sale_order_detail_id === val.sale_order_detail_id) { + if (Number(e.detail.value) < 1) { + it.nums = 1 + } else { + it.nums = Number(e.detail.value) + } + if (Number(e.detail.value) > it.roll) { + it.nums = 1 + } + } + return it + }) + }) + setListArr([...ListArr]) + } + + //点击加 + const handAdd = (val) => { + ListArr.forEach(item => { + item.av_product_color.map(it => { + if (it.sale_order_detail_id === val.sale_order_detail_id) { + if (it.nums < it.roll) { + it.nums++ + } else { + return + } + } + return it + }) + }) + setListArr([...ListArr]) + } + + const totalNums = useMemo(() => { + const arr: any[] = [] + ListArr.forEach(item => { + item.av_product_color.forEach(it => { + if (it.isTui) { + arr.push(it) + } + }) + }) + return arr.length + }, [ListArr]) + + + //获取图片列表 + const picUrl = useRef([]) + const getImageList = useCallback((list) => { + picUrl.current = list + }, []) + + + //判断是否允许提交 + const isDisabled = useMemo(() => { + + return false + }, []) + + //筛选内容展示 + const [showPopup, setshowPopup] = useState(false) + + useEffect(() => { + getReason() + getReasonTwo() + }, []) + + + + const queryRef = useRef( + { + return_reason: 1,//退货原因 + return_explain: '',//退货理由 + reasonName: '请选择', + reasonNameTwo: '请选择', + GoodStatus: '', + GoodStatusName: "请选择" + } + ) + const [Query, setQuery] = useState({ + // reason_describe: '',//描述说明 + return_reason: 1,//退货原因 + reasonName: '请选择', + reasonNameTwo: '请选择', + return_explain: '',//退货理由 + GoodStatus: '', + GoodStatusName: "请选择" + // goods_status: '',//货物状况 + // fabric_piece_accessory_url:[],//退货图片 + // sale_order_id:infoObj.id,//详情id + }) + + + ///获取退货原因 + const { fetchData: resonFetch } = mpenumreturnOrderreturnReason() + const [ReasonList, setReasonList] = useState([]) + const getReason = async () => { + const res = await resonFetch() + if (res.data) { + setReasonList(res.data.list) + } + } + + //获取退货原因2 + const { fetchData: resonTwoFetch } = mpenumreturnExplain() + const [ReasonListTwo, setReasonListTwo] = useState([]) + const getReasonTwo = async () => { + const res = await resonTwoFetch({ return_reason: queryRef.current.return_reason }) + if (res.data) { + setReasonListTwo(res.data.list) + } + } + + //选择退货原因 + const handReasonOne = (item) => { + ReasonList.map(it => { + if (it.id === item.id) { + it.default = true + } else { + it.default = false + } + return it + }) + setQuery((val) => ({ ...val, return_reason: item.id, return_explain: '' })) + queryRef.current.return_reason = item.id + queryRef.current.reasonName = item.name + setReasonList([...ReasonList]) + getReasonTwo() + } + + //选择退货理由 + const handReasonTwo = (item) => { + ReasonListTwo.map(it => { + if (it.id === item.id) { + it.default = true + } else { + it.default = false + } + return it + }) + setReasonListTwo([...ReasonListTwo]) + queryRef.current.reasonNameTwo = item.name + setQuery({ return_explain: item.id }) + queryRef.current.return_explain = item.id + } + + //重置 + const handReset = () => { + queryRef.current.return_reason = 1 + queryRef.current.return_explain = '' + queryRef.current.reasonName = '请选择' + queryRef.current.reasonNameTwo = '请选择' + setQuery((val) => ({ ...val, return_reason: 1, return_explain: '', reasonName: '请选择', reasonNameTwo: '请选择' })) + getReasonTwo() + const arrOne = resetArr(ReasonList) + setReasonList([...arrOne]) + const arrTwo = resetArr(ReasonListTwo) + setReasonListTwo([...arrTwo]) + } + + //数组重置 + const resetArr = (arr) => { + arr.map(it => { + it.default = false + return it + }) + return arr + } + + //判断选择原因 + const selectIsDisabled = useMemo(() => { + if (Query.return_explain == '') { + return true + } else { + return false + } + }, [Query]) + + + //确认选择退货原因 + const handSlect = () => { + setQuery((val) => ({ + ...val, + reasonName: queryRef.current.reasonName, + reasonNameTwo: queryRef.current.reasonNameTwo + })) + setshowPopup(false) + } + + //货物情况 + const [DescPopup, setDescPopup] = useState(false) + const { fetchData: statusFetch } = mpenumreturngoodsStatus() + const [GoodStatusList, setGoodStatusList] = useState([]) + useEffect(() => { + getGoodStatus() + }, []) + const getGoodStatus = async () => { + const res = await statusFetch() + if (res.data) { + setGoodStatusList(res.data.list) + } + } + + const handStatus = (item) => { + GoodStatusList.map(it => { + if (it.id === item.id) { + it.default = true + } else { + it.default = false + } + return it + }) + setQuery((val) => ({ ...val, GoodStatus: item.id, GoodStatusName: item.name })) + setGoodStatusList([...GoodStatusList]) + queryRef.current.GoodStatus = item.id + queryRef.current.GoodStatusName = item.name + } + + //判断状态是否有选 + const StatusIsDisabled = useMemo(() => { + if (Query.GoodStatus !== '') { + return false + } else { + return true + } + }, [Query]) + + //重置货物状态 + const handResetStatus = () => { + const arr = resetArr(GoodStatusList) + setGoodStatusList([...arr]) + queryRef.current.GoodStatus = '' + queryRef.current.GoodStatusName = '请选择' + setQuery((val) => ({ ...val, GoodStatus: '', GoodStatusName: '请选择' })) + } + + //确认选择货物状况 + const handSlectStatus = () => { + setQuery((val) => ({ ...val, GoodStatus: queryRef.current.GoodStatus, GoodStatusName: queryRef.current.GoodStatusName })) + setDescPopup(false) + } + + return ( + + + handTui(item)} + handCancel={(item) => handCancel(item)} + // onBlur={(e, item) => onBlur(e, item)} + handReduce={(item) => handReduce(item)} + handAdd={(item) => handAdd(item)} + onInputEven={(e, item) => onInputEven(e, item)} + > + 汇总:已选{totalNums}种商品 + + + { setshowPopup(true) }}> + + 退货原因 + * + { + Query.reasonName === '请选择' && 请选择 + } + { + Query.reasonName !== '请选择' && {Query.reasonName}/{Query.reasonNameTwo} + } + + + + { setDescPopup?.(true) }}> + + 货物情况 + * + { + Query.GoodStatusName === '请选择' && 请选择 + } + { + Query.GoodStatusName !== '请选择' && {Query.GoodStatusName} + } + + + + + 拍照上传 + + + + + 其他说明 + + + + + + + + + + + + { setshowPopup?.(false) }}> + + + 退货原因 + + { + 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} + ) + }) + } + + + + + + + + + + + { setDescPopup?.(false) }}> + + + 货物情况 + + { + GoodStatusList.map((item, index) => { + return ( + { handStatus(item) }} className={classnames(item.default ? styles.activemodeBox : styles.modeBox)} key={index}>{item.name} + ) + }) + } + + + + + + + + + + + + ) +} + + + + + + +//产品商品元素 +interface PropGoods { + list: any[], + obj: { + sale_mode?: number | string + }, + handTui?: (any) => void, + handCancel?: (any) => void, + onBlur?: (e: any, obj: any) => void, + onInputEven?: (e: any, obj: any) => void, + handReduce?: (any) => void, + handAdd?: (any) => void, +} +const GoodsItem = memo((porps: PropGoods) => { + const { list = [], obj = {}, handTui, handCancel, onBlur, handReduce, handAdd, onInputEven } = porps + // const [value, setValue] = useState({ count: 1 }) + // const onInputEven = (e) => { + // let res = Number(e.detail.value) + // if (res < 1) { + // setValue({ count: 1 }) + // } else { + // setValue({ count: res }) + // } + // } + + return ( + <> + { + list.map((item, index) => { + return ( + + {item.product_code}# {item.product_name} + + { + item.av_product_color.map((it, inx) => { + return ( + + + + + {it.product_color_code} {it.product_color_name} + + + x{obj?.sale_mode === 0 ? it.roll : it.length / 100}{obj?.sale_mode === 0 ? '条' : 'm'} + { + !it.isTui && handTui?.(it)}>退货 + } + { + (it.sale_mode != 0 && it.isTui) && handCancel?.(it)}>已选择退货 + } + { + (it.sale_mode == 0 && it.isTui) && + handReduce?.(it)}> + + + + onInputEven?.(e, it)} maxlength={it.roll} onBlur={(e) => onBlur?.(e, it)}> + + handAdd?.(it)}> + + + + + } + + + + ) + }) + } + + ) + }) + } + + + ) +}) \ No newline at end of file diff --git a/src/pages/orderDetails/components/BottomApply/index.tsx b/src/pages/orderDetails/components/BottomApply/index.tsx index 1f1deef..dad7820 100644 --- a/src/pages/orderDetails/components/BottomApply/index.tsx +++ b/src/pages/orderDetails/components/BottomApply/index.tsx @@ -65,7 +65,6 @@ export default memo((props: prosObj) => { }, [obj]) - return ( < > diff --git a/src/pages/orderDetails/index.tsx b/src/pages/orderDetails/index.tsx index a9dd56c..593837f 100644 --- a/src/pages/orderDetails/index.tsx +++ b/src/pages/orderDetails/index.tsx @@ -22,7 +22,8 @@ import { orderPaymentpreCollectOrderorderPaymentSubmission, mpsaleOrdercancel, GetPayCode, - mpsaleOrderaddress + mpsaleOrderaddress, + mpsaleOrderreceive } from '@/api/order' import { alert, goLink } from '@/common/common' import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format' @@ -477,6 +478,7 @@ export default () => { setShowPay(false) getDetail() } else { + Taro.hideLoading() Taro.showToast({ title: restult?.msg, icon: 'error' @@ -505,6 +507,52 @@ export default () => { }) } + //申请退货 + const handApplyGood = () => { + if (infoObj.av_return_product.length == 0) { + return alert.error('暂无货物退') + } else { + Taro.navigateTo({ + url: '/pages/applyGoods/index?orderId=' + infoObj.id + }) + } + } + + //确认收货 + const { fetchData: receveFetch } = mpsaleOrderreceive() + const handSureGoods = async () => { + + Taro.showModal({ + content: "确认收货吗?", + confirmText: "确认", + cancelText: "取消", + success: async function (res) { + if (res.confirm) { + Taro.showLoading({ + title: '请稍等...', + mask: true + }) + const res = await receveFetch({ id: Number(infoObj.id) }) + if (res?.msg === 'success') { + Taro.showToast({ + title: '成功' + }) + Taro.hideLoading() + setShowMore(false) + getDetail() + } else { + Taro.hideLoading() + Taro.showToast({ + title: res?.msg, + icon: 'error' + }) + } + } + + } + }) + } + return ( {(infoObj?.status != 10 && )} @@ -587,7 +635,12 @@ export default () => { } { showMore && - + handApplyGood?.()} + handApplyMoney={() => handApplyMoney?.()} + handSureGoods={() => handSureGoods?.()} + > } { } }) } + const proview = (item) => { + Taro.previewImage({ + current: IMG_CND_Prefix + item, // 当前显示图片的 http 链接 + urls: DeatailObj.fabric_piece_accessory_url.map((item) => { + item = IMG_CND_Prefix + item; + return item; + }), // 需要预览的图片 http 链接列表 + }); + }; + return ( @@ -258,7 +268,7 @@ export default () => { { DeatailObj?.fabric_piece_accessory_url?.length > 0 && DeatailObj?.fabric_piece_accessory_url.map((item, index) => { return ( - proview(item)} mode="aspectFill" src={IMG_CND_Prefix + item}> ) }) diff --git a/src/pages/refundMoneyDetail/index.module.scss b/src/pages/refundMoneyDetail/index.module.scss index 37c70a3..c56c1aa 100644 --- a/src/pages/refundMoneyDetail/index.module.scss +++ b/src/pages/refundMoneyDetail/index.module.scss @@ -99,6 +99,7 @@ display: flex; align-items: center; justify-content: space-between; + margin-bottom: 10px; .totalLeft { font-size: 28px; diff --git a/src/pages/refundMoneyDetail/index.tsx b/src/pages/refundMoneyDetail/index.tsx index b388bc6..ca61255 100644 --- a/src/pages/refundMoneyDetail/index.tsx +++ b/src/pages/refundMoneyDetail/index.tsx @@ -11,10 +11,8 @@ import { returnApplyOrderuploadAccessory } from "@/api/refound" import OrderState from './components/orderState' -import AddressDetailBox from './components/addressDetailBox' +// import AddressDetailBox from './components/addressDetailBox' import { IMG_CND_Prefix } from "@/common/constant"; -import Popup from '@/components/popup'; -import UploadImage from '@/components/uploadImage' export default () => { const router = useRouter() @@ -48,23 +46,22 @@ export default () => { if (it.leftTitle === '其他什么:') { it.rightTitle = res.data.reason_describe } - if (it.leftTitle === '货物状况:') { - it.rightTitle = res.data.goods_status_name - } + // if (it.leftTitle === '货物状况:') { + // it.rightTitle = res.data.goods_status_name + // } if (it.leftTitle === '申请时间:') { it.rightTitle = formatDateTime(res.data.apply_time) } }) setOrderMsg([...orderMsg]) - setPicList([...res.data?.accessory_url !== null ? res.data?.accessory_url : []]) + // setPicList([...res.data?.accessory_url !== null ? res.data?.accessory_url : []]) Taro.hideLoading() } } //分辨用质检中还是质检前的数组 const productList = useMemo(() => { - if (DeatailObj.stage === 0 || - (DeatailObj.sale_mode == 1 && DeatailObj.type == 1) || DeatailObj.stage === 1 || DeatailObj.stage === 2) { + if (DeatailObj.stage == 0 || DeatailObj.type == 3) { return DeatailObj.product_list } else { return DeatailObj.quality_check_pass_product @@ -96,10 +93,10 @@ export default () => { leftTitle: '其他什么:', rightTitle: '------', }, - { - leftTitle: '货物状况:', - rightTitle: '------', - }, + // { + // leftTitle: '货物状况:', + // rightTitle: '------', + // }, { leftTitle: '申请时间:', rightTitle: '------', @@ -151,70 +148,49 @@ export default () => { } - //查看图片 - const [ShowPic, setShowPic] = useState(false) + // //查看图片 + // const [ShowPic, setShowPic] = useState(false) - const [PicList, setPicList] = useState([]) + // const [PicList, setPicList] = useState([]) - const handUp = (value) => { - setShowPic(true) - } + // const handUp = (value) => { + // setShowPic(true) + // } - const onlyRead = useMemo(() => { - if (DeatailObj.stage == 1) { - return false - } else { - return true - } - }, [DeatailObj]) + // const onlyRead = useMemo(() => { + // if (DeatailObj.stage == 1) { + // return false + // } else { + // return true + // } + // }, [DeatailObj]) - //获取图片列表 - const picUrl = useRef([]) - const getImageList = useCallback((list) => { - picUrl.current = list - }, []) + // //获取图片列表 + // const picUrl = useRef([]) + // const getImageList = useCallback((list) => { + // picUrl.current = list + // }, []) + + + const proview = (item) => { + Taro.previewImage({ + current: IMG_CND_Prefix + item, // 当前显示图片的 http 链接 + urls: DeatailObj.fabric_piece_accessory_url.map((item) => { + item = IMG_CND_Prefix + item; + return item; + }), // 需要预览的图片 http 链接列表 + }); + }; - //提交附件 - const { fetchData: sureFetch } = returnApplyOrderuploadAccessory() - const handSure = () => { - let arr: any = [] - arr = [...picUrl.current, ...PicList] - Taro.showModal({ - content: "确定要提交吗?", - confirmText: "确认", - cancelText: "取消", - success: async function (res) { - if (res.confirm) { - const res = await sureFetch({ id: Number(DeatailObj.id), accessory_url: arr, }) - Taro.showLoading({ - title: '请稍等...', - mask: true - }) - if (res.msg === 'success') { - Taro.showToast({ - title: '取消成功' - }) - Taro.hideLoading() - getDetail() - } else { - Taro.showToast({ - title: res.msg, - icon: 'error' - }) - } - } - } - }) - } return ( - handUp(DeatailObj)} - > + > */} { DeatailObj?.sale_mode == 0 ? DeatailObj?.return_roll : DeatailObj?.total_number / 100 } {DeatailObj?.sale_mode == 0 ? "条" : "米"} + { + DeatailObj.stage == 0 && + 合计金额 + { + formatPriceDiv(DeatailObj.total_refund_amount) + } + + } + { + (DeatailObj.stage == 5 || DeatailObj.stage == 6) && + 退款金额 + { + formatPriceDiv(DeatailObj.refund_amount) + } + + } + { + (DeatailObj.stage == 5 || DeatailObj.stage == 6) && + 其他扣除金额 + { + formatPriceDiv(DeatailObj.other_deduction_amount) + } + + } + { + (DeatailObj.stage == 5 || DeatailObj.stage == 6) && + 退款去向 + { + formatPriceDiv(DeatailObj.refund_flow_name) + } + + } { @@ -258,7 +266,7 @@ export default () => { { DeatailObj?.fabric_piece_accessory_url?.length > 0 && DeatailObj?.fabric_piece_accessory_url.map((item, index) => { return ( - proview(item)} mode="aspectFill" src={IMG_CND_Prefix + item}> ) }) @@ -274,13 +282,6 @@ export default () => { handCancle()}>取消退货 } - setShowPic(false)}> - - { - - !onlyRead && handSure()}>确认修改 - } - ) } diff --git a/src/styles/iconfont.scss b/src/styles/iconfont.scss index b109443..aa8004e 100644 --- a/src/styles/iconfont.scss +++ b/src/styles/iconfont.scss @@ -3,7 +3,7 @@ /* Project id 3619513 */ // url('/src/styles/iconfont.ttf') format('truetype'); src: - url('/src/styles/iconfont.ttf?t=1663556335905') format('truetype'); + url('iconfont.ttf?t=1663556335905') format('truetype'); } .iconfont {