商城测试版v7
This commit is contained in:
parent
c646bac0a4
commit
c4684c11b8
@ -42,7 +42,7 @@ import { useRequest } from "@/use/useHttp"
|
|||||||
/**
|
/**
|
||||||
* 公司类型|企业类型 下拉列表
|
* 公司类型|企业类型 下拉列表
|
||||||
*/
|
*/
|
||||||
export const companyTypeApi = () => {
|
export const companyTypeApi = () => {
|
||||||
return useRequest({
|
return useRequest({
|
||||||
url: `/v1/mall/enum/purchaserType`,
|
url: `/v1/mall/enum/purchaserType`,
|
||||||
method: "get",
|
method: "get",
|
||||||
@ -89,3 +89,22 @@ import { useRequest } from "@/use/useHttp"
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邀请码获取业务员信息
|
||||||
|
*/
|
||||||
|
export const GetInvitationInfoApi = () => {
|
||||||
|
return useRequest({
|
||||||
|
url: `/v1/mall/user/invitationInfo`,
|
||||||
|
method: "get",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定业务员
|
||||||
|
*/
|
||||||
|
export const BindInvitationInfoApi = () => {
|
||||||
|
return useRequest({
|
||||||
|
url: `/v1/mall/user/bindInvitationCode`,
|
||||||
|
method: "post",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { CancelOrderApi, ReceiveOrderApi } from "@/api/order"
|
|
||||||
import { alert } from "@/common/common"
|
import { alert } from "@/common/common"
|
||||||
import { AFTER_ORDER_STATUS, ORDER_STATUS, REFUND_STATUS_ORDER, SALE_MODE } from "@/common/enum"
|
import { AFTER_ORDER_STATUS, ORDER_STATUS, REFUND_STATUS_ORDER, SALE_MODE } from "@/common/enum"
|
||||||
import {Text, View } from "@tarojs/components"
|
import {Text, View } from "@tarojs/components"
|
||||||
@ -12,10 +11,10 @@ import { throttle } from "@/common/util"
|
|||||||
type Param = {
|
type Param = {
|
||||||
orderInfo: {
|
orderInfo: {
|
||||||
stage: number, //售后状态
|
stage: number, //售后状态
|
||||||
orderId: number, //订单id
|
|
||||||
sale_mode: number, //订单类型
|
sale_mode: number, //订单类型
|
||||||
type: number, //1退货,2退款
|
type: number, //1退货,2退款
|
||||||
return_apply_order_id: number //售后申请单
|
return_apply_order_id: number //售后申请单
|
||||||
|
is_quality_check: true|false //质检结果
|
||||||
},
|
},
|
||||||
onClick?: (val: number) => void, //点击后触发的事件,返回订单状态
|
onClick?: (val: number) => void, //点击后触发的事件,返回订单状态
|
||||||
fixedBottom?: true|false, //是否固定在底部
|
fixedBottom?: true|false, //是否固定在底部
|
||||||
@ -61,8 +60,7 @@ export default memo(({orderInfo, onClick, fixedBottom = true}:Param) => {
|
|||||||
id: 4,
|
id: 4,
|
||||||
label: '质检结果',
|
label: '质检结果',
|
||||||
validatarFunc: (orderInfo) => {
|
validatarFunc: (orderInfo) => {
|
||||||
if(orderInfo.sale_mode !== 1 && orderInfo.type == ReturnApplyOrderTypeReturnForRefund.value) return [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value].includes(orderInfo.stage)
|
return orderInfo?.is_quality_check
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -21,16 +21,29 @@
|
|||||||
z-index: 1999;
|
z-index: 1999;
|
||||||
.bindSalesman_header{
|
.bindSalesman_header{
|
||||||
width: 654px;
|
width: 654px;
|
||||||
height: 654px;
|
position: relative;
|
||||||
image{
|
image{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 40px 40px 0 0;
|
border-radius: 40px 40px 0 0;
|
||||||
}
|
}
|
||||||
|
.sale_man{
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 26px;
|
||||||
|
position: absolute;
|
||||||
|
margin: auto;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 60px;
|
||||||
|
height: 100px;
|
||||||
|
line-height: 100px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.btns{
|
.btns{
|
||||||
width: 488px;
|
width: 488px;
|
||||||
height: 104px;
|
height: 104px;
|
||||||
|
margin: 50px;
|
||||||
image{
|
image{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
@ -8,16 +8,12 @@ import { useEffect, useState } from "react";
|
|||||||
|
|
||||||
type params = {
|
type params = {
|
||||||
show?: true|false,
|
show?: true|false,
|
||||||
onClose?: () => void
|
onClose?: () => void,
|
||||||
|
saleMan?: string
|
||||||
}
|
}
|
||||||
export default ({show = false, onClose}:params) => {
|
export default ({show = false, saleMan = '', onClose}:params) => {
|
||||||
const [showPop, setShowPop] = useState<true|false>(false)
|
|
||||||
useEffect(() => {
|
|
||||||
if(show !== undefined) setShowPop(() => show)
|
|
||||||
}, [show])
|
|
||||||
const onClick = async (val) => {
|
const onClick = async (val) => {
|
||||||
onClose?.()
|
onClose?.()
|
||||||
setShowPop(() => false)
|
|
||||||
if(val == 1) {
|
if(val == 1) {
|
||||||
goLink('/pages/depositBeforehand/index')
|
goLink('/pages/depositBeforehand/index')
|
||||||
} else {
|
} else {
|
||||||
@ -25,20 +21,20 @@ export default ({show = false, onClose}:params) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const onCloseEven = () => {
|
const onCloseEven = () => {
|
||||||
setShowPop(() => false)
|
|
||||||
onClose?.()
|
onClose?.()
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{showPop&&<View className={styles.bindSalesman_main}>
|
{show&&<View className={styles.bindSalesman_main}>
|
||||||
<View className={styles.bindSalesman_pop}>
|
<View className={styles.bindSalesman_pop}>
|
||||||
<View className={styles.bindSalesman_header} onClick={() => onClick(1)}>
|
<View className={styles.bindSalesman_header} onClick={() => onClick(1)}>
|
||||||
<Image src={formatImgUrl('/mall/invite_code_success.png', '!w400')} mode="widthFix"/>
|
<Image src={formatImgUrl('/mall/invite_code_success.png', '!w400')} mode="widthFix"/>
|
||||||
|
<View className={styles.sale_man}>邀请人: {saleMan}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.btns} onClick = {() => onClick(2)}>
|
<View className={styles.btns} >
|
||||||
<Image src={formatImgUrl('/mall/invite_code_btn.png', '!w400')} mode="widthFix"/>
|
<Image src={formatImgUrl('/mall/invite_code_btn.png', '!w400')} mode="widthFix" onClick = {() => onClick(2)}/>
|
||||||
</View>
|
</View>
|
||||||
{/* <CloseBtn styleObj={{backgroundImage: '', border:'2PX solid #fff', color: '#fff'}}/> */}
|
<CloseBtn styleObj={{backgroundImage: '', border:'2PX solid #fff', color: '#fff'}}/>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.bindSalesman_mask} onClick={onCloseEven}></View>
|
<View className={styles.bindSalesman_mask} onClick={onCloseEven}></View>
|
||||||
</View>}
|
</View>}
|
||||||
|
@ -3,11 +3,13 @@ import styles from './index.module.scss'
|
|||||||
import useLogin from '@/use/useLogin'
|
import useLogin from '@/use/useLogin'
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import { formatImgUrl } from '@/common/fotmat'
|
import { formatImgUrl } from '@/common/fotmat'
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import { alert } from '@/common/common';
|
import { alert } from '@/common/common';
|
||||||
import CloseBtn from '@/components/closeBtn';
|
import CloseBtn from '@/components/closeBtn';
|
||||||
import SuccessBind from './component/successBind';
|
import SuccessBind from './component/successBind';
|
||||||
import Taro, { useDidShow } from "@tarojs/taro";
|
import Taro, { useDidShow } from "@tarojs/taro";
|
||||||
|
import { BindInvitationInfoApi, GetInvitationInfoApi } from '@/api/user';
|
||||||
|
import { debounce, getFilterData, throttle } from '@/common/util';
|
||||||
export default () => {
|
export default () => {
|
||||||
useLogin()
|
useLogin()
|
||||||
|
|
||||||
@ -16,25 +18,45 @@ export default () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const [submitData, setSubmitData] = useState({
|
const [submitData, setSubmitData] = useState({
|
||||||
code: '',
|
invitation_code: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
const onSubmit = () => {
|
//获取业务员信息
|
||||||
if(!submitData.code) alert.error('请输入邀请码')
|
type Param = {invitation_code: string, name: string, phone: string}
|
||||||
|
const [salesMan, setSalesMan] = useState<Param|null>(null)
|
||||||
|
const {fetchData: GetInvitationInfoFetchData} = GetInvitationInfoApi()
|
||||||
|
const getInvitationInfo = async () => {
|
||||||
|
let res = await GetInvitationInfoFetchData(getFilterData({...submitData}))
|
||||||
|
res.success?setSalesMan(res.data):setSalesMan(null)
|
||||||
}
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
if(submitData.invitation_code.length === 4)
|
||||||
|
getInvitationInfo()
|
||||||
|
}, [submitData])
|
||||||
|
|
||||||
const onInputCode = (e) => {
|
const onInputCode = (e) => {
|
||||||
setSubmitData((val) => ({...val, code:e.detail.value}))
|
const value = e.detail.value.replace(/[\W]/g, "")
|
||||||
|
setSubmitData((val) => ({...val, invitation_code:value}))
|
||||||
}
|
}
|
||||||
|
|
||||||
const oncloseEven = () => {
|
const oncloseEven = () => {
|
||||||
setSubmitData((val) => ({...val, code:''}))
|
setSubmitData((val) => ({...val, invitation_code:''}))
|
||||||
|
setSalesMan(null)
|
||||||
|
}
|
||||||
|
|
||||||
|
//绑定业务员
|
||||||
|
const [bindShow, setBindShow] = useState(false)
|
||||||
|
const {fetchData: bindInvitationInfoFetchData} = BindInvitationInfoApi()
|
||||||
|
const onSubmit = async () => {
|
||||||
|
if(!submitData.invitation_code) return alert.error('请输入邀请码')
|
||||||
|
let res = await bindInvitationInfoFetchData({...submitData})
|
||||||
|
if(res.success) setBindShow(() => true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onScanCode = () => {
|
const onScanCode = () => {
|
||||||
Taro.scanCode({
|
Taro.scanCode({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log(res)
|
setSubmitData(() => ({invitation_code: res.result}))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -44,7 +66,7 @@ export default () => {
|
|||||||
Taro.getClipboardData({
|
Taro.getClipboardData({
|
||||||
success: function (res){
|
success: function (res){
|
||||||
let val = res.data.match(/InviteCode:([a-zA-Z0-9]{4})/)
|
let val = res.data.match(/InviteCode:([a-zA-Z0-9]{4})/)
|
||||||
setSubmitData((...e) => ({...e, code: val?val[1]:''}))
|
setSubmitData((e) => ({...e, invitation_code: val?val[1]:''}))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -55,15 +77,15 @@ export default () => {
|
|||||||
<Image src={formatImgUrl('/mall/invite_code_bg.png')} mode="aspectFill"/>
|
<Image src={formatImgUrl('/mall/invite_code_bg.png')} mode="aspectFill"/>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.inputCode}>
|
<View className={styles.inputCode}>
|
||||||
<Input value={submitData.code} placeholder='请输入邀请码' onInput={(e) => onInputCode(e)}/>
|
<Input maxlength={4} value={submitData.invitation_code} placeholder='请输入邀请码' onInput={onInputCode} type="text" />
|
||||||
<View className={styles.close_btn} >
|
<View className={styles.close_btn} >
|
||||||
{submitData.code&&<CloseBtn styleObj={{backgroundColor: '#ccc', color: '#fff'}} onClose={oncloseEven}/>}
|
{submitData.invitation_code&&<CloseBtn styleObj={{backgroundColor: '#ccc', color: '#fff'}} onClose={oncloseEven}/>}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.scan_code} onClick={() => onScanCode()}>
|
<View className={styles.scan_code} onClick={() => onScanCode()}>
|
||||||
<Text className={classnames('iconfont icon-saomazhifu', styles.miconfont)}></Text>
|
<Text className={classnames('iconfont icon-saomazhifu', styles.miconfont)}></Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.salesman_name}><Text>邀请人:</Text><Text>李先生(132****6690)</Text></View>
|
{salesMan&&<View className={styles.salesman_name}><Text>邀请人:</Text><Text>{`${salesMan.name} (${salesMan.phone})`}</Text></View>}
|
||||||
<View className={styles.btns} onClick={onSubmit}>提交</View>
|
<View className={styles.btns} onClick={onSubmit}>提交</View>
|
||||||
<View className={styles.message}>
|
<View className={styles.message}>
|
||||||
<Text>温馨提示</Text>
|
<Text>温馨提示</Text>
|
||||||
@ -71,7 +93,7 @@ export default () => {
|
|||||||
<Text>2. 一个手机只能输入一次邀请码。输入邀请码。</Text>
|
<Text>2. 一个手机只能输入一次邀请码。输入邀请码。</Text>
|
||||||
</View>
|
</View>
|
||||||
<View className='common_safe_area_y'></View>
|
<View className='common_safe_area_y'></View>
|
||||||
<SuccessBind show={false}/>
|
<SuccessBind show={bindShow} onClose={() => setBindShow(false)} saleMan={salesMan?.name}/>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ import AddCollection from '@/components/addCollection';
|
|||||||
import { AddFavoriteApi, DelFavoriteProductApi } from '@/api/favorite';
|
import { AddFavoriteApi, DelFavoriteProductApi } from '@/api/favorite';
|
||||||
import useCommonData from '@/use/useCommonData';
|
import useCommonData from '@/use/useCommonData';
|
||||||
import { IMG_CND_Prefix } from '@/common/constant';
|
import { IMG_CND_Prefix } from '@/common/constant';
|
||||||
import LabAndImgShow from '@/components/LabAndImgShow';
|
|
||||||
|
|
||||||
type item = {title:string, img:string, url:string, id:number}
|
type item = {title:string, img:string, url:string, id:number}
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ import { throttle } from "@/common/util";
|
|||||||
alert.none(res.msg)
|
alert.none(res.msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 600)
|
}, 800)
|
||||||
|
|
||||||
//页面下拉刷新
|
//页面下拉刷新
|
||||||
usePullDownRefresh(() => {
|
usePullDownRefresh(() => {
|
||||||
|
@ -125,7 +125,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
}, [order])
|
}, [order])
|
||||||
//对应单价
|
//对应单价
|
||||||
const standardPrice = useCallback(price => {
|
const standardPrice = useCallback(price => {
|
||||||
return formatPriceDiv(price, 100, true) + '/' + (order?.sale_mode == 1?'m':'kg')
|
return formatPriceDiv(price) + '/' + (order?.sale_mode == 1?'m':'kg')
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
//数量格式
|
//数量格式
|
||||||
|
@ -13,6 +13,7 @@ import { formatPriceDiv } from "@/common/fotmat";
|
|||||||
import {alert} from "@/common/common"
|
import {alert} from "@/common/common"
|
||||||
import { ORDER_STATUS, PAYMENT_METHOD, SUBSCRIPTION_MESSAGE_SCENE } from "@/common/enum";
|
import { ORDER_STATUS, PAYMENT_METHOD, SUBSCRIPTION_MESSAGE_SCENE } from "@/common/enum";
|
||||||
import { UseSubscriptionMessage } from "@/use/useCommon";
|
import { UseSubscriptionMessage } from "@/use/useCommon";
|
||||||
|
import { throttle } from "@/common/util";
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
show?: true|false,
|
show?: true|false,
|
||||||
@ -28,6 +29,8 @@ type OrderInfo = {
|
|||||||
status?: number, //订单状态
|
status?: number, //订单状态
|
||||||
payment_method?: number, //支付方式
|
payment_method?: number, //支付方式
|
||||||
sale_mode?: number, //订单类型 0:大货 1剪板 2散剪
|
sale_mode?: number, //订单类型 0:大货 1剪板 2散剪
|
||||||
|
actual_weight?: number, //实际重量
|
||||||
|
estimate_weight?: number, //预估重量
|
||||||
[val: string]: any
|
[val: string]: any
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +102,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
//提交支付
|
//提交支付
|
||||||
const {fetchData: submitFetchData} = SubmitOrderPayApi() //应收单提交
|
const {fetchData: submitFetchData} = SubmitOrderPayApi() //应收单提交
|
||||||
const {fetchData: submitPrepayOrderFetchData} = SubmitPrepayOrderPayApi() //预付单提交
|
const {fetchData: submitPrepayOrderFetchData} = SubmitPrepayOrderPayApi() //预付单提交
|
||||||
const submitPay = async () => {
|
const submitPay = throttle(async () => {
|
||||||
if(submitData.payment_method === null) {
|
if(submitData.payment_method === null) {
|
||||||
alert.error('请选择支付方式')
|
alert.error('请选择支付方式')
|
||||||
return false
|
return false
|
||||||
@ -121,7 +124,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
} else {
|
} else {
|
||||||
alert.none(res.msg)
|
alert.none(res.msg)
|
||||||
}
|
}
|
||||||
}
|
}, 800)
|
||||||
|
|
||||||
//预付款
|
//预付款
|
||||||
const advance_payment = useMemo(() => {
|
const advance_payment = useMemo(() => {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
padding: 20px;
|
padding: 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
box-shadow: 0px 0px 12px 0px rgba(0,0,0,0.16);
|
box-shadow: 0px 0px 12px 0px rgba(0,0,0,0.16);
|
||||||
margin-bottom: 20px;;
|
margin-bottom: 20px;
|
||||||
.header{
|
.header{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -46,7 +46,7 @@ export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
|||||||
product_color_name: citem.name,
|
product_color_name: citem.name,
|
||||||
num: citem.roll.toString(),
|
num: citem.roll.toString(),
|
||||||
length: (citem.length/100).toString(),
|
length: (citem.length/100).toString(),
|
||||||
weight: formatWeightDiv(citem.estimate_weight).toString(),
|
weight: formatWeightDiv(citem.actual_weight||citem.estimate_weight).toString(),
|
||||||
sale_price: formatPriceDiv(citem.sale_price).toString(),
|
sale_price: formatPriceDiv(citem.sale_price).toString(),
|
||||||
total_price: formatPriceDiv(citem.estimate_amount).toString(),
|
total_price: formatPriceDiv(citem.estimate_amount).toString(),
|
||||||
})
|
})
|
||||||
@ -73,7 +73,7 @@ export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
|||||||
order_total_price: formatPriceDiv(orderInfo.total_sale_price).toString(), //订单价格
|
order_total_price: formatPriceDiv(orderInfo.total_sale_price).toString(), //订单价格
|
||||||
order_total_num: (orderInfo.total_number) + '',
|
order_total_num: (orderInfo.total_number) + '',
|
||||||
qrcode:"", //跳转链接
|
qrcode:"", //跳转链接
|
||||||
order_total_weight: formatWeightDiv(orderInfo.total_estimate_weight).toString(), //订单布匹重量
|
order_total_weight: formatWeightDiv(orderInfo.total_weight||orderInfo.total_estimate_weight).toString(), //订单布匹重量
|
||||||
list: lists ,
|
list: lists ,
|
||||||
show_qrcode: true //是否显示码单
|
show_qrcode: true //是否显示码单
|
||||||
}))
|
}))
|
||||||
@ -172,7 +172,7 @@ export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
|||||||
<View className={styles.scanPay_list}>
|
<View className={styles.scanPay_list}>
|
||||||
{(state.loading)&&<LoadingCard/>||
|
{(state.loading)&&<LoadingCard/>||
|
||||||
<ScrollView scrollY className={styles.scanPay_list}>
|
<ScrollView scrollY className={styles.scanPay_list}>
|
||||||
<Image mode="widthFix" src={payCodeImage} showMenuByLongpress={true} onClick={showImage}></Image>
|
<Image mode="widthFix" src={payCodeImage} onClick={showImage}></Image>
|
||||||
</ScrollView>}
|
</ScrollView>}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.btns} onClick={saveImageCheck}>保存电子确认单</View>
|
<View className={styles.btns} onClick={saveImageCheck}>保存电子确认单</View>
|
||||||
|
@ -5,12 +5,10 @@ import styles from './index.module.scss'
|
|||||||
import Popup from "@/components/popup";
|
import Popup from "@/components/popup";
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from "@tarojs/taro";
|
||||||
import { alert } from "@/common/common";
|
import { alert } from "@/common/common";
|
||||||
import { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, formatRemoveHashTag, formatWeightDiv } from "@/common/fotmat";
|
import { formatDateTime, formatPriceDiv, formatRemoveHashTag, formatWeightDiv } from "@/common/fotmat";
|
||||||
import useCheckAuthorize from "@/use/useCheckAuthorize";
|
import useCheckAuthorize from "@/use/useCheckAuthorize";
|
||||||
import { GetPayCode } from "@/api/onlinePay";
|
import { GetPayCode } from "@/api/onlinePay";
|
||||||
import LoadingCard from "@/components/loadingCard";
|
import LoadingCard from "@/components/loadingCard";
|
||||||
import { GetOrderPayApi, GetPrepayOrderPayApi } from "@/api/orderPay";
|
|
||||||
|
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
show?: true|false,
|
show?: true|false,
|
||||||
@ -52,7 +50,7 @@ export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
|||||||
product_color_name: citem.name,
|
product_color_name: citem.name,
|
||||||
num: citem.roll.toString(),
|
num: citem.roll.toString(),
|
||||||
length: (citem.length/100).toString(),
|
length: (citem.length/100).toString(),
|
||||||
weight: formatWeightDiv(citem.estimate_weight).toString(),
|
weight: formatWeightDiv(citem.actual_weight||citem.estimate_weight).toString(),
|
||||||
sale_price: formatPriceDiv(citem.sale_price).toString(),
|
sale_price: formatPriceDiv(citem.sale_price).toString(),
|
||||||
total_price: formatPriceDiv(citem.total_sale_price||citem.estimate_amount).toString(),
|
total_price: formatPriceDiv(citem.total_sale_price||citem.estimate_amount).toString(),
|
||||||
})
|
})
|
||||||
@ -79,7 +77,7 @@ export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
|||||||
order_total_price: formatPriceDiv(orderInfo.total_sale_price).toString(), //订单价格
|
order_total_price: formatPriceDiv(orderInfo.total_sale_price).toString(), //订单价格
|
||||||
order_total_num: (orderInfo.total_number).toString(),
|
order_total_num: (orderInfo.total_number).toString(),
|
||||||
qrcode:"", //跳转链接
|
qrcode:"", //跳转链接
|
||||||
order_total_weight: formatWeightDiv(orderInfo.total_estimate_weight).toString(), //订单布匹重量
|
order_total_weight: formatWeightDiv(orderInfo.total_weight||orderInfo.total_estimate_weight).toString(), //订单布匹重量
|
||||||
list: lists
|
list: lists
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
@ -104,7 +102,6 @@ export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
|||||||
return addressInfo?.shipment_mode == 2? orderInfo.target_user_phone : orderInfo.take_goods_phone
|
return addressInfo?.shipment_mode == 2? orderInfo.target_user_phone : orderInfo.take_goods_phone
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取支付二维码
|
//获取支付二维码
|
||||||
const [payCodeImage, setPayCodeImage] = useState<string>('')
|
const [payCodeImage, setPayCodeImage] = useState<string>('')
|
||||||
const fileData = useRef({
|
const fileData = useRef({
|
||||||
@ -142,7 +139,7 @@ export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
|||||||
alert.loading('正在保存图片')
|
alert.loading('正在保存图片')
|
||||||
Taro.saveImageToPhotosAlbum({
|
Taro.saveImageToPhotosAlbum({
|
||||||
filePath: fileData.current.filePath,
|
filePath: fileData.current.filePath,
|
||||||
success: function (res) {
|
success: function () {
|
||||||
alert.success('图片保存成功')
|
alert.success('图片保存成功')
|
||||||
},
|
},
|
||||||
fail: function (err) {
|
fail: function (err) {
|
||||||
|
@ -48,7 +48,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
}, [value])
|
}, [value])
|
||||||
//对应单价
|
//对应单价
|
||||||
const standardPrice = useCallback((price, sale_mode) => {
|
const standardPrice = useCallback((price, sale_mode) => {
|
||||||
return formatPriceDiv(price).toLocaleString() + '/' + (sale_mode == 1?'m':'kg')
|
return '¥' + formatPriceDiv(price).toLocaleString() + '/' + (sale_mode == 1?'m':'kg')
|
||||||
}, [value])
|
}, [value])
|
||||||
|
|
||||||
//点击订单按钮
|
//点击订单按钮
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
navigationBarTitleText: '订单列表',
|
navigationBarTitleText: '订单列表',
|
||||||
enableShareAppMessage: true,
|
enableShareAppMessage: true,
|
||||||
|
enablePullDownRefresh: true,
|
||||||
|
backgroundTextStyle: 'dark',
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { SaleOrderOrderDetailApi } from "@/api/salesAfterOrder";
|
import { SaleOrderOrderDetailApi } from "@/api/salesAfterOrder";
|
||||||
import { formatHashTag, formatPriceDiv } from "@/common/fotmat";
|
import { formatHashTag, formatPriceDiv, formatWeightDiv } from "@/common/fotmat";
|
||||||
import LabAndImg from "@/components/LabAndImg";
|
import LabAndImg from "@/components/LabAndImg";
|
||||||
import Popup from "@/components/popup";
|
import Popup from "@/components/popup";
|
||||||
import { ScrollView, Text, View } from "@tarojs/components";
|
import { ScrollView, Text, View } from "@tarojs/components";
|
||||||
@ -106,7 +106,7 @@ export default memo(({show, onClose, onSubmit, id}:Param) => {
|
|||||||
<View className={styles.order_list_item_title}>{colorItem.code + ' ' + colorItem.name}</View>
|
<View className={styles.order_list_item_title}>{colorItem.code + ' ' + colorItem.name}</View>
|
||||||
<View className={styles.order_list_item_price}>
|
<View className={styles.order_list_item_price}>
|
||||||
<Text>¥{standardPrice(colorItem.sale_price)}</Text>
|
<Text>¥{standardPrice(colorItem.sale_price)}</Text>
|
||||||
<Text>总重{standardPrice(colorItem.estimate_weight)}</Text>
|
<Text>总重{formatWeightDiv(colorItem.estimate_weight)}kg</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_list_item_count}>
|
<View className={styles.order_list_item_count}>
|
||||||
|
@ -28,6 +28,7 @@ type OrderParam = {
|
|||||||
quality_check_pass_colors: number, //验布后的颜色总数
|
quality_check_pass_colors: number, //验布后的颜色总数
|
||||||
quality_check_pass_fabrics: number, //验布后的面料数量
|
quality_check_pass_fabrics: number, //验布后的面料数量
|
||||||
quality_check_pass_number: number, //验布后的总数量
|
quality_check_pass_number: number, //验布后的总数量
|
||||||
|
is_quality_check: true|false, //是否质检过
|
||||||
}
|
}
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
@ -36,31 +37,6 @@ type Param = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default memo(({order, comfirm = false}:Param) => {
|
export default memo(({order, comfirm = false}:Param) => {
|
||||||
//对应数量
|
|
||||||
const formatCount = useCallback((item) => {
|
|
||||||
return order?.sale_mode == 0? item.roll : Number(item.length / 100)
|
|
||||||
}, [order])
|
|
||||||
//对应单价
|
|
||||||
const standardPrice = useCallback(price => {
|
|
||||||
return formatPriceDiv(price).toLocaleString() + '/' + (order?.sale_mode == 1?'m':'kg')
|
|
||||||
}, [order])
|
|
||||||
//数量格式
|
|
||||||
const numText = useMemo(() => {
|
|
||||||
if(order) {
|
|
||||||
if(!order?.quality_check_pass_fabrics&&!order?.quality_check_pass_number&&!order?.quality_check_pass_colors) {
|
|
||||||
let total_number = order?.sale_mode == 0?order?.total_number:(order?.total_number/100)
|
|
||||||
return `${order?.total_fabrics} 种面料,${order?.total_colors} 种颜色,共 ${total_number} ${order?.unit}`
|
|
||||||
} else {
|
|
||||||
let total_number = order?.sale_mode == 0?order?.quality_check_pass_number:(order?.quality_check_pass_number/100)
|
|
||||||
return `${order?.quality_check_pass_fabrics} 种面料,${order?.quality_check_pass_colors} 种颜色,共 ${total_number} ${order?.unit}`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, [order])
|
|
||||||
|
|
||||||
//获取面料数组
|
|
||||||
const list = useMemo(() => {
|
|
||||||
return order?.quality_check_pass_product?.length > 0?order?.quality_check_pass_product:order?.product_list
|
|
||||||
}, [order])
|
|
||||||
|
|
||||||
//售后单状态枚举
|
//售后单状态枚举
|
||||||
const {
|
const {
|
||||||
@ -74,14 +50,6 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
ReturnStageRejected, // 已拒绝
|
ReturnStageRejected, // 已拒绝
|
||||||
} = AFTER_ORDER_STATUS
|
} = AFTER_ORDER_STATUS
|
||||||
|
|
||||||
//退款状态枚举
|
|
||||||
// const {
|
|
||||||
// ShouldCollectOrderRefundTypeUnknown,
|
|
||||||
// ShouldCollectOrderRefundTypeAdvanceReceiptRefund,
|
|
||||||
// ShouldCollectOrderRefundTypeReturnForRefund,
|
|
||||||
// ShouldCollectOrderRefundTypeSalesRefund,
|
|
||||||
// } = REFUND_STATUS
|
|
||||||
|
|
||||||
//金额列表枚举
|
//金额列表枚举
|
||||||
const priceList = [
|
const priceList = [
|
||||||
{
|
{
|
||||||
@ -133,6 +101,34 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
)
|
)
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
|
//对应数量
|
||||||
|
const formatCount = useCallback((item) => {
|
||||||
|
return order?.sale_mode == 0? item.roll : Number(item.length / 100)
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//对应单价
|
||||||
|
const standardPrice = useCallback(price => {
|
||||||
|
return formatPriceDiv(price).toLocaleString() + '/' + (order?.sale_mode == 1?'m':'kg')
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//数量格式
|
||||||
|
const numText = useMemo(() => {
|
||||||
|
if(order) {
|
||||||
|
if(!order?.is_quality_check) {
|
||||||
|
let total_number = order?.sale_mode == 0?order?.total_number:(order?.total_number/100)
|
||||||
|
return `${order?.total_fabrics} 种面料,${order?.total_colors} 种颜色,共 ${total_number} ${order?.unit}`
|
||||||
|
} else {
|
||||||
|
let total_number = order?.sale_mode == 0?order?.quality_check_pass_number:(order?.quality_check_pass_number/100)
|
||||||
|
return `${order?.quality_check_pass_fabrics} 种面料,${order?.quality_check_pass_colors} 种颜色,共 ${total_number} ${order?.unit}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//获取面料数组
|
||||||
|
const list = useMemo(() => {
|
||||||
|
return order?.is_quality_check?order?.quality_check_pass_product:order?.product_list
|
||||||
|
}, [order])
|
||||||
|
|
||||||
//整理颜色
|
//整理颜色
|
||||||
const labAndRgbAndUrl = useCallback((item) => {
|
const labAndRgbAndUrl = useCallback((item) => {
|
||||||
return {lab:{...item?.lab}, rgb:{...item?.rgb}, texturl_url: item?.texturl_url}
|
return {lab:{...item?.lab}, rgb:{...item?.rgb}, texturl_url: item?.texturl_url}
|
||||||
@ -145,7 +141,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
|
|
||||||
//销售价格
|
//销售价格
|
||||||
const formatPrice = useCallback((colorItem) => {
|
const formatPrice = useCallback((colorItem) => {
|
||||||
return (ReturnStageReturned.value == order?.stage) && <View className={styles.count_price}><text>¥</text>{formatPriceDiv(colorItem.estimate_amount, {} , true)}</View>
|
return (ReturnStageReturned.value == order?.stage) && <View className={styles.count_price}><text>¥</text>{formatPriceDiv(colorItem.estimate_amount, 100 , true)}</View>
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -46,32 +46,8 @@ import styles from './index.module.scss'
|
|||||||
const [formatDetailOrder, setFormatDetailOrder] = useState<any>() //格式化后的数据
|
const [formatDetailOrder, setFormatDetailOrder] = useState<any>() //格式化后的数据
|
||||||
const formatData = () => {
|
const formatData = () => {
|
||||||
setFormatDetailOrder({
|
setFormatDetailOrder({
|
||||||
estimate_amount: orderDetail.estimate_amount, //预估金额
|
...orderDetail,
|
||||||
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, //面料数量
|
|
||||||
quality_check_pass_colors: orderDetail.quality_check_pass_colors, //验布后的颜色总数
|
|
||||||
quality_check_pass_fabrics: orderDetail.quality_check_pass_fabrics, //验布后的面料数量
|
|
||||||
quality_check_pass_number: orderDetail.quality_check_pass_number, //验布后的总数量
|
|
||||||
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
||||||
// list: orderDetail.quality_check_pass_product.length > 0?orderDetail.quality_check_pass_product:orderDetail.product_list,
|
|
||||||
product_list: orderDetail.product_list,
|
|
||||||
quality_check_pass_product: orderDetail.quality_check_pass_product,
|
|
||||||
stage: orderDetail.stage, //订单状态
|
|
||||||
type: orderDetail.type, //退货or退款
|
|
||||||
total_sale_price: orderDetail.total_sale_price, //销售金额
|
|
||||||
total_should_collect_money: orderDetail.total_should_collect_money, //应收金额
|
|
||||||
total_weight_error_discount: orderDetail.total_weight_error_discount, //空差优惠
|
|
||||||
actual_amount: orderDetail.actual_amount, //实付金额
|
|
||||||
the_previous_status: orderDetail.the_previous_status, //取消订单时的订单状态
|
|
||||||
other_deduction_amount: orderDetail.other_deduction_amount, //其他扣除金额
|
|
||||||
total_refund_amount: orderDetail.total_refund_amount, //合计金额
|
|
||||||
refund_amount: orderDetail.refund_amount, //退款金额
|
|
||||||
refund_type: orderDetail.refund_type, //退款状态
|
|
||||||
refund_flow_name: orderDetail.refund_flow_name //退款去向
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const formatPreViewOrderMemo = useMemo(() => {
|
const formatPreViewOrderMemo = useMemo(() => {
|
||||||
@ -99,12 +75,7 @@ import styles from './index.module.scss'
|
|||||||
//按钮所需数据
|
//按钮所需数据
|
||||||
const orderInfo = useMemo(() => {
|
const orderInfo = useMemo(() => {
|
||||||
return {
|
return {
|
||||||
stage: orderDetail?.stage, //售后订单状态
|
...orderDetail
|
||||||
orderId: orderDetail?.id,
|
|
||||||
settle_mode: orderDetail?.settle_mode,
|
|
||||||
type: orderDetail?.type, //退货or退款
|
|
||||||
sale_mode: orderDetail?.sale_mode, //订单类型
|
|
||||||
return_apply_order_id: orderDetail?.return_apply_order_id
|
|
||||||
}
|
}
|
||||||
}, [orderDetail])
|
}, [orderDetail])
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ type Param = {
|
|||||||
type: number //2 退货 1 预收退款 3 销售
|
type: number //2 退货 1 预收退款 3 销售
|
||||||
return_apply_order_id: number //退款申请单
|
return_apply_order_id: number //退款申请单
|
||||||
refund_amount: number // 退款金额
|
refund_amount: number // 退款金额
|
||||||
|
is_quality_check: true|false
|
||||||
},
|
},
|
||||||
onClickBtn?: (val:{status:number, orderInfo:Param['value']}) => void
|
onClickBtn?: (val:{status:number, orderInfo:Param['value']}) => void
|
||||||
}
|
}
|
||||||
@ -52,13 +53,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
|
|
||||||
//按钮所需数据
|
//按钮所需数据
|
||||||
const orderInfo = useMemo(() => {
|
const orderInfo = useMemo(() => {
|
||||||
return {
|
return value
|
||||||
stage: value?.stage, //订单状态
|
|
||||||
orderId: value?.id,
|
|
||||||
sale_mode: value?.sale_mode, //订单类型
|
|
||||||
type: value?.type, //退货or退款
|
|
||||||
return_apply_order_id: value?.return_apply_order_id //退款申请单
|
|
||||||
}
|
|
||||||
}, [value])
|
}, [value])
|
||||||
|
|
||||||
//整理颜色
|
//整理颜色
|
||||||
@ -110,11 +105,11 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
<View className={styles.color_num}>{value?.product_list?.[0].product_colors?.[0].code}</View>
|
<View className={styles.color_num}>{value?.product_list?.[0].product_colors?.[0].code}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.color_list}>
|
<View className={styles.color_list}>
|
||||||
{value?.product_list?.[0].product_colors.map((itemColor, index) => {
|
{value?.product_list?.[0].product_colors?.map((itemColor, index) => {
|
||||||
return (
|
return (
|
||||||
(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)}</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
@ -129,7 +124,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
</View>
|
</View>
|
||||||
<View className={styles.color_count_num}>
|
<View className={styles.color_count_num}>
|
||||||
<Text>{numText}</Text>
|
<Text>{numText}</Text>
|
||||||
{ReturnStageReturned.value == value?.stage && <Text className={styles.refund_amount}><Text>¥</Text>{formatPriceDiv(value?.refund_amount, 100, true)}</Text>}
|
{/* {ReturnStageReturned.value == value?.stage && <Text className={styles.refund_amount}><Text>¥</Text>{formatPriceDiv(value?.refund_amount, 100, true)}</Text>} */}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_number}>
|
<View className={styles.order_number}>
|
||||||
<Text>{value?.type == ReturnApplyOrderTypeReturnForRefund.value?'已申请退货':'已申请退款'}</Text>
|
<Text>{value?.type == ReturnApplyOrderTypeReturnForRefund.value?'已申请退货':'已申请退款'}</Text>
|
||||||
|
@ -35,7 +35,8 @@ type option = {
|
|||||||
page?: number,
|
page?: number,
|
||||||
pageSize?: number,
|
pageSize?: number,
|
||||||
pagination?: true|false,
|
pagination?: true|false,
|
||||||
base_url?: string
|
base_url?: string,
|
||||||
|
apiMsgStatus?: true|false
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,8 +102,10 @@ export const useRequest = (options:option = {
|
|||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 24,
|
pageSize: 24,
|
||||||
pagination: false, // 是否分页
|
pagination: false, // 是否分页
|
||||||
base_url: ''
|
base_url: '',
|
||||||
|
apiMsgStatus: true //是否直接弹出后端错误
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
options.url = `${options.base_url||BASE_URL}${options.url}`
|
options.url = `${options.base_url||BASE_URL}${options.url}`
|
||||||
let params:Params = {
|
let params:Params = {
|
||||||
code: null, // 业务码
|
code: null, // 业务码
|
||||||
@ -127,7 +130,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}))
|
||||||
stateRef.current.query = {
|
stateRef.current.query = {
|
||||||
@ -170,7 +172,7 @@ export const useRequest = (options:option = {
|
|||||||
stateRef.current.data = data
|
stateRef.current.data = data
|
||||||
stateRef.current.total = data?.list ? data?.total : 0
|
stateRef.current.total = data?.list ? data?.total : 0
|
||||||
if(code !== 0) {
|
if(code !== 0) {
|
||||||
Taro.showToast({
|
options.apiMsgStatus !== false &&Taro.showToast({
|
||||||
title: `${msg}`,
|
title: `${msg}`,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
@ -183,7 +185,6 @@ export const useRequest = (options:option = {
|
|||||||
removeSessionKey()
|
removeSessionKey()
|
||||||
removeUserInfo()
|
removeUserInfo()
|
||||||
login()
|
login()
|
||||||
//todo 登录数据刷新次数问题
|
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: `错误:${showStatus(statusCode)}`,
|
title: `错误:${showStatus(statusCode)}`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user