合并宝代码
This commit is contained in:
commit
589515e207
@ -60,3 +60,33 @@ export const GetSaleOrderListApi = () => {
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 售后退货原因
|
||||
*/
|
||||
export const ReturnReasonApi = () => {
|
||||
return useRequest({
|
||||
url: `/v1/mall/enum/returnOrder/returnReason`,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 售后退货原因
|
||||
*/
|
||||
export const ReturnExplainApi = () => {
|
||||
return useRequest({
|
||||
url: `/v1/mall/enum/returnExplain`,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请退款
|
||||
*/
|
||||
export const ApplyRefundApi = () => {
|
||||
return useRequest({
|
||||
url: `/v1/mall/returnApplyOrder`,
|
||||
method: "post",
|
||||
})
|
||||
}
|
||||
|
@ -15,28 +15,26 @@ type Param = {
|
||||
sale_mode: number //订单类型
|
||||
type: number //1退货,2退款
|
||||
},
|
||||
onClick?: (val: number) => void //点击后触发的事件,返回订单状态
|
||||
onClick?: (val: number) => void, //点击后触发的事件,返回订单状态
|
||||
onBtnNull?: () => void //所有按钮都为空
|
||||
}
|
||||
|
||||
export default memo(({orderInfo, onClick}:Param) => {
|
||||
export default memo(({orderInfo, onClick, onBtnNull}:Param) => {
|
||||
//售后订单状态
|
||||
const {
|
||||
ReturnStageApplying,
|
||||
ReturnStageWaitCheck,
|
||||
ReturnStageChecked,
|
||||
ReturnStageReturned,
|
||||
ReturnStageCancel,
|
||||
ReturnStageQualityCheckPendingRefund,
|
||||
ReturnStageServiceOrderPendingRefund,
|
||||
ReturnStageRejected
|
||||
} = AFTER_ORDER_STATUS
|
||||
|
||||
//订单类型
|
||||
const {
|
||||
SaLeModeBulk,
|
||||
SaleModeLengthCut,
|
||||
SaLeModeWeightCut,
|
||||
} = SALE_MODE
|
||||
// const {
|
||||
// SaLeModeBulk,
|
||||
// SaleModeLengthCut,
|
||||
// SaLeModeWeightCut,
|
||||
// } = SALE_MODE
|
||||
|
||||
//售后按钮按售后状态归类, value是该订单状态,可能该按钮会出现
|
||||
const orderBtnsList = useRef([
|
||||
@ -50,11 +48,11 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
value: [ReturnStageWaitCheck.value],
|
||||
label: '退货物流'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: [ReturnStageChecked.value, ReturnStageQualityCheckPendingRefund.value],
|
||||
label: '查看物流'
|
||||
},
|
||||
// {
|
||||
// id: 3,
|
||||
// value: [ReturnStageChecked.value, ReturnStageQualityCheckPendingRefund.value],
|
||||
// label: '查看物流'
|
||||
// },
|
||||
{
|
||||
id: 4,
|
||||
value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||
@ -86,7 +84,6 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
//判断是否显示该按钮
|
||||
const orderBtnsShow = (item) => {
|
||||
if(!orderInfo) return false
|
||||
|
||||
if(item.id == 1) {
|
||||
//取消退货
|
||||
return (orderInfo.type == 1)&&item.value.includes(orderInfo.stage)
|
||||
@ -94,8 +91,13 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
//取消退款
|
||||
return (orderInfo.type == 2)&&item.value.includes(orderInfo.stage)
|
||||
} else {
|
||||
return item.value.includes(orderInfo.stage)
|
||||
if(item.value.includes(orderInfo.stage)) {
|
||||
return true
|
||||
} else {
|
||||
onBtnNull?.()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import {useRef, memo, useState, useMemo } from "react"
|
||||
import classnames from "classnames";
|
||||
import styles from './index.module.scss'
|
||||
import { AddShoppingCartApi } from "@/api/shopCart"
|
||||
import { ApplyRefundApi } from "@/api/salesAfterOrder"
|
||||
|
||||
type Param = {
|
||||
orderInfo: {
|
||||
@ -133,6 +134,8 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
receiveOrder()
|
||||
} else if(val == 5) {
|
||||
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
|
||||
} else if(val == 8) {
|
||||
applyRefund()
|
||||
} else {
|
||||
onClick?.(val)
|
||||
}
|
||||
@ -181,6 +184,28 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
})
|
||||
}
|
||||
|
||||
//退款
|
||||
const {fetchData: fetchDataApplyRefund} = ApplyRefundApi()
|
||||
const applyRefund = async () => {
|
||||
Taro.showModal({
|
||||
title: '确定退款?',
|
||||
success: async function async (res) {
|
||||
if(res.confirm) {
|
||||
let res = await fetchDataApplyRefund({sale_order_id: orderInfo?.orderId})
|
||||
if(res.success) {
|
||||
alert.success('申请成功')
|
||||
} else {
|
||||
alert.error('申请失败')
|
||||
}
|
||||
onClick?.(8)
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
//显示更多按钮
|
||||
const [showMore, setShowMore] = useState(false)
|
||||
|
@ -8,3 +8,4 @@ export const CLEAR_SESSIONKEY = 'clearSessionkey'
|
||||
export const CLEAR_USERINFO = 'clearUserInfo'
|
||||
export const CLEAR_ADMINUSERINFO = 'clearAdminUserInfo'
|
||||
export const CLEAR_SORTCODE = 'clearSortCode'
|
||||
export const LOGIN_STATUS = 'loginStatus'
|
@ -22,6 +22,9 @@
|
||||
.reason_item{
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
.select_item {
|
||||
color: #007AFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +1,19 @@
|
||||
import Popup from "@/components/popup";
|
||||
import { ScrollView, Text, View } from "@tarojs/components";
|
||||
import { memo, useMemo } from "react";
|
||||
import classnames from "classnames";
|
||||
import styles from './index.module.scss'
|
||||
|
||||
//原因选择
|
||||
type ReasonInfoParam = {
|
||||
show?: boolean,
|
||||
onClose?: () => void,
|
||||
title?: string,
|
||||
list?: {id:number, name:string}[]
|
||||
show?: boolean, //显示
|
||||
onClose?: () => void, //关闭
|
||||
title?: string, //标题
|
||||
list?: {id:number, name:string, typle?:number}[], //数据列表
|
||||
onSelect?: (val: object) => void, //选择
|
||||
defaultValue?: number, //默认选中
|
||||
}
|
||||
export default memo(({show = false, onClose, title = '', list= []}: ReasonInfoParam) => {
|
||||
export default memo(({show = false, onClose, title = '', list= [], onSelect, defaultValue}: ReasonInfoParam) => {
|
||||
|
||||
return (
|
||||
<Popup showIconButton={false} show={show} title={title} onClose={onClose} >
|
||||
@ -18,7 +21,7 @@ export default memo(({show = false, onClose, title = '', list= []}: ReasonInfoPa
|
||||
<View className={styles.reason_title}><Text>{title}</Text></View>
|
||||
<ScrollView scrollY className={styles.reason_scroll}>
|
||||
<View className={styles.reason_list}>
|
||||
{list.map(item => <View key={item.id} className={styles.reason_item}>{item.name}</View> )}
|
||||
{list.map(item => <View onClick={() => onSelect?.(item)} key={item.id} className={classnames(styles.reason_item, item.id == defaultValue&&styles.select_item)}>{item.name}</View> )}
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
|
253
src/pages/applyAfterSales/index copy.tsx
Normal file
253
src/pages/applyAfterSales/index copy.tsx
Normal file
@ -0,0 +1,253 @@
|
||||
import { Image, ScrollView, Text, View } from "@tarojs/components";
|
||||
import { FC, memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import classnames from "classnames";
|
||||
import styles from './index.module.scss'
|
||||
import ReasonPopup from "./components/reasonPopup";
|
||||
import { useDidShow, useRouter } from "@tarojs/taro";
|
||||
import { GetSaleOrderDetailApi } from "@/api/order";
|
||||
import KindList from "./components/kindList"
|
||||
import { ReturnApplyOrderApi, ReturnExplainApi, ReturnGoodsStatusApi, ReturnReasonApi } from "@/api/salesAfterOrder";
|
||||
import { alert, goLink } from "@/common/common";
|
||||
import UploadImage from "@/components/uploadImage"
|
||||
import TextareaEnhance from "@/components/textareaEnhance";
|
||||
|
||||
enum returnStatus {
|
||||
return_reason = 1, //原因
|
||||
reason_describe = 2, //状况
|
||||
return_explain = 3, //说明
|
||||
|
||||
}
|
||||
export default () => {
|
||||
|
||||
useDidShow(() => {
|
||||
getSaleOrderPreView()
|
||||
})
|
||||
|
||||
const router = useRouter()
|
||||
const orderId = useRef<number>(Number(router.params.id))
|
||||
|
||||
//需要提交的数据
|
||||
const [submitData, setSubmitData] = useState<any>({
|
||||
fabric_piece_accessory_url: [],
|
||||
goods_status: 0,
|
||||
reason_describe: '',
|
||||
return_explain: 0,
|
||||
return_reason: 1,
|
||||
roll: 0,
|
||||
roll_list: [],
|
||||
sale_order_id: orderId.current
|
||||
})
|
||||
|
||||
//获取订单数据
|
||||
const [orderDetail, setOrderDetail] = useState<any>() //获取到的原始数据
|
||||
const {fetchData: getOrderFetchData} = GetSaleOrderDetailApi()
|
||||
const getSaleOrderPreView = async () => {
|
||||
if(orderId.current) {
|
||||
let res = await getOrderFetchData({id: orderId.current})
|
||||
setOrderDetail(res.data)
|
||||
}
|
||||
}
|
||||
|
||||
//监听获取到的数据
|
||||
useEffect(() => {
|
||||
if(orderDetail) {
|
||||
formatData()
|
||||
}
|
||||
}, [orderDetail])
|
||||
|
||||
//格式化数据格式
|
||||
const [formatDetailOrder, setFormatDetailOrder] = useState<any>() //格式化后的数据
|
||||
const formatData = () => {
|
||||
setFormatDetailOrder({
|
||||
sale_mode: orderDetail.sale_mode,
|
||||
sale_mode_name: orderDetail.sale_mode_name,
|
||||
total_colors: orderDetail.total_colors, //总颜色数量
|
||||
total_number: orderDetail.total_number, //总数量
|
||||
total_fabrics: orderDetail.total_fabrics, //面料数量
|
||||
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
||||
list: orderDetail.product_list,
|
||||
status: orderDetail.status, //订单状态
|
||||
})
|
||||
}
|
||||
|
||||
//数据总量
|
||||
const dataCount = useMemo(() => {
|
||||
if(formatDetailOrder) {
|
||||
return `${formatDetailOrder.total_fabrics}种面料,${formatDetailOrder.total_colors}种颜色,共${formatDetailOrder.total_number}条`
|
||||
}
|
||||
}, [formatDetailOrder])
|
||||
|
||||
|
||||
|
||||
//面料数据
|
||||
let roll_list = useRef({})
|
||||
|
||||
//大货时获取计步器数据
|
||||
const getNumChange = useCallback((val) => {
|
||||
if(parseInt(val.number) > 0) {
|
||||
roll_list.current[val.color_id] = {product_color_id: val.color_id, product_roll: val.number}
|
||||
} else {
|
||||
delete roll_list.current[val.color_id]
|
||||
}
|
||||
|
||||
let count = 0
|
||||
Object.values(roll_list.current).map((item: any) => {
|
||||
count += item.product_roll
|
||||
})
|
||||
setSubmitData((e) => ({...e, roll_list:Object.values(roll_list.current), roll: count}))
|
||||
}, [])
|
||||
|
||||
//散剪和剪板
|
||||
const getSelectChange = useCallback((val) => {
|
||||
if(val.status) {
|
||||
roll_list.current[val.color_id] = {product_color_id: val.color_id, product_roll: val.length}
|
||||
} else {
|
||||
delete roll_list.current[val.color_id]
|
||||
}
|
||||
let count = 0
|
||||
Object.values(roll_list.current).map((item: any) => {
|
||||
count += item.product_roll
|
||||
})
|
||||
setSubmitData((e) => ({...e, roll_list:Object.values(roll_list.current), roll: count}))
|
||||
}, [])
|
||||
|
||||
//获取图片列表
|
||||
const getImageList = useCallback((list) => {
|
||||
setSubmitData((e) => ({...e, fabric_piece_accessory_url:list}))
|
||||
}, [])
|
||||
|
||||
//其他说明
|
||||
const getOtherReason = useCallback((val) => {
|
||||
setSubmitData((e) => ({...e, reason_describe: val}))
|
||||
}, [])
|
||||
|
||||
//提交数据
|
||||
const {fetchData: fetchDataReturnApply} = ReturnApplyOrderApi()
|
||||
const onSubmitData = async () => {
|
||||
if(submitData.roll_list.length <= 0) return alert.error('请选择退货颜色')
|
||||
let res = await fetchDataReturnApply(submitData)
|
||||
if(res.success) {
|
||||
alert.success('申请成功')
|
||||
goLink('/pages/salesAfterList/index',{}, 'reLaunch')
|
||||
} else {
|
||||
alert.error('申请失败')
|
||||
}
|
||||
console.log('提交::',submitData)
|
||||
}
|
||||
|
||||
//底部按钮
|
||||
const onSubmit = (val) => {
|
||||
if(val == 2) {
|
||||
onSubmitData()
|
||||
}
|
||||
}
|
||||
|
||||
//退货选择弹窗
|
||||
|
||||
const [showReason, setShowReason] = useState(false)
|
||||
const closeReason = useCallback(() => setShowReason(false), [])
|
||||
const onShowReason = (status) => {
|
||||
if(status == returnStatus.reason_describe) {
|
||||
getReturnReason()
|
||||
} else if (status == returnStatus.return_explain) {
|
||||
getReturnGoodsStatus()
|
||||
} else {
|
||||
getReturnExplain()
|
||||
}
|
||||
setShowReason(true)
|
||||
}
|
||||
|
||||
const [returnGoodsInfo, setReturnGoodsInfo] = useState<{title:string, list: any[], status: 1|2|3}>({title:'', list:[], status: returnStatus.reason_describe})
|
||||
//售后货物状况
|
||||
const {fetchData: fetchDataGoodsStatus} = ReturnGoodsStatusApi()
|
||||
const getReturnGoodsStatus = async () => {
|
||||
let res = await fetchDataGoodsStatus()
|
||||
setReturnGoodsInfo((e) => ({...e, title: '货物状况', list:res.data?.list||[], status:returnStatus.reason_describe}))
|
||||
}
|
||||
//退货原因
|
||||
const {fetchData: fetchDataReturnReason} = ReturnReasonApi()
|
||||
const getReturnReason = async () => {
|
||||
let res = await fetchDataReturnReason()
|
||||
setReturnGoodsInfo((e) => ({...e, title: '退货原因', list:res.data?.list||[], status:returnStatus.return_explain}))
|
||||
}
|
||||
//售后退货说明
|
||||
const {fetchData: fetchDataReturnExplain} = ReturnExplainApi()
|
||||
const getReturnExplain = async () => {
|
||||
let res = await fetchDataReturnExplain()
|
||||
setReturnGoodsInfo((e) => ({...e, title: '退货说明', list:res.data?.list||[], status:returnStatus.return_reason}))
|
||||
}
|
||||
//选择返回的数据
|
||||
const [returnObj, setReturnObj] = useState<{[val:number]:string, id: number}>({})
|
||||
const onReturnSelect = useCallback((val) => {
|
||||
let {id, name} = val
|
||||
if(returnGoodsInfo.status == returnStatus.reason_describe) {
|
||||
setSubmitData((e) => ({...e, reason_describe:id}))
|
||||
setReturnObj(e => ({...e, [returnStatus.reason_describe]:name, id}))
|
||||
}
|
||||
if(returnGoodsInfo.status == returnStatus.return_explain) {
|
||||
setSubmitData((e) => ({...e, return_explain:id}))
|
||||
setReturnObj(e => ({...e, [returnStatus.return_explain]:name, id}))
|
||||
}
|
||||
if(returnGoodsInfo.status == returnStatus.return_reason) {
|
||||
setSubmitData((e) => ({...e, return_reason:id}))
|
||||
setReturnObj(e => ({...e, [returnStatus.return_reason]:name, id}))
|
||||
}
|
||||
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('returnObj::', returnObj)
|
||||
}, [returnObj])
|
||||
|
||||
return (
|
||||
<View className={styles.apply_after_sales_main}>
|
||||
<View className={styles.apply_after_sales_con}>
|
||||
<View className={styles.kind_number}><Text>{dataCount}</Text></View>
|
||||
<ScrollView scrollY className={styles.scroll}>
|
||||
<View className={styles.scroll_con}>
|
||||
<KindList order={formatDetailOrder} onNumChange={getNumChange} onSelectChange={getSelectChange}/>
|
||||
<View className={styles.returnSaleInput}>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>退货原因</View>
|
||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.reason_describe)}>
|
||||
<Text>{returnObj[returnStatus.reason_describe]||'请选择'}</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>货物状况</View>
|
||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.return_explain)}>
|
||||
<Text>{returnObj[returnStatus.return_explain]||'请选择'}</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>退货说明</View>
|
||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.return_reason)}>
|
||||
<Text>{returnObj[returnStatus.return_reason]||'请选择'}</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>拍照上传</View>
|
||||
<View className={styles.upload_image}>
|
||||
<UploadImage onChange={getImageList}/>
|
||||
</View>
|
||||
</View>
|
||||
<TextareaEnhance onChange={getOtherReason} title='其他说明'/>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</ScrollView>
|
||||
<View className="common_safe_area_y"></View>
|
||||
</View>
|
||||
<View className={styles.btns_con}>
|
||||
<View className={styles.btns_two}>
|
||||
<View className={styles.rest_btn} onClick={() => onSubmit(1)}>取消</View>
|
||||
<View className={styles.verify_btn } onClick={() => onSubmit(2)}>确认</View>
|
||||
</View >
|
||||
</View >
|
||||
<ReasonPopup defaultValue={returnObj.id} show={showReason} onClose={closeReason} title={returnGoodsInfo.title} list={returnGoodsInfo.list} onSelect={onReturnSelect}/>
|
||||
</View>
|
||||
)
|
||||
}
|
@ -3,16 +3,20 @@ import { FC, memo, useCallback, useEffect, useMemo, useRef, useState } from "rea
|
||||
import classnames from "classnames";
|
||||
import styles from './index.module.scss'
|
||||
import ReasonPopup from "./components/reasonPopup";
|
||||
import OtherReason from "./components/otherReason";
|
||||
import { useDidShow, useRouter } from "@tarojs/taro";
|
||||
import { GetSaleOrderDetailApi } from "@/api/order";
|
||||
import KindList from "./components/kindList"
|
||||
import { ReturnApplyOrderApi, ReturnGoodsStatusApi } from "@/api/salesAfterOrder";
|
||||
import { ReturnApplyOrderApi, ReturnExplainApi, ReturnGoodsStatusApi, ReturnReasonApi } from "@/api/salesAfterOrder";
|
||||
import { alert, goLink } from "@/common/common";
|
||||
import UploadImage from "@/components/uploadImage"
|
||||
import TextareaEnhance from "@/components/textareaEnhance";
|
||||
|
||||
type ReasonParam = 1|2|3 //1 退货原因 2 货物状况 3 退货说明
|
||||
enum returnStatus {
|
||||
return_reason = 1, //原因
|
||||
goods_status = 2, //状况
|
||||
return_explain = 3, //说明
|
||||
|
||||
}
|
||||
export default () => {
|
||||
|
||||
useDidShow(() => {
|
||||
@ -28,7 +32,7 @@ export default () => {
|
||||
goods_status: 0,
|
||||
reason_describe: '',
|
||||
return_explain: 0,
|
||||
return_reason: 1,
|
||||
return_reason: 0,
|
||||
roll: 0,
|
||||
roll_list: [],
|
||||
sale_order_id: orderId.current
|
||||
@ -75,12 +79,6 @@ export default () => {
|
||||
}, [formatDetailOrder])
|
||||
|
||||
|
||||
//退货选择弹窗
|
||||
const [showReason, setShowReason] = useState<{show:true|false, title: string}>({show:false, title: ''})
|
||||
const closeReason = useCallback(() => setShowReason({...showReason, show:false}), [])
|
||||
const onShowReason = (status) => {
|
||||
setShowReason({...showReason, show:true})
|
||||
}
|
||||
|
||||
//面料数据
|
||||
let roll_list = useRef({})
|
||||
@ -102,7 +100,6 @@ export default () => {
|
||||
|
||||
//散剪和剪板
|
||||
const getSelectChange = useCallback((val) => {
|
||||
console.log('val::', val)
|
||||
if(val.status) {
|
||||
roll_list.current[val.color_id] = {product_color_id: val.color_id, product_roll: val.length}
|
||||
} else {
|
||||
@ -146,16 +143,58 @@ export default () => {
|
||||
}
|
||||
}
|
||||
|
||||
const [returnGoodsInfo, setReturnGoodsInfo] = useState<{title:string, list: any[]}>({title:'', list:[]})
|
||||
//退货选择弹窗
|
||||
const [showReason, setShowReason] = useState(false)
|
||||
const closeReason = useCallback(() => setShowReason(false), [])
|
||||
const onShowReason = (status) => {
|
||||
if(status == returnStatus.return_reason) {
|
||||
getReturnReason()
|
||||
} else if (status == returnStatus.goods_status) {
|
||||
getReturnGoodsStatus()
|
||||
} else {
|
||||
getReturnExplain()
|
||||
}
|
||||
setShowReason(true)
|
||||
}
|
||||
|
||||
//请求获取到的数据
|
||||
const [returnGoodsInfo, setReturnGoodsInfo] = useState<{title:string, list: any[], status: 1|2|3}>({title:'', list:[], status: returnStatus.goods_status})
|
||||
//售后货物状况
|
||||
const {fetchData: fetchDataGoodsStatus} = ReturnGoodsStatusApi()
|
||||
const getReturnGoodsStatus = async () => {
|
||||
let res = await fetchDataGoodsStatus()
|
||||
setReturnGoodsInfo((e) => ({...e, title: '售后货物状况', list:res.data?.list||[]}))
|
||||
setReturnGoodsInfo((e) => ({...e, title: '货物状况', list:res.data?.list||[], status:returnStatus.goods_status}))
|
||||
}
|
||||
useEffect(() => {
|
||||
getReturnGoodsStatus()
|
||||
}, [])
|
||||
//退货原因
|
||||
const {fetchData: fetchDataReturnReason} = ReturnReasonApi()
|
||||
const getReturnReason = async () => {
|
||||
let res = await fetchDataReturnReason()
|
||||
setReturnGoodsInfo((e) => ({...e, title: '退货原因', list:res.data?.list||[], status:returnStatus.return_reason}))
|
||||
}
|
||||
//售后退货说明
|
||||
const {fetchData: fetchDataReturnExplain} = ReturnExplainApi()
|
||||
const getReturnExplain = async () => {
|
||||
let res = await fetchDataReturnExplain()
|
||||
setReturnGoodsInfo((e) => ({...e, title: '退货说明', list:res.data?.list||[], status:returnStatus.return_explain}))
|
||||
}
|
||||
//选择列表返回的数据
|
||||
const [returnObj, setReturnObj] = useState<{[val:number]:{name:string, id: number}}>({})
|
||||
const onReturnSelect = useCallback((val) => {
|
||||
let {id, name} = val
|
||||
if(returnGoodsInfo.status == returnStatus.goods_status) {
|
||||
setSubmitData((e) => ({...e, goods_status:id}))
|
||||
setReturnObj(e => ({...e, [returnStatus.goods_status]:{name, id}}))
|
||||
}
|
||||
if(returnGoodsInfo.status == returnStatus.return_explain) {
|
||||
setSubmitData((e) => ({...e, return_explain:id}))
|
||||
setReturnObj(e => ({...e, [returnStatus.return_explain]:{name, id}}))
|
||||
}
|
||||
if(returnGoodsInfo.status == returnStatus.return_reason) {
|
||||
setSubmitData((e) => ({...e, return_reason:id}))
|
||||
setReturnObj(e => ({...e, [returnStatus.return_reason]:{name, id}}))
|
||||
}
|
||||
setShowReason(false)
|
||||
}, [returnGoodsInfo])
|
||||
|
||||
return (
|
||||
<View className={styles.apply_after_sales_main}>
|
||||
@ -167,22 +206,22 @@ export default () => {
|
||||
<View className={styles.returnSaleInput}>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>退货原因</View>
|
||||
<View className={styles.select} onClick={() => onShowReason(1)}>
|
||||
<Text>请选择</Text>
|
||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.return_reason)}>
|
||||
<Text>{returnObj[returnStatus.return_reason]?.name||'请选择'}</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>货物状况</View>
|
||||
<View className={styles.select} onClick={() => onShowReason(2)}>
|
||||
<Text>请选择</Text>
|
||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.goods_status)}>
|
||||
<Text>{returnObj[returnStatus.goods_status]?.name||'请选择'}</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>退货说明</View>
|
||||
<View className={styles.select} onClick={() => onShowReason(3)}>
|
||||
<Text>请选择</Text>
|
||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.return_explain)}>
|
||||
<Text>{returnObj[returnStatus.return_explain]?.name||'请选择'}</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||
</View>
|
||||
</View>
|
||||
@ -205,7 +244,7 @@ export default () => {
|
||||
<View className={styles.verify_btn } onClick={() => onSubmit(2)}>确认</View>
|
||||
</View >
|
||||
</View >
|
||||
<ReasonPopup show={showReason.show} onClose={closeReason} title={returnGoodsInfo.title} list={returnGoodsInfo.list}/>
|
||||
<ReasonPopup defaultValue={returnObj[returnGoodsInfo.status]?.id} show={showReason} onClose={closeReason} title={returnGoodsInfo.title} list={returnGoodsInfo.list} onSelect={onReturnSelect}/>
|
||||
</View>
|
||||
)
|
||||
}
|
@ -192,9 +192,9 @@ export default (props:Params) => {
|
||||
{
|
||||
(!userInfo.adminUserInfo?.is_authorize_phone)&&<View className={styles.buy_btn} >
|
||||
<Button className={styles.phoneBtn} open-type="getPhoneNumber" onGetPhoneNumber={(e) => placeOrder('to_phone',e)}></Button>
|
||||
开始下单
|
||||
选购商品
|
||||
</View>
|
||||
|| <View className={styles.buy_btn} onClick={() => placeOrder('to_order')}>开始下单</View>
|
||||
|| <View className={styles.buy_btn} onClick={() => placeOrder('to_order')}>选购商品</View>
|
||||
}
|
||||
</View>
|
||||
<CustomWrapper>
|
||||
|
@ -1,25 +1,54 @@
|
||||
import Popup from "@/components/popup";
|
||||
import TextareaEnhance from "@/components/textareaEnhance";
|
||||
import { ScrollView, Text, View } from "@tarojs/components";
|
||||
import { memo, useCallback, useState } from "react";
|
||||
import { memo, useCallback, useEffect, useRef, useState } from "react";
|
||||
import ReasonPopup from "../reasonPopup";
|
||||
import styles from './index.module.scss'
|
||||
import classnames from "classnames";
|
||||
import { ApplyRefundApi } from "@/api/salesAfterOrder";
|
||||
import { alert } from "@/common/common";
|
||||
|
||||
type Param = {
|
||||
show?: true|false,
|
||||
onClose?: () => void
|
||||
onClose?: () => void,
|
||||
orderId?: number
|
||||
}
|
||||
export default memo(({show, onClose}:Param) => {
|
||||
export default memo(({show, onClose, orderId}:Param) => {
|
||||
|
||||
//提交的数据
|
||||
const submitData = useRef({
|
||||
return_explain: 1,
|
||||
sale_order_id: 0,
|
||||
reason_describe: ''
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
if(orderId)
|
||||
submitData.current.sale_order_id = orderId
|
||||
}, [orderId])
|
||||
|
||||
//申请退款
|
||||
const {fetchData} = ApplyRefundApi()
|
||||
const getApplyRefund = async () => {
|
||||
let res = await fetchData(submitData.current)
|
||||
if(!submitData.current.return_explain) return alert.error('请选择说明原因')
|
||||
if(res.success) {
|
||||
alert.error('申请成功')
|
||||
} else {
|
||||
alert.error('申请失败')
|
||||
}
|
||||
onClose?.()
|
||||
}
|
||||
|
||||
//获取说明数据
|
||||
const [list, setList] = useState<any[]>([])
|
||||
|
||||
|
||||
const getOtherReason = useCallback(() => {
|
||||
|
||||
//备注
|
||||
const getOtherReason = useCallback((val) => {
|
||||
submitData.current.reason_describe = val
|
||||
}, [])
|
||||
|
||||
const onSubmit = (val) => {
|
||||
|
||||
}
|
||||
|
||||
//显示说明
|
||||
const [showReason, setShowReason] = useState(false)
|
||||
@ -27,17 +56,21 @@ export default memo(({show, onClose}:Param) => {
|
||||
setShowReason(false)
|
||||
}, [])
|
||||
|
||||
const onShowReason = () => {
|
||||
setShowReason(true)
|
||||
|
||||
//提交
|
||||
const onSubmit = () => {
|
||||
getApplyRefund()
|
||||
}
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Popup show={show} title="申请退款" onClose={onClose} >
|
||||
<View className={styles.apply_after_sales_con}>
|
||||
<View className={styles.returnSaleInput_item}>
|
||||
<View className={styles.title}>退款说明</View>
|
||||
<View className={styles.select} onClick={() => onShowReason()}>
|
||||
<View className={styles.select} onClick={() => setShowReason(true)}>
|
||||
<Text>请选择</Text>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||
</View>
|
||||
@ -51,7 +84,7 @@ export default memo(({show, onClose}:Param) => {
|
||||
</View>
|
||||
</View>
|
||||
</Popup>
|
||||
<ReasonPopup show={showReason} onClose={closeReason} />
|
||||
<ReasonPopup show={showReason} onClose={closeReason} list={list} title="退款说明"/>
|
||||
</>
|
||||
)
|
||||
})
|
@ -96,9 +96,15 @@ $top:190px;
|
||||
}
|
||||
.miconfont{
|
||||
font-size: 30px;
|
||||
color: #FFC300;
|
||||
color: #007AFF;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.advance_payment{
|
||||
color: #FFC300;
|
||||
}
|
||||
.account_period{
|
||||
color: #07C160;
|
||||
}
|
||||
.payment_list_item_left_price{
|
||||
font-size: $font_size_min;
|
||||
color: $color_font_two;
|
||||
|
@ -122,7 +122,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
||||
|
||||
//是否显示七天账期
|
||||
const show_account_payment = useMemo(() => {
|
||||
console.log('orderInfo?.status::',orderInfo)
|
||||
console.log('orderInfo?.status::123',orderInfo)
|
||||
//剪板合散剪不显示
|
||||
if(orderInfo?.sale_mode != 0) return false
|
||||
//支付方式是账期支付,不显示
|
||||
@ -174,7 +174,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
||||
<View className={styles.payment_list_item} onClick={changeSelect}>
|
||||
<View className={styles.payment_list_item_left}>
|
||||
<View className={styles.payment_list_item_left_name}>
|
||||
<View className={classnames('iconfont icon-a-tuikuanshouhou', styles.miconfont)}></View>
|
||||
<View className={classnames('iconfont icon-a-tuikuanshouhou', styles.miconfont, styles.advance_payment)}></View>
|
||||
<View className={styles.payment_list_item_left_text}>预存款</View>
|
||||
</View>
|
||||
{advance_payment}
|
||||
@ -184,7 +184,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
||||
{show_account_payment&&<View className={styles.payment_list_item}>
|
||||
<View className={styles.payment_list_item_left}>
|
||||
<View className={styles.payment_list_item_left_name}>
|
||||
<View className={classnames('iconfont icon-a-tuikuanshouhou', styles.miconfont)}></View>
|
||||
<View className={classnames('iconfont icon-xtianzhangqi', styles.miconfont, styles.account_period)}></View>
|
||||
<View className={styles.payment_list_item_left_text}>{payInfo?.account_period}天账期</View>
|
||||
</View>
|
||||
{account_peyment}
|
||||
@ -194,7 +194,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
||||
<View className={styles.payment_list_item} onClick={onShowOfflinePay}>
|
||||
<View className={styles.payment_list_item_left}>
|
||||
<View className={styles.payment_list_item_left_name}>
|
||||
<View className={classnames('iconfont icon-a-tuikuanshouhou', styles.miconfont)}></View>
|
||||
<View className={classnames('iconfont icon-xianxiahuikuan', styles.miconfont)}></View>
|
||||
<View className={styles.payment_list_item_left_text}>线下汇款</View>
|
||||
</View>
|
||||
</View>
|
||||
@ -203,7 +203,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
||||
<View className={styles.payment_list_item} onClick={onShowScanPay}>
|
||||
<View className={styles.payment_list_item_left}>
|
||||
<View className={styles.payment_list_item_left_name}>
|
||||
<View className={classnames('iconfont icon-a-tuikuanshouhou', styles.miconfont)}></View>
|
||||
<View className={classnames('iconfont icon-saomazhifu', styles.miconfont)}></View>
|
||||
<View className={styles.payment_list_item_left_text}>扫码支付</View>
|
||||
</View>
|
||||
</View>
|
||||
|
@ -22,6 +22,9 @@
|
||||
.reason_item{
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
.select_item {
|
||||
color: #007AFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,34 +1,27 @@
|
||||
import Popup from "@/components/popup";
|
||||
import { ScrollView, Text, View } from "@tarojs/components";
|
||||
import { memo, useMemo } from "react";
|
||||
import classnames from "classnames";
|
||||
import styles from './index.module.scss'
|
||||
|
||||
//原因选择
|
||||
type ReasonInfoParam = {
|
||||
show?: boolean,
|
||||
onClose?: () => void,
|
||||
show?: boolean, //显示
|
||||
onClose?: () => void, //关闭
|
||||
title?: string, //标题
|
||||
list?: {id:number, name:string, typle?:number}[], //数据列表
|
||||
onSelect?: (val: object) => void, //选择
|
||||
defaultValue?: number, //默认选中
|
||||
}
|
||||
export default memo(({show = false, onClose}: ReasonInfoParam) => {
|
||||
export default memo(({show = false, onClose, title = '', list= [], onSelect, defaultValue}: ReasonInfoParam) => {
|
||||
|
||||
return (
|
||||
<Popup showIconButton={false} show={show} title="退款说明" onClose={onClose} >
|
||||
<Popup showIconButton={false} show={show} title={title} onClose={onClose} >
|
||||
<View className={styles.reason_return_con}>
|
||||
<View className={styles.reason_title}><Text>退款说明</Text></View>
|
||||
<View className={styles.reason_title}><Text>{title}</Text></View>
|
||||
<ScrollView scrollY className={styles.reason_scroll}>
|
||||
<View className={styles.reason_list}>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
<View className={styles.reason_item}>完好无损带原标签</View>
|
||||
{list.map(item => <View onClick={() => onSelect?.(item)} key={item.id} className={classnames(styles.reason_item, item.id == defaultValue&&styles.select_item)}>{item.name}</View> )}
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
|
@ -19,13 +19,13 @@ export default ({onBlur, onSave, defaultValue = ''}:Param) => {
|
||||
getDesc(defaultValue)
|
||||
}, [defaultValue])
|
||||
|
||||
const getDesc = useCallback((value) => {
|
||||
const getDesc = (value) => {
|
||||
let res = value
|
||||
if(value.length > descData.count) {
|
||||
res = value.slice(0, descData.count)
|
||||
}
|
||||
setDescData({...descData, number:res.length, value: res})
|
||||
},[])
|
||||
}
|
||||
|
||||
const setSave = () => {
|
||||
onSave?.(descData.value)
|
||||
@ -34,7 +34,7 @@ export default ({onBlur, onSave, defaultValue = ''}:Param) => {
|
||||
<View className={styles.order_popup}>
|
||||
<View className={styles.order_popup_title}>编辑备注</View>
|
||||
<View className={styles.order_popup_input}>
|
||||
<Textarea placeholder="请添加备注" maxlength={descData.count} cursorSpacing={100} onInput={(e) => getDesc(e.detail.value)} onBlur={(e) => onBlur?.(e)}></Textarea>
|
||||
<Textarea placeholder="请添加备注" value={descData?.value} maxlength={descData.count} cursorSpacing={100} onInput={(e) => getDesc(e.detail.value)} onBlur={(e) => onBlur?.(e)}></Textarea>
|
||||
<View className={styles.descDataNum}>{descData.number}/{descData.count}</View>
|
||||
</View>
|
||||
<View className={styles.order_save_address} onClick={() => setSave()}>保存</View>
|
||||
|
@ -127,11 +127,6 @@ import styles from './index.module.scss'
|
||||
setPayMentShow(true)
|
||||
}
|
||||
|
||||
//地址组件所需数据
|
||||
const addressInfoDetailData = useMemo(() => {
|
||||
return {orderId:orderDetail?.id, shipment_mode:orderDetail?.shipment_mode, status: orderDetail?.status}
|
||||
}, [orderDetail])
|
||||
|
||||
//打开地址修改
|
||||
const addressRef = useRef<any>(null)
|
||||
|
||||
@ -287,7 +282,7 @@ import styles from './index.module.scss'
|
||||
<Remark onSave={(e) => getRemark(e)} defaultValue={orderDetail?.remark}/>
|
||||
</Popup>
|
||||
<Payment onSubmitSuccess={onPaySuccess} show={payMentShow} onClose={closePayShow} orderInfo={orderDetail} />
|
||||
<ApplyRefund show={refundShow} onClose={applyRefundClose}/>
|
||||
<ApplyRefund show={refundShow} onClose={applyRefundClose} orderId={orderDetail?.id}/>
|
||||
<ShopCart show={showCart} onClose={() => setShowCart(false)}/>
|
||||
<View className="common_safe_area_y"></View>
|
||||
</View>
|
||||
|
@ -72,8 +72,7 @@
|
||||
.image{
|
||||
width: 126px;
|
||||
height: 126px;
|
||||
background: #e5ad3a;
|
||||
border-radius: 20px 20px 0px 0px;
|
||||
border-radius: 20px;
|
||||
position: relative;
|
||||
image{
|
||||
width: 100%;
|
||||
@ -82,13 +81,13 @@
|
||||
}
|
||||
.color_num {
|
||||
background: rgba(0,0,0, 0.5);
|
||||
border-radius: 50px 0px 0px 0px;
|
||||
border-radius: 50px 0px 20px 0px;
|
||||
font-size: $font_size_min;
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
right:0;
|
||||
bottom:0;
|
||||
padding: 5px 10px;
|
||||
padding: 5px 10px 5px 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ type Param = {
|
||||
texture_url: string,
|
||||
payment_method: number, //支付方式
|
||||
actual_amount: number, //实付金额
|
||||
wait_pay_amount: number //待付金额
|
||||
should_collect_order_id: number //应付单id
|
||||
wait_pay_amount: number, //待付金额
|
||||
should_collect_order_id: number, //应付单id
|
||||
},
|
||||
onClickBtn?: (val:{status:number, orderInfo:Param['value']}) => void
|
||||
}
|
||||
@ -59,6 +59,11 @@ export default memo(({value, onClickBtn}: Param) => {
|
||||
}
|
||||
}, [value])
|
||||
|
||||
//总条数
|
||||
const numText = useMemo(() => {
|
||||
return `${value?.total_fabrics}种面料,${value?.total_colors}种颜色,共${value?.total_number}${value?.sale_mode == 0? '条':'米'}`
|
||||
}, [value])
|
||||
|
||||
return (
|
||||
<View className={styles.order_item}>
|
||||
<View className={styles.header} onClick={() => goLink('/pages/order/index', {id: value?.id})}>
|
||||
@ -89,7 +94,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
||||
(index <= 1)&&<View className={styles.color_item}>
|
||||
<View className={styles.color_title}>{formatHashTag(itemColor.code, itemColor.name)}</View>
|
||||
<View className={styles.color_price}>{standardPrice(itemColor.sale_price, value.sale_mode)}</View>
|
||||
<View className={styles.color_num}>×{formatCount(itemColor, value.sale_mode)}条</View>
|
||||
<View className={styles.color_num}>×{formatCount(itemColor, value.sale_mode) + (value.sale_mode == 0?'条':'米')}</View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
@ -101,7 +106,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.color_count_num}>{`${value?.total_fabrics}种面料,${value?.total_colors}种颜色,共${value?.total_number}条`}</View>
|
||||
<View className={styles.color_count_num}>{numText}</View>
|
||||
</View>
|
||||
<OrderBtns orderInfo={orderInfo} onClick={orderBtnsClick}/>
|
||||
</View>
|
||||
|
@ -102,13 +102,7 @@ export default () => {
|
||||
getOrderList()
|
||||
} else if(status == 2) {
|
||||
//去支付
|
||||
console.log('orderInfo::',orderInfo)
|
||||
setPayOrderInfo({
|
||||
should_collect_order_id: orderInfo.should_collect_order_id,//应付单id
|
||||
pre_collect_order_id: orderInfo.pre_collect_order_id, //预付单id
|
||||
status: orderInfo.status, //订单状态
|
||||
payment_method: orderInfo.payment_method //支付方式
|
||||
})
|
||||
setPayOrderInfo(() => orderInfo)
|
||||
toPay()
|
||||
} else if (status == 7) {
|
||||
//购买
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
import { GetOrderPayApi } from "@/api/orderPay";
|
||||
import { SaleOrderOrderDetailApi } from "@/api/salesAfterOrder";
|
||||
import { alert, goLink } from "@/common/common";
|
||||
import { ORDER_STATUS } from "@/common/enum";
|
||||
import { AFTER_ORDER_STATUS, ORDER_STATUS } from "@/common/enum";
|
||||
import { formatDateTime, formatImgUrl, formatPriceDiv } from "@/common/fotmat";
|
||||
import AfterOrderBtns from "@/components/afterOrderBtns";
|
||||
import OrderBtns from "@/components/orderBtns";
|
||||
@ -95,8 +95,10 @@ import styles from './index.module.scss'
|
||||
}
|
||||
}, [orderDetail])
|
||||
|
||||
//订单状态枚举
|
||||
const {SaleOrderStatusCancel} = ORDER_STATUS
|
||||
//售后订单状态枚举
|
||||
const {
|
||||
|
||||
} = AFTER_ORDER_STATUS
|
||||
|
||||
//物流显示
|
||||
const [logisticsShow, setLogisticsShow] = useState(false)
|
||||
@ -122,15 +124,17 @@ import styles from './index.module.scss'
|
||||
//显示生气记录
|
||||
const [applyRecord, setApplyRecord] = useState(false)
|
||||
|
||||
//货
|
||||
|
||||
return (
|
||||
<View className={styles.order_main}>
|
||||
<OrderState orderInfo={orderDetail}/>
|
||||
<AddressInfoDetail return_address={orderDetail?.return_address} return_phone={orderDetail?.return_phone} stage={orderDetail?.stage} onLogistics={onShowLogistics}/>
|
||||
<KindList order={formatPreViewOrderMemo}/>
|
||||
<OrderDes orderInfo={orderDetail}/>
|
||||
{(orderDetail?.status != SaleOrderStatusCancel.value)&&<View className={styles.submit_order}>
|
||||
<View className={styles.submit_order}>
|
||||
<AfterOrderBtns orderInfo={orderInfo} onClick={orderStateClick} />
|
||||
</View>}
|
||||
</View>
|
||||
<AfterSalePricture urls={orderDetail?.fabric_piece_accessory_url}/>
|
||||
<ReturnLogistics show={logisticsShow} id={orderDetail?.return_apply_order_id} onClose={onCloseLogistics} onSubmit={logisticsSuccess}/>
|
||||
<ApplyRecord show={applyRecord} id={orderDetail?.id} onClose={() => setApplyRecord(false)}/>
|
||||
|
@ -107,7 +107,6 @@ export default () => {
|
||||
const [logisticsShow, setLogisticsShow] = useState(false)
|
||||
const onCloseLogistics = useCallback(() => setLogisticsShow(false), [])
|
||||
|
||||
|
||||
return (
|
||||
<View className={styles.order_list_main}>
|
||||
<View className={styles.title}>
|
||||
|
@ -10,7 +10,8 @@ import {
|
||||
CLEAR_USERINFO,
|
||||
CLEAR_SESSIONKEY,
|
||||
CLEAR_ADMINUSERINFO,
|
||||
CLEAR_SORTCODE
|
||||
CLEAR_SORTCODE,
|
||||
LOGIN_STATUS
|
||||
} from '../constants/userInfo'
|
||||
|
||||
export type UserParam = {
|
||||
@ -53,6 +54,7 @@ export type DataParam = {
|
||||
userInfo: UserParam,
|
||||
adminUserInfo: UserAdminParam,
|
||||
sort_code: SortCodeParam
|
||||
logingStatus?: false //登录状态 true 正在登录
|
||||
}
|
||||
|
||||
type Action = {
|
||||
@ -67,6 +69,7 @@ const INIT_USER = {
|
||||
token: Taro.getStorageSync('token')||'',
|
||||
session_key: Taro.getStorageSync('session_key')||'',
|
||||
sort_code: Taro.getStorageSync('sort_code')?JSON.parse(Taro.getStorageSync('sort_code')):null,
|
||||
logingStatus: false
|
||||
}
|
||||
|
||||
export default function counter (state = INIT_USER, action: Action) {
|
||||
@ -102,6 +105,8 @@ export default function counter (state = INIT_USER, action: Action) {
|
||||
case CLEAR_SORTCODE:
|
||||
Taro.removeStorageSync('sort_code')
|
||||
return {...state, sortCode: null}
|
||||
case LOGIN_STATUS:
|
||||
return {...state, ...data}
|
||||
default:
|
||||
return state
|
||||
}
|
||||
|
@ -85,6 +85,8 @@ const showStatus = (status) => {
|
||||
return `${message},请检查网络或联系管理员!`
|
||||
}
|
||||
|
||||
//登录状态
|
||||
const loginStatus: false|true = false // true:登录中
|
||||
|
||||
/**
|
||||
* axios 请求状态封装,返回响应式数据 fetch(), loading, error, code, msg 等常用方法/状态
|
||||
@ -133,7 +135,6 @@ export const useRequest = (options:option = {
|
||||
const fetchData = async (sub_options?:any) => {
|
||||
stateRef.current.loading = true
|
||||
setState((e) => ({...e, loading:true}))
|
||||
console.log('tf:::', stateRef.current.loading)
|
||||
stateRef.current.query = {
|
||||
...sub_options,
|
||||
...options.pagination && {
|
||||
@ -161,7 +162,6 @@ export const useRequest = (options:option = {
|
||||
}
|
||||
}
|
||||
const result = await Taro.request(q as any)
|
||||
|
||||
const { statusCode } = result
|
||||
const {
|
||||
code,
|
||||
|
Loading…
x
Reference in New Issue
Block a user