bug(custom): eCX-7329

This commit is contained in:
zhangjing1
2025-09-25 11:43:53 +08:00
parent 880474e509
commit 2912488cbc
4 changed files with 29 additions and 16 deletions

10
.env
View File

@@ -1,16 +1,16 @@
APP_BASE_URL=https://demo-ecshopx.ishopex.cn/api/h5app/wxapp
APP_WEBSOCKET=wss://demo-ecshopx.ishopex.cn/ws
APP_COMPANY_ID=5
APP_PLATFORM=platform
APP_COMPANY_ID=38
APP_PLATFORM=standard
APP_CUSTOM_SERVER=https://ecshopx-h5.ex-sandbox.com/
APP_HOME_PAGE=/pages/index
APP_TRACK=youshu
APP_YOUSHU_TOKEN=bi281e87ab2424481a
APP_ID=wxf7abee400d50e0d0
APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe
APP_ID=wx1e25e45145b70faa
APP_MAP_KEY=PSPBZ-KQ5CW-CSGRF-ON2S4-K2HQJ-XEBQG
APP_MAP_NAME=oneX新零售门店定位
APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
APP_DIANWU_URL=
APP_DIANWU_URL=https://demo-ecshopx-dianwu.shopex123.com
APP_MERCHANT_URL=
APP_ADAPAY=

View File

@@ -1,3 +1,5 @@
export const VIP_GRADE_ITEM = {
grade_name: 'grade_name',
description: 'description',
@@ -8,7 +10,8 @@ export const VIP_GRADE_ITEM = {
},
discount_desc: ({ privileges }) => {
return privileges.discount_desc
}
},
grade_background: 'grade_background'
}
export const MEMBER_CARD_ITEM = {
@@ -21,5 +24,6 @@ export const MEMBER_CARD_ITEM = {
},
discount_desc: ({ privileges }) => {
return privileges.discount_desc
}
},
grade_background: 'grade_background'
}

View File

@@ -1,9 +1,9 @@
{
"extEnable": true,
"extAppid": "wxf7abee400d50e0d0",
"extAppid": "wx1e25e45145b70faa",
"ext": {
"company_id": "5",
"appid": "wxf7abee400d50e0d0",
"company_id": "38",
"appid": "wx1e25e45145b70faa",
"wxa_name": "通用小程序",
"ali_isvid":""
},

View File

@@ -34,10 +34,8 @@ function MemberLevel(props) {
list = pickBy(member_card_list, doc.member.MEMBER_CARD_ITEM)
}
const grade_index = list.findIndex((item) => item.grade_id == grade_id)
console.log(grade_index, 'grade_index')
console.log(list, 'list')
setState((draft) => {
;(draft.list = list?.map((item, index) => {
draft.list = list?.map((item, index) => {
if (item.grade_id == grade_id) {
item.type = 'active'
} else if (index < grade_index) {
@@ -46,8 +44,8 @@ function MemberLevel(props) {
item.type = 'next'
}
return item
})),
(draft.total_consumption = total_consumption)
})
draft.total_consumption = total_consumption
})
}
@@ -56,6 +54,17 @@ function MemberLevel(props) {
draft.activeIndex = e.detail.current
})
}
const renderBackgroundImage = (item) => {
if (!item.grade_background) {
return {}
}
return {
backgroundImage: `url(${item.grade_background})`,
backgroundSize: 'cover',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat'
}
}
return (
<SpPage className='page-member-level'>
@@ -69,7 +78,7 @@ function MemberLevel(props) {
>
{list.map((item, idx) => (
<SwiperItem key={`swiperitem__${idx}`}>
<View className='member-card'>
<View className='member-card' style={renderBackgroundImage(item)}>
<SpImage src={item.pic || 'fufei_bg.png'} width={600} height={375} />
<View className='grade-name'>{item.grade_name}</View>
{/* <View className='grade-discount'>{`已消费${total_consumption / 100}元`}</View> */}