|
@@ -14,13 +14,13 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view>
|
|
<view>
|
|
- <swiper class="swiper-box" :current="current">
|
|
|
|
|
|
+ <swiper class="swiper-box" :current="current" indicator-dots indicator-active-color="#f1b17a">
|
|
<swiper-item v-for="(item, index) in memberListLength" :key="index" class="swiper-items">
|
|
<swiper-item v-for="(item, index) in memberListLength" :key="index" class="swiper-items">
|
|
<view class="swiper-item" v-for="val in item" :key="val.id">
|
|
<view class="swiper-item" v-for="val in item" :key="val.id">
|
|
<view
|
|
<view
|
|
class="card"
|
|
class="card"
|
|
:class="{ recommend: val.recommend, vipFlag: val.my, active: val.id === chooseId}"
|
|
:class="{ recommend: val.recommend, vipFlag: val.my, active: val.id === chooseId}"
|
|
- @tap="handleChoose(val, index)"
|
|
|
|
|
|
+ @tap="handleChoose(val)"
|
|
>
|
|
>
|
|
<text>{{ val.name }}</text>
|
|
<text>{{ val.name }}</text>
|
|
<view>
|
|
<view>
|
|
@@ -178,7 +178,7 @@ const radioChange = (index) => {
|
|
}
|
|
}
|
|
|
|
|
|
const chooseItem = ref(null)
|
|
const chooseItem = ref(null)
|
|
-const handleChoose = (val, index) => {
|
|
|
|
|
|
+const handleChoose = (val) => {
|
|
chooseId.value = val.id
|
|
chooseId.value = val.id
|
|
chooseItem.value = val
|
|
chooseItem.value = val
|
|
}
|
|
}
|
|
@@ -370,13 +370,15 @@ const getMemberList = async () => {
|
|
})
|
|
})
|
|
// 低于当前套餐的(套餐)不展示
|
|
// 低于当前套餐的(套餐)不展示
|
|
memberList.value = vipFlagIndex ? list.slice(vipFlagIndex) : list
|
|
memberList.value = vipFlagIndex ? list.slice(vipFlagIndex) : list
|
|
- handleChoose(memberList.value[0], recommend.value)
|
|
|
|
if ((!userInfo.value?.vipFlag || userInfo.value?.vipExpireDate - new Date().getTime() > 0 ) && typeof recommend.value === 'number') {
|
|
if ((!userInfo.value?.vipFlag || userInfo.value?.vipExpireDate - new Date().getTime() > 0 ) && typeof recommend.value === 'number') {
|
|
// current.value = parseInt(recommend.value / 2)
|
|
// current.value = parseInt(recommend.value / 2)
|
|
current.value = vipFlagIndex === 0 ? 0 : parseInt((vipFlagIndex || recommend.value) / 2)
|
|
current.value = vipFlagIndex === 0 ? 0 : parseInt((vipFlagIndex || recommend.value) / 2)
|
|
- chooseId.value = memberList.value[recommend.value]?.id
|
|
|
|
- chooseItem.value = memberList.value[recommend.value]
|
|
|
|
|
|
+ // chooseId.value = memberList.value[recommend.value]?.id
|
|
|
|
+ // chooseItem.value = memberList.value[recommend.value]
|
|
}
|
|
}
|
|
|
|
+ // 设置选中项
|
|
|
|
+ const chooseIndex = vipFlagIndex !== null ? vipFlagIndex : recommend.value
|
|
|
|
+ handleChoose(memberList.value[chooseIndex])
|
|
} catch (error) {
|
|
} catch (error) {
|
|
uni.showToast({ title: '查询数据失败,请重试', icon: 'none' })
|
|
uni.showToast({ title: '查询数据失败,请重试', icon: 'none' })
|
|
}
|
|
}
|