|
@@ -8,11 +8,14 @@
|
|
|
<view class="endTime">会员到期时间: {{expireTime||'--'}}</view>
|
|
|
</view>
|
|
|
<view class="right">
|
|
|
- <image slot="icon" src="http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/Jm8VtOGY6Bqg6cf0dd7cba21cff1cf57cd5a36effe8f.png/1.png" mode="widthFix"></image>
|
|
|
+ <image slot="icon"
|
|
|
+ src="http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/Jm8VtOGY6Bqg6cf0dd7cba21cff1cf57cd5a36effe8f.png/1.png"
|
|
|
+ mode="widthFix"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="inputBox">
|
|
|
- <input type="text" v-model="vipQuery.activationCode" placeholder="请输入激活码" placeholder-class="activationIpt" />
|
|
|
+ <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>
|
|
@@ -35,35 +38,46 @@
|
|
|
<u-empty mode="data" textSize="20" iconSize="120" text="暂无激活记录"></u-empty>
|
|
|
</block>
|
|
|
</view>
|
|
|
+ <u-toast ref="uToast"></u-toast>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {mealList} from '@/api/combo.js'
|
|
|
- import {refreshVip} from '@/api/common.js'
|
|
|
- import { selectActivationCode,getActivationList } from '@/api/vipActivation.js'
|
|
|
- import { levelImgName } from '@/utils/config.js'
|
|
|
- import{timestampToDate} from '@/utils/tool.js'
|
|
|
+ import {
|
|
|
+ mealList
|
|
|
+ } from '@/api/combo.js'
|
|
|
+ import {
|
|
|
+ refreshVip
|
|
|
+ } from '@/api/common.js'
|
|
|
+ import {
|
|
|
+ selectActivationCode,
|
|
|
+ getActivationList
|
|
|
+ } from '@/api/vipActivation.js'
|
|
|
+ import {
|
|
|
+ levelImgName
|
|
|
+ } from '@/utils/config.js'
|
|
|
+ import {
|
|
|
+ timestampToDate
|
|
|
+ } from '@/utils/tool.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- expireTime:'',
|
|
|
+ expireTime: '',
|
|
|
redeemload: false,
|
|
|
activationList: [],
|
|
|
- list:[],
|
|
|
- userInfo:'',
|
|
|
- setMealName:'',
|
|
|
- vipQuery:{
|
|
|
- phoneNum:'',
|
|
|
- activationCode:'',
|
|
|
+ list: [],
|
|
|
+ userInfo: '',
|
|
|
+ setMealName: '',
|
|
|
+ vipQuery: {
|
|
|
+ phoneNum: '',
|
|
|
+ activationCode: '',
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- onShow() {
|
|
|
- },
|
|
|
+ onShow() {},
|
|
|
onLoad() {
|
|
|
- this.userInfo=JSON.parse(uni.getStorageSync('userInfo'))
|
|
|
- this.vipQuery.phoneNum=this.userInfo.phoneNum
|
|
|
+ this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
|
|
|
+ this.vipQuery.phoneNum = this.userInfo.phoneNum
|
|
|
this.mealList()
|
|
|
this.get_activationList()
|
|
|
this.get_userinfo()
|
|
@@ -71,26 +85,26 @@
|
|
|
|
|
|
methods: {
|
|
|
// 用户信息
|
|
|
- get_userinfo(){
|
|
|
- refreshVip().then(res=>{
|
|
|
- res.content.map((item)=>{
|
|
|
- this.expireTime=timestampToDate(item.expirationTime)
|
|
|
+ get_userinfo() {
|
|
|
+ refreshVip().then(res => {
|
|
|
+ res.content.map((item) => {
|
|
|
+ this.expireTime = timestampToDate(item.expirationTime)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// 激活列表
|
|
|
- get_activationList(){
|
|
|
- getActivationList().then(res=>{
|
|
|
- if(res.state=='Success'){
|
|
|
- res.content.content.map((item)=>{
|
|
|
- item.useTime= timestampToDate(item.useTime)
|
|
|
+ get_activationList() {
|
|
|
+ getActivationList().then(res => {
|
|
|
+ if (res.state == 'Success') {
|
|
|
+ res.content.content.map((item) => {
|
|
|
+ item.useTime = timestampToDate(item.useTime)
|
|
|
})
|
|
|
- this.activationList=res.content.content
|
|
|
+ this.activationList = res.content.content
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// 二次确认
|
|
|
confirmActivation() {
|
|
|
let that = this
|
|
@@ -105,33 +119,37 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// 兑换激活码
|
|
|
- select_activationCode(){
|
|
|
- selectActivationCode(this.vipQuery).then(res=>{
|
|
|
- this.redeemload=false
|
|
|
- if(res.state=='Success'){
|
|
|
+ select_activationCode() {
|
|
|
+ selectActivationCode(this.vipQuery).then(res => {
|
|
|
+ this.redeemload = false
|
|
|
+ if (res.state == 'Success') {
|
|
|
uni.showToast({
|
|
|
title: '激活成功',
|
|
|
});
|
|
|
- this.vipQuery.activationCode=''
|
|
|
+ this.vipQuery.activationCode = ''
|
|
|
this.get_activationList()
|
|
|
- }else{
|
|
|
- uni.showToast({
|
|
|
- title: res.content,
|
|
|
- });
|
|
|
+ } else if(res.content=='该手机号已订购【惠生活优享会员】,请在会员到期后再使用激活码'){
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ message:res.content
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
// 获取套餐类型
|
|
|
- mealList(){
|
|
|
- mealList({currentPage:1,pageSize:99,status:1}).then(res=>{
|
|
|
+ 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.list.map(item => {
|
|
|
+ if (item.setMealCode == this.userInfo.setMealCode) {
|
|
|
this.setMealName = item.setMealName
|
|
|
}
|
|
|
})
|