✨ feat:修改确认订单选择后无法渲染的问题,顶input框的高度问题

This commit is contained in:
Haiyi
2022-09-29 15:22:39 +08:00
parent 6b59d688db
commit 232d372796
19 changed files with 101 additions and 104 deletions
@@ -7,7 +7,8 @@ interface prosObj {
sale_mode?: Number,
collect_status?: Number | string,
status?: Number,
payment_method?: Number
payment_method?: Number,
settle_mode?: Number | string,
}
handApplyGoods?: () => void,
handApplyMoney?: () => void,
@@ -21,18 +22,21 @@ export default memo((props: prosObj) => {
collect_status: '',
status: '',
payment_method: 0,
settle_mode: ''
},
handApplyGoods,
handApplyMoney,
handSureGoods
} = props
//判断显示申请收货
//判断显示申请退货
const showTuihuo = useMemo(() => {
if (
(obj.sale_mode === 0 && obj.status === 9 && obj.collect_status == 2) ||
(obj.sale_mode === 0 && obj.status === 9 && (obj.payment_method == 3 || obj.payment_method == 5 || obj.collect_status === 1)) ||
(obj.sale_mode === 2 && obj.status === 9)
(obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 0) ||
(obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 1) ||
(obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 2) ||
(obj.sale_mode === 0 && obj.status == 9 && obj.settle_mode == 3) ||
(obj.sale_mode === 2 && obj.status == 9)
) {
return true
} else return false
@@ -40,14 +44,16 @@ export default memo((props: prosObj) => {
//判断显示申请退款
const showTuikuan = useMemo(() => {
if (
(obj.sale_mode === 0 && obj.status === 11 && (obj.collect_status == 1 || obj.collect_status == 2)) ||
(obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 2) ||
(obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 1) ||
(obj.sale_mode === 0 && obj.status === 3 && obj.collect_status == 2) ||
(obj.sale_mode === 0 && obj.status === 3 && obj.collect_status == 1) ||
(obj.sale_mode === 1 && obj.status === 0) ||
(obj.sale_mode === 1 && obj.status === 9) ||
(obj.sale_mode === 2 && obj.status === 0)
(obj.sale_mode === 0 && obj.status == 2 && obj.collect_status == 1) ||
(obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 0) ||
(obj.sale_mode === 0 && obj.status == 11 && (obj.collect_status == 1 || obj.collect_status == 2)) ||
(obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 0) ||
(obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2) ||
(obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1) ||
(obj.sale_mode === 1 && obj.status == 0) ||
(obj.sale_mode === 1 && obj.status == 9) ||
(obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 1) ||
(obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 2)
) {
return true
} else return false
@@ -55,10 +61,12 @@ export default memo((props: prosObj) => {
//判断显示确认收货
const showTake = useMemo(() => {
if (
(obj.sale_mode === 0 && obj.status === 8 && obj.collect_status == 2) ||
(obj.sale_mode === 0 && obj.status === 8 && (obj.payment_method == 3 || obj.payment_method == 5 || obj.collect_status == 1)) ||
(obj.sale_mode === 1 && obj.status === 8) ||
(obj.sale_mode === 2 && obj.status === 8)
(obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 0) ||
(obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 1) ||
(obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 2) ||
(obj.sale_mode === 0 && obj.status == 8 && obj.settle_mode == 3) ||
(obj.sale_mode === 1 && obj.status == 8) ||
(obj.sale_mode === 2 && obj.status == 8)
) {
return true
} else return false
@@ -42,7 +42,6 @@
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /*这里设置几行*/
overflow: hidden;
}
.icon_more {
@@ -67,6 +66,7 @@
margin-top: 24px;
.name {
line-height: 34px;
width: 84px;
height: 34px;
@include common_ellipsis();
@@ -78,6 +78,7 @@
}
.phone {
height: 34px;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
@@ -3,56 +3,44 @@ import { memo, useEffect, useMemo, useRef, useState } from "react";
import classnames from "classnames";
import styles from './index.module.scss'
import IconFont from '@/components/iconfont/iconfont'
import { alert } from '@/common/common'
interface propsObj {
receivingStatus: Number | null,
onReceivingStatus?: (any, Number) => void,
obj: any,
obj?: any,
navSelect?: (any) => void
}
export default memo((props: propsObj) => {
const {
receivingStatus = 2,
receivingStatus = null,
onReceivingStatus,
obj = {},
navSelect
} = props
const addressInfo = useMemo(() => {
if (receivingStatus == 1) {
return obj.take_goods_address
} else {
return obj.province_name + obj.city_name + obj.district_name + obj.address_detail
}
}, [obj, receivingStatus])
// const addressPone = useMemo(() => {
// if (receivingStatus == 1) {
// return 13242128982
// } else {
// return obj.purchaser_phone
// }
// }, [obj,receivingStatus])
// const addressUser = useMemo(() => {
// if (receivingStatus == 1) {
// return '谭先生'
// } else {
// return obj.target_user_name
// }
// }, [obj,receivingStatus])
return (
<View className={styles.addressBox}>
<View className={styles.topBox} onClick={() => navSelect?.(obj)}>
<View className={styles.cirle}>
<IconFont name={'icon-dingwei'} size={26} color={'#ffffff'}></IconFont>
{/* <View className={classnames('iconfont', 'icon-dingwei', styles.dingwei)}></View> */}
</View>
<View className={styles.address}>{addressInfo}</View>
{
receivingStatus == 1 && <View className={styles.address}>{obj.take_goods_address}</View>
}
{
(obj?.province_name != '' && receivingStatus == 2) &&
<View className={styles.address}>{obj?.province_name}{obj?.city_name}{obj?.district_name}{obj?.address_detail}</View>
}
{
(obj?.province_name == '' && receivingStatus == 2) &&
<View className={styles.address}>{''}</View>
}
{
receivingStatus !== 1 &&
<IconFont name={'icon-chakanquanbukehu'} size={50} ></IconFont>
// <View className={classnames('iconfont', 'icon-chakanquanbukehu', styles.icon_more)}></View>
}
</View>
<View className={styles.line}></View>
+3 -3
View File
@@ -49,7 +49,7 @@ export default () => {
//切换自提或者物流
const { fetchData: selectFetch } = mpsaleOrdershipmentMode()
const onReceivingStatus = debounce(async (e, value) => {
if (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5) {
if (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5 || infoObj.status === 3 || infoObj.status === 11) {
alert.error('不允许更改')
return false
}
@@ -486,7 +486,7 @@ export default () => {
title: '请稍等...',
mask: true
})
let restult = await obj.status !== 10 ? payOneFetch({ id: Number(obj.should_collect_order_id), payment_method: Number(arr[0]?.id) }) : payTwoFetch({ id: Number(obj.pre_collect_order_id), payment_method: Number(arr[0]?.id) })
let restult = await (obj.status !== 10 ? payOneFetch({ id: Number(obj.should_collect_order_id), payment_method: Number(arr[0]?.id) }) : payTwoFetch({ id: Number(obj.pre_collect_order_id), payment_method: Number(arr[0]?.id) }))
if (restult?.msg === 'success') {
Taro.showToast({
title: '交易成功'
@@ -515,7 +515,7 @@ export default () => {
const [showOffline, setShowOffine] = useState(false)
//选择地址
const handSelect = (obj) => {
if (receivingStatus === 1 || (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5)) {
if (receivingStatus === 1 || (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5 || infoObj.status === 11 || infoObj.status === 3)) {
alert.error('不允许更改')
return false
}