Merge branch 'dev' of ssh://git.online.zzfzyc.com:10022/mp/EShop into 样式对比
This commit is contained in:
commit
18c9ef9b0c
@ -60,3 +60,33 @@ export const GetSaleOrderListApi = () => {
|
|||||||
method: "get",
|
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",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -5,12 +5,13 @@ export const BASE_URL = CURRENT_ENV.includes('development') ? `https://test.zzfz
|
|||||||
// export const BASE_URL = `http://192.168.0.89:40001/lymarket`
|
// export const BASE_URL = `http://192.168.0.89:40001/lymarket`
|
||||||
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
|
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
|
||||||
// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
|
// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
|
||||||
// export const BASE_URL = `http://192.168.1.9:40001/lymarket` // 发
|
// export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发
|
||||||
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
|
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
|
||||||
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
|
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
|
||||||
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
|
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
|
||||||
// export const BASE_URL = `http://192.168.1.4:40001/lymarket` // 王霞
|
// export const BASE_URL = `http://192.168.1.4:40001/lymarket` // 王霞
|
||||||
// export const BASE_URL = `http://192.168.1.7:50001/lymarket` // 添
|
// export const BASE_URL = `http://192.168.1.7:50001/lymarket` // 添
|
||||||
|
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
||||||
// export const BASE_URL = `http://192.168.1.15:50001/lymarket` // 杰
|
// export const BASE_URL = `http://192.168.1.15:50001/lymarket` // 杰
|
||||||
|
|
||||||
// CDN
|
// CDN
|
||||||
|
@ -22,7 +22,7 @@ export const AFTER_ORDER_STATUS = {
|
|||||||
ReturnStageChecked : {value:2, label:'待验布'}, // 待验布
|
ReturnStageChecked : {value:2, label:'待验布'}, // 待验布
|
||||||
ReturnStageReturned : {value:3, label:'已退款'}, // 已退款
|
ReturnStageReturned : {value:3, label:'已退款'}, // 已退款
|
||||||
ReturnStageCancel : {value:4, label:'已取消'}, // 已取消
|
ReturnStageCancel : {value:4, label:'已取消'}, // 已取消
|
||||||
ReturnStageQualityCheckPendingRefund : {value:5, label:'待退款'}, // 待退款-质检
|
ReturnStageQualityCheckPendingRefund : {value:5, label:'待退款'}, // 已验布
|
||||||
ReturnStageServiceOrderPendingRefund : {value:6, label:'待退款'}, // 待退款
|
ReturnStageServiceOrderPendingRefund : {value:6, label:'待退款'}, // 待退款
|
||||||
ReturnStageRejected : {value:7, label:'已拒绝'}, // 已拒绝
|
ReturnStageRejected : {value:7, label:'已拒绝'}, // 已拒绝
|
||||||
}
|
}
|
||||||
|
@ -15,28 +15,26 @@ type Param = {
|
|||||||
sale_mode: number //订单类型
|
sale_mode: number //订单类型
|
||||||
type: number //1退货,2退款
|
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 {
|
const {
|
||||||
ReturnStageApplying,
|
ReturnStageApplying,
|
||||||
ReturnStageWaitCheck,
|
ReturnStageWaitCheck,
|
||||||
ReturnStageChecked,
|
|
||||||
ReturnStageReturned,
|
ReturnStageReturned,
|
||||||
ReturnStageCancel,
|
|
||||||
ReturnStageQualityCheckPendingRefund,
|
ReturnStageQualityCheckPendingRefund,
|
||||||
ReturnStageServiceOrderPendingRefund,
|
ReturnStageServiceOrderPendingRefund,
|
||||||
ReturnStageRejected
|
|
||||||
} = AFTER_ORDER_STATUS
|
} = AFTER_ORDER_STATUS
|
||||||
|
|
||||||
//订单类型
|
//订单类型
|
||||||
const {
|
// const {
|
||||||
SaLeModeBulk,
|
// SaLeModeBulk,
|
||||||
SaleModeLengthCut,
|
// SaleModeLengthCut,
|
||||||
SaLeModeWeightCut,
|
// SaLeModeWeightCut,
|
||||||
} = SALE_MODE
|
// } = SALE_MODE
|
||||||
|
|
||||||
//售后按钮按售后状态归类, value是该订单状态,可能该按钮会出现
|
//售后按钮按售后状态归类, value是该订单状态,可能该按钮会出现
|
||||||
const orderBtnsList = useRef([
|
const orderBtnsList = useRef([
|
||||||
@ -50,31 +48,31 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
value: [ReturnStageWaitCheck.value],
|
value: [ReturnStageWaitCheck.value],
|
||||||
label: '退货物流'
|
label: '退货物流'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
id: 3,
|
// id: 3,
|
||||||
value: [ReturnStageChecked.value, ReturnStageQualityCheckPendingRefund.value],
|
// value: [ReturnStageChecked.value, ReturnStageQualityCheckPendingRefund.value],
|
||||||
label: '查看物流'
|
// label: '查看物流'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||||
label: '质检结果'
|
label: '质检结果'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
id: 5,
|
// id: 5,
|
||||||
value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
// value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||||
label: '退货码单'
|
// label: '退货码单'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
id: 6,
|
id: 6,
|
||||||
value: [ReturnStageApplying.value, ReturnStageServiceOrderPendingRefund.value],
|
value: [ReturnStageApplying.value, ReturnStageServiceOrderPendingRefund.value],
|
||||||
label: '取消退款'
|
label: '取消退款'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
id: 7,
|
// id: 7,
|
||||||
value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
// value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||||
label: '退款码单'
|
// label: '退款码单'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
id: 8,
|
id: 8,
|
||||||
value: [],
|
value: [],
|
||||||
@ -86,17 +84,18 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
//判断是否显示该按钮
|
//判断是否显示该按钮
|
||||||
const orderBtnsShow = (item) => {
|
const orderBtnsShow = (item) => {
|
||||||
if(!orderInfo) return false
|
if(!orderInfo) return false
|
||||||
|
|
||||||
if(item.id == 1) {
|
if(item.id == 1) {
|
||||||
//取消退货
|
//取消退货
|
||||||
return (orderInfo.type == 1)&&item.value.includes(orderInfo.stage)
|
return (orderInfo.type == 1)&&item.value.includes(orderInfo.stage)
|
||||||
} else if (item.id == 6) {
|
} else if (item.id == 6) {
|
||||||
//取消退款
|
//取消退款
|
||||||
return (orderInfo.type == 2)&&item.value.includes(orderInfo.stage)
|
return (orderInfo.type == 2)&&item.value.includes(orderInfo.stage)
|
||||||
|
} else if (item.id == 4) {
|
||||||
|
//质检结果
|
||||||
|
return (orderInfo?.type == 1)&&item.value.includes(orderInfo.stage) //退货才有
|
||||||
} else {
|
} else {
|
||||||
return item.value.includes(orderInfo.stage)
|
return item.value.includes(orderInfo.stage)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//显示的按钮数组
|
//显示的按钮数组
|
||||||
|
@ -7,6 +7,7 @@ import {useRef, memo, useState, useMemo } from "react"
|
|||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { AddShoppingCartApi } from "@/api/shopCart"
|
import { AddShoppingCartApi } from "@/api/shopCart"
|
||||||
|
import { ApplyRefundApi } from "@/api/salesAfterOrder"
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
orderInfo: {
|
orderInfo: {
|
||||||
@ -14,7 +15,9 @@ type Param = {
|
|||||||
orderId: number, //订单id
|
orderId: number, //订单id
|
||||||
actual_amount: number, //实付金额
|
actual_amount: number, //实付金额
|
||||||
wait_pay_amount: number, //待付金额
|
wait_pay_amount: number, //待付金额
|
||||||
sale_mode: number //订单类型
|
sale_mode: number, //订单类型
|
||||||
|
av_return_roll?: number, //可退数量
|
||||||
|
|
||||||
}|null,
|
}|null,
|
||||||
onClick?: (val: number) => void //点击后触发的事件,返回订单状态
|
onClick?: (val: number) => void //点击后触发的事件,返回订单状态
|
||||||
}
|
}
|
||||||
@ -132,7 +135,10 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
} else if (val == 6) {
|
} else if (val == 6) {
|
||||||
receiveOrder()
|
receiveOrder()
|
||||||
} else if(val == 5) {
|
} else if(val == 5) {
|
||||||
|
if(!orderInfo?.av_return_roll) return alert.none('该订单没有可退条数')
|
||||||
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
|
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
|
||||||
|
} else if(val == 8) {
|
||||||
|
applyRefund()
|
||||||
} else {
|
} else {
|
||||||
onClick?.(val)
|
onClick?.(val)
|
||||||
}
|
}
|
||||||
@ -181,6 +187,29 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//退款
|
||||||
|
const {fetchData: fetchDataApplyRefund} = ApplyRefundApi()
|
||||||
|
const applyRefund = async () => {
|
||||||
|
if(!orderInfo?.av_return_roll) return alert.none('该订单没有可退条数')
|
||||||
|
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)
|
const [showMore, setShowMore] = useState(false)
|
||||||
|
@ -8,3 +8,4 @@ export const CLEAR_SESSIONKEY = 'clearSessionkey'
|
|||||||
export const CLEAR_USERINFO = 'clearUserInfo'
|
export const CLEAR_USERINFO = 'clearUserInfo'
|
||||||
export const CLEAR_ADMINUSERINFO = 'clearAdminUserInfo'
|
export const CLEAR_ADMINUSERINFO = 'clearAdminUserInfo'
|
||||||
export const CLEAR_SORTCODE = 'clearSortCode'
|
export const CLEAR_SORTCODE = 'clearSortCode'
|
||||||
|
export const LOGIN_STATUS = 'loginStatus'
|
@ -22,6 +22,9 @@
|
|||||||
.reason_item{
|
.reason_item{
|
||||||
margin-bottom: 36px;
|
margin-bottom: 36px;
|
||||||
}
|
}
|
||||||
|
.select_item {
|
||||||
|
color: #007AFF;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,16 +1,19 @@
|
|||||||
import Popup from "@/components/popup";
|
import Popup from "@/components/popup";
|
||||||
import { ScrollView, Text, View } from "@tarojs/components";
|
import { ScrollView, Text, View } from "@tarojs/components";
|
||||||
import { memo, useMemo } from "react";
|
import { memo, useMemo } from "react";
|
||||||
|
import classnames from "classnames";
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
//原因选择
|
//原因选择
|
||||||
type ReasonInfoParam = {
|
type ReasonInfoParam = {
|
||||||
show?: boolean,
|
show?: boolean, //显示
|
||||||
onClose?: () => void,
|
onClose?: () => void, //关闭
|
||||||
title?: string,
|
title?: string, //标题
|
||||||
list?: {id:number, name: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 (
|
return (
|
||||||
<Popup showIconButton={false} show={show} title={title} onClose={onClose} >
|
<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>
|
<View className={styles.reason_title}><Text>{title}</Text></View>
|
||||||
<ScrollView scrollY className={styles.reason_scroll}>
|
<ScrollView scrollY className={styles.reason_scroll}>
|
||||||
<View className={styles.reason_list}>
|
<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>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</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 classnames from "classnames";
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import ReasonPopup from "./components/reasonPopup";
|
import ReasonPopup from "./components/reasonPopup";
|
||||||
import OtherReason from "./components/otherReason";
|
|
||||||
import { useDidShow, useRouter } from "@tarojs/taro";
|
import { useDidShow, useRouter } from "@tarojs/taro";
|
||||||
import { GetSaleOrderDetailApi } from "@/api/order";
|
import { GetSaleOrderDetailApi } from "@/api/order";
|
||||||
import KindList from "./components/kindList"
|
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 { alert, goLink } from "@/common/common";
|
||||||
import UploadImage from "@/components/uploadImage"
|
import UploadImage from "@/components/uploadImage"
|
||||||
import TextareaEnhance from "@/components/textareaEnhance";
|
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 () => {
|
export default () => {
|
||||||
|
|
||||||
useDidShow(() => {
|
useDidShow(() => {
|
||||||
@ -28,7 +32,7 @@ export default () => {
|
|||||||
goods_status: 0,
|
goods_status: 0,
|
||||||
reason_describe: '',
|
reason_describe: '',
|
||||||
return_explain: 0,
|
return_explain: 0,
|
||||||
return_reason: 1,
|
return_reason: 0,
|
||||||
roll: 0,
|
roll: 0,
|
||||||
roll_list: [],
|
roll_list: [],
|
||||||
sale_order_id: orderId.current
|
sale_order_id: orderId.current
|
||||||
@ -75,12 +79,6 @@ export default () => {
|
|||||||
}, [formatDetailOrder])
|
}, [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({})
|
let roll_list = useRef({})
|
||||||
@ -102,7 +100,6 @@ export default () => {
|
|||||||
|
|
||||||
//散剪和剪板
|
//散剪和剪板
|
||||||
const getSelectChange = useCallback((val) => {
|
const getSelectChange = useCallback((val) => {
|
||||||
console.log('val::', val)
|
|
||||||
if(val.status) {
|
if(val.status) {
|
||||||
roll_list.current[val.color_id] = {product_color_id: val.color_id, product_roll: val.length}
|
roll_list.current[val.color_id] = {product_color_id: val.color_id, product_roll: val.length}
|
||||||
} else {
|
} 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 {fetchData: fetchDataGoodsStatus} = ReturnGoodsStatusApi()
|
||||||
const getReturnGoodsStatus = async () => {
|
const getReturnGoodsStatus = async () => {
|
||||||
let res = await fetchDataGoodsStatus()
|
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 (
|
return (
|
||||||
<View className={styles.apply_after_sales_main}>
|
<View className={styles.apply_after_sales_main}>
|
||||||
@ -167,22 +206,22 @@ export default () => {
|
|||||||
<View className={styles.returnSaleInput}>
|
<View className={styles.returnSaleInput}>
|
||||||
<View className={styles.returnSaleInput_item}>
|
<View className={styles.returnSaleInput_item}>
|
||||||
<View className={styles.title}>退货原因</View>
|
<View className={styles.title}>退货原因</View>
|
||||||
<View className={styles.select} onClick={() => onShowReason(1)}>
|
<View className={styles.select} onClick={() => onShowReason(returnStatus.return_reason)}>
|
||||||
<Text>请选择</Text>
|
<Text>{returnObj[returnStatus.return_reason]?.name||'请选择'}</Text>
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.returnSaleInput_item}>
|
<View className={styles.returnSaleInput_item}>
|
||||||
<View className={styles.title}>货物状况</View>
|
<View className={styles.title}>货物状况</View>
|
||||||
<View className={styles.select} onClick={() => onShowReason(2)}>
|
<View className={styles.select} onClick={() => onShowReason(returnStatus.goods_status)}>
|
||||||
<Text>请选择</Text>
|
<Text>{returnObj[returnStatus.goods_status]?.name||'请选择'}</Text>
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.returnSaleInput_item}>
|
<View className={styles.returnSaleInput_item}>
|
||||||
<View className={styles.title}>退货说明</View>
|
<View className={styles.title}>退货说明</View>
|
||||||
<View className={styles.select} onClick={() => onShowReason(3)}>
|
<View className={styles.select} onClick={() => onShowReason(returnStatus.return_explain)}>
|
||||||
<Text>请选择</Text>
|
<Text>{returnObj[returnStatus.return_explain]?.name||'请选择'}</Text>
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@ -205,7 +244,7 @@ export default () => {
|
|||||||
<View className={styles.verify_btn } onClick={() => onSubmit(2)}>确认</View>
|
<View className={styles.verify_btn } onClick={() => onSubmit(2)}>确认</View>
|
||||||
</View >
|
</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>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -192,9 +192,9 @@ export default (props:Params) => {
|
|||||||
{
|
{
|
||||||
(!userInfo.adminUserInfo?.is_authorize_phone)&&<View className={styles.buy_btn} >
|
(!userInfo.adminUserInfo?.is_authorize_phone)&&<View className={styles.buy_btn} >
|
||||||
<Button className={styles.phoneBtn} open-type="getPhoneNumber" onGetPhoneNumber={(e) => placeOrder('to_phone',e)}></Button>
|
<Button className={styles.phoneBtn} open-type="getPhoneNumber" onGetPhoneNumber={(e) => placeOrder('to_phone',e)}></Button>
|
||||||
开始下单
|
选购商品
|
||||||
</View>
|
</View>
|
||||||
|| <View className={styles.buy_btn} onClick={() => placeOrder('to_order')}>开始下单</View>
|
|| <View className={styles.buy_btn} onClick={() => placeOrder('to_order')}>选购商品</View>
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
<CustomWrapper>
|
<CustomWrapper>
|
||||||
|
@ -1,25 +1,54 @@
|
|||||||
import Popup from "@/components/popup";
|
import Popup from "@/components/popup";
|
||||||
import TextareaEnhance from "@/components/textareaEnhance";
|
import TextareaEnhance from "@/components/textareaEnhance";
|
||||||
import { ScrollView, Text, View } from "@tarojs/components";
|
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 ReasonPopup from "../reasonPopup";
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
|
import { ApplyRefundApi } from "@/api/salesAfterOrder";
|
||||||
|
import { alert } from "@/common/common";
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
show?: true|false,
|
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)
|
const [showReason, setShowReason] = useState(false)
|
||||||
@ -27,9 +56,22 @@ export default memo(({show, onClose}:Param) => {
|
|||||||
setShowReason(false)
|
setShowReason(false)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const onShowReason = () => {
|
|
||||||
setShowReason(true)
|
//提交
|
||||||
|
const onSubmit = (val) => {
|
||||||
|
if(val == 2) {
|
||||||
|
getApplyRefund()
|
||||||
|
} else {
|
||||||
|
onClose?.()
|
||||||
|
submitData.current = {
|
||||||
|
return_explain: 0,
|
||||||
|
sale_order_id: 0,
|
||||||
|
reason_describe: ''
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -37,7 +79,7 @@ export default memo(({show, onClose}:Param) => {
|
|||||||
<View className={styles.apply_after_sales_con}>
|
<View className={styles.apply_after_sales_con}>
|
||||||
<View className={styles.returnSaleInput_item}>
|
<View className={styles.returnSaleInput_item}>
|
||||||
<View className={styles.title}>退款说明</View>
|
<View className={styles.title}>退款说明</View>
|
||||||
<View className={styles.select} onClick={() => onShowReason()}>
|
<View className={styles.select} onClick={() => setShowReason(true)}>
|
||||||
<Text>请选择</Text>
|
<Text>请选择</Text>
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||||
</View>
|
</View>
|
||||||
@ -51,7 +93,7 @@ export default memo(({show, onClose}:Param) => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</Popup>
|
</Popup>
|
||||||
<ReasonPopup show={showReason} onClose={closeReason} />
|
<ReasonPopup show={showReason} onClose={closeReason} list={list} title="退款说明"/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
})
|
})
|
@ -65,6 +65,17 @@
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: $font_size;
|
font-size: $font_size;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
|
text{
|
||||||
|
height: 30px;
|
||||||
|
background: #f0f0f0;
|
||||||
|
border-radius: 6px;
|
||||||
|
color: #ABABAB;
|
||||||
|
font-size: 24px;
|
||||||
|
padding: 0 10px;
|
||||||
|
margin-left: 20px;
|
||||||
|
font-weight: normal;
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.order_list_item_price, .order_list_item_price_dg{
|
.order_list_item_price, .order_list_item_price_dg{
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
|
@ -165,7 +165,10 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
</View>
|
</View>
|
||||||
<View className={styles.order_list_item_con}>
|
<View className={styles.order_list_item_con}>
|
||||||
<View className={styles.order_list_item_des}>
|
<View className={styles.order_list_item_des}>
|
||||||
<View className={styles.order_list_item_title}>{colorItem.code + ' ' + colorItem.name}</View>
|
<View className={styles.order_list_item_title}>
|
||||||
|
{colorItem.code + ' ' + colorItem.name}
|
||||||
|
{colorItem?.return_roll&&<Text>{`已退${colorItem?.return_roll}条`}</Text>}
|
||||||
|
</View>
|
||||||
<View className={styles.order_list_item_price}>
|
<View className={styles.order_list_item_price}>
|
||||||
¥{standardPrice(colorItem.sale_price)}
|
¥{standardPrice(colorItem.sale_price)}
|
||||||
{aboutWeight(colorItem.estimate_weight)}
|
{aboutWeight(colorItem.estimate_weight)}
|
||||||
|
@ -96,9 +96,15 @@ $top:190px;
|
|||||||
}
|
}
|
||||||
.miconfont{
|
.miconfont{
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
color: #FFC300;
|
color: #007AFF;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
.advance_payment{
|
||||||
|
color: #FFC300;
|
||||||
|
}
|
||||||
|
.account_period{
|
||||||
|
color: #07C160;
|
||||||
|
}
|
||||||
.payment_list_item_left_price{
|
.payment_list_item_left_price{
|
||||||
font-size: $font_size_min;
|
font-size: $font_size_min;
|
||||||
color: $color_font_two;
|
color: $color_font_two;
|
||||||
|
@ -122,7 +122,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
|
|
||||||
//是否显示七天账期
|
//是否显示七天账期
|
||||||
const show_account_payment = useMemo(() => {
|
const show_account_payment = useMemo(() => {
|
||||||
console.log('orderInfo?.status::',orderInfo)
|
console.log('orderInfo?.status::123',orderInfo)
|
||||||
//剪板合散剪不显示
|
//剪板合散剪不显示
|
||||||
if(orderInfo?.sale_mode != 0) return false
|
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} onClick={changeSelect}>
|
||||||
<View className={styles.payment_list_item_left}>
|
<View className={styles.payment_list_item_left}>
|
||||||
<View className={styles.payment_list_item_left_name}>
|
<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 className={styles.payment_list_item_left_text}>预存款</View>
|
||||||
</View>
|
</View>
|
||||||
{advance_payment}
|
{advance_payment}
|
||||||
@ -184,7 +184,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
{show_account_payment&&<View className={styles.payment_list_item}>
|
{show_account_payment&&<View className={styles.payment_list_item}>
|
||||||
<View className={styles.payment_list_item_left}>
|
<View className={styles.payment_list_item_left}>
|
||||||
<View className={styles.payment_list_item_left_name}>
|
<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 className={styles.payment_list_item_left_text}>{payInfo?.account_period}天账期</View>
|
||||||
</View>
|
</View>
|
||||||
{account_peyment}
|
{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} onClick={onShowOfflinePay}>
|
||||||
<View className={styles.payment_list_item_left}>
|
<View className={styles.payment_list_item_left}>
|
||||||
<View className={styles.payment_list_item_left_name}>
|
<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 className={styles.payment_list_item_left_text}>线下汇款</View>
|
||||||
</View>
|
</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} onClick={onShowScanPay}>
|
||||||
<View className={styles.payment_list_item_left}>
|
<View className={styles.payment_list_item_left}>
|
||||||
<View className={styles.payment_list_item_left_name}>
|
<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 className={styles.payment_list_item_left_text}>扫码支付</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
.reason_item{
|
.reason_item{
|
||||||
margin-bottom: 36px;
|
margin-bottom: 36px;
|
||||||
}
|
}
|
||||||
|
.select_item {
|
||||||
|
color: #007AFF;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,34 +1,27 @@
|
|||||||
import Popup from "@/components/popup";
|
import Popup from "@/components/popup";
|
||||||
import { ScrollView, Text, View } from "@tarojs/components";
|
import { ScrollView, Text, View } from "@tarojs/components";
|
||||||
import { memo, useMemo } from "react";
|
import { memo, useMemo } from "react";
|
||||||
|
import classnames from "classnames";
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
//原因选择
|
//原因选择
|
||||||
type ReasonInfoParam = {
|
type ReasonInfoParam = {
|
||||||
show?: boolean,
|
show?: boolean, //显示
|
||||||
onClose?: () => void,
|
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 (
|
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_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}>
|
<ScrollView scrollY className={styles.reason_scroll}>
|
||||||
<View className={styles.reason_list}>
|
<View className={styles.reason_list}>
|
||||||
<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 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>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
|
@ -19,13 +19,13 @@ export default ({onBlur, onSave, defaultValue = ''}:Param) => {
|
|||||||
getDesc(defaultValue)
|
getDesc(defaultValue)
|
||||||
}, [defaultValue])
|
}, [defaultValue])
|
||||||
|
|
||||||
const getDesc = useCallback((value) => {
|
const getDesc = (value) => {
|
||||||
let res = value
|
let res = value
|
||||||
if(value.length > descData.count) {
|
if(value.length > descData.count) {
|
||||||
res = value.slice(0, descData.count)
|
res = value.slice(0, descData.count)
|
||||||
}
|
}
|
||||||
setDescData({...descData, number:res.length, value: res})
|
setDescData({...descData, number:res.length, value: res})
|
||||||
},[])
|
}
|
||||||
|
|
||||||
const setSave = () => {
|
const setSave = () => {
|
||||||
onSave?.(descData.value)
|
onSave?.(descData.value)
|
||||||
@ -34,7 +34,7 @@ export default ({onBlur, onSave, defaultValue = ''}:Param) => {
|
|||||||
<View className={styles.order_popup}>
|
<View className={styles.order_popup}>
|
||||||
<View className={styles.order_popup_title}>编辑备注</View>
|
<View className={styles.order_popup_title}>编辑备注</View>
|
||||||
<View className={styles.order_popup_input}>
|
<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 className={styles.descDataNum}>{descData.number}/{descData.count}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_save_address} onClick={() => setSave()}>保存</View>
|
<View className={styles.order_save_address} onClick={() => setSave()}>保存</View>
|
||||||
|
@ -127,11 +127,6 @@ import styles from './index.module.scss'
|
|||||||
setPayMentShow(true)
|
setPayMentShow(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//地址组件所需数据
|
|
||||||
const addressInfoDetailData = useMemo(() => {
|
|
||||||
return {orderId:orderDetail?.id, shipment_mode:orderDetail?.shipment_mode, status: orderDetail?.status}
|
|
||||||
}, [orderDetail])
|
|
||||||
|
|
||||||
//打开地址修改
|
//打开地址修改
|
||||||
const addressRef = useRef<any>(null)
|
const addressRef = useRef<any>(null)
|
||||||
|
|
||||||
@ -155,6 +150,8 @@ import styles from './index.module.scss'
|
|||||||
//待付款
|
//待付款
|
||||||
toPay()
|
toPay()
|
||||||
} else if(val == 3) {
|
} else if(val == 3) {
|
||||||
|
//申请退款
|
||||||
|
if(!orderDetail?.av_return_roll) return alert.none('该订单已申请过退款')
|
||||||
setRefundShow(true)
|
setRefundShow(true)
|
||||||
} else if(val == 7) {
|
} else if(val == 7) {
|
||||||
//再购
|
//再购
|
||||||
@ -188,6 +185,7 @@ import styles from './index.module.scss'
|
|||||||
actual_amount: orderDetail?.actual_amount, //实付金额
|
actual_amount: orderDetail?.actual_amount, //实付金额
|
||||||
wait_pay_amount: orderDetail?.wait_pay_amount, //待付金额
|
wait_pay_amount: orderDetail?.wait_pay_amount, //待付金额
|
||||||
sale_mode: orderDetail?.sale_mode, //订单类型
|
sale_mode: orderDetail?.sale_mode, //订单类型
|
||||||
|
av_return_roll: orderDetail?.av_return_roll //可退条数
|
||||||
}
|
}
|
||||||
}, [orderDetail])
|
}, [orderDetail])
|
||||||
|
|
||||||
@ -287,7 +285,7 @@ import styles from './index.module.scss'
|
|||||||
<Remark onSave={(e) => getRemark(e)} defaultValue={orderDetail?.remark}/>
|
<Remark onSave={(e) => getRemark(e)} defaultValue={orderDetail?.remark}/>
|
||||||
</Popup>
|
</Popup>
|
||||||
<Payment onSubmitSuccess={onPaySuccess} show={payMentShow} onClose={closePayShow} orderInfo={orderDetail} />
|
<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)}/>
|
<ShopCart show={showCart} onClose={() => setShowCart(false)}/>
|
||||||
<View className="common_safe_area_y"></View>
|
<View className="common_safe_area_y"></View>
|
||||||
</View>
|
</View>
|
||||||
|
66
src/pages/orderList/components/applyRefund/index.module.scss
Normal file
66
src/pages/orderList/components/applyRefund/index.module.scss
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
|
||||||
|
.apply_after_sales_con{
|
||||||
|
padding: 20px;
|
||||||
|
.returnSaleInput_item{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-bottom: 50px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
.title{
|
||||||
|
font-size: $font_size;
|
||||||
|
font-weight: 700;
|
||||||
|
width: 119px;
|
||||||
|
}
|
||||||
|
.select{
|
||||||
|
flex:1;
|
||||||
|
height: 60px;
|
||||||
|
border: 2px solid #e6e6e6;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-left: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 20px;
|
||||||
|
font-size: 26px;
|
||||||
|
color: $color_font_two;
|
||||||
|
.miconfont{
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.upload_image{
|
||||||
|
flex:1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btns_con{
|
||||||
|
width: 100%;
|
||||||
|
bottom:0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-top: 50px;
|
||||||
|
.btns_two{
|
||||||
|
display: flex;
|
||||||
|
height: 82px;
|
||||||
|
// border: 1PX solid #007aff;
|
||||||
|
font-size: $font_size_big;
|
||||||
|
border-radius: 40px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
.rest_btn{
|
||||||
|
flex:1;
|
||||||
|
border: 1PX solid #007aff;
|
||||||
|
border-radius: 40px 0 0 40px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 82px;
|
||||||
|
color: $color_main;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
}
|
||||||
|
.verify_btn{
|
||||||
|
flex:1;
|
||||||
|
border-radius: 0 40px 40px 0;
|
||||||
|
background: #007aff;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 82px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
99
src/pages/orderList/components/applyRefund/index.tsx
Normal file
99
src/pages/orderList/components/applyRefund/index.tsx
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
import Popup from "@/components/popup";
|
||||||
|
import TextareaEnhance from "@/components/textareaEnhance";
|
||||||
|
import { ScrollView, Text, View } from "@tarojs/components";
|
||||||
|
import { memo, useCallback, useEffect, useRef, useState } from "react";
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
import classnames from "classnames";
|
||||||
|
import { ApplyRefundApi } from "@/api/salesAfterOrder";
|
||||||
|
import { alert } from "@/common/common";
|
||||||
|
import ReasonPopup from "@/pages/order/components/reasonPopup";
|
||||||
|
|
||||||
|
type Param = {
|
||||||
|
show?: true|false,
|
||||||
|
onClose?: () => void,
|
||||||
|
orderId?: number
|
||||||
|
}
|
||||||
|
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((val) => {
|
||||||
|
submitData.current.reason_describe = val
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
|
//显示说明
|
||||||
|
const [showReason, setShowReason] = useState(false)
|
||||||
|
const closeReason = useCallback(() => {
|
||||||
|
setShowReason(false)
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
|
//提交
|
||||||
|
const onSubmit = (val) => {
|
||||||
|
if(val == 2) {
|
||||||
|
getApplyRefund()
|
||||||
|
} else {
|
||||||
|
onClose?.()
|
||||||
|
submitData.current = {
|
||||||
|
return_explain: 0,
|
||||||
|
sale_order_id: 0,
|
||||||
|
reason_describe: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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={() => setShowReason(true)}>
|
||||||
|
<Text>请选择</Text>
|
||||||
|
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<TextareaEnhance onChange={getOtherReason} title='备注' placeholder="请输入退款备注"/>
|
||||||
|
<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>
|
||||||
|
</View>
|
||||||
|
</Popup>
|
||||||
|
<ReasonPopup show={showReason} onClose={closeReason} list={list} title="退款说明"/>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
})
|
@ -60,7 +60,8 @@
|
|||||||
flex:1;
|
flex:1;
|
||||||
font-size: $font_size;
|
font-size: $font_size;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
padding-left: 20px;
|
padding: 0 20px;
|
||||||
|
@include common_ellipsis()
|
||||||
}
|
}
|
||||||
.product_status{
|
.product_status{
|
||||||
font-size: $font_size;
|
font-size: $font_size;
|
||||||
@ -72,8 +73,7 @@
|
|||||||
.image{
|
.image{
|
||||||
width: 126px;
|
width: 126px;
|
||||||
height: 126px;
|
height: 126px;
|
||||||
background: #e5ad3a;
|
border-radius: 20px;
|
||||||
border-radius: 20px 20px 0px 0px;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
image{
|
image{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -82,13 +82,13 @@
|
|||||||
}
|
}
|
||||||
.color_num {
|
.color_num {
|
||||||
background: rgba(0,0,0, 0.5);
|
background: rgba(0,0,0, 0.5);
|
||||||
border-radius: 50px 0px 0px 0px;
|
border-radius: 50px 0px 20px 0px;
|
||||||
font-size: $font_size_min;
|
font-size: $font_size_min;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right:0;
|
right:0;
|
||||||
bottom:0;
|
bottom:0;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px 5px 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,8 @@ type Param = {
|
|||||||
texture_url: string,
|
texture_url: string,
|
||||||
payment_method: number, //支付方式
|
payment_method: number, //支付方式
|
||||||
actual_amount: number, //实付金额
|
actual_amount: number, //实付金额
|
||||||
wait_pay_amount: number //待付金额
|
wait_pay_amount: number, //待付金额
|
||||||
should_collect_order_id: number //应付单id
|
should_collect_order_id: number, //应付单id
|
||||||
},
|
},
|
||||||
onClickBtn?: (val:{status:number, orderInfo:Param['value']}) => void
|
onClickBtn?: (val:{status:number, orderInfo:Param['value']}) => void
|
||||||
}
|
}
|
||||||
@ -59,6 +59,11 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
}
|
}
|
||||||
}, [value])
|
}, [value])
|
||||||
|
|
||||||
|
//总条数
|
||||||
|
const numText = useMemo(() => {
|
||||||
|
return `${value?.total_fabrics}种面料,${value?.total_colors}种颜色,共${value?.total_number}${value?.sale_mode == 0? '条':'米'}`
|
||||||
|
}, [value])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_item}>
|
<View className={styles.order_item}>
|
||||||
<View className={styles.header} onClick={() => goLink('/pages/order/index', {id: value?.id})}>
|
<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}>
|
(index <= 1)&&<View className={styles.color_item}>
|
||||||
<View className={styles.color_title}>{formatHashTag(itemColor.code, itemColor.name)}</View>
|
<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_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>
|
</View>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -101,7 +106,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</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>
|
</View>
|
||||||
<OrderBtns orderInfo={orderInfo} onClick={orderBtnsClick}/>
|
<OrderBtns orderInfo={orderInfo} onClick={orderBtnsClick}/>
|
||||||
</View>
|
</View>
|
||||||
|
@ -14,6 +14,8 @@ import Payment from "../order/components/payment"
|
|||||||
import { ORDER_STATUS } from "@/common/enum"
|
import { ORDER_STATUS } from "@/common/enum"
|
||||||
import { AddShoppingCartApi } from "@/api/shopCart"
|
import { AddShoppingCartApi } from "@/api/shopCart"
|
||||||
import ShopCart from "@/components/shopCart"
|
import ShopCart from "@/components/shopCart"
|
||||||
|
import ApplyRefund from "./components/applyRefund"
|
||||||
|
import { alert } from "@/common/common"
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const {checkLogin} = useLogin()
|
const {checkLogin} = useLogin()
|
||||||
@ -98,18 +100,16 @@ export default () => {
|
|||||||
|
|
||||||
//监听点击的按钮
|
//监听点击的按钮
|
||||||
const clickOrderBtn = useCallback(({status, orderInfo}) => {
|
const clickOrderBtn = useCallback(({status, orderInfo}) => {
|
||||||
|
setCallBackPayOrderInfo(() => orderInfo)
|
||||||
if(status == 1 || status == 6) {
|
if(status == 1 || status == 6) {
|
||||||
getOrderList()
|
getOrderList()
|
||||||
} else if(status == 2) {
|
} 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 //支付方式
|
|
||||||
})
|
|
||||||
toPay()
|
toPay()
|
||||||
|
} else if (status == 3) {
|
||||||
|
//申请退款
|
||||||
|
if(!orderInfo?.av_return_roll) return alert.none('该订单已申请过退款')
|
||||||
|
setRefundShow(true)
|
||||||
} else if (status == 7) {
|
} else if (status == 7) {
|
||||||
//购买
|
//购买
|
||||||
addShopCart(orderInfo)
|
addShopCart(orderInfo)
|
||||||
@ -117,8 +117,9 @@ export default () => {
|
|||||||
}, [orderData])
|
}, [orderData])
|
||||||
|
|
||||||
|
|
||||||
|
const [callBackOrderInfo, setCallBackPayOrderInfo] = useState<any>()
|
||||||
|
|
||||||
//去付款
|
//去付款
|
||||||
const [payOrderInfo, setPayOrderInfo] = useState<any>()
|
|
||||||
const [payMentShow, setPayMentShow] = useState(false)
|
const [payMentShow, setPayMentShow] = useState(false)
|
||||||
const toPay = () => {
|
const toPay = () => {
|
||||||
setPayMentShow(true)
|
setPayMentShow(true)
|
||||||
@ -165,6 +166,12 @@ export default () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//申请退款
|
||||||
|
const [refundShow, setRefundShow] = useState(false)
|
||||||
|
const applyRefundClose = useCallback(() => {
|
||||||
|
setRefundShow(false)
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_list_main}>
|
<View className={styles.order_list_main}>
|
||||||
@ -179,8 +186,9 @@ export default () => {
|
|||||||
})}
|
})}
|
||||||
</InfiniteScroll>
|
</InfiniteScroll>
|
||||||
</View>
|
</View>
|
||||||
|
<ApplyRefund show={refundShow} onClose={applyRefundClose} orderId={callBackOrderInfo?.id}/>
|
||||||
<ShopCart show={showCart} onClose={() => setShowCart(false)}/>
|
<ShopCart show={showCart} onClose={() => setShowCart(false)}/>
|
||||||
<Payment onSubmitSuccess={onPaySuccess} show={payMentShow} onClose={closePayShow} orderInfo={payOrderInfo}/>
|
<Payment onSubmitSuccess={onPaySuccess} show={payMentShow} onClose={closePayShow} orderInfo={callBackOrderInfo}/>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
import { GetOrderPayApi } from "@/api/orderPay";
|
import { GetOrderPayApi } from "@/api/orderPay";
|
||||||
import { SaleOrderOrderDetailApi } from "@/api/salesAfterOrder";
|
import { SaleOrderOrderDetailApi } from "@/api/salesAfterOrder";
|
||||||
import { alert, goLink } from "@/common/common";
|
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 { formatDateTime, formatImgUrl, formatPriceDiv } from "@/common/fotmat";
|
||||||
import AfterOrderBtns from "@/components/afterOrderBtns";
|
import AfterOrderBtns from "@/components/afterOrderBtns";
|
||||||
import OrderBtns from "@/components/orderBtns";
|
import OrderBtns from "@/components/orderBtns";
|
||||||
@ -95,8 +95,10 @@ import styles from './index.module.scss'
|
|||||||
}
|
}
|
||||||
}, [orderDetail])
|
}, [orderDetail])
|
||||||
|
|
||||||
//订单状态枚举
|
//售后订单状态枚举
|
||||||
const {SaleOrderStatusCancel} = ORDER_STATUS
|
const {
|
||||||
|
|
||||||
|
} = AFTER_ORDER_STATUS
|
||||||
|
|
||||||
//物流显示
|
//物流显示
|
||||||
const [logisticsShow, setLogisticsShow] = useState(false)
|
const [logisticsShow, setLogisticsShow] = useState(false)
|
||||||
@ -122,15 +124,17 @@ import styles from './index.module.scss'
|
|||||||
//显示生气记录
|
//显示生气记录
|
||||||
const [applyRecord, setApplyRecord] = useState(false)
|
const [applyRecord, setApplyRecord] = useState(false)
|
||||||
|
|
||||||
|
//货
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_main}>
|
<View className={styles.order_main}>
|
||||||
<OrderState orderInfo={orderDetail}/>
|
<OrderState orderInfo={orderDetail}/>
|
||||||
<AddressInfoDetail return_address={orderDetail?.return_address} return_phone={orderDetail?.return_phone} stage={orderDetail?.stage} onLogistics={onShowLogistics}/>
|
<AddressInfoDetail return_address={orderDetail?.return_address} return_phone={orderDetail?.return_phone} stage={orderDetail?.stage} onLogistics={onShowLogistics}/>
|
||||||
<KindList order={formatPreViewOrderMemo}/>
|
<KindList order={formatPreViewOrderMemo}/>
|
||||||
<OrderDes orderInfo={orderDetail}/>
|
<OrderDes orderInfo={orderDetail}/>
|
||||||
{(orderDetail?.status != SaleOrderStatusCancel.value)&&<View className={styles.submit_order}>
|
<View className={styles.submit_order}>
|
||||||
<AfterOrderBtns orderInfo={orderInfo} onClick={orderStateClick}/>
|
<AfterOrderBtns orderInfo={orderInfo} onClick={orderStateClick} />
|
||||||
</View>}
|
</View>
|
||||||
<AfterSalePricture urls={orderDetail?.fabric_piece_accessory_url}/>
|
<AfterSalePricture urls={orderDetail?.fabric_piece_accessory_url}/>
|
||||||
<ReturnLogistics show={logisticsShow} id={orderDetail?.return_apply_order_id} onClose={onCloseLogistics} onSubmit={logisticsSuccess}/>
|
<ReturnLogistics show={logisticsShow} id={orderDetail?.return_apply_order_id} onClose={onCloseLogistics} onSubmit={logisticsSuccess}/>
|
||||||
<ApplyRecord show={applyRecord} id={orderDetail?.id} onClose={() => setApplyRecord(false)}/>
|
<ApplyRecord show={applyRecord} id={orderDetail?.id} onClose={() => setApplyRecord(false)}/>
|
||||||
@ -174,7 +178,7 @@ import styles from './index.module.scss'
|
|||||||
<Text>{orderInfo?.return_explain_name}</Text>
|
<Text>{orderInfo?.return_explain_name}</Text>
|
||||||
</SearchInput>
|
</SearchInput>
|
||||||
<SearchInput showBorder={false} title='其它说明' height={50}>
|
<SearchInput showBorder={false} title='其它说明' height={50}>
|
||||||
<Text>{orderInfo?.return_remark}</Text>
|
<Text>{orderInfo?.reason_describe}</Text>
|
||||||
</SearchInput>
|
</SearchInput>
|
||||||
<SearchInput showBorder={false} title='货物状况' height={50}>
|
<SearchInput showBorder={false} title='货物状况' height={50}>
|
||||||
<Text>{orderInfo?.goods_status_name}</Text>
|
<Text>{orderInfo?.goods_status_name}</Text>
|
||||||
|
@ -59,7 +59,8 @@
|
|||||||
flex:1;
|
flex:1;
|
||||||
font-size: $font_size;
|
font-size: $font_size;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
padding-left: 20px;
|
padding: 0 20px;
|
||||||
|
@include common_ellipsis()
|
||||||
}
|
}
|
||||||
.product_status{
|
.product_status{
|
||||||
font-size: $font_size;
|
font-size: $font_size;
|
||||||
|
@ -109,7 +109,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
<Text>订单号:{value?.order_no}</Text>
|
<Text>订单号:{value?.order_no}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<AfterOrderBtns orderInfo={orderInfo} onClick={orderBtnsClick}/>
|
<AfterOrderBtns orderInfo={orderInfo} onClick={orderBtnsClick} />
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -5,7 +5,7 @@ import styles from './index.module.scss'
|
|||||||
|
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
status?: 0|1|2 //0默认不处理, 1退货,2退款
|
status?: number //0默认不处理, 1退货,2退款
|
||||||
}
|
}
|
||||||
export default memo(({status = 0}:Param) => {
|
export default memo(({status = 0}:Param) => {
|
||||||
return (
|
return (
|
||||||
|
@ -107,7 +107,6 @@ export default () => {
|
|||||||
const [logisticsShow, setLogisticsShow] = useState(false)
|
const [logisticsShow, setLogisticsShow] = useState(false)
|
||||||
const onCloseLogistics = useCallback(() => setLogisticsShow(false), [])
|
const onCloseLogistics = useCallback(() => setLogisticsShow(false), [])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_list_main}>
|
<View className={styles.order_list_main}>
|
||||||
<View className={styles.title}>
|
<View className={styles.title}>
|
||||||
|
@ -10,7 +10,8 @@ import {
|
|||||||
CLEAR_USERINFO,
|
CLEAR_USERINFO,
|
||||||
CLEAR_SESSIONKEY,
|
CLEAR_SESSIONKEY,
|
||||||
CLEAR_ADMINUSERINFO,
|
CLEAR_ADMINUSERINFO,
|
||||||
CLEAR_SORTCODE
|
CLEAR_SORTCODE,
|
||||||
|
LOGIN_STATUS
|
||||||
} from '../constants/userInfo'
|
} from '../constants/userInfo'
|
||||||
|
|
||||||
export type UserParam = {
|
export type UserParam = {
|
||||||
@ -54,6 +55,7 @@ export type DataParam = {
|
|||||||
userInfo: UserParam,
|
userInfo: UserParam,
|
||||||
adminUserInfo: UserAdminParam,
|
adminUserInfo: UserAdminParam,
|
||||||
sort_code: SortCodeParam
|
sort_code: SortCodeParam
|
||||||
|
logingStatus?: false //登录状态 true 正在登录
|
||||||
}
|
}
|
||||||
|
|
||||||
type Action = {
|
type Action = {
|
||||||
@ -68,6 +70,7 @@ const INIT_USER = {
|
|||||||
token: Taro.getStorageSync('token')||'',
|
token: Taro.getStorageSync('token')||'',
|
||||||
session_key: Taro.getStorageSync('session_key')||'',
|
session_key: Taro.getStorageSync('session_key')||'',
|
||||||
sort_code: Taro.getStorageSync('sort_code')?JSON.parse(Taro.getStorageSync('sort_code')):null,
|
sort_code: Taro.getStorageSync('sort_code')?JSON.parse(Taro.getStorageSync('sort_code')):null,
|
||||||
|
logingStatus: false
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function counter (state = INIT_USER, action: Action) {
|
export default function counter (state = INIT_USER, action: Action) {
|
||||||
@ -103,6 +106,8 @@ export default function counter (state = INIT_USER, action: Action) {
|
|||||||
case CLEAR_SORTCODE:
|
case CLEAR_SORTCODE:
|
||||||
Taro.removeStorageSync('sort_code')
|
Taro.removeStorageSync('sort_code')
|
||||||
return {...state, sortCode: null}
|
return {...state, sortCode: null}
|
||||||
|
case LOGIN_STATUS:
|
||||||
|
return {...state, ...data}
|
||||||
default:
|
default:
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,8 @@ const showStatus = (status) => {
|
|||||||
return `${message},请检查网络或联系管理员!`
|
return `${message},请检查网络或联系管理员!`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//登录状态
|
||||||
|
const loginStatus: false|true = false // true:登录中
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* axios 请求状态封装,返回响应式数据 fetch(), loading, error, code, msg 等常用方法/状态
|
* axios 请求状态封装,返回响应式数据 fetch(), loading, error, code, msg 等常用方法/状态
|
||||||
@ -133,7 +135,6 @@ export const useRequest = (options:option = {
|
|||||||
const fetchData = async (sub_options?:any) => {
|
const fetchData = async (sub_options?:any) => {
|
||||||
stateRef.current.loading = true
|
stateRef.current.loading = true
|
||||||
setState((e) => ({...e, loading:true}))
|
setState((e) => ({...e, loading:true}))
|
||||||
console.log('tf:::', stateRef.current.loading)
|
|
||||||
stateRef.current.query = {
|
stateRef.current.query = {
|
||||||
...sub_options,
|
...sub_options,
|
||||||
...options.pagination && {
|
...options.pagination && {
|
||||||
@ -161,7 +162,6 @@ export const useRequest = (options:option = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const result = await Taro.request(q as any)
|
const result = await Taro.request(q as any)
|
||||||
|
|
||||||
const { statusCode } = result
|
const { statusCode } = result
|
||||||
const {
|
const {
|
||||||
code,
|
code,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user