电子商城测试版v3
This commit is contained in:
parent
b2f17afe50
commit
06aeda9e6b
@ -86,7 +86,7 @@ import { useRequest } from "@/use/useHttp"
|
|||||||
export const SubscriptionMessageApi = () => {
|
export const SubscriptionMessageApi = () => {
|
||||||
return useRequest({
|
return useRequest({
|
||||||
url: `/v1/mall/subscriptionMessage`,
|
url: `/v1/mall/subscriptionMessage`,
|
||||||
method: "post",
|
method: "get",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
|
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
|
||||||
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
|
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
|
||||||
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
|
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
|
||||||
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
||||||
// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
|
// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
|
||||||
export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰
|
// export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰
|
||||||
|
|
||||||
// CDN
|
// CDN
|
||||||
// 生成密钥
|
// 生成密钥
|
||||||
|
@ -50,3 +50,10 @@ export const SHARE_SCENE = {
|
|||||||
ShareDetail: {value:1, label:'详情分享'},
|
ShareDetail: {value:1, label:'详情分享'},
|
||||||
SharePage : {value:2, label:'页面分享'},
|
SharePage : {value:2, label:'页面分享'},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//订阅消息
|
||||||
|
export const SUBSCRIPTION_MESSAGE_SCENE = {
|
||||||
|
SubmitOrder: {value:1, label:'确认下单'},
|
||||||
|
ToPay : {value:2, label:'去付款'},
|
||||||
|
ApplyGoods: {value:3, label: '申请退款'}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
import { CancelOrderApi, ReceiveOrderApi } from "@/api/order"
|
import { CancelOrderApi, ReceiveOrderApi } from "@/api/order"
|
||||||
import { alert, goLink } from "@/common/common"
|
import { alert, goLink } from "@/common/common"
|
||||||
import { ORDER_STATUS, SALE_MODE } from "@/common/enum"
|
import { ORDER_STATUS, SALE_MODE, SUBSCRIPTION_MESSAGE_SCENE } from "@/common/enum"
|
||||||
import {Text, View } from "@tarojs/components"
|
import {Text, View } from "@tarojs/components"
|
||||||
import Taro from "@tarojs/taro"
|
import Taro from "@tarojs/taro"
|
||||||
import {useRef, memo, useState, useMemo } from "react"
|
import {useRef, memo, useState, useMemo } from "react"
|
||||||
@ -8,6 +8,7 @@ import classnames from "classnames";
|
|||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { AddShoppingCartApi } from "@/api/shopCart"
|
import { AddShoppingCartApi } from "@/api/shopCart"
|
||||||
import { ApplyRefundApi } from "@/api/salesAfterOrder"
|
import { ApplyRefundApi } from "@/api/salesAfterOrder"
|
||||||
|
import { UseSubscriptionMessage } from "@/use/useCommonData"
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
orderInfo: {
|
orderInfo: {
|
||||||
@ -126,22 +127,29 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
})
|
})
|
||||||
}, [orderInfo])
|
}, [orderInfo])
|
||||||
|
|
||||||
|
//订阅消息
|
||||||
|
const {ApplyGoods} = SUBSCRIPTION_MESSAGE_SCENE
|
||||||
|
const {openSubscriptionMessage} = UseSubscriptionMessage()
|
||||||
|
|
||||||
//点击按钮操作
|
//点击按钮操作
|
||||||
const submitBtns = (val, index) => {
|
const submitBtns = async (val, index) => {
|
||||||
if (val == 1) {
|
if (val == 1) {
|
||||||
cancelOrder()
|
cancelOrder()
|
||||||
} else if (val == 6) {
|
} else if (val == 6) {
|
||||||
receiveOrder()
|
receiveOrder()
|
||||||
} else if(val == 5) {
|
} else if(val == 5) {
|
||||||
if(!orderInfo?.av_return_roll) return alert.none('该订单没有可退条数')
|
if(!orderInfo?.av_return_roll) return alert.none('该订单没有可退条数')
|
||||||
|
await openSubscriptionMessage({orderId: orderInfo?.orderId, scenes: ApplyGoods.value})
|
||||||
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
|
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
|
||||||
|
} else if (val == 3) {
|
||||||
|
await openSubscriptionMessage({orderId: orderInfo?.orderId, scenes: ApplyGoods.value})
|
||||||
|
onClick?.(val)
|
||||||
} else if(val == 8) {
|
} else if(val == 8) {
|
||||||
applyRefund()
|
applyRefund()
|
||||||
} else {
|
} else {
|
||||||
onClick?.(val)
|
onClick?.(val)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//取消订单
|
//取消订单
|
||||||
@ -194,6 +202,7 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
title: '确定退款?',
|
title: '确定退款?',
|
||||||
success: async function async (res) {
|
success: async function async (res) {
|
||||||
if(res.confirm) {
|
if(res.confirm) {
|
||||||
|
await openSubscriptionMessage({orderId: orderInfo?.orderId, scenes: ApplyGoods.value})
|
||||||
let res = await fetchDataApplyRefund({sale_order_id: orderInfo?.orderId})
|
let res = await fetchDataApplyRefund({sale_order_id: orderInfo?.orderId})
|
||||||
if(res.success) {
|
if(res.success) {
|
||||||
alert.success('申请成功')
|
alert.success('申请成功')
|
||||||
|
@ -13,7 +13,7 @@ import { formatHashTag, formatImgUrl, formatPriceDiv } from "@/common/fotmat";
|
|||||||
import { setParam } from "@/common/system";
|
import { setParam } from "@/common/system";
|
||||||
import { debounce } from "@/common/util";
|
import { debounce } from "@/common/util";
|
||||||
import Counter from "../counter";
|
import Counter from "../counter";
|
||||||
import { ApplyOrderAccessApi, GetAdminUserInfoApi } from "@/api/user";
|
import { ApplyOrderAccessApi, GetAdminUserInfoApi, SubscriptionMessageApi } from "@/api/user";
|
||||||
|
|
||||||
type param = {
|
type param = {
|
||||||
show?: true|false,
|
show?: true|false,
|
||||||
@ -213,9 +213,11 @@ export default ({show = false, onClose}: param) => {
|
|||||||
|
|
||||||
//去结算
|
//去结算
|
||||||
const {fetchData: useFetchData} = GetAdminUserInfoApi()
|
const {fetchData: useFetchData} = GetAdminUserInfoApi()
|
||||||
|
const {fetchData: applyOrderAccessFetchData} = ApplyOrderAccessApi()
|
||||||
const orderDetail = debounce( async () => {
|
const orderDetail = debounce( async () => {
|
||||||
let res = await useFetchData()
|
let res = await useFetchData()
|
||||||
if(res.data.order_access_status !== 3) {
|
if(res.data.order_access_status !== 3) {
|
||||||
|
if(res.data.order_access_status == 1) applyOrderAccessFetchData()
|
||||||
Taro.showModal({
|
Taro.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '暂未开通下单权限功能,稍后有客服联系您,请注意接受电话。',
|
content: '暂未开通下单权限功能,稍后有客服联系您,请注意接受电话。',
|
||||||
@ -223,7 +225,6 @@ export default ({show = false, onClose}: param) => {
|
|||||||
confirmText: '我知道',
|
confirmText: '我知道',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
console.log('用户点击取消')
|
console.log('用户点击取消')
|
||||||
}
|
}
|
||||||
|
@ -5,16 +5,16 @@ import { View } from "@tarojs/components"
|
|||||||
import Taro, { useDidShow, usePullDownRefresh} from "@tarojs/taro";
|
import Taro, { useDidShow, usePullDownRefresh} from "@tarojs/taro";
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import AddressInfo from "./components/addressInfo";
|
|
||||||
import KindList from "./components/kindList";
|
import KindList from "./components/kindList";
|
||||||
import Remark from "./components/remark";
|
import Remark from "./components/remark";
|
||||||
import styles from './comfirm.module.scss'
|
import styles from './comfirm.module.scss'
|
||||||
import { getParam } from "@/common/system";
|
import { getParam } from "@/common/system";
|
||||||
import useLogin from "@/use/useLogin";
|
|
||||||
import { alert, goLink } from "@/common/common";
|
import { alert, goLink } from "@/common/common";
|
||||||
import ShipmentMode from "../editOrder/components/shipmentMode";
|
|
||||||
import SubmitOrderBtn from "./components/submitOrderBtn";
|
import SubmitOrderBtn from "./components/submitOrderBtn";
|
||||||
import AddressInfoDetail from "./components/addressInfoDetail";
|
import AddressInfoDetail from "./components/addressInfoDetail";
|
||||||
|
import { SubscriptionMessageApi } from "@/api/user";
|
||||||
|
import { SUBSCRIPTION_MESSAGE_SCENE } from "@/common/enum";
|
||||||
|
import { UseSubscriptionMessage } from "@/use/useCommonData";
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
|
|
||||||
@ -134,9 +134,13 @@ import AddressInfoDetail from "./components/addressInfoDetail";
|
|||||||
}
|
}
|
||||||
}, [formatPreViewOrder])
|
}, [formatPreViewOrder])
|
||||||
|
|
||||||
|
//订阅消息
|
||||||
|
const {SubmitOrder} = SUBSCRIPTION_MESSAGE_SCENE
|
||||||
|
const {openSubscriptionMessage} = UseSubscriptionMessage()
|
||||||
|
|
||||||
//提交订单
|
//提交订单
|
||||||
const {fetchData: saleOrderFetchData} = SaleOrderApi()
|
const {fetchData: saleOrderFetchData} = SaleOrderApi()
|
||||||
const submitOrderEven = () => {
|
const submitOrderEven = async () => {
|
||||||
if(!submitOrderData?.shipment_mode) {
|
if(!submitOrderData?.shipment_mode) {
|
||||||
alert.error('请选择收货方式')
|
alert.error('请选择收货方式')
|
||||||
return false
|
return false
|
||||||
@ -145,28 +149,20 @@ import AddressInfoDetail from "./components/addressInfoDetail";
|
|||||||
alert.error('请选择地址')
|
alert.error('请选择地址')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
await openSubscriptionMessage({scenes: SubmitOrder.value})
|
||||||
Taro.showModal({
|
|
||||||
title: '确定提交?',
|
|
||||||
success: async function (res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
const res = await saleOrderFetchData(submitOrderData)
|
const res = await saleOrderFetchData(submitOrderData)
|
||||||
if(res.success) {
|
if(res.success) {
|
||||||
goLink('/pages/order/index',{id: res.data.id}, 'redirectTo')
|
goLink('/pages/order/index',{id: res.data.id}, 'redirectTo')
|
||||||
} else {
|
} else {
|
||||||
alert.none(res.msg)
|
alert.none(res.msg)
|
||||||
}
|
}
|
||||||
} else if (res.cancel) {
|
|
||||||
console.log('用户点击取消')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//页面下拉刷新
|
//页面下拉刷新
|
||||||
usePullDownRefresh(() => {
|
usePullDownRefresh(() => {
|
||||||
getSaleOrderPreView()
|
getSaleOrderPreView()
|
||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_main}>
|
<View className={styles.order_main}>
|
||||||
<AddressInfoDetail orderInfo={defaultAddress} onSelect={getAddress} onChangeShipmentMode={selectShipmentMode} status={1}/>
|
<AddressInfoDetail orderInfo={defaultAddress} onSelect={getAddress} onChangeShipmentMode={selectShipmentMode} status={1}/>
|
||||||
|
@ -11,7 +11,8 @@ import ScanPay from "../scanPay";
|
|||||||
import { GetOrderPayApi, SubmitOrderPayApi, GetPrepayOrderPayApi, SubmitPrepayOrderPayApi } 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 { ORDER_STATUS, PAYMENT_METHOD, PAYMENT_METHOD_PARAM } from "@/common/enum";
|
import { ORDER_STATUS, PAYMENT_METHOD, PAYMENT_METHOD_PARAM, SUBSCRIPTION_MESSAGE_SCENE } from "@/common/enum";
|
||||||
|
import { UseSubscriptionMessage } from "@/use/useCommonData";
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
show?: true|false,
|
show?: true|false,
|
||||||
@ -21,11 +22,13 @@ type Param = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OrderInfo = {
|
type OrderInfo = {
|
||||||
|
id?: number, //销售单id
|
||||||
should_collect_order_id?: number, //应付单id
|
should_collect_order_id?: number, //应付单id
|
||||||
pre_collect_order_id?: number, //预付单id
|
pre_collect_order_id?: number, //预付单id
|
||||||
status?: number, //订单状态
|
status?: number, //订单状态
|
||||||
payment_method?: 0|PAYMENT_METHOD_PARAM //支付方式
|
payment_method?: 0|PAYMENT_METHOD_PARAM //支付方式
|
||||||
sale_mode?: number //订单类型 0:大货 1剪板 2散剪
|
sale_mode?: number, //订单类型 0:大货 1剪板 2散剪
|
||||||
|
[val: string]: any
|
||||||
}
|
}
|
||||||
|
|
||||||
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:货到付款
|
||||||
@ -89,6 +92,10 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
setSubmitData((e) => ({...e, payment_method:val}))
|
setSubmitData((e) => ({...e, payment_method:val}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//订阅消息
|
||||||
|
const {ToPay} = SUBSCRIPTION_MESSAGE_SCENE
|
||||||
|
const {openSubscriptionMessage} = UseSubscriptionMessage()
|
||||||
|
|
||||||
//提交支付
|
//提交支付
|
||||||
const {fetchData: submitFetchData} = SubmitOrderPayApi() //应收单提交
|
const {fetchData: submitFetchData} = SubmitOrderPayApi() //应收单提交
|
||||||
const {fetchData: submitPrepayOrderFetchData} = SubmitPrepayOrderPayApi() //预付单提交
|
const {fetchData: submitPrepayOrderFetchData} = SubmitPrepayOrderPayApi() //预付单提交
|
||||||
@ -97,6 +104,10 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
alert.error('请选择支付方式')
|
alert.error('请选择支付方式')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
//账期支付,或预付款并且不是剪板才会订阅
|
||||||
|
if((submitData.payment_method == PaymentMethodAccountPeriod.value || orderInfo?.status == SaleorderstatusWaitingPrePayment.value)&& orderInfo?.sale_mode != 1) {
|
||||||
|
await openSubscriptionMessage({orderId: orderInfo?.id, scenes: ToPay.value})
|
||||||
|
}
|
||||||
alert.loading('正在支付')
|
alert.loading('正在支付')
|
||||||
let res:any = null
|
let res:any = null
|
||||||
if(orderInfo?.should_collect_order_id) {
|
if(orderInfo?.should_collect_order_id) {
|
||||||
@ -122,7 +133,6 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
|
|
||||||
//是否显示七天账期
|
//是否显示七天账期
|
||||||
const show_account_payment = useMemo(() => {
|
const show_account_payment = useMemo(() => {
|
||||||
console.log('orderInfo?.status::123',orderInfo)
|
|
||||||
//剪板合散剪不显示
|
//剪板合散剪不显示
|
||||||
if(orderInfo?.sale_mode != 0) return false
|
if(orderInfo?.sale_mode != 0) return false
|
||||||
//支付方式是账期支付,不显示
|
//支付方式是账期支付,不显示
|
||||||
@ -151,7 +161,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
<Popup show={show} showTitle={false} onClose={onClose} >
|
<Popup show={show} showTitle={false} onClose={onClose} >
|
||||||
<View className={styles.payment_con}>
|
<View className={styles.payment_con}>
|
||||||
<View className={classnames('iconfont icon-a-moreback', styles.miconfont_title)} onClick={onClose}></View>
|
<View className={classnames('iconfont icon-a-moreback', styles.miconfont_title)} onClick={onClose}></View>
|
||||||
<View className={styles.title}>订单支付</View>
|
<View className={styles.title}>待支付款项</View>
|
||||||
<View className={styles.amount}>
|
<View className={styles.amount}>
|
||||||
<AmountShow status={2} number={formatPriceDiv(payInfo?.should_collect_money - payInfo?.amount_paid)}/>
|
<AmountShow status={2} number={formatPriceDiv(payInfo?.should_collect_money - payInfo?.amount_paid)}/>
|
||||||
</View>
|
</View>
|
||||||
@ -215,7 +225,7 @@ export default memo(({show = false, onClose, orderInfo, onSubmitSuccess}:Param)
|
|||||||
</View>
|
</View>
|
||||||
</Popup>
|
</Popup>
|
||||||
<OfflinePay show={offlinePayShow} onClose={() => setofflinePayShow(false)} offlineInfo={payInfo?.offline_remittance_information}/>
|
<OfflinePay show={offlinePayShow} onClose={() => setofflinePayShow(false)} offlineInfo={payInfo?.offline_remittance_information}/>
|
||||||
<ScanPay show={scanPayShow} onClose={() => setScanPayShow(false)}/>
|
<ScanPay orderInfo={orderInfo} show={scanPayShow} onClose={() => setScanPayShow(false)} />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
)
|
)
|
||||||
|
@ -5,7 +5,7 @@ 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 { formatImgUrl } from "@/common/fotmat";
|
import { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, 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";
|
||||||
@ -13,45 +13,91 @@ import LoadingCard from "@/components/loadingCard";
|
|||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
show?: true|false,
|
show?: true|false,
|
||||||
onClose?: () => void
|
onClose?: () => void,
|
||||||
|
company?: string,
|
||||||
|
qrcode?: string,
|
||||||
|
orderInfo?: any,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
type ListParam = {
|
||||||
|
|
||||||
type Item = {
|
|
||||||
product_code: string,
|
product_code: string,
|
||||||
product_name: string,
|
product_name: string,
|
||||||
product_color_code: string,
|
product_color_code: string,
|
||||||
product_color_name: string,
|
product_color_name: string,
|
||||||
num: string,
|
num: string,
|
||||||
weight: string,
|
weight: string,
|
||||||
|
length: string,
|
||||||
sale_price: string,
|
sale_price: string,
|
||||||
total_price: string
|
total_price: string
|
||||||
}
|
}
|
||||||
type CodeParam = {
|
export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
||||||
title: string,
|
const [detail, setDetail] = useState<any>()
|
||||||
company: string,
|
|
||||||
order_type: string,
|
useEffect(() => {
|
||||||
sale_user: string,
|
if(orderInfo) {
|
||||||
order_created_time: string,
|
console.log('orderInfo::',orderInfo)
|
||||||
order_no: string,
|
let lists:ListParam[] = []
|
||||||
department: string,
|
orderInfo.product_list?.map(pitem => {
|
||||||
shipment_mode: string,
|
pitem?.product_colors?.map(citem => {
|
||||||
target_user_name: string,
|
lists.push({
|
||||||
target_address: string,
|
product_code: formatHashTag(pitem.code, '', 'name')!,
|
||||||
target_description: string,
|
product_name: pitem.name,
|
||||||
pay_account: string,
|
product_color_code: formatHashTag(citem.code)!,
|
||||||
bank_account_name: string,
|
product_color_name: citem.name,
|
||||||
bank_name: string,
|
num: citem.roll + '',
|
||||||
pay_type: string,
|
length: (citem.length/100) + '',
|
||||||
client: string,
|
weight: formatWeightDiv(citem.estimate_weight) + '',
|
||||||
phone: string,
|
sale_price: formatPriceDiv(citem.sale_price) + '',
|
||||||
order_total_length: string,
|
total_price: formatPriceDiv(citem.estimate_amount) + '',
|
||||||
order_total_price: string,
|
})
|
||||||
qrcode: string,
|
})
|
||||||
order_total_weight: string,
|
})
|
||||||
list: Item[]
|
setDetail(() => ({
|
||||||
}
|
title: "面料销售电子确认单",
|
||||||
export default memo(({show = true, onClose}:Param) => {
|
company: orderInfo.company_name, //后端公司
|
||||||
|
order_type: orderInfo.sale_mode_name, //类型:大货
|
||||||
|
sale_user: orderInfo.sale_user_name, //业务员
|
||||||
|
order_created_time: formatDateTime(orderInfo.create_time),
|
||||||
|
order_no: orderInfo.order_no,
|
||||||
|
shipment_mode: orderInfo.shipment_mode_name, //发货方式
|
||||||
|
target_user_name: userName(orderInfo), //收件人
|
||||||
|
target_address: address(orderInfo), //收货地址
|
||||||
|
target_description: orderInfo.remark, //发货备注
|
||||||
|
pay_account:"1234567890123450001", //专属收款账号
|
||||||
|
bank_account_name:"佛山市浩川长盛科技有限公司", //账户名称
|
||||||
|
bank_name:"招商银行佛山分行禅城支行", //开户银行
|
||||||
|
pay_type:"", //支付方式, 可不传
|
||||||
|
client: orderInfo.purchaser_name, //客户名称
|
||||||
|
phone: userPhone(orderInfo), //收货手机号码
|
||||||
|
order_total_length: (orderInfo.total_number/100) + '', //订单布匹长度
|
||||||
|
order_total_price: formatPriceDiv(orderInfo.total_sale_price) + '', //订单价格
|
||||||
|
order_total_num: orderInfo.total_number + '',
|
||||||
|
qrcode:"", //跳转链接
|
||||||
|
order_total_weight: formatWeightDiv(orderInfo.total_estimate_weight) + '', //订单布匹重量
|
||||||
|
list: lists
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}, [orderInfo])
|
||||||
|
|
||||||
|
//收货地址
|
||||||
|
const address = (addressInfo) => {
|
||||||
|
if(addressInfo?.shipment_mode == 2) {
|
||||||
|
return addressInfo?.province_name?addressInfo.province_name + addressInfo.city_name + addressInfo.district_name + addressInfo.address_detail:''
|
||||||
|
} else {
|
||||||
|
return addressInfo?.take_goods_address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//收件人
|
||||||
|
const userName = (addressInfo) => {
|
||||||
|
return addressInfo?.shipment_mode == 2? orderInfo.target_user_name: ''
|
||||||
|
}
|
||||||
|
|
||||||
|
//手机号
|
||||||
|
const userPhone = (addressInfo) => {
|
||||||
|
return addressInfo?.shipment_mode == 2? orderInfo.target_user_phone : orderInfo.take_goods_phone
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取支付二维码
|
//获取支付二维码
|
||||||
const [payCodeImage, setPayCodeImage] = useState<string>('')
|
const [payCodeImage, setPayCodeImage] = useState<string>('')
|
||||||
@ -61,30 +107,7 @@ export default memo(({show = true, onClose}:Param) => {
|
|||||||
})
|
})
|
||||||
const {fetchData, state} = GetPayCode()
|
const {fetchData, state} = GetPayCode()
|
||||||
const getCore = async () => {
|
const getCore = async () => {
|
||||||
let res = await fetchData({
|
let res = await fetchData(detail)
|
||||||
title: "面料销售电子确认单",
|
|
||||||
company: "什么什么公司123",
|
|
||||||
order_type: "散剪",
|
|
||||||
sale_user: "小崔",
|
|
||||||
order_created_time:"2022/02/01 12:32:13",
|
|
||||||
order_no:"XS-211005888",
|
|
||||||
department:"嘻嘻嘻",
|
|
||||||
shipment_mode:"自提",
|
|
||||||
target_user_name:"大崔",
|
|
||||||
target_address:"阿斯顿发斯蒂芬",
|
|
||||||
target_description:"无",
|
|
||||||
pay_account:"1234567890123450001",
|
|
||||||
bank_account_name:"佛山市浩川长盛科技有限公司",
|
|
||||||
bank_name:"招商银行佛山分行禅城支行",
|
|
||||||
pay_type:"现结",
|
|
||||||
client:"客户名称",
|
|
||||||
phone:"15818085802",
|
|
||||||
order_total_length:"12",
|
|
||||||
order_total_price:"63000",
|
|
||||||
qrcode:"https://www.zzfzyc.com/checkorder/XS-211005888",
|
|
||||||
order_total_weight:"300.00",
|
|
||||||
list: [{product_code:'5215',product_name:'26S双纱亲水滑爽棉',product_color_code:'053',product_color_name:'洋红',num:'4',weight:'123.23',sale_price:'43',total_price:'4510.7'}]
|
|
||||||
})
|
|
||||||
const base64 = res.data.base64
|
const base64 = res.data.base64
|
||||||
setPayCodeImage(() => base64)
|
setPayCodeImage(() => base64)
|
||||||
const time = new Date().valueOf()
|
const time = new Date().valueOf()
|
||||||
@ -98,7 +121,6 @@ export default memo(({show = true, onClose}:Param) => {
|
|||||||
data: fileData.current.base64,
|
data: fileData.current.base64,
|
||||||
encoding: 'base64',
|
encoding: 'base64',
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(show)
|
if(show)
|
||||||
|
@ -5,8 +5,9 @@ import {
|
|||||||
} from "@/api/order";
|
} from "@/api/order";
|
||||||
import { GetOrderPayApi } from "@/api/orderPay";
|
import { GetOrderPayApi } from "@/api/orderPay";
|
||||||
import { AddShoppingCartApi } from "@/api/shopCart";
|
import { AddShoppingCartApi } from "@/api/shopCart";
|
||||||
|
import { SubscriptionMessageApi } from "@/api/user";
|
||||||
import { alert, goLink } from "@/common/common";
|
import { alert, goLink } from "@/common/common";
|
||||||
import { ORDER_STATUS } from "@/common/enum";
|
import { ORDER_STATUS, SUBSCRIPTION_MESSAGE_SCENE } from "@/common/enum";
|
||||||
import { formatDateTime, formatImgUrl, formatPriceDiv } from "@/common/fotmat";
|
import { formatDateTime, formatImgUrl, formatPriceDiv } from "@/common/fotmat";
|
||||||
import OrderBtns from "@/components/orderBtns";
|
import OrderBtns from "@/components/orderBtns";
|
||||||
import Popup from "@/components/popup";
|
import Popup from "@/components/popup";
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import { SubscriptionMessageApi } from "@/api/user"
|
||||||
|
import Taro from "@tarojs/taro"
|
||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import { useEffect, useRef, useState } from "react"
|
import { useEffect, useRef, useState } from "react"
|
||||||
|
|
||||||
@ -58,3 +60,32 @@ export const useTimeCountDown = () => {
|
|||||||
timeStatus
|
timeStatus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//订阅消息hook
|
||||||
|
export const UseSubscriptionMessage = () => {
|
||||||
|
const {fetchData: fetchDataMessage} = SubscriptionMessageApi()
|
||||||
|
const openSubscriptionMessage = ({orderId = 0, scenes = 0}:{orderId?: number, scenes: number}) => {
|
||||||
|
return new Promise(async (resolve) => {
|
||||||
|
let params:{sale_order_id?: number, scenes?: number} = {}
|
||||||
|
orderId&&(params.sale_order_id = orderId)
|
||||||
|
params.scenes = scenes
|
||||||
|
let res = await fetchDataMessage(params)
|
||||||
|
if(res.success&&res.data.TemplateID&&res.data.TemplateID.length > 0) {
|
||||||
|
Taro.requestSubscribeMessage({
|
||||||
|
tmplIds: res.data.TemplateID,
|
||||||
|
complete: function (res) {
|
||||||
|
resolve(res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
resolve(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
openSubscriptionMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user