index.vue
5.19 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<template>
<view class="wode-container">
<view class="head-top-box">
<view class="head-image-box">
<u-avatar :src="pic" size="140"></u-avatar>
</view>
<view style="display: flex; flex-direction: column; width: 100%;">
<view class="manager-info">
<view class="manager-info-transport-company-name">
<text>{{ userInfo.transportCompanyName }}</text>
</view>
<view class="choose-type-item-text-right-label">{{ userInfo.userType }}</view>
</view>
</view>
</view>
<view class="more-setting-box">
<view class="more-setting-title">
更多设置
</view>
<view class="cell-box" @click="handleAddressManager" hover-class="handlerClick">
<view class="cell-icon">
<image width="35rpx" height="35rpx" src="../../static/image/address-manager.png"></image>
</view>
<view class="cell-label">
<text>地 址 管 理</text>
</view>
</view>
<view class="cell-box" @click="handlerChangeRole" hover-class="handlerClick">
<view class="cell-icon">
<image src="../../static/image/role-change.png"></image>
</view>
<view class="cell-label">
<text>角 色 切 换</text>
</view>
</view>
<view class="cell-box" @click="handleLoginOut" hover-class="handlerClick">
<view class="cell-icon">
<image src="../../static/image/quit-login.png"></image>
</view>
<view class="cell-label">
<text>退 出 登 录</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { loginOut, queryRole } from "@/apis/user";
import headImg from "@/static/image/st_pic.png";
import { useMainStore } from "@/stores/index";
import { setRequestToken } from '@/utils/request/request.js';
import { computed, ref } from "vue";
const store = useMainStore();
const pic = ref(headImg)
const show = ref(true)
const userInfo = computed(() => store.userInfo)
const handleAddressManager = () => {
uni.$u.route({
url: `pages/home/address/index`,
})
}
const handlerChangeRole = () => {
uni.showModal({
title: '提示',
content: '是否进行身份切换?',
success: function (res) {
if (res.confirm) {
queryRole().then(res => {
if (res.data.success) {
uni.$u.route({
url: `pages/wode/choose/index?ruleVos= ${encodeURIComponent(JSON.stringify(res.data.data.ruleVos))}`,
})
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
const handleLoginOut = () => {
uni.showModal({
title: '提示',
content: '确定要退出吗?',
success: function (res) {
if (res.confirm) {
loginOut().then(res => {
if (res.data.success) {
store.token = null;
setRequestToken();
uni.$u.toast("已退出")
uni.$u.route({
type: "reLaunch",
url: "pages/login/index"
})
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
</script>
<style lang="scss" scoped>
.wode-container {
height: 100%;
box-sizing: border-box;
.head-top-box {
display: flex;
align-items: center;
background: #19a97c;
padding: 20rpx 30rpx;
box-sizing: border-box;
border-radius: 0 0 30rpx 30rpx;
height: 300rpx;
.head-image-box {
display: flex;
align-items: center;
justify-content: center;
width: 180rpx;
height: 180rpx;
margin-right: 30rpx;
}
}
.more-setting-box {
margin-top: 60rpx;
margin-bottom: 20rpx;
padding: 20rpx;
box-sizing: border-box;
align-items: center;
.more-setting-title {
color: $u-info;
}
.cell-box {
display: flex;
align-items: center;
line-height: 80rpx;
font-size: 35rpx;
background-color: white;
border-radius: 15rpx;
margin: 40rpx 0;
.cell-icon {
margin: 0 20rpx;
display: flex;
align-items: center;
image {
background-size: 100% 100%;
width: 40rpx;
height: 40rpx;
}
u-icon {}
}
.cell-label {
text {}
}
}
.handlerClick {
@include handleClick;
}
}
}
.user-box {
background-color: #fff;
}
.u-cell-group {
background-color: #fff;
}
.manager-info {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-around;
color: white;
.choose-tyep-item-text-right-info {
font-size: 40rpx;
}
.manager-info-transport-company-name {
display: flex;
color: white;
line-height: 80rpx;
font-size: 40rpx;
}
.choose-tyep-item-text-right-company {
font-weight: bolder;
line-height: 40rpx;
font-size: 40rpx;
}
.choose-type-item-text-right-label {
font-size: 30rpx;
padding: 8rpx 15rpx;
border-radius: 5rpx;
color: $u-main-color;
font-weight: 600;
margin-bottom: 10rpx;
background: #f3a200;
}
}
.manager-info-parent-company-name {
color: white;
text {
color: white;
}
}
</style>