vip.vue
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<template>
<view class="vip_content">
<!-- 个人信息 -->
<view class="person_msg">
<view class="header_wrap">
<view class="header_box">
<image class="header" :src="avatar" mode=""></image>
<!-- vip icon -->
<image class="crown" v-if="isVip == 1" src="../../static/crown.png" mode="widthFix"></image>
</view>
<view class="person_name" v-if="nickName">{{nickName}}</view>
<view class="person_name" v-else @click="toLogin()">点击登录</view>
</view>
</view>
<!-- 菜单 -->
<view class="vip_single_box">
<view class="vip_single layer_between" v-for="(item, index) in navList" :key="index" :class="{ single_no_bottom: index == 3 }" @click="toJump(index)">
<view class="layer_between">
<image class="single_icon" :src="item.icon" mode=""></image>
<view class="">{{ item.name }}</view>
</view>
<view class="right_arrow"><image src="../../static/biaoti_right_icon@2x.png" mode=""></image></view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
nickName:"",
avatar:"",
isVip:"",
// 菜单
navList: [
{
icon: require('../../static/icon1.png'),
name: '我的会员'
},
{
icon: require('../../static/icon2.png'),
name: '我的充值'
},
{
icon: require('../../static/icon3.png'),
name: '联系客服'
},
{
icon: require('../../static/icon4.png'),
name: '关于我们'
}
]
};
},
methods: {
// 授权
toLogin(){
uni.navigateTo({
url:"/pages/start/start"
})
},
toJump(index) {
switch (index) {
case 0:
uni.navigateTo({
url: '/pages/vip/myVip'
});
break;
case 1:
uni.navigateTo({
url: '/pages/vip/recharge'
});
break;
case 2:
uni.navigateTo({
url: '/pages/vip/contactService'
});
break;
case 3:
uni.navigateTo({
url: '/pages/vip/aboutUs'
});
break;
}
}
},
onShow() {
this.nickName = uni.getStorageSync("nickName");
this.avatar = uni.getStorageSync("avatarUrl");
this.isVip = uni.getStorageSync("is_vip");
},
onLoad() {
},
};
</script>
<style>
@import url('../../style/vip');
page {
background-color: #f9f9f9;
}
</style>