feat:销售码单跳转支付

This commit is contained in:
Haiyi 2022-10-19 17:37:24 +08:00
parent 4b75ef1493
commit 42c5bb0952
7 changed files with 76 additions and 61 deletions

View File

@ -37,3 +37,5 @@ export const WX_APPID = 'wx64fe67f111d52457'
export const SCENE = { export const SCENE = {
SearchScene: 0, //商城面料搜索 SearchScene: 0, //商城面料搜索
} }
//支付码单跳转链接
export const PAY_H5_CODE_URL = CURRENT_ENV.includes('production') ? 'https://www.zzfzyc.com/cashier' : 'https://test.zzfzyc.com/cashier'

View File

@ -6,7 +6,7 @@ import classnames from "classnames";
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
import { GetAddressListApi } from "@/api/addressList"; import { GetAddressListApi } from "@/api/addressList";
import { alert } from "@/common/common"; import { alert } from "@/common/common";
import IconFont from "../iconfont/iconfont";
type DefaultValueParm = { name: string, id: string | number, level?: number | string } type DefaultValueParm = { name: string, id: string | number, level?: number | string }
@ -204,7 +204,9 @@ export default memo(({
return ( return (
<View onClick={() => selectItem(item)} className={classnames(styles.address_list_item, { [styles.addresst_select]: (selectId == item.id) })}> <View onClick={() => selectItem(item)} className={classnames(styles.address_list_item, { [styles.addresst_select]: (selectId == item.id) })}>
<View className={styles.address_list_item_name}>{item.name}</View> <View className={styles.address_list_item_name}>{item.name}</View>
{(selectArr[selectIndex]?.id == item.id)&&<View className={`iconfont icon-lujing ${styles.address_iconfont}` }></View>} {(selectArr[selectIndex]?.id == item.id) &&
<IconFont name={'icon-lujing'} color={'#327fff'} size={30}></IconFont>
}
</View> </View>
) )
})} })}

View File

@ -1,13 +1,20 @@
.loadingCard_main { .loadingCard_main {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 100%; height: 100%;
.loading_text { .loading_text {
font-size: 26px; font-size: 26px;
margin-top: 20px; margin-top: 20px;
color: $color_font_two; color: $color_font_two;
} }
.pic {
margin-bottom: 20px;
width: 410px;
height: 268px;
}
} }

View File

@ -1,4 +1,4 @@
import { View } from "@tarojs/components" import { View, Image } from "@tarojs/components"
import Loading from "@/components/loading" import Loading from "@/components/loading"
import style from "./index.module.scss" import style from "./index.module.scss"
import { memo } from "react"; import { memo } from "react";
@ -16,6 +16,9 @@ export default memo(({
<> <>
<View className={style.loadingCard_main}> <View className={style.loadingCard_main}>
{loadingIcon && <Loading />} {loadingIcon && <Loading />}
{
!loadingIcon && <Image className={style.pic} mode='aspectFill' lazyLoad src={'https://cdn.zzfzyc.com/empty.png'}></Image>
}
<View className={style.loading_text}>{title}</View> <View className={style.loading_text}>{title}</View>
</View> </View>
</> </>

View File

@ -32,7 +32,7 @@ interface filterObj {
sale_mode?: Number | undefined, sale_mode?: Number | undefined,
shipment_mode?: Number | undefined shipment_mode?: Number | undefined
} }
import { PAY_H5_CODE_URL } from '@/common/constant'
export default () => { export default () => {
//页码和页数 //页码和页数
@ -518,7 +518,7 @@ export default () => {
itemObj.total_weight_error_discount / 100 itemObj.total_weight_error_discount / 100
).toString(), ).toString(),
order_total_num: itemObj.total_number.toString(), order_total_num: itemObj.total_number.toString(),
qrcode: "", qrcode: `${PAY_H5_CODE_URL}?sale_order_no=${itemObj.order_no}`,
order_total_weight: (itemObj.total_weight / 1000).toString(), order_total_weight: (itemObj.total_weight / 1000).toString(),
estimate_amount: (itemObj.estimate_amount / 100).toString(), estimate_amount: (itemObj.estimate_amount / 100).toString(),
total_sale_price: (itemObj.total_sale_price / 100).toString(), total_sale_price: (itemObj.total_sale_price / 100).toString(),

View File

@ -30,6 +30,7 @@ import { alert, goLink } from '@/common/common'
import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format' import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format'
import PayPopup from '../order/components/PayPopup' import PayPopup from '../order/components/PayPopup'
import IconFont from '@/components/iconfont/iconfont' import IconFont from '@/components/iconfont/iconfont'
import { PAY_H5_CODE_URL } from '@/common/constant'
export default () => { export default () => {
const router = useRouter() const router = useRouter()
// useEffect(() => { // useEffect(() => {
@ -437,7 +438,7 @@ export default () => {
infoObj.total_weight_error_discount / 100 infoObj.total_weight_error_discount / 100
).toString(), ).toString(),
order_total_num: infoObj.total_number.toString(), order_total_num: infoObj.total_number.toString(),
qrcode: "", qrcode: `${PAY_H5_CODE_URL}?sale_order_no=${infoObj.order_no}`,
order_total_weight: (infoObj.total_weight / 1000).toString(), order_total_weight: (infoObj.total_weight / 1000).toString(),
estimate_amount: (infoObj.estimate_amount / 100).toString(), estimate_amount: (infoObj.estimate_amount / 100).toString(),
total_sale_price: (infoObj.total_sale_price / 100).toString(), total_sale_price: (infoObj.total_sale_price / 100).toString(),

View File

@ -218,7 +218,7 @@ export default memo(() => {
}) })
const res = await historyFetch() const res = await historyFetch()
if (res.data) { if (res.data) {
setHistroyList([...res.data.list]) setHistroyList([...res?.data?.list])
Taro.hideLoading() Taro.hideLoading()
} }
} }
@ -256,7 +256,7 @@ export default memo(() => {
productFetch({ code_or_name: e }).then((res) => { productFetch({ code_or_name: e }).then((res) => {
if (res.data) { if (res.data) {
Taro.hideLoading() Taro.hideLoading()
setSearchList([...res.data.list]) setSearchList([...res?.data?.list])
} }
}) })
}, 300) }, 300)