my.vue
3.6 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<template>
<view class="content">
<view class="top">
<view style="display: flex;align-items: center;" class="">
<image v-if="!info" src="/static/my/Frame 2996.png" style="width: 100rpx; height:100rpx;margin-right: 30rpx;" mode=""></image>
<image v-else :src="info.avatar" style="width: 100rpx; height:100rpx;margin-right: 30rpx;" mode=""></image>
<p v-if="!info">未登录</p>
<p v-else>{{info.nickname}}</p>
</view>
<view class="">
<image src="../../static/Frame@2x.png" style="width: 40rpx; height: 40rpx;" mode="" @click="goEdit"></image>
</view>
</view>
<view class="box">
<view style="display: flex;flex-direction: column;align-items: center;" v-for="item in list" @click="go(item)">
<image class="imgBox" :src="item.url" mode=""></image>
<p style=" color: #000000e6;font-size: 26rpx;font-weight: 400;">{{item.title}}</p>
</view>
</view>
<view style="background: #f7f8faff; padding: 32rpx;">
<view class="bottomBox" v-for="item in list1" style="padding: 24rpx;" @click="go(item)">
<view style="display: flex;align-items: center;" class="">
<image style="width: 48rpx; height: 48rpx;margin-right: 22rpx;" :src="item.url" mode=""></image>
<p style="color: #0d1013e6;font-size: 28rpx;font-weight: 500;">{{item.title}}</p>
</view>
<view class="">
<image src="../../static/my/方向=right@2x(4).png" style="width: 16rpx;height: 32rpx;" mode=""></image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
info:{
},
list:[
{
url:'../../static/my/Frame 2999.png',
title:'我的设备',
route:'/pages/my/myDevice'
},
{
url:'../../static/my/Frame 3000.png',
title:'我的需求',
route:'/pages/my/myNeeds'
},
{
url:'../../static/my/Frame 3001.png',
title:'我的收藏',
route:'/pages/my/myStars'
},
{
url:'../../static/my/Frame 3002.png',
title:'最近浏览',
route:'/pages/my/history'
},
],
list1:[
{
url:'/static/my/ic-us.png',
title:'关于我们',
route:'/pages/my/aboutUs'
},
{
url:'/static/my/Frame(2) (1).png',
title:'联系客服'
},
{
url:'/static/my/ic-building.png',
title:'合伙人加盟',
route:'/pages/subPages/join'
},
{
url:'/static/my/ic-yijian.png',
title:'意见反馈',
route:'/pages/subPages/ad'
},
{
url:'/static/my/ic-setting.png',
title:'设置',
route:'/pages/my/setting'
},
]
}
},
methods: {
go(item){
uni.navigateTo({
url:item.route
})
},
goEdit(){
uni.navigateTo({
url:'/pages/my/setting'
})
},
getList(){
uni.$u.http.get('/api/user/index').then(res => {
console.log(res);
this.info = res.data
}).catch(err => {
console.log(err);
})
}
},
onLoad() {
this.getList()
},
onShow() {
this.getList()
}
}
</script>
<style>
.bottomBox{
opacity: 1;
background: #ffffffff;
display: flex;
align-items: center;
justify-content: space-between;
}
.imgBox{
width: 80rpx;
height: 80rpx;
margin-bottom: 13rpx;
}
.box{
height: 204rpx;
border-radius: 16rpx;
opacity: 1;
background: #ffffffff;
margin: 32rpx;
display: flex;
align-items: center;
justify-content: space-evenly;
}
.content{
height: 560rpx;
border: 1rpx solid #e8eaedff;
background: linear-gradient(137.9deg, #ffffffff 0%, #cde1ffff 100%);
}
.top{
display: flex;
margin: 80rpx 40rpx;
padding-top: 80rpx;
justify-content: space-between;
align-items: center;
}
</style>