2025-04-02 11:34:12 +08:00
|
|
|
<template>
|
|
|
|
<view class="member-card-box">
|
2025-04-03 16:46:51 +08:00
|
|
|
<navigation-bar-vue title="会员中心" style="width: 100%;" background-color="#262626"
|
|
|
|
title-color="#FFFFFF"></navigation-bar-vue>
|
2025-04-02 11:34:12 +08:00
|
|
|
<view class="main-body">
|
|
|
|
<!-- 会员卡展示区 -->
|
|
|
|
<view class="vip-box">
|
|
|
|
<view class="dl-menu-box">
|
|
|
|
<view v-for="(item,index) in memberCardList" @click="itemClick(index)" class="dl-menu"
|
2025-04-02 15:17:19 +08:00
|
|
|
:class="index==chooseCardIndex?'dl-menu click':'dl-menu'">
|
2025-04-02 11:34:12 +08:00
|
|
|
<!-- 这里的图标要换成动态配置的 -->
|
|
|
|
<image src="@/static/mine/huang.png" mode="aspectFit"></image>
|
|
|
|
{{item.cardName}}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 会员卡详情 -->
|
|
|
|
<view class="card-detail-box">
|
|
|
|
<view class="price-box">
|
2025-04-02 15:17:19 +08:00
|
|
|
<view
|
|
|
|
:class="['price-item',choosePriceIndex==index?'choose':'',1==index?'margin-left-right':'']"
|
|
|
|
v-for="(item,index) in memberCardList[chooseCardIndex].priceList"
|
|
|
|
@click="changePriceIndex(index)">
|
|
|
|
<image v-if="item.isHot" class="hot-img" src="@/static/mine/hot.png" mode="aspectFit">
|
|
|
|
</image>
|
|
|
|
<view class="text1">{{item.title}}</view>
|
|
|
|
<view class="text2"><text>¥</text>{{item.price}}</view>
|
|
|
|
<view class="text3">折合{{item.dayPrice}}元/天</view>
|
2025-04-02 11:34:12 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
2025-04-02 15:17:19 +08:00
|
|
|
<!-- 购买 -->
|
2025-04-08 14:52:43 +08:00
|
|
|
<view class="buy-button" @click="toOrder()">立即开通</view>
|
2025-04-02 15:17:19 +08:00
|
|
|
<!-- 协议 -->
|
|
|
|
<view class="xieyi-box">
|
|
|
|
开通即代表您已阅读并同意<text
|
|
|
|
@click="handleUserAgrement(globalConfig.appInfo.agreements[2])">《{{globalConfig.appInfo.agreements[2].title}}》</text>
|
|
|
|
</view>
|
2025-04-02 11:34:12 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 权益展示区 -->
|
|
|
|
<view class="rights-box">
|
|
|
|
<view class="rights-item title">
|
|
|
|
<view class="title-left">会员权益</view>
|
2025-04-07 16:57:04 +08:00
|
|
|
<view class="value-item" v-for="(item,index) in cardList">{{item.cardName}}</view>
|
2025-04-02 11:34:12 +08:00
|
|
|
</view>
|
|
|
|
<view class="rights-item item-bg" v-for="(item,index) in rightsList">
|
|
|
|
<view class="title-left">{{item.name}}</view>
|
|
|
|
<view :class="[i==cardList.length-1?'value-item yellow-bg':'value-item']"
|
|
|
|
v-for="(card,i) in cardList">
|
|
|
|
<view v-if="'02'==item.rightsType">
|
|
|
|
<!-- 数量限制 -->
|
|
|
|
<text v-if="0==item.cardRights[card.id]">无限</text>
|
|
|
|
<text v-else>{{item.cardRights[card.id]}}条</text>
|
|
|
|
</view>
|
|
|
|
<view v-else-if="'01'==item.rightsType">
|
|
|
|
<!-- 是否支持 -->
|
|
|
|
<text v-if="0==item.cardRights[card.id]">-</text>
|
|
|
|
<view v-else>
|
|
|
|
<uni-icons v-if="i==cardList.length-1" color="#3A3A38" type="checkmarkempty"
|
|
|
|
size="18"></uni-icons>
|
|
|
|
<uni-icons v-else color="#E8CEAD" type="checkmarkempty" size="18"></uni-icons>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
2025-04-08 14:52:43 +08:00
|
|
|
import {baseCardList, rightList} from '@/api/business/base.js'
|
|
|
|
import {saveOrder} from '@/api/business/member.js'
|
2025-04-02 11:34:12 +08:00
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
navigationBarVue
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2025-04-02 15:17:19 +08:00
|
|
|
globalConfig: getApp().globalData.config,
|
|
|
|
ifAgree: 0,
|
|
|
|
//当前选中的会员卡下标
|
2025-04-02 11:34:12 +08:00
|
|
|
chooseCardIndex: 0,
|
2025-04-02 15:17:19 +08:00
|
|
|
//当前选中的会员卡付款下标
|
|
|
|
choosePriceIndex: 0,
|
2025-04-07 16:57:04 +08:00
|
|
|
//用户类型
|
|
|
|
userType:'02',
|
2025-04-02 11:34:12 +08:00
|
|
|
// 会员卡数组
|
|
|
|
memberCardList: [{
|
|
|
|
id: "1",
|
|
|
|
cardName: "箐英会员",
|
|
|
|
image: "",
|
2025-04-02 15:17:19 +08:00
|
|
|
priceList: [{
|
|
|
|
title: "年付会员",
|
|
|
|
price: 228,
|
|
|
|
dayPrice: 0.82,
|
|
|
|
isHot: true
|
|
|
|
}, {
|
|
|
|
title: "季付会员",
|
|
|
|
price: 78,
|
|
|
|
dayPrice: 0.82,
|
|
|
|
isHot: false
|
|
|
|
}, {
|
|
|
|
title: "月付会员",
|
|
|
|
price: 28,
|
|
|
|
dayPrice: 0.82,
|
|
|
|
isHot: false
|
|
|
|
}]
|
2025-04-02 11:34:12 +08:00
|
|
|
}, {
|
|
|
|
id: "2",
|
|
|
|
cardName: "钻石会员",
|
|
|
|
image: "",
|
2025-04-02 15:17:19 +08:00
|
|
|
priceList: [{
|
|
|
|
title: "年付会员",
|
|
|
|
price: 1228,
|
|
|
|
dayPrice: 0.82,
|
|
|
|
isHot: true
|
|
|
|
}, {
|
|
|
|
title: "季付会员",
|
|
|
|
price: 178,
|
|
|
|
dayPrice: 0.82,
|
|
|
|
isHot: false
|
|
|
|
}, {
|
|
|
|
title: "月付会员",
|
|
|
|
price: 128,
|
|
|
|
dayPrice: 0.82,
|
|
|
|
isHot: false
|
|
|
|
}]
|
2025-04-02 11:34:12 +08:00
|
|
|
}],
|
|
|
|
//权益对比的数组
|
|
|
|
cardList: [{
|
|
|
|
id: '1',
|
2025-04-07 16:57:04 +08:00
|
|
|
cardName: '非会员'
|
2025-04-02 11:34:12 +08:00
|
|
|
}, {
|
|
|
|
id: '2',
|
2025-04-07 16:57:04 +08:00
|
|
|
cardName: '箐英'
|
2025-04-02 11:34:12 +08:00
|
|
|
}, {
|
|
|
|
id: '3',
|
2025-04-07 16:57:04 +08:00
|
|
|
cardName: '钻石'
|
2025-04-02 11:34:12 +08:00
|
|
|
}],
|
|
|
|
rightsList: [{
|
|
|
|
name: "每日解锁通告上限",
|
|
|
|
// 权益类型 01-是否支持 | 02-数量限制
|
|
|
|
rightsType: '02',
|
|
|
|
cardRights: {
|
|
|
|
"1": 20,
|
|
|
|
"2": 0,
|
|
|
|
"3": 0
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
name: "高奖励&最新通告",
|
|
|
|
// 权益类型 01-是否支持 | 02-数量限制
|
|
|
|
rightsType: '01',
|
|
|
|
cardRights: {
|
|
|
|
"1": 0,
|
|
|
|
"2": 1,
|
|
|
|
"3": 1
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
2025-04-08 14:52:43 +08:00
|
|
|
|
|
|
|
onLoad(options){
|
|
|
|
this.initData(options.userType);
|
2025-04-07 16:57:04 +08:00
|
|
|
},
|
2025-04-02 11:34:12 +08:00
|
|
|
methods: {
|
2025-04-07 16:57:04 +08:00
|
|
|
/**初始化*/
|
2025-04-08 14:52:43 +08:00
|
|
|
initData(userType){
|
|
|
|
this.userType = userType
|
|
|
|
this.getCardList(userType);
|
|
|
|
this.getRightsList(userType);
|
2025-04-07 16:57:04 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
/**获取会员卡列表*/
|
2025-04-08 14:52:43 +08:00
|
|
|
getCardList(userType){
|
|
|
|
baseCardList({userType:userType}).then(res => {
|
2025-04-07 16:57:04 +08:00
|
|
|
this.memberCardList = res.data
|
|
|
|
}).catch((e) => {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'error',
|
|
|
|
duration: 2000,
|
|
|
|
title: e
|
|
|
|
});
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**权益列表*/
|
2025-04-08 14:52:43 +08:00
|
|
|
getRightsList(userType){
|
|
|
|
rightList({userType:userType}).then(res => {
|
2025-04-07 16:57:04 +08:00
|
|
|
this.cardList = res.data.cardList
|
|
|
|
this.rightsList = res.data.rightsList
|
|
|
|
console.log(this.cardList,'cardList')
|
|
|
|
console.log(this.rightsList,'rightsList')
|
|
|
|
}).catch((e) => {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'error',
|
|
|
|
duration: 2000,
|
|
|
|
title: e
|
|
|
|
});
|
|
|
|
})
|
|
|
|
},
|
2025-04-02 11:34:12 +08:00
|
|
|
/**
|
|
|
|
* 菜单点击
|
|
|
|
* @param {Object} index
|
|
|
|
*/
|
|
|
|
itemClick(index) {
|
|
|
|
this.chooseCardIndex = index
|
2025-04-02 15:17:19 +08:00
|
|
|
this.choosePriceIndex = 0
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 切换选中的会员卡付款类型
|
|
|
|
* @param {Object} index
|
|
|
|
*/
|
|
|
|
changePriceIndex(index) {
|
|
|
|
this.choosePriceIndex = index
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 阅读会员协议
|
|
|
|
*/
|
|
|
|
// 查看相关协议
|
|
|
|
handleUserAgrement(site) {
|
|
|
|
this.$tab.navigateTo(`/pages/common/richview/index?title=${site.title}&code=${site.code}`)
|
2025-04-02 11:34:12 +08:00
|
|
|
},
|
2025-04-08 14:52:43 +08:00
|
|
|
/**生成订单*/
|
|
|
|
toOrder(){
|
|
|
|
let data = {
|
|
|
|
userType:this.userType,
|
|
|
|
orderType:'01',
|
|
|
|
goodsId:this.memberCardList[this.chooseCardIndex].id,
|
|
|
|
goodsNum:1,
|
|
|
|
goodsPrice:this.memberCardList[this.chooseCardIndex].priceList[this.choosePriceIndex].price,
|
|
|
|
}
|
|
|
|
if (this.memberCardList[this.chooseCardIndex].priceList[this.choosePriceIndex].title === '年付会员') {
|
|
|
|
data.goodsCycle = '03'
|
|
|
|
}
|
|
|
|
if (this.memberCardList[this.chooseCardIndex].priceList[this.choosePriceIndex].title === '季付会员') {
|
|
|
|
data.goodsCycle = '02'
|
|
|
|
}
|
|
|
|
if (this.memberCardList[this.chooseCardIndex].priceList[this.choosePriceIndex].title === '月付会员') {
|
|
|
|
data.goodsCycle = '01'
|
|
|
|
}
|
|
|
|
saveOrder(data).then(res => {
|
|
|
|
if (res.code == 200) {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'success',
|
|
|
|
duration: 2000,
|
|
|
|
title: '保存成功'
|
|
|
|
});
|
|
|
|
uni.navigateBack()
|
|
|
|
}
|
|
|
|
}).catch((e) => {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'error',
|
|
|
|
duration: 2000,
|
|
|
|
title: e
|
|
|
|
});
|
|
|
|
})
|
|
|
|
},
|
2025-04-02 11:34:12 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.member-card-box {
|
|
|
|
width: 100%;
|
2025-04-03 16:46:51 +08:00
|
|
|
padding-top: calc(90rpx + var(--status-bar-height));
|
2025-04-02 11:34:12 +08:00
|
|
|
color: #363636;
|
|
|
|
font-size: 29rpx;
|
|
|
|
background-color: #262626;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
.main-body {
|
|
|
|
width: 100%;
|
2025-04-03 16:46:51 +08:00
|
|
|
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 90rpx);
|
|
|
|
overflow-y: scroll;
|
2025-04-02 11:34:12 +08:00
|
|
|
padding: 20rpx;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
|
|
.vip-box {
|
|
|
|
width: 100%;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-start;
|
|
|
|
padding-bottom: 20rpx;
|
|
|
|
|
|
|
|
.dl-menu-box {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-start;
|
|
|
|
width: 100%;
|
|
|
|
color: #888888;
|
|
|
|
padding-top: 20rpx;
|
|
|
|
|
|
|
|
.dl-menu {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
font-size: 30rpx;
|
|
|
|
margin: 0 20rpx;
|
|
|
|
padding-bottom: 15rpx;
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
image {
|
|
|
|
width: 38rpx;
|
|
|
|
height: 38rpx;
|
|
|
|
margin-right: 5rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.click {
|
|
|
|
color: white;
|
|
|
|
font-weight: bold;
|
|
|
|
border-bottom: 2px solid white;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.card-detail-box {
|
|
|
|
width: 100%;
|
|
|
|
margin-top: 20rpx;
|
2025-04-02 15:17:19 +08:00
|
|
|
padding: 40rpx 20rpx 30rpx 20rpx;
|
2025-04-02 11:34:12 +08:00
|
|
|
border-radius: 20rpx;
|
|
|
|
border: 1rpx solid #96948C;
|
|
|
|
background-color: #1A1A1A;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2025-04-02 15:17:19 +08:00
|
|
|
|
|
|
|
.price-box {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
.price-item {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
width: 33%;
|
|
|
|
padding: 30rpx 20rpx;
|
|
|
|
color: #FAE4C8;
|
|
|
|
background-color: #302D29;
|
|
|
|
border-radius: 25rpx;
|
|
|
|
padding: 30rpx 20rpx;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
.hot-img {
|
|
|
|
width: 80rpx;
|
|
|
|
height: 80rpx;
|
|
|
|
position: absolute;
|
|
|
|
top: -20px;
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.text1 {
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 26rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.text2 {
|
|
|
|
margin: 15rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 40rpx;
|
|
|
|
|
|
|
|
text {
|
|
|
|
font-size: 20rpx;
|
|
|
|
margin-right: 10rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.text3 {
|
|
|
|
font-size: 20rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.margin-left-right {
|
|
|
|
margin: 0 25rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.choose {
|
|
|
|
color: #603B25 !important;
|
|
|
|
background-image: linear-gradient(to bottom, #F8DFC0, #EFCBA0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.buy-button {
|
|
|
|
width: 100%;
|
|
|
|
padding: 20rpx 0;
|
|
|
|
color: #010000;
|
|
|
|
background-image: linear-gradient(to right, #F8DFC0, #EFCBA0);
|
|
|
|
margin-top: 40rpx;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 32rpx;
|
|
|
|
border-radius: 50rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.xieyi-box {
|
|
|
|
width: 100%;
|
|
|
|
font-size: 20rpx;
|
|
|
|
color: #707070;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
margin-top: 20rpx;
|
|
|
|
|
|
|
|
text {
|
|
|
|
color: #FFFFFF;
|
|
|
|
}
|
|
|
|
}
|
2025-04-02 11:34:12 +08:00
|
|
|
}
|
2025-04-02 15:17:19 +08:00
|
|
|
|
|
|
|
|
2025-04-02 11:34:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.rights-box {
|
|
|
|
width: 100%;
|
|
|
|
padding: 0 20rpx 30rpx 20rpx;
|
|
|
|
border-radius: 20rpx;
|
|
|
|
border: 1rpx solid #96948C;
|
|
|
|
background-color: #363636;
|
|
|
|
color: #E8CEAD;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
.rights-item {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
.title-left {
|
|
|
|
width: 260rpx;
|
|
|
|
padding: 20rpx 0 20rpx 20rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.value-item {
|
|
|
|
flex: 1;
|
|
|
|
text-align: center;
|
|
|
|
padding: 20rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item-bg {
|
|
|
|
font-size: 24rpx;
|
|
|
|
background-color: #42403E;
|
|
|
|
border-radius: 15rpx;
|
|
|
|
margin-bottom: 20rpx;
|
|
|
|
|
|
|
|
.yellow-bg {
|
|
|
|
background-color: #F3D2A6;
|
|
|
|
border-radius: 0 15rpx 15rpx 0;
|
|
|
|
color: #3A3A38;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|