🎈 perf(优化我的页面样式):

This commit is contained in:
czm 2022-12-13 18:32:08 +08:00
parent b8a7d5634f
commit 25c0ca3ad3
5 changed files with 68 additions and 44 deletions

View File

@ -182,10 +182,13 @@ const Payment = ({ show = false, onClose, orderInfo, onSubmitSuccess }: Param) =
// 直接微信支付事件
const { fetchData: SubmitTradeOrderPayData } = SubmitTradeOrderPayApi()
const bankCallBack = useCallback(async() => {
const bankCallBack = async() => {
onClose?.()
const res = await SubmitTradeOrderPayData({ pay_no: payInfo?.pay_no })
if (res.success) { onSubmitSuccess?.() }
}, [payInfo])
if (res.data.trade_collect_status == 3) {
onSubmitSuccess?.()
}
}
const { pullBank, payStatus } = usePayBank({ merchId: payInfo?.merch_id, custMerchId: payInfo?.pay_no, callBack: bankCallBack })
return (

View File

@ -18,9 +18,6 @@ import { alert } from '@/common/common'
const OrderList = () => {
const { checkLogin } = useLogin()
useDidShow(async() => {
await checkLogin()
})
// 传递过来的参数
const router = useRouter()
@ -52,6 +49,11 @@ const OrderList = () => {
setRefresherTriggeredStatus(() => false)
}
useDidShow(() => {
checkLogin()
searchField.status && getOrderList()
})
// 监听筛选条件变化
useEffect(() => {
if (searchField.status != null) { getOrderList() }
@ -200,9 +202,9 @@ const OrderList = () => {
},
[orderData],
)
useDidHide(() => {
setSearchField(e => ({ ...e, status: -1 }))
})
// useDidHide(() => {
// setSearchField(e => ({ ...e, status: -1 }))
// })
return (
<View className={styles.order_list_main}>
<View className={styles.title}>

View File

@ -12,13 +12,18 @@
z-index: 1000;
}
.user_main__header {
min-height: 315px;
width: 100%;
background-color: #eff3ff;
position: relative;
overflow: hidden;
.user_main__header_con {
min-height: 315px;
position: relative;
overflow: hidden;
}
.header_bg {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
@ -26,7 +31,7 @@
.header_img_name {
display: flex;
position: relative;
padding: 25px 36px 0 36px;
padding: 0 36px 0 36px;
z-index: 999;
align-items: center;
flex: 1;
@ -54,7 +59,7 @@
.header_title {
font-size: 28px;
color: rgba(0, 0, 0, 0.6);
margin-top: 10px;
margin-top: 8px;
}
}
text {
@ -71,9 +76,8 @@
.header_picture {
display: flex;
align-items: center;
padding: 5px 10px;
padding-right: 10px;
height: 38px;
padding-right: 20px;
height: 37px;
background: #3e6cff;
border-radius: 16px;
font-size: 24px;
@ -81,8 +85,18 @@
color: #fff;
margin-top: 8px;
align-self: baseline;
.icon_renzhengchenggong {
width: 37px;
height: 37px;
background-color: #2248c4ff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.header_picture_name {
margin-left: 8px;
font-size: 23px;
}
}
}
@ -104,6 +118,7 @@
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
text {
&:nth-child(1) {
font-size: 42px;
@ -123,7 +138,6 @@
width: 100%;
padding: 0 24px;
box-sizing: border-box;
margin-top: 24px;
.price_bg {
position: absolute;
top: 0;

View File

@ -93,6 +93,7 @@ export default () => {
<View className={styles.user_main}>
{!userInfo?.adminUserInfo?.phone && <Button className={styles.getPhoneButton} openType="getPhoneNumber" onGetPhoneNumber={mGetPhoneNumber}></Button>}
<View className={styles.user_main__header}>
<View className={styles.user_main__header_con}>
<View className={styles.header_img_name}>
<View className={styles.header_img}>
<Image className={styles.header_img_src} mode="aspectFill" src={`${userInfo?.adminUserInfo?.avatar_url}`} />
@ -102,7 +103,9 @@ export default () => {
<View className={styles['arcd-info-left-phone']}>
<View className={styles.header_title}> {userInfo?.adminUserInfo?.phone || 'Hi,欢迎来到陆盈商城'}</View>
</View>
{!!userInfo?.adminUserInfo?.company_name && <View className={styles.header_picture} ><IconFont name="icon-renzhengchenggong" size={30} /><View className={styles.header_picture_name}>{userInfo?.adminUserInfo?.company_name}</View></View>}
{!!userInfo?.adminUserInfo?.company_name && <View className={styles.header_picture} >
<View className={styles.icon_renzhengchenggong}><IconFont name="icon-renzhengchenggong" size={24} /></View>
<View className={styles.header_picture_name}>{userInfo?.adminUserInfo?.company_name}</View></View>}
</View>
<View className={styles.header_setting} onClick={() => goLink('/pages/userEdit/index')}>
<IconFont name="icon-shezhi" size={50} />
@ -122,6 +125,8 @@ export default () => {
<Text></Text>
</View>
</View>
<Image className={styles.header_bg} src={formatImgUrl('/mall/user_header_bg.png', '')} mode="aspectFit"></Image>
</View>
{userInfo?.adminUserInfo?.order_access_status == 3 && <View className={styles.price_count}>
<View className={styles.price_count_list}>
{priceList?.map((item, index) => {
@ -133,7 +138,7 @@ export default () => {
<Image className={styles.price_bg} src={formatImgUrl('/mall/price_bg.png', '')} mode="aspectFit"></Image>
</View>
</View>}
<Image className={styles.header_bg} src={formatImgUrl('/mall/user_header_bg.png', '')} mode="aspectFit"></Image>
</View>
<View className={styles.order_count}>
<View className={styles.order_count__title}>

View File

@ -16,7 +16,7 @@ export default (props: Param) => {
console.log('openstatus::', openStatus)
useEffect(() => {
Taro.onAppShow((res) => {
if (res?.referrerInfo?.appId == BANk_WX_APPID && !openStatus.current) {
if (res?.referrerInfo?.appId == BANk_WX_APPID && !openStatus.current && props.custMerchId) {
console.log('onAppShow::', res)
callBack?.(res)
const tf = res?.referrerInfo?.extraData?.payStatus == 'success'
@ -24,7 +24,7 @@ export default (props: Param) => {
openStatus.current = true
}
})
}, [])
}, [props])
const pullBank = () => {
console.log('merchId::', `${merchId}&&${custMerchId}`)