剪板流程
This commit is contained in:
parent
4903c026b0
commit
86a8a76b27
@ -21,11 +21,21 @@ import { useRequest } from "@/use/useHttp"
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取应收单订单支付方式信息
|
* 获取预付单支付方式信息
|
||||||
*/
|
*/
|
||||||
export const GetOrderPayApi2 = () => {
|
export const GetPrepayOrderPayApi = () => {
|
||||||
return useRequest({
|
return useRequest({
|
||||||
url: `/v1/mall/orderPayment/preCollectOrder/orderPaymentMethodInfo`,
|
url: `/v1/mall/orderPayment/preCollectOrder/orderPaymentMethodInfo`,
|
||||||
method: "get",
|
method: "get",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预付单订单支付提交
|
||||||
|
*/
|
||||||
|
export const SubmitPrepayOrderPayApi = () => {
|
||||||
|
return useRequest({
|
||||||
|
url: `/v1/mall/orderPayment/preCollectOrder/orderPaymentSubmission`,
|
||||||
|
method: "put",
|
||||||
|
})
|
||||||
|
}
|
@ -10,7 +10,7 @@ export const BASE_URL = `http://192.168.1.30:40001/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.224:50001/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
|
// CDN
|
||||||
|
@ -6,6 +6,7 @@ export const ORDER_STATUS = {
|
|||||||
SaleOrderStatusArranging : {value:1, label:'配布中'}, // 配布中
|
SaleOrderStatusArranging : {value:1, label:'配布中'}, // 配布中
|
||||||
SaleOrderStatusArranged : {value:2, label:'已配布'}, // 已配布
|
SaleOrderStatusArranged : {value:2, label:'已配布'}, // 已配布
|
||||||
SaleOrderStatusWaitingPayment : {value:7, label:'待付款'}, // 待付款
|
SaleOrderStatusWaitingPayment : {value:7, label:'待付款'}, // 待付款
|
||||||
|
SaleOrderStatusTaking: {value: 11, label:'提货中'}, //提货中
|
||||||
SaleOrderStatusWaitingDelivery : {value:3, label:'待发货'}, // 待发货
|
SaleOrderStatusWaitingDelivery : {value:3, label:'待发货'}, // 待发货
|
||||||
SaleOrderStatusWaitingReceipt : {value:8, label:'待收货'}, // 待收货
|
SaleOrderStatusWaitingReceipt : {value:8, label:'待收货'}, // 待收货
|
||||||
SaleOrderStatusAlreadyReceipt : {value:9, label:'已收货'}, // 已收货
|
SaleOrderStatusAlreadyReceipt : {value:9, label:'已收货'}, // 已收货
|
||||||
|
@ -1,8 +1,57 @@
|
|||||||
.btns_list{
|
.btns_list{
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
// margin-top: 30px;
|
// margin-top: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-content: center;
|
||||||
|
.more{
|
||||||
|
font-size: 28px;
|
||||||
|
width: 143px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: $color_font_two;
|
||||||
|
padding-left: 20px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.more_list{
|
||||||
|
position: absolute;
|
||||||
|
background-color: #fff;
|
||||||
|
width: 226px;
|
||||||
|
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.06);
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 0 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
z-index:999;
|
||||||
|
&::before{
|
||||||
|
z-index: 1;
|
||||||
|
position: absolute;
|
||||||
|
bottom: -7px;
|
||||||
|
left: 50px;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
content: " ";
|
||||||
|
transform: rotate(45deg);
|
||||||
|
background: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
.more_item{
|
||||||
|
font-size: 28px;
|
||||||
|
height: 70px;
|
||||||
|
line-height: 70px;
|
||||||
|
text-align: center;
|
||||||
|
&:nth-last-child(n+2) {
|
||||||
|
border-bottom: 1PX solid #F0F0F0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.more_bg{
|
||||||
|
position:fixed;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.scroll{
|
.scroll{
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -14,7 +63,7 @@
|
|||||||
}
|
}
|
||||||
.btns_item{
|
.btns_item{
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
width: 100px;
|
width: 130px;
|
||||||
border: 2px solid #dddddd;
|
border: 2px solid #dddddd;
|
||||||
border-radius: 38px;
|
border-radius: 38px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { CancelOrderApi, ReceiveOrderApi } from "@/api/order"
|
import { CancelOrderApi, ReceiveOrderApi } from "@/api/order"
|
||||||
import { alert } from "@/common/common"
|
import { alert } from "@/common/common"
|
||||||
import { ORDER_STATUS } from "@/common/enum"
|
import { ORDER_STATUS } from "@/common/enum"
|
||||||
import { ScrollView, View } from "@tarojs/components"
|
import { ScrollView, Text, View } from "@tarojs/components"
|
||||||
import Taro from "@tarojs/taro"
|
import Taro from "@tarojs/taro"
|
||||||
import { useCallback, useRef, memo, useState, useEffect } from "react"
|
import { useCallback, useRef, memo, useState, useEffect, useMemo } from "react"
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
@ -30,7 +30,7 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
SaleOrderStatusAlreadyReceipt,
|
SaleOrderStatusAlreadyReceipt,
|
||||||
SaleorderstatusWaitingPrePayment
|
SaleorderstatusWaitingPrePayment
|
||||||
} = ORDER_STATUS
|
} = ORDER_STATUS
|
||||||
//订单按钮按订单状态归类
|
//订单按钮按订单状态归类, value是该订单状态,可能该按钮会出现
|
||||||
const orderBtnsList = useRef([
|
const orderBtnsList = useRef([
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -66,12 +66,17 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
id: 7,
|
id: 7,
|
||||||
value: [SaleOrderStatusWaitingReceipt.value,SaleOrderStatusAlreadyReceipt.value,SaleOrderStatusComplete.value,SaleOrderStatusRefund.value], //取消订单按钮对应: 待收货,已收货,已完成, 已退款
|
value: [SaleOrderStatusWaitingReceipt.value,SaleOrderStatusAlreadyReceipt.value,SaleOrderStatusComplete.value,SaleOrderStatusRefund.value], //取消订单按钮对应: 待收货,已收货,已完成, 已退款
|
||||||
label: '再次购买'
|
label: '再次购买'
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
id: 8,
|
||||||
|
value: [SaleOrderStatusBooking.value], //按钮对应: 待接单
|
||||||
|
label: '退款'
|
||||||
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
//判断是否显示该按钮
|
//判断是否显示该按钮
|
||||||
const orderBtnsShow = useCallback((item) => {
|
const orderBtnsShow = (item) => {
|
||||||
if(orderInfo) {
|
if(orderInfo) {
|
||||||
if(item.id == 1) {
|
if(item.id == 1) {
|
||||||
//取消订单按钮
|
//取消订单按钮
|
||||||
@ -87,11 +92,19 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
return item.value.includes(orderInfo.status)
|
return item.value.includes(orderInfo.status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},[orderInfo])
|
}
|
||||||
|
|
||||||
|
//显示的按钮数组
|
||||||
|
const orderBtnsShowList: {id: number, value: any, label: string}[] = useMemo(() => {
|
||||||
|
return orderBtnsList.current.filter(item => {
|
||||||
|
return orderBtnsShow(item)
|
||||||
|
})
|
||||||
|
}, [orderInfo])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//点击按钮操作
|
//点击按钮操作
|
||||||
const submitBtns = (val, index) => {
|
const submitBtns = (val, index) => {
|
||||||
clickEvent(val, index);
|
|
||||||
(val == 1)&&cancelOrder(); //取消订单按钮
|
(val == 1)&&cancelOrder(); //取消订单按钮
|
||||||
(val == 2)&&onClick?.(2); //去付款按钮
|
(val == 2)&&onClick?.(2); //去付款按钮
|
||||||
(val == 6)&&receiveOrder(); //确认收货
|
(val == 6)&&receiveOrder(); //确认收货
|
||||||
@ -140,28 +153,32 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//按钮点击滚动
|
|
||||||
const [selectInfo, setSelectInfo] = useState({
|
//显示更多按钮
|
||||||
selected: -1, //当前选中的id
|
const [showMore, setShowMore] = useState(false)
|
||||||
tabId: '', //需要滚动到的id
|
const styleTop = useMemo(() => {
|
||||||
})
|
return {top:`-${(orderBtnsShowList.length - 3)*70 + 10}rpx`, left: `-${10}rpx`}
|
||||||
const clickEvent = (id, index) => {
|
}, [orderBtnsShowList])
|
||||||
console.log(id, index)
|
|
||||||
const num = index > 0?( index - 1) : 0
|
|
||||||
console.log('num::',orderBtnsList.current[num].id)
|
|
||||||
setSelectInfo((e) => ({...e, tabId:orderBtnsList.current[num].id.toString(), selected: id}))
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.btns_list}>
|
<View className={styles.btns_list}>
|
||||||
<ScrollView scrollX scrollIntoView={`orderBtns_${selectInfo.tabId}`} scrollWithAnimation={true} className={styles.scroll}>
|
{(orderBtnsShowList.length > 3)&&<View className={styles.more}>
|
||||||
|
<Text onClick={() => setShowMore(true)}>更多</Text>
|
||||||
|
{showMore&&<View className={styles.more_con}>
|
||||||
|
<View className={styles.more_list} style={styleTop}>
|
||||||
|
{orderBtnsShowList.map((item, index) => {
|
||||||
|
return ((index >= 3) &&<View className={styles.more_item} key={item.id} onClick={() => submitBtns(item.id, index)}>{item.label}</View>)
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
<View className={styles.more_bg} catchMove onClick={() => setShowMore(false)}></View>
|
||||||
|
</View>}
|
||||||
|
</View>}
|
||||||
|
|
||||||
<View className={styles.list_scroll}>
|
<View className={styles.list_scroll}>
|
||||||
{orderBtnsList.current.map((item, index) =>
|
{orderBtnsShowList.map((item, index) =>
|
||||||
orderBtnsShow(item)&&<View key={item.id} className={styles.btns_item} onClick={() => submitBtns(item.id, index)}>{item.label}</View>
|
(index < 3)&&<View key={item.id} className={styles.btns_item} onClick={() => submitBtns(item.id, index)}>{item.label}</View>
|
||||||
// <View key={item.id} className={styles.btns_item} onClick={() => submitBtns(item.id, index)}>{item.label}</View>
|
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
@ -102,18 +102,10 @@ export default () => {
|
|||||||
|
|
||||||
//图片列表
|
//图片列表
|
||||||
const PictureItem = memo(() => {
|
const PictureItem = memo(() => {
|
||||||
const {uploadCDNImg} = useUploadCDNImg()
|
const {getWxPhoto} = useUploadCDNImg()
|
||||||
//图片
|
//图片
|
||||||
const uploadImage = () => {
|
const uploadImage = async () => {
|
||||||
Taro.chooseImage({
|
let res = await getWxPhoto('after-sale')
|
||||||
count: 1, // 默认9
|
|
||||||
sizeType: ['original', 'compressed'],
|
|
||||||
sourceType: ['album', 'camera'],
|
|
||||||
success: function (res) {
|
|
||||||
const file = res.tempFiles[0]
|
|
||||||
uploadCDNImg(file, 'product', 'product')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -53,7 +53,6 @@ export default memo(({show = false, onClose, title = '', productId = 0}: param)
|
|||||||
const condition = useRef({physical_warehouse:adminUserInfo?.physical_warehouse, sale_mode:selectIndex, product_id:0, code_or_name:null})
|
const condition = useRef({physical_warehouse:adminUserInfo?.physical_warehouse, sale_mode:selectIndex, product_id:0, code_or_name:null})
|
||||||
const getColorList = async () => {
|
const getColorList = async () => {
|
||||||
setLoading(() => true)
|
setLoading(() => true)
|
||||||
console.log('数据:::',getFilterData(condition.current))
|
|
||||||
let {data} = await colorFetchData(getFilterData(condition.current))
|
let {data} = await colorFetchData(getFilterData(condition.current))
|
||||||
let lists = initList(data.list)
|
let lists = initList(data.list)
|
||||||
setList(() => [...lists])
|
setList(() => [...lists])
|
||||||
|
@ -15,6 +15,7 @@ import { AnalysisShortCodeApi, BindShortCodeApi, GetShortCodeApi } from '@/api/s
|
|||||||
import { SHARE_SCENE } from '@/common/enum';
|
import { SHARE_SCENE } from '@/common/enum';
|
||||||
import useUserInfo from '@/use/useUserInfo';
|
import useUserInfo from '@/use/useUserInfo';
|
||||||
import LabAndImg from '@/components/LabAndImg';
|
import LabAndImg from '@/components/LabAndImg';
|
||||||
|
import { alert } from '@/common/common';
|
||||||
|
|
||||||
type item = {title:string, img:string, url:string, id:number}
|
type item = {title:string, img:string, url:string, id:number}
|
||||||
|
|
||||||
@ -114,17 +115,20 @@ export default (props:Params) => {
|
|||||||
setSortCode({... userObj.sort_code, shareShortDetail: {title: productName as string, code: resDetail.md5_key, img:''}})
|
setSortCode({... userObj.sort_code, shareShortDetail: {title: productName as string, code: resDetail.md5_key, img:''}})
|
||||||
}
|
}
|
||||||
|
|
||||||
//开始下单
|
//授权手机号和下单
|
||||||
const placeOrder = async (e:any) => {
|
const placeOrder = async (status = 'to_phone',e:any = {}) => {
|
||||||
// try {
|
if(status == 'to_phone') {
|
||||||
// await getPhoneNumber(e.detail.code)
|
if(!e.detail.code) return alert.error('请授权手机号')
|
||||||
// } catch(msg) {
|
try {
|
||||||
// Taro.showToast({
|
await getPhoneNumber(e.detail.code)
|
||||||
// icon:"none",
|
} catch(msg) {
|
||||||
// title: msg
|
Taro.showToast({
|
||||||
// })
|
icon:"none",
|
||||||
// return false
|
title: msg
|
||||||
// }
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
setShowOrderCount(true)
|
setShowOrderCount(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,12 +188,11 @@ export default (props:Params) => {
|
|||||||
<View className={styles.text}>购物车</View>
|
<View className={styles.text}>购物车</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
// !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(e)}></Button>
|
<Button className={styles.phoneBtn} open-type="getPhoneNumber" onGetPhoneNumber={(e) => placeOrder('to_phone',e)}></Button>
|
||||||
// 开始下单
|
开始下单
|
||||||
// </View>
|
</View>
|
||||||
// || <View className={styles.buy_btn} onClick={(e) => placeOrder(e)}>开始下单</View>
|
|| <View className={styles.buy_btn} onClick={() => placeOrder('to_order')}>开始下单</View>
|
||||||
<View className={styles.buy_btn} onClick={(e) => placeOrder(e)}>开始下单</View>
|
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
<CustomWrapper>
|
<CustomWrapper>
|
||||||
|
@ -150,11 +150,7 @@ import SubmitOrderBtn from "./components/submitOrderBtn";
|
|||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
const res = await saleOrderFetchData(submitOrderData)
|
const res = await saleOrderFetchData(submitOrderData)
|
||||||
if(res.success) {
|
if(res.success) {
|
||||||
if(preViewOrder?.sale_mode == 0) {
|
|
||||||
goLink('/pages/order/index',{id: res.data.id}, 'redirectTo')
|
goLink('/pages/order/index',{id: res.data.id}, 'redirectTo')
|
||||||
} else if (preViewOrder?.sale_mode == 1) {
|
|
||||||
goLink('/pages/order/cutOrder/index',{id: res.data.id}, 'redirectTo')
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
alert.none(res.msg)
|
alert.none(res.msg)
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
.order_address{
|
.order_address{
|
||||||
height: 178px;
|
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -26,16 +25,18 @@
|
|||||||
.order_address_text_title{
|
.order_address_text_title{
|
||||||
font-size: $font_size_medium;
|
font-size: $font_size_medium;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
@include common_ellipsis;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
.moreIconfont{
|
.moreIconfont{
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
.address_text{
|
||||||
|
word-break:break-all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.order_address_text_name{
|
.order_address_text_name{
|
||||||
|
margin-top: 30px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text{
|
text{
|
||||||
&:nth-child(1) {
|
&:nth-child(1) {
|
||||||
|
@ -97,7 +97,7 @@ export default memo(forwardRef(({onSelect, onChangeShipmentMode, defaultValue =
|
|||||||
<View className={classnames(styles.order_address_icon, 'iconfont', receivingStatus == 2?'icon-daohang':'icon-fahuo')}></View>
|
<View className={classnames(styles.order_address_icon, 'iconfont', receivingStatus == 2?'icon-daohang':'icon-fahuo')}></View>
|
||||||
<View className={styles.order_address_text_con}>
|
<View className={styles.order_address_text_con}>
|
||||||
<View className={styles.order_address_text_title}>
|
<View className={styles.order_address_text_title}>
|
||||||
<Text>{formatAddress}</Text>
|
<Text className={styles.address_text}>{formatAddress}</Text>
|
||||||
{(receivingStatus == 2)&&<Text className={classnames(styles.moreIconfont,'iconfont icon-a-moreback')}></Text>}
|
{(receivingStatus == 2)&&<Text className={classnames(styles.moreIconfont,'iconfont icon-a-moreback')}></Text>}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_address_text_name}>
|
<View className={styles.order_address_text_name}>
|
||||||
|
@ -97,12 +97,12 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
return priceInfo.value.includes(status)
|
return priceInfo.value.includes(status)
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
//金额展示
|
//金额展示大货
|
||||||
const priceConDom = useMemo(() => {
|
const priceConDom = useMemo(() => {
|
||||||
if(!order) return
|
if(!order) return
|
||||||
if(comfirm == true) {
|
if(comfirm == true) {
|
||||||
//确认订单时
|
//确认订单时
|
||||||
return (order.sale_mode == 1)?<EstimatedAmount number={formatPriceDiv(order.total_should_collect_money)} title="合计金额" /> : <EstimatedAmount number={formatPriceDiv(order.estimate_amount)} title="预估金额" />
|
return <EstimatedAmount number={formatPriceDiv(order.estimate_amount)} title="预估金额" />
|
||||||
} else if(order?.status == SaleOrderStatusCancel.value) {
|
} else if(order?.status == SaleOrderStatusCancel.value) {
|
||||||
//订单状态为取消订单时
|
//订单状态为取消订单时
|
||||||
return (
|
return (
|
||||||
@ -128,6 +128,22 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
}
|
}
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
|
//金额展示剪板
|
||||||
|
const cutPriceConDom = useMemo(() => {
|
||||||
|
if(!order) return
|
||||||
|
return <EstimatedAmount number={formatPriceDiv(order.total_should_collect_money)} title="合计金额" />
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
const showPriceAll = useMemo(() => {
|
||||||
|
if(order?.sale_mode == 1) {
|
||||||
|
return cutPriceConDom //剪板
|
||||||
|
} else {
|
||||||
|
return priceConDom //大货
|
||||||
|
}
|
||||||
|
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View className={styles.orders_list_title}>{numText}</View>
|
<View className={styles.orders_list_title}>{numText}</View>
|
||||||
@ -163,7 +179,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
<View className={styles.order_estimated_amount}>
|
<View className={styles.order_estimated_amount}>
|
||||||
{priceConDom}
|
{showPriceAll}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
|
@ -8,26 +8,33 @@ import MCheckbox from "@/components/checkbox";
|
|||||||
import Popup from "@/components/popup";
|
import Popup from "@/components/popup";
|
||||||
import OfflinePay from "../offlinePay";
|
import OfflinePay from "../offlinePay";
|
||||||
import ScanPay from "../scanPay";
|
import ScanPay from "../scanPay";
|
||||||
import { GetOrderPayApi, SubmitOrderPayApi } from "@/api/orderPay";
|
import { GetOrderPayApi, SubmitOrderPayApi, GetPrepayOrderPayApi, SubmitPrepayOrderPayApi } from "@/api/orderPay";
|
||||||
import { formatPriceDiv } from "@/common/fotmat";
|
import { formatPriceDiv } from "@/common/fotmat";
|
||||||
import {alert} from "@/common/common"
|
import {alert} from "@/common/common"
|
||||||
import { PAYMENT_METHOD, PAYMENT_METHOD_PARAM } from "@/common/enum";
|
import { ORDER_STATUS, PAYMENT_METHOD, PAYMENT_METHOD_PARAM } from "@/common/enum";
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
show?: true|false,
|
show?: true|false,
|
||||||
onClose?: () => void,
|
onClose?: () => void,
|
||||||
onSubmitSuccess?: () => void, //支付成功
|
onSubmitSuccess?: () => void, //支付成功
|
||||||
orderInfo?: OrderInfo
|
orderInfo?: OrderInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
type OrderInfo = {
|
type OrderInfo = {
|
||||||
orderId: number, //应付单id
|
should_collect_order_id?: number, //应付单id
|
||||||
payment_method: 0|PAYMENT_METHOD_PARAM //支付方式
|
pre_collect_order_id?: number, //预付单id
|
||||||
|
status?: number, //订单状态
|
||||||
|
payment_method?: 0|PAYMENT_METHOD_PARAM //支付方式
|
||||||
}
|
}
|
||||||
|
|
||||||
type PayStatus = 1|2|3|4|5|null //1:预存款, 2:账期,3:线下汇款, 4:扫码支付, 5:货到付款
|
type PayStatus = 1|2|3|4|5|null //1:预存款, 2:账期,3:线下汇款, 4:扫码支付, 5:货到付款
|
||||||
export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param) => {
|
export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param) => {
|
||||||
|
|
||||||
|
//支付方式枚举
|
||||||
|
const {PaymentMethodPreDeposit, PaymentMethodAccountPeriod, PaymentMethodCashOnDelivery} = PAYMENT_METHOD
|
||||||
|
//订单状态枚举
|
||||||
|
const {SaleorderstatusWaitingPrePayment} = ORDER_STATUS
|
||||||
|
|
||||||
//提交参数
|
//提交参数
|
||||||
const [submitData, setSubmitData] = useState<{id:number, payment_method: PayStatus}>({
|
const [submitData, setSubmitData] = useState<{id:number, payment_method: PayStatus}>({
|
||||||
id:0,
|
id:0,
|
||||||
@ -38,7 +45,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
const [offlinePayShow, setofflinePayShow] = useState(false)
|
const [offlinePayShow, setofflinePayShow] = useState(false)
|
||||||
const onShowOfflinePay = () => {
|
const onShowOfflinePay = () => {
|
||||||
setofflinePayShow(true)
|
setofflinePayShow(true)
|
||||||
onClose?.()
|
// onClose?.()
|
||||||
}
|
}
|
||||||
|
|
||||||
//扫码支付
|
//扫码支付
|
||||||
@ -51,13 +58,22 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
//获取支付方式数据
|
//获取支付方式数据
|
||||||
const [payInfo, setPayInfo] = useState<any>()
|
const [payInfo, setPayInfo] = useState<any>()
|
||||||
const {fetchData: orderFetchData} = GetOrderPayApi()
|
const {fetchData: orderFetchData} = GetOrderPayApi()
|
||||||
|
const {fetchData: prepayOrderFetchData} = GetPrepayOrderPayApi()
|
||||||
const getOrderPay = async () => {
|
const getOrderPay = async () => {
|
||||||
let {data} = await orderFetchData({id: orderInfo?.orderId})
|
if(orderInfo&&orderInfo.should_collect_order_id) {
|
||||||
|
//有应收单id时用应收单获取数据
|
||||||
|
let {data} = await orderFetchData({id: orderInfo?.should_collect_order_id})
|
||||||
|
setPayInfo(() => data)
|
||||||
|
} else {
|
||||||
|
//用预付单id获取支付信息
|
||||||
|
let {data} = await prepayOrderFetchData({id: orderInfo?.pre_collect_order_id})
|
||||||
setPayInfo(() => data)
|
setPayInfo(() => data)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(show&&orderInfo?.orderId) {
|
if(show&&orderInfo&&(orderInfo?.should_collect_order_id||orderInfo?.pre_collect_order_id)) {
|
||||||
setSubmitData((val) => ({...val, id:orderInfo.orderId}))
|
let id = orderInfo.should_collect_order_id||orderInfo.pre_collect_order_id
|
||||||
|
setSubmitData((val) => ({...val, id:id as number}))
|
||||||
getOrderPay()
|
getOrderPay()
|
||||||
}
|
}
|
||||||
}, [show, orderInfo])
|
}, [show, orderInfo])
|
||||||
@ -73,14 +89,20 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//提交支付
|
//提交支付
|
||||||
const {fetchData: submitFetchData} = SubmitOrderPayApi()
|
const {fetchData: submitFetchData} = SubmitOrderPayApi() //应收单提交
|
||||||
|
const {fetchData: submitPrepayOrderFetchData} = SubmitPrepayOrderPayApi() //预付单提交
|
||||||
const submitPay = async () => {
|
const submitPay = async () => {
|
||||||
if(submitData.payment_method === null) {
|
if(submitData.payment_method === null) {
|
||||||
alert.error('请选择支付方式')
|
alert.error('请选择支付方式')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
alert.loading('正在支付')
|
alert.loading('正在支付')
|
||||||
let res = await submitFetchData(submitData)
|
let res:any = null
|
||||||
|
if(orderInfo?.should_collect_order_id) {
|
||||||
|
res = await submitFetchData(submitData)
|
||||||
|
} else {
|
||||||
|
res = await submitPrepayOrderFetchData(submitData)
|
||||||
|
}
|
||||||
if(res.success) {
|
if(res.success) {
|
||||||
alert.success('支付成功')
|
alert.success('支付成功')
|
||||||
onSubmitSuccess?.()
|
onSubmitSuccess?.()
|
||||||
@ -97,6 +119,17 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
)
|
)
|
||||||
}, [payInfo])
|
}, [payInfo])
|
||||||
|
|
||||||
|
//是否显示七天账期
|
||||||
|
const show_account_payment = useMemo(() => {
|
||||||
|
//支付方式是账期支付,不显示
|
||||||
|
if(orderInfo?.payment_method == PaymentMethodAccountPeriod.value) return false
|
||||||
|
//支付方式是货到付款,不显示
|
||||||
|
if(orderInfo?.payment_method == PaymentMethodCashOnDelivery.value) return false
|
||||||
|
//订单状态是预付款,不显示
|
||||||
|
if(orderInfo?.status == SaleorderstatusWaitingPrePayment.value) return false
|
||||||
|
return true
|
||||||
|
}, [orderInfo])
|
||||||
|
|
||||||
//账期
|
//账期
|
||||||
const account_peyment = useMemo(() => {
|
const account_peyment = useMemo(() => {
|
||||||
const price = payInfo?.should_collect_money - payInfo?.amount_paid
|
const price = payInfo?.should_collect_money - payInfo?.amount_paid
|
||||||
@ -105,9 +138,6 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
)
|
)
|
||||||
}, [payInfo])
|
}, [payInfo])
|
||||||
|
|
||||||
//支付方式枚举
|
|
||||||
const {PaymentMethodPreDeposit, PaymentMethodAccountPeriod} = PAYMENT_METHOD
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.payment_main}>
|
<View className={styles.payment_main}>
|
||||||
<Popup show={show} showTitle={false} onClose={onClose} >
|
<Popup show={show} showTitle={false} onClose={onClose} >
|
||||||
@ -143,13 +173,12 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
</View>
|
</View>
|
||||||
<MCheckbox status={submitData.payment_method == PaymentMethodPreDeposit.value} onSelect={() => advanceSelectData(PaymentMethodPreDeposit.value)} onClose={() => advanceSelectData(null)}/>
|
<MCheckbox status={submitData.payment_method == PaymentMethodPreDeposit.value} onSelect={() => advanceSelectData(PaymentMethodPreDeposit.value)} onClose={() => advanceSelectData(null)}/>
|
||||||
</View>
|
</View>
|
||||||
{(orderInfo?.payment_method != PaymentMethodAccountPeriod.value)&&<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-a-tuikuanshouhou', styles.miconfont)}></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>
|
||||||
{/* <View className={styles.payment_list_item_left_price}>可用额度 ¥{formatPriceDiv(payInfo?.account_period_credit_available_line)}</View> */}
|
|
||||||
{account_peyment}
|
{account_peyment}
|
||||||
</View>
|
</View>
|
||||||
<MCheckbox status={submitData.payment_method == PaymentMethodAccountPeriod.value} onSelect={() => periodSelectData(PaymentMethodAccountPeriod.value)} onClose={() => periodSelectData(null)}/>
|
<MCheckbox status={submitData.payment_method == PaymentMethodAccountPeriod.value} onSelect={() => periodSelectData(PaymentMethodAccountPeriod.value)} onClose={() => periodSelectData(null)}/>
|
||||||
|
@ -63,19 +63,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.submit_order{
|
.submit_order{
|
||||||
display: flex;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
justify-content: flex-end;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-shadow: 6px 0px 12px 0px rgba(0,0,0,0.16);
|
box-shadow: 6px 0px 12px 0px rgba(0,0,0,0.16);
|
||||||
padding: 20px 20px;
|
padding: 20px 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-bottom: constant(safe-area-inset-bottom);
|
// padding-bottom: constant(safe-area-inset-bottom);
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
// padding-bottom: env(safe-area-inset-bottom);
|
||||||
.order_btn {
|
.order_btn {
|
||||||
width: 152px;
|
width: 152px;
|
||||||
height: 72px;
|
height: 72px;
|
||||||
|
@ -115,10 +115,10 @@ import styles from './index.module.scss'
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
//支付所需数据
|
//支付所需数据
|
||||||
const payOrderInfo = useMemo(() => {
|
// const payOrderInfo = useMemo(() => {
|
||||||
if(orderDetail)
|
// if(orderDetail)
|
||||||
return {orderId: orderDetail.should_collect_order_id, payment_method:orderDetail.payment_method }
|
// return {should_collect_order_id: orderDetail.should_collect_order_id, payment_method:orderDetail.payment_method, pre_collect_order_id:orderDetail.pre_collect_order_id}
|
||||||
}, [orderDetail])
|
// }, [orderDetail])
|
||||||
|
|
||||||
//去付款
|
//去付款
|
||||||
const [payMentShow, setPayMentShow] = useState(false)
|
const [payMentShow, setPayMentShow] = useState(false)
|
||||||
@ -217,11 +217,12 @@ import styles from './index.module.scss'
|
|||||||
</View>
|
</View>
|
||||||
{(orderDetail?.status != SaleOrderStatusCancel.value)&&<View className={styles.submit_order}>
|
{(orderDetail?.status != SaleOrderStatusCancel.value)&&<View className={styles.submit_order}>
|
||||||
<OrderBtns orderInfo={orderInfo} onClick={orderStateClick}/>
|
<OrderBtns orderInfo={orderInfo} onClick={orderStateClick}/>
|
||||||
|
<View className="common_safe_area_y"></View>
|
||||||
</View> }
|
</View> }
|
||||||
<Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)} >
|
<Popup show={showDesc} showTitle={false} onClose={() => setShowDesc(false)}>
|
||||||
<Remark onSave={(e) => getRemark(e)}/>
|
<Remark onSave={(e) => getRemark(e)}/>
|
||||||
</Popup>
|
</Popup>
|
||||||
<Payment onSubmitSuccess={onPaySuccess} show={payMentShow} onClose={closePayShow} orderInfo={payOrderInfo} />
|
<Payment onSubmitSuccess={onPaySuccess} show={payMentShow} onClose={closePayShow} orderInfo={orderDetail} />
|
||||||
<View className="common_safe_area_y"></View>
|
<View className="common_safe_area_y"></View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
@ -131,7 +131,7 @@ export default () => {
|
|||||||
<OrderStatusList list={statusList} onSelect={changeStatus} defaultId={1}/>
|
<OrderStatusList list={statusList} onSelect={changeStatus} defaultId={1}/>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_list}>
|
<View className={styles.order_list}>
|
||||||
<InfiniteScroll statusMore={statusMore} selfonScrollToLower={getScrolltolower} refresherEnabled={true} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={getRefresherRefresh}>
|
<InfiniteScroll statusMore={statusMore} selfonScrollToLower={getScrolltolower} refresherEnabled={false} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={getRefresherRefresh}>
|
||||||
{orderData?.list.map(item => {
|
{orderData?.list.map(item => {
|
||||||
return <View key={item.id} className={styles.order_item_con}> <Order value={item} onClickBtn={clickOrderBtn}/></View>
|
return <View key={item.id} className={styles.order_item_con}> <Order value={item} onClickBtn={clickOrderBtn}/></View>
|
||||||
})}
|
})}
|
||||||
|
@ -69,7 +69,7 @@ export default () => {
|
|||||||
<View className={styles.search}>
|
<View className={styles.search}>
|
||||||
<Search style={{width: '100%'}} placeholder="请输入面料关键词" placeIcon="out" showBtn={true} clickOnSearch={(e) => searchEvent(e)}/>
|
<Search style={{width: '100%'}} placeholder="请输入面料关键词" placeIcon="out" showBtn={true} clickOnSearch={(e) => searchEvent(e)}/>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.up_search} onClick={() => goLink('/pages/searchList/searchList')}>高级搜索</View>
|
<View className={styles.up_search} onClick={() => goLink('/pages/searchList/hightSearchList')}>高级搜索</View>
|
||||||
{searchData?.hotField.length > 0 && <View className={styles.hot}>
|
{searchData?.hotField.length > 0 && <View className={styles.hot}>
|
||||||
<View className={styles.hot_header}>
|
<View className={styles.hot_header}>
|
||||||
<View className={styles.hot_header_title}>热门面料</View>
|
<View className={styles.hot_header_title}>热门面料</View>
|
||||||
|
@ -6,6 +6,7 @@ import { useSelector } from "@/reducers/hooks";
|
|||||||
import { GetAdminUserInfoApi } from "@/api/user";
|
import { GetAdminUserInfoApi } from "@/api/user";
|
||||||
import { alert, goLink } from "@/common/common";
|
import { alert, goLink } from "@/common/common";
|
||||||
import useLogin from '@/use/useLogin'
|
import useLogin from '@/use/useLogin'
|
||||||
|
import {BASE_URL} from '@/common/constant'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
// 用户信息
|
// 用户信息
|
||||||
@ -31,6 +32,8 @@ export default () => {
|
|||||||
<Assets />
|
<Assets />
|
||||||
<Main />
|
<Main />
|
||||||
<Modal data={adminUserInfo}/>
|
<Modal data={adminUserInfo}/>
|
||||||
|
{/* 测试暂时添加 */}
|
||||||
|
<View style={{fontSize:'26rpx', textAlign:'center'}}>{BASE_URL}</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import { GetWxUserInfoApi, GetAdminUserInfoApi, GetPhoneNumberApi } from "@/api/
|
|||||||
import useLoginRequest from "./useLoginRequest"
|
import useLoginRequest from "./useLoginRequest"
|
||||||
import { SHARE_SCENE } from "@/common/enum"
|
import { SHARE_SCENE } from "@/common/enum"
|
||||||
import { GetShortCodeApi } from "@/api/share"
|
import { GetShortCodeApi } from "@/api/share"
|
||||||
|
import { alert } from "@/common/common"
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const {setUserInfo, setAdminUserInfo, setSortCode, userInfo} = useUserInfo()
|
const {setUserInfo, setAdminUserInfo, setSortCode, userInfo} = useUserInfo()
|
||||||
|
@ -114,8 +114,39 @@ export default () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传手机图片
|
||||||
|
* @param cdn_upload_type //CDN 文件上传场景值
|
||||||
|
*/
|
||||||
|
// product 产品相关,图片、纹理图等 全平台
|
||||||
|
// after-sale 售后(申请退货、退款)相关的、图片、视频 全平台
|
||||||
|
// mall 电子商城相关的 全平台
|
||||||
|
// logistics 物流(发货、提货)相关的、图片、视频 全平台
|
||||||
|
type cdn_upload_type_Param = 'product'|'after-sale'|'mall'|'logistics'
|
||||||
|
const getWxPhoto = (cdn_upload_type: cdn_upload_type_Param) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
Taro.chooseImage({
|
||||||
|
count: 1, // 默认9
|
||||||
|
sizeType: ['original', 'compressed'],
|
||||||
|
sourceType: ['album', 'camera'],
|
||||||
|
success: async function (res) {
|
||||||
|
const file = res.tempFiles[0]
|
||||||
|
try {
|
||||||
|
let data = await uploadCDNImg(file, cdn_upload_type, cdn_upload_type)
|
||||||
|
resolve(data)
|
||||||
|
} catch(res) {
|
||||||
|
reject(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
uploadCDNImg
|
uploadCDNImg,
|
||||||
|
getWxPhoto
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user