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
105
106
107
108
109
110
111
<template>
<div class="mine">
<div class="head" :style="{backgroundImage:`url(${image.head_bg})`}">
<img class="header-icon" :src="userDetail.avatar">
<div class="ref-block" @click="clearBoth()">
<img :src="image.ref"/>
</div>
<p class="name">{{userDetail.nickname}}</p>
<span class="id">学员号:{{userDetail.user_id}}</span>
</div>
<div class="list">
<mt-cell title="订单" to="/order" is-link>
<img slot="icon" :src="image.order" width="24" height="24">
</mt-cell>
<!--<mt-cell title="Q&A" to="//github.com" is-link>-->
<!--<img slot="icon" :src="image.qa" width="24" height="24">-->
<!--</mt-cell>-->
</div>
<bottom-tab/>
</div>
</template>
<script>
import bottomTab from './public/bottomTab';
import {mineImage} from "../util/imgUrl";
import {getUserDetailApi} from "../service/api";
import { Toast } from 'mint-ui';
export default {
name: "mine",
components:{
bottomTab
},
data(){
return {
image:mineImage,
userDetail:{}
}
},
mounted(){
this.initPage()
},
methods:{
initPage(){
getUserDetailApi().then(res=>{
this.userDetail = res
})
},
clearBoth(){
localStorage.clear();
Toast('清除成功')
}
}
}
</script>
<style scoped lang="less">
@import "../util/public";
.mine{
height: 100%;
background: #EEEEEE;
overflow: auto;
.head{
.ref-block{
width: 25 * @toVw;
height: 25 * @toVw;
position: absolute;
right: 20 * @toVw;
top: 20 * @toVw;
img{
width: 100%;
}
}
width: 375 * @toVw;
height: 160 * @toVw ;
background-size: 100% 100%;
color: white;
text-align: center;
.header-icon{
margin-top: 18 * @toVw;
margin-bottom: 14 * @toVw;
width: 72 * @toVw;
height: 72 * @toVw;
border-radius: 10000px;
}
.name{
font-size:14px;
font-family:PingFang-SC-Medium;
font-weight:normal;
color:rgba(255,255,255,1);
line-height:20* @toVw;
}
.id{
font-size:12px;
font-family:PingFang-SC-Medium;
font-weight:normal;
color: #808080;
border-radius: 200px;
line-height:17* @toVw;
background-color: white;
padding: 0 20*@toVw;
}
}
.list{
margin-top: 12*@toVw;
.mt-cell{
height: 40 * @toVw;
}
}
}
</style>