|
@@ -1,14 +1,14 @@
|
|
<!-- -->
|
|
<!-- -->
|
|
<template>
|
|
<template>
|
|
<div class="d-flex mt-5 list">
|
|
<div class="d-flex mt-5 list">
|
|
- <div v-for="(val, i) in packDataList" :key="i" class="list-item cursor-pointer" :class="{'active': active === i }" @click="handleClickItem(val, i)">
|
|
|
|
|
|
+ <div v-for="(val, i) in packDataList" :key="i" class="list-item cursor-pointer elevation-2" :class="{'active': active === i }" @click="handleClickItem(val, i)">
|
|
<div v-if="val.id === userStore.userInfo?.vipFlag && userStore.userInfo?.vipExpireDate && userStore.userInfo?.vipExpireDate > Date.now()" class="recommend long">我的套餐</div>
|
|
<div v-if="val.id === userStore.userInfo?.vipFlag && userStore.userInfo?.vipExpireDate && userStore.userInfo?.vipExpireDate > Date.now()" class="recommend long">我的套餐</div>
|
|
<div v-if="val.recommend" class="recommend">推荐</div>
|
|
<div v-if="val.recommend" class="recommend">推荐</div>
|
|
<div class="text-center font-weight-bold">{{ val.name }}</div>
|
|
<div class="text-center font-weight-bold">{{ val.name }}</div>
|
|
<div class="text-center my-5">
|
|
<div class="text-center my-5">
|
|
<div v-if="val.price && !val.cycle">
|
|
<div v-if="val.price && !val.cycle">
|
|
¥
|
|
¥
|
|
- <span class="font-weight-bold font-size-20">{{ val.price }}</span>
|
|
|
|
|
|
+ <span class="font-weight-bold font-size-20">{{ val.price / 100 }}</span>
|
|
<!-- /年 -->
|
|
<!-- /年 -->
|
|
</div>
|
|
</div>
|
|
<div v-if="val.cycle">¥<span class="font-weight-bold font-size-18 font-size-20">{{ val.price }}</span><span class="font-size-14 mr-3">起</span> {{ val.cycle }}</div>
|
|
<div v-if="val.cycle">¥<span class="font-weight-bold font-size-18 font-size-20">{{ val.price }}</span><span class="font-size-14 mr-3">起</span> {{ val.cycle }}</div>
|
|
@@ -47,7 +47,8 @@
|
|
<v-btn
|
|
<v-btn
|
|
color="error"
|
|
color="error"
|
|
variant="outlined"
|
|
variant="outlined"
|
|
- rounded
|
|
|
|
|
|
+ rounded
|
|
|
|
+ :disabled="Number(val.id) < Number(userStore.userInfo?.vipFlag)"
|
|
:loading="val.loading"
|
|
:loading="val.loading"
|
|
@click="createOrder(val)"
|
|
@click="createOrder(val)"
|
|
>开通会员</v-btn>
|
|
>开通会员</v-btn>
|
|
@@ -106,10 +107,10 @@ const packDataList = ref([])
|
|
const getData = async () => {
|
|
const getData = async () => {
|
|
const data = await getMembershipPackageList()
|
|
const data = await getMembershipPackageList()
|
|
if (!data?.length) return
|
|
if (!data?.length) return
|
|
- let vipFlagIndex = null
|
|
|
|
|
|
+ // let vipFlagIndex = null
|
|
const list = data.map((item, index) => {
|
|
const list = data.map((item, index) => {
|
|
item.id = item.id?.toString()
|
|
item.id = item.id?.toString()
|
|
- if (item.id === userStore.userInfo?.vipFlag) vipFlagIndex = index // 低于当前套餐的(套餐)不展示
|
|
|
|
|
|
+ // if (item.id === userStore.userInfo?.vipFlag) vipFlagIndex = index // 低于当前套餐的(套餐)不展示
|
|
if (item.recommend) active.value = index // 推荐套餐
|
|
if (item.recommend) active.value = index // 推荐套餐
|
|
return {
|
|
return {
|
|
...item,
|
|
...item,
|
|
@@ -119,7 +120,8 @@ const getData = async () => {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
// 低于当前套餐的(套餐)不展示
|
|
// 低于当前套餐的(套餐)不展示
|
|
- packDataList.value = vipFlagIndex ? list.slice(vipFlagIndex) : list
|
|
|
|
|
|
+ // packDataList.value = vipFlagIndex ? list.slice(vipFlagIndex) : list
|
|
|
|
+ packDataList.value = list
|
|
}
|
|
}
|
|
getData()
|
|
getData()
|
|
|
|
|