mirror of
https://gitee.com/ShopeX/ECShopX_mobile-frontend
synced 2026-08-12 14:25:38 +08:00
bug(custom): eCX-7329
This commit is contained in:
@@ -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'
|
||||
}
|
||||
|
||||
@@ -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":""
|
||||
},
|
||||
|
||||
@@ -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> */}
|
||||
|
||||
Reference in New Issue
Block a user