电子商城测试版v2
This commit is contained in:
parent
3b0f32c88a
commit
9503d35dbb
@ -60,3 +60,23 @@ 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",
|
||||
})
|
||||
}
|
@ -4,14 +4,14 @@
|
||||
// export const BASE_URL = `http://10.0.0.5:50001/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 = `https://test.zzfzyc.com/lymarket` // 测试环境
|
||||
export const BASE_URL = `https://test.zzfzyc.com/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 = `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.15:50001/lymarket` // 杰
|
||||
// export const BASE_URL = `http://192.168.1.15:50001/lymarket` // 杰
|
||||
|
||||
// CDN
|
||||
// 生成密钥
|
||||
|
@ -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>
|
||||
|
254
src/pages/applyAfterSales/index copy.tsx
Normal file
254
src/pages/applyAfterSales/index copy.tsx
Normal file
@ -0,0 +1,254 @@
|
||||
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>
|
||||
)
|
||||
}
|
@ -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>
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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) {
|
||||
//购买
|
||||
|
Loading…
x
Reference in New Issue
Block a user