电子商城测试版v2
This commit is contained in:
commit
b6938510f5
@ -10,7 +10,7 @@
|
||||
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
|
||||
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
|
||||
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
||||
export const BASE_URL = `http://192.168.1.224:50002/lymarket` // 添
|
||||
export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
|
||||
// export const BASE_URL = `http://192.168.1.15:50001/lymarket` // 杰
|
||||
|
||||
// CDN
|
||||
|
@ -22,7 +22,7 @@ export const AFTER_ORDER_STATUS = {
|
||||
ReturnStageChecked : {value:2, label:'待验布'}, // 待验布
|
||||
ReturnStageReturned : {value:3, label:'已退款'}, // 已退款
|
||||
ReturnStageCancel : {value:4, label:'已取消'}, // 已取消
|
||||
ReturnStageQualityCheckPendingRefund : {value:5, label:'待退款'}, // 待退款-质检
|
||||
ReturnStageQualityCheckPendingRefund : {value:5, label:'待退款'}, // 已验布
|
||||
ReturnStageServiceOrderPendingRefund : {value:6, label:'待退款'}, // 待退款
|
||||
ReturnStageRejected : {value:7, label:'已拒绝'}, // 已拒绝
|
||||
}
|
||||
|
@ -58,21 +58,21 @@ export default memo(({orderInfo, onClick, onBtnNull}:Param) => {
|
||||
value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||
label: '质检结果'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||
label: '退货码单'
|
||||
},
|
||||
// {
|
||||
// id: 5,
|
||||
// value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||
// label: '退货码单'
|
||||
// },
|
||||
{
|
||||
id: 6,
|
||||
value: [ReturnStageApplying.value, ReturnStageServiceOrderPendingRefund.value],
|
||||
label: '取消退款'
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||
label: '退款码单'
|
||||
},
|
||||
// {
|
||||
// id: 7,
|
||||
// value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||
// label: '退款码单'
|
||||
// },
|
||||
{
|
||||
id: 8,
|
||||
value: [],
|
||||
@ -90,15 +90,12 @@ export default memo(({orderInfo, onClick, onBtnNull}:Param) => {
|
||||
} else if (item.id == 6) {
|
||||
//取消退款
|
||||
return (orderInfo.type == 2)&&item.value.includes(orderInfo.stage)
|
||||
} else if (item.id == 4) {
|
||||
//质检结果
|
||||
return (orderInfo?.type == 1)&&item.value.includes(orderInfo.stage) //退货才有
|
||||
} else {
|
||||
if(item.value.includes(orderInfo.stage)) {
|
||||
return true
|
||||
} else {
|
||||
onBtnNull?.()
|
||||
}
|
||||
return item.value.includes(orderInfo.stage)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//显示的按钮数组
|
||||
|
@ -15,7 +15,9 @@ type Param = {
|
||||
orderId: number, //订单id
|
||||
actual_amount: number, //实付金额
|
||||
wait_pay_amount: number, //待付金额
|
||||
sale_mode: number //订单类型
|
||||
sale_mode: number, //订单类型
|
||||
av_return_roll?: number, //可退数量
|
||||
|
||||
}|null,
|
||||
onClick?: (val: number) => void //点击后触发的事件,返回订单状态
|
||||
}
|
||||
@ -104,7 +106,7 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
return( orderInfo.wait_pay_amount != 0 && item.value.includes(orderInfo.status)) //只要没有付完款就显示
|
||||
} else if(item.id == 3 ) {
|
||||
//申请退款, 只有大货才有
|
||||
return (orderInfo.sale_mode == SaLeModeBulk.value && orderInfo.actual_amount != 0 && item.value.includes(orderInfo.status)) //大货在待发货付过款
|
||||
return (orderInfo.sale_mode == SaLeModeBulk.value && orderInfo.actual_amount != 0 && item.value.includes(orderInfo.status)) //大货在待发货付过款
|
||||
} else if( item.id == 8) {
|
||||
//退款按钮(直接退款不用申请), 只有散剪和剪板有
|
||||
return (orderInfo.sale_mode != SaLeModeBulk.value && orderInfo.actual_amount != 0 && item.value.includes(orderInfo.status)) //散剪和剪板在待接单时付过款
|
||||
@ -133,7 +135,8 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
} else if (val == 6) {
|
||||
receiveOrder()
|
||||
} else if(val == 5) {
|
||||
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
|
||||
if(!orderInfo?.av_return_roll) return alert.none('该订单没有可退条数')
|
||||
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
|
||||
} else if(val == 8) {
|
||||
applyRefund()
|
||||
} else {
|
||||
@ -187,6 +190,7 @@ 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) {
|
||||
|
@ -58,8 +58,17 @@ export default memo(({show, onClose, orderId}:Param) => {
|
||||
|
||||
|
||||
//提交
|
||||
const onSubmit = () => {
|
||||
getApplyRefund()
|
||||
const onSubmit = (val) => {
|
||||
if(val == 2) {
|
||||
getApplyRefund()
|
||||
} else {
|
||||
onClose?.()
|
||||
submitData.current = {
|
||||
return_explain: 0,
|
||||
sale_order_id: 0,
|
||||
reason_describe: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,6 +65,17 @@
|
||||
font-weight: 700;
|
||||
font-size: $font_size;
|
||||
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{
|
||||
font-size: 26px;
|
||||
|
@ -165,7 +165,10 @@ export default memo(({order, comfirm = false}:Param) => {
|
||||
</View>
|
||||
<View className={styles.order_list_item_con}>
|
||||
<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}>
|
||||
¥{standardPrice(colorItem.sale_price)}
|
||||
{aboutWeight(colorItem.estimate_weight)}
|
||||
|
@ -150,6 +150,8 @@ import styles from './index.module.scss'
|
||||
//待付款
|
||||
toPay()
|
||||
} else if(val == 3) {
|
||||
//申请退款
|
||||
if(!orderDetail?.av_return_roll) return alert.none('该订单已申请过退款')
|
||||
setRefundShow(true)
|
||||
} else if(val == 7) {
|
||||
//再购
|
||||
@ -183,6 +185,7 @@ import styles from './index.module.scss'
|
||||
actual_amount: orderDetail?.actual_amount, //实付金额
|
||||
wait_pay_amount: orderDetail?.wait_pay_amount, //待付金额
|
||||
sale_mode: orderDetail?.sale_mode, //订单类型
|
||||
av_return_roll: orderDetail?.av_return_roll //可退条数
|
||||
}
|
||||
}, [orderDetail])
|
||||
|
||||
|
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;
|
||||
font-size: $font_size;
|
||||
font-weight: 700;
|
||||
padding-left: 20px;
|
||||
padding: 0 20px;
|
||||
@include common_ellipsis()
|
||||
}
|
||||
.product_status{
|
||||
font-size: $font_size;
|
||||
|
@ -14,6 +14,8 @@ import Payment from "../order/components/payment"
|
||||
import { ORDER_STATUS } from "@/common/enum"
|
||||
import { AddShoppingCartApi } from "@/api/shopCart"
|
||||
import ShopCart from "@/components/shopCart"
|
||||
import ApplyRefund from "./components/applyRefund"
|
||||
import { alert } from "@/common/common"
|
||||
|
||||
export default () => {
|
||||
const {checkLogin} = useLogin()
|
||||
@ -98,12 +100,16 @@ export default () => {
|
||||
|
||||
//监听点击的按钮
|
||||
const clickOrderBtn = useCallback(({status, orderInfo}) => {
|
||||
setCallBackPayOrderInfo(() => orderInfo)
|
||||
if(status == 1 || status == 6) {
|
||||
getOrderList()
|
||||
} else if(status == 2) {
|
||||
//去支付
|
||||
setPayOrderInfo(() => orderInfo)
|
||||
toPay()
|
||||
} else if (status == 3) {
|
||||
//申请退款
|
||||
if(!orderInfo?.av_return_roll) return alert.none('该订单已申请过退款')
|
||||
setRefundShow(true)
|
||||
} else if (status == 7) {
|
||||
//购买
|
||||
addShopCart(orderInfo)
|
||||
@ -111,8 +117,9 @@ export default () => {
|
||||
}, [orderData])
|
||||
|
||||
|
||||
const [callBackOrderInfo, setCallBackPayOrderInfo] = useState<any>()
|
||||
|
||||
//去付款
|
||||
const [payOrderInfo, setPayOrderInfo] = useState<any>()
|
||||
const [payMentShow, setPayMentShow] = useState(false)
|
||||
const toPay = () => {
|
||||
setPayMentShow(true)
|
||||
@ -159,6 +166,12 @@ export default () => {
|
||||
|
||||
}
|
||||
|
||||
//申请退款
|
||||
const [refundShow, setRefundShow] = useState(false)
|
||||
const applyRefundClose = useCallback(() => {
|
||||
setRefundShow(false)
|
||||
}, [])
|
||||
|
||||
|
||||
return (
|
||||
<View className={styles.order_list_main}>
|
||||
@ -173,8 +186,9 @@ export default () => {
|
||||
})}
|
||||
</InfiniteScroll>
|
||||
</View>
|
||||
<ApplyRefund show={refundShow} onClose={applyRefundClose} orderId={callBackOrderInfo?.id}/>
|
||||
<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>
|
||||
)
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ import styles from './index.module.scss'
|
||||
<Text>{orderInfo?.return_explain_name}</Text>
|
||||
</SearchInput>
|
||||
<SearchInput showBorder={false} title='其它说明' height={50}>
|
||||
<Text>{orderInfo?.return_remark}</Text>
|
||||
<Text>{orderInfo?.reason_describe}</Text>
|
||||
</SearchInput>
|
||||
<SearchInput showBorder={false} title='货物状况' height={50}>
|
||||
<Text>{orderInfo?.goods_status_name}</Text>
|
||||
|
@ -59,7 +59,8 @@
|
||||
flex:1;
|
||||
font-size: $font_size;
|
||||
font-weight: 700;
|
||||
padding-left: 20px;
|
||||
padding: 0 20px;
|
||||
@include common_ellipsis()
|
||||
}
|
||||
.product_status{
|
||||
font-size: $font_size;
|
||||
|
@ -5,7 +5,7 @@ import styles from './index.module.scss'
|
||||
|
||||
|
||||
type Param = {
|
||||
status?: 0|1|2 //0默认不处理, 1退货,2退款
|
||||
status?: number //0默认不处理, 1退货,2退款
|
||||
}
|
||||
export default memo(({status = 0}:Param) => {
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user