|
@@ -0,0 +1,251 @@
|
|
|
+<template>
|
|
|
+ <view class="vip">
|
|
|
+ <view style="height: 20rpx;"></view>
|
|
|
+ <view class="topCard">
|
|
|
+ <view class="vipInfo">
|
|
|
+ <view class="left">
|
|
|
+ <view class="ownVip">当前会员:<text>{{setMealName||'普通用户'}}</text></view>
|
|
|
+ <view class="endTime">会员到期时间: 2023-10-19 22:25:10</view>
|
|
|
+ </view>
|
|
|
+ <view class="right">
|
|
|
+ <image slot="icon" src="../../static/vipTypology-icon.png" mode="widthFix"></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="inputBox">
|
|
|
+ <input type="text" v-model="vipQuery.activationCode" placeholder="请输入激活码" placeholder-class="activationIpt" />
|
|
|
+ <u-button type="error " :loading="redeemload" loadingSize="20" shape="circle" text="立即兑换"
|
|
|
+ @click="confirmActivation"></u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="listCard">
|
|
|
+ <view class="listTitle">激活记录</view>
|
|
|
+ <view class="listBox" v-if="activationList.length>0">
|
|
|
+ <view class="list" v-for="item of 4">
|
|
|
+ <view class="vipTitle">
|
|
|
+ <view class="">尊享会员</view>
|
|
|
+ <view class="">已激活</view>
|
|
|
+ </view>
|
|
|
+ <view class="listInfo">
|
|
|
+ <view class="">激活码:<text>JTsjTIENS03J35ID</text></view>
|
|
|
+ <view class="">激活时间: 2023-10-19 22:25:10</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <block v-else>
|
|
|
+ <u-empty mode="data" textSize="20" iconSize="120" text="暂无激活记录"></u-empty>
|
|
|
+ </block>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {mealList} from '@/api/combo.js'
|
|
|
+ import { selectActivationCode,getActivationList } from '@/api/vipActivation.js'
|
|
|
+ import { levelImgName } from '@/utils/config.js'
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ redeemload: false,
|
|
|
+ activationList: [],
|
|
|
+ list:[],
|
|
|
+ userInfo:'',
|
|
|
+ setMealName:'',
|
|
|
+ vipQuery:{
|
|
|
+ phoneNum:'',
|
|
|
+ activationCode:'',
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.userInfo=JSON.parse(uni.getStorageSync('userInfo'))
|
|
|
+ this.vipQuery.phoneNum=this.userInfo.phoneNum
|
|
|
+ this.mealList()
|
|
|
+ this.get_activationList()
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ // 激活列表
|
|
|
+ get_activationList(){
|
|
|
+ getActivationList().then(res=>{
|
|
|
+ if(res.state=='Success'){
|
|
|
+ this.activationList=res.content
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 二次确认
|
|
|
+ confirmActivation() {
|
|
|
+ let that = this
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确认兑换当前激活码吗?',
|
|
|
+ success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ that.redeemload = true
|
|
|
+ that.select_activationCode()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 兑换激活码
|
|
|
+ select_activationCode(){
|
|
|
+ selectActivationCode(this.vipQuery).then(res=>{
|
|
|
+ this.redeemload=false
|
|
|
+ if(res.state=='Success'){
|
|
|
+ uni.showToast({
|
|
|
+ title: '激活成功',
|
|
|
+ });
|
|
|
+ this.get_activationList()
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: res.content,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取套餐列表
|
|
|
+ mealList(){
|
|
|
+ mealList({currentPage:1,pageSize:99,status:1}).then(res=>{
|
|
|
+ if (res.state == 'Success') {
|
|
|
+ this.list = res.content.records
|
|
|
+ // 判断当前会员类型
|
|
|
+ this.list.map(item=>{
|
|
|
+ if(item.setMealCode == this.userInfo.setMealCode){
|
|
|
+ this.setMealName = item.setMealName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .vip {
|
|
|
+ height: 100vh;
|
|
|
+ padding: 0 24rpx;
|
|
|
+ background: #F9F9F9;
|
|
|
+
|
|
|
+ .topCard {
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ padding: 20rpx;
|
|
|
+
|
|
|
+ .vipInfo {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .left {
|
|
|
+ .ownVip {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #181818;
|
|
|
+ font-weight: bold;
|
|
|
+
|
|
|
+ &>text {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 36rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .endTime {
|
|
|
+ margin-top: 20rpx;
|
|
|
+ font-weight: normal;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #AAAAAA;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .right {
|
|
|
+ &>image {
|
|
|
+ width: 100rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .inputBox {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ border: #F9F9F9 4rpx solid;
|
|
|
+ border-radius: 50rpx;
|
|
|
+ padding: 6rpx;
|
|
|
+ margin-top: 20rpx;
|
|
|
+
|
|
|
+ &>input {
|
|
|
+ margin-left: 8rpx;
|
|
|
+ width: 1800rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .activationIpt {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #AAAAAA;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .listCard {
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ padding: 20rpx;
|
|
|
+ margin-top: 20rpx;
|
|
|
+
|
|
|
+ .listTitle {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #222222;
|
|
|
+ }
|
|
|
+
|
|
|
+ .listBox {
|
|
|
+ .list {
|
|
|
+ border-bottom: 1rpx solid #F0F0F0;
|
|
|
+
|
|
|
+ .vipTitle {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 32rpx;
|
|
|
+ margin-top: 20rpx;
|
|
|
+
|
|
|
+ &>view:first-child {
|
|
|
+ color: #222222;
|
|
|
+ }
|
|
|
+
|
|
|
+ &>view:last-child {
|
|
|
+ color: #FF4A39;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .listInfo {
|
|
|
+ margin-top: 20rpx;
|
|
|
+
|
|
|
+ &>view:first-child {
|
|
|
+ font-weight: normal;
|
|
|
+ color: #222222;
|
|
|
+ font-size: 24rpx;
|
|
|
+
|
|
|
+ &>text {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ color: #AAAAAA;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &>view:last-child {
|
|
|
+ height: 64rpx;
|
|
|
+ line-height: 64rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: normal;
|
|
|
+ color: #222222;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|