|
@@ -6,50 +6,39 @@ import NavbarEvo from '@/components/navbar-evo.vue'
|
|
|
import { levels } from '../../../core/libs/levels'
|
|
|
import { useRouter } from '../../../core/utils/router'
|
|
|
import { notify } from '@designer-hub/assets/src/assets/svgs'
|
|
|
+import LevelCard from './components/level-card.vue'
|
|
|
+import { getAppMemberLevelConfigs } from '../../../core/libs/requests'
|
|
|
+import { useUserStore } from '../../../store'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
+
|
|
|
const router = useRouter()
|
|
|
+const userStore = useUserStore()
|
|
|
+const { userInfo } = storeToRefs(userStore)
|
|
|
const current = ref(0)
|
|
|
const swiperList = ref(levels.map(({ bgImg }) => bgImg))
|
|
|
-const items = ref([
|
|
|
- {
|
|
|
- icon: 'https://image.zhuchaohui.com/zhucaohui/95aa37b07a32a571fda86e8f8b89a2e54d1dd36d1250190ed8cfc68d638c3d43.png',
|
|
|
- title: '会员专属活动',
|
|
|
- subTitle: '参与平台内的会员活动',
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'https://image.zhuchaohui.com/zhucaohui/95aa37b07a32a571fda86e8f8b89a2e54d1dd36d1250190ed8cfc68d638c3d43.png',
|
|
|
- title: '国内外游学项目',
|
|
|
- subTitle: '参与平台国内外设计游学项目',
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'https://image.zhuchaohui.com/zhucaohui/95aa37b07a32a571fda86e8f8b89a2e54d1dd36d1250190ed8cfc68d638c3d43.png',
|
|
|
- title: '专属经纪人',
|
|
|
- subTitle: '认证成功即可拥有专属经纪人',
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'https://image.zhuchaohui.com/zhucaohui/95aa37b07a32a571fda86e8f8b89a2e54d1dd36d1250190ed8cfc68d638c3d43.png',
|
|
|
- title: '销售积分券',
|
|
|
- subTitle: '得1张200积分的销售积分券,使用时不限制...',
|
|
|
- },
|
|
|
-])
|
|
|
+const { data: levelConfigs, run: setLevelConfigs } = useRequest(() => getAppMemberLevelConfigs(), {
|
|
|
+ initialData: [],
|
|
|
+})
|
|
|
+const handleSwiperChange = ({ detail }) => {
|
|
|
+ current.value = detail.current
|
|
|
+}
|
|
|
+onMounted(async () => {
|
|
|
+ await setLevelConfigs()
|
|
|
+ current.value = levelConfigs.value?.findIndex(
|
|
|
+ (it) => it.memberLevel === userInfo.value?.level?.level,
|
|
|
+ )
|
|
|
+})
|
|
|
</script>
|
|
|
<template>
|
|
|
- <div class="flex-grow flex flex-col gap-4 bg-gradient-to-b from-[#312c38] to-[#171322] px-3.5">
|
|
|
- <!-- <wd-navbar
|
|
|
- left-arrow
|
|
|
- safe-area-inset-top
|
|
|
- custom-class="mx--3.5 bg-transparent!"
|
|
|
- title="会员等级"
|
|
|
- :bordered="false"
|
|
|
- @left-click="router.back()"
|
|
|
- ></wd-navbar> -->
|
|
|
- <NavbarEvo fixed transparent title="会员等级" dark></NavbarEvo>
|
|
|
+ <div class="flex-grow flex flex-col gap-4 bg-gradient-to-b from-[#312c38] to-[#171322] p-3.5">
|
|
|
+ <NavbarEvo transparent title="会员等级" dark placeholder></NavbarEvo>
|
|
|
<div class="flex gap-2 bg-gradient-to-r from-[#292331] to-[#35303b] rounded-md px-5 py-1">
|
|
|
<wd-img width="22" height="22" :src="notify"></wd-img>
|
|
|
<div class="text-[#f1d2c5] text-sm font-normal font-['PingFang_SC'] leading-normal">
|
|
|
会员成长等级保级规则通知
|
|
|
</div>
|
|
|
</div>
|
|
|
- <view class="card-swiper mx--3.5">
|
|
|
+ <!-- <view class="card-swiper mx--3.5">
|
|
|
<wd-swiper
|
|
|
:autoplay="false"
|
|
|
v-model:current="current"
|
|
@@ -57,23 +46,51 @@ const items = ref([
|
|
|
custom-image-class="custom-image"
|
|
|
custom-next-image-class="custom-image-prev"
|
|
|
custom-prev-image-class="custom-image-prev"
|
|
|
- :indicator="{ type: 'dots' }"
|
|
|
:list="swiperList"
|
|
|
previousMargin="24px"
|
|
|
nextMargin="24px"
|
|
|
></wd-swiper>
|
|
|
- </view>
|
|
|
- <template v-for="({ icon, title, subTitle }, index) in items" :key="index">
|
|
|
+ </view> -->
|
|
|
+ <div class="mx--3.5">
|
|
|
+ <div class="my-swiper w-full aspect-[2.22/1] relative">
|
|
|
+ <swiper
|
|
|
+ :current="current"
|
|
|
+ @change="handleSwiperChange"
|
|
|
+ circular
|
|
|
+ previous-margin="24"
|
|
|
+ next-margin="24"
|
|
|
+ >
|
|
|
+ <template v-for="(it, i) in levelConfigs" :key="i">
|
|
|
+ <swiper-item class="">
|
|
|
+ <div
|
|
|
+ class="px-1.25 h-full box-border"
|
|
|
+ :style="{ padding: current !== i ? '10rpx' : '0 10rpx' }"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="w-full h-full bg-[length:100%_100%]"
|
|
|
+ :style="{ backgroundImage: `url(${it.memberBgImage})` }"
|
|
|
+ >
|
|
|
+ <LevelCard
|
|
|
+ :is-current="userInfo.level?.level === levelConfigs[i].memberLevel"
|
|
|
+ ></LevelCard>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </swiper-item>
|
|
|
+ </template>
|
|
|
+ </swiper>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template v-for="(it, index) in levelConfigs[current].setMemberRights" :key="index">
|
|
|
<div
|
|
|
class="bg-[#201d28] rounded-2xl shadow border border-[#504951] border-solid flex gap-4 px-2.5 py-5.5"
|
|
|
>
|
|
|
- <wd-img width="50" height="50" :src="icon"></wd-img>
|
|
|
+ <wd-img width="50" height="50" :src="it.rightsImage"></wd-img>
|
|
|
<div class="flex flex-col justify-between flex-1">
|
|
|
<div class="text-[#f1d2c5] text-base font-normal font-['PingFang_SC']">
|
|
|
- {{ title }}
|
|
|
+ {{ it.rightsName }}
|
|
|
</div>
|
|
|
<div class="text-white/40 text-xs font-normal font-['PingFang_SC']">
|
|
|
- {{ subTitle }}
|
|
|
+ {{ it.rightsDescription }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div></div>
|
|
@@ -98,4 +115,9 @@ const items = ref([
|
|
|
height: 168px !important;
|
|
|
}
|
|
|
}
|
|
|
+.my-swiper {
|
|
|
+ :deep(.uni-swiper-slides) {
|
|
|
+ inset: 0 48rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|