电子商城测试版v4

This commit is contained in:
2022-07-06 20:29:48 +08:00
parent bbc485ee3f
commit f05389ced7
48 changed files with 358 additions and 545 deletions
@@ -7,7 +7,7 @@ import styles from './index.module.scss'
type Param = {
return_address?:string,
return_phone?: string,
onLogistics?: (val: number) => void,
onLogistics?: (val: 1|2) => void, //1 上传物流 2 查看物流
stage?: number,
}
export default memo(({return_address = '', return_phone = '', onLogistics, stage}:Param) => {
@@ -118,7 +118,7 @@ export default memo(({order, comfirm = false}:Param) => {
cut_value: [ReturnStageReturned.value],
model_value: [ReturnStageReturned.value],
label:'退款去向',
field: 'actual_amount'
field: 'refund_flow_name'
},
]
@@ -14,8 +14,9 @@ type Param = {
id?: number, //订单id
images: string[], //图片列表
descValue?: string, //描述
onlyRead?: false|true //true 只读
}
export default memo(({show = false, onClose, onSubmit, id = 0, images = [], descValue = ''}: Param) => {
export default memo(({show = false, onClose, onSubmit, id = 0, images = [], descValue = '', onlyRead = false}: Param) => {
//需要提交的数据
const submitData = useRef({
accessory_url: [],
@@ -52,20 +53,20 @@ export default memo(({show = false, onClose, onSubmit, id = 0, images = [], desc
return (
<>
<Popup show={show} title="上传物流" onClose={onClose}>
<Popup show={show} title={onlyRead?'查看物流':"上传物流"} onClose={onClose}>
<View className={styles.logistics_main}>
<View className={styles.logistics_image}>
<Text className={styles.title_desc}>上传附件:</Text>
<View className={styles.upload_image}>
<UploadImage onChange={getImageList} defaultList={images}/>
<UploadImage onChange={getImageList} defaultList={images} onlyRead={onlyRead}/>
</View>
</View>
<View className={styles.logistics_desc}>
<TextareaEnhance defaultValue={descValue} onChange={getOtherReason} title="备注:" placeholder="请输入备注信息"/>
<TextareaEnhance defaultValue={descValue} onChange={getOtherReason} title="备注:" onlyRead={onlyRead} placeholder="请输入备注信息"/>
</View>
<View className={styles.btns_two}>
{!onlyRead&&<View className={styles.btns_two}>
<View className={styles.verify_btn } onClick={() => onSubmitEven()}>保存</View>
</View >
</View >}
</View>
</Popup>
</>
+23 -16
View File
@@ -4,6 +4,7 @@ import { AFTER_ORDER_STATUS, ORDER_STATUS } from "@/common/enum";
import { formatDateTime, formatImgUrl, formatPriceDiv } from "@/common/fotmat";
import AfterOrderBtns from "@/components/afterOrderBtns";
import SearchInput from "@/components/searchInput";
import useLogin from "@/use/useLogin";
import { Image, Text, Textarea, View } from "@tarojs/components"
import Taro, {useDidShow, usePullDownRefresh, useRouter } from "@tarojs/taro";
import classnames from "classnames";
@@ -17,7 +18,7 @@ import ReturnLogistics from "./components/returnLogistics";
import styles from './index.module.scss'
export default () => {
useLogin()
const router = useRouter()
const orderId = useRef<number>(Number(router.params.id))
useDidShow(() => {
@@ -63,7 +64,8 @@ import styles from './index.module.scss'
other_deduction_amount: orderDetail.other_deduction_amount, //其他扣除金额
total_refund_amount: orderDetail.total_refund_amount, //合计金额
refund_amount: orderDetail.refund_amount, //退款金额
refund_type: orderDetail.refund_type //退款状态
refund_type: orderDetail.refund_type, //退款状态
refund_flow_name: orderDetail.refund_flow_name //退款去向
})
}
@@ -74,7 +76,9 @@ import styles from './index.module.scss'
//获取底部按钮点击, 获取按钮状态
const orderStateClick = useCallback((val) => {
if(val == 8) {
if(val == 1 || val == 6) {
getSaleOrderPreView()
} else if(val == 8) {
//申请记录
setApplyRecord(true)
}
@@ -105,19 +109,22 @@ import styles from './index.module.scss'
//物流显示
const [logisticsShow, setLogisticsShow] = useState(false)
const [logistics, setLogistics] = useState(false)
const onShowLogistics = useCallback((val) => {
if(val == 1) {
setLogisticsShow(true)
} else {
const list = orderDetail?.accessory_url.map(item => {
return formatImgUrl(item)
})
Taro.previewImage({
current: list[0], // 当前显示
urls: list // 需要预览的图片http链接列表
})
}
}, [orderDetail])
setLogisticsShow(true)
if(val != 1) setLogistics(true)
// if(val == 1) {
// setLogisticsShow(true)
// } else {
// const list = orderDetail?.accessory_url.map(item => {
// return formatImgUrl(item)
// })
// Taro.previewImage({
// current: list[0], // 当前显示
// urls: list // 需要预览的图片http链接列表
// })
// }
}, [])
const onCloseLogistics = useCallback(() => {
setLogisticsShow(false)
}, [])
@@ -139,7 +146,7 @@ import styles from './index.module.scss'
<OrderDes orderInfo={orderDetail}/>
<AfterOrderBtns orderInfo={orderInfo} onClick={orderStateClick}/>
<AfterSalePricture urls={orderDetail?.fabric_piece_accessory_url}/>
<ReturnLogistics images={orderDetail?.accessory_url} descValue={orderDetail?.take_goods_remark} show={logisticsShow} id={orderDetail?.return_apply_order_id} onClose={onCloseLogistics} onSubmit={logisticsSuccess}/>
<ReturnLogistics onlyRead={logistics} images={orderDetail?.accessory_url} descValue={orderDetail?.take_goods_remark} show={logisticsShow} id={orderDetail?.return_apply_order_id} onClose={onCloseLogistics} onSubmit={logisticsSuccess}/>
<ApplyRecord show={applyRecord} id={orderDetail?.id} onClose={() => setApplyRecord(false)}/>
<View className="common_safe_area_y"></View>
</View>