my.vue
5.65 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
231
232
233
234
235
236
237
<template>
<view class="page">
<view class="bg">
<image src="/static/bg.jpg"></image>
</view>
<view class="back" @click="home"><image src="../../static/left.png"></image></view>
<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
<view class="content">
<view class="my-top">
<view class="user-info">
<view class="portrait" @click="tzmy">
<image :src="user.avatar"></image>
</view>
<view class="info">
<view class="nickname">
<text>{{user.nickName}}</text>
</view>
<view class="rank">
<image src="../../static/id.png"></image>
<text>{{user.userId}}</text>
</view>
</view>
</view>
</view>
<view class="message-list">
<!-- 司机列表 -->
<view class="" v-if="sjshow">
<view class="titleall-box" style="margin-bottom: -20rpx;">
<view class="titleall-left"><view class="titleall-left-line"></view>服务</view>
</view>
<hcxx v-if="sjshow"></hcxx>
</view>
<!-- 收敛工列表 -->
<view class="" v-if="slgshow">
<view class="titleall-box" style="margin-bottom: -40rpx;">
<view class="titleall-left"><view class="titleall-left-line"></view>服务</view>
</view>
<slgxx v-if="slgshow"></slgxx>
</view>
<view class="titleall-box" v-if="!sjshow && !slgshow">
<view class="titleall-left"><view class="titleall-left-line"></view>我的服务</view>
</view>
<view class="list" @click="mydeath" v-if="ptyhshow || ddyshow">
<view class="icon-data">
<view class="icon">
<image src="/static/my-icon4.png" mode=""></image>
</view>
<view class="data">
<view class="title">
<text>报丧记录</text>
</view>
</view>
</view>
<view class="more">
<text class="iconfont icon-more"></text>
</view>
</view>
<view class="list" @click="myreservation" v-if="ptyhshow">
<view class="icon-data">
<view class="icon">
<image src="/static/my-icon5.png" mode=""></image>
</view>
<view class="data">
<view class="title">
<text>预约记录</text>
</view>
</view>
</view>
<view class="more">
<text class="iconfont icon-more"></text>
</view>
</view>
<view class="list" @click="myevaluate" v-if="ptyhshow">
<view class="icon-data">
<view class="icon">
<image src="/static/my-icon6.png" mode=""></image>
</view>
<view class="data">
<view class="title">
<text>服务评价</text>
</view>
</view>
</view>
<view class="more">
<text class="iconfont icon-more"></text>
</view>
</view>
</view>
</view>
</view>
<!-- tabbar -->
<TabBar :tabBarShow="3" v-if="!sjshow && !slgshow"></TabBar>
</view>
</template>
<script>
import TabBar from '../../components/TabBar/TabBar.vue';
import hcxx from '../hcxx/hcxx.vue'
// url: '/pages/slgxx/slgxx'
import slgxx from '../slgxx/slgxx.vue'
export default {
components: {
TabBar,
hcxx,
slgxx
},
data() {
return {
Baseapi:"http://zhmz.rsxmzj.cn:8536",
nvConfig:{
title:"殡葬公共服务",
bgColor:"#ffffff",
color:"#000000",
fixedAssist:{
hide:true,
},
transparent:{
initColor:"#000",
},
back:{
hide:true
},
},
user:{
nickName:"",
userId:"",
avatar:""
},
sjshow:false,
slgshow:false,
ddyshow:false,
ptyhshow:false,
};
},
onPageScroll(e) {this.$refs.nv.pageScroll(e)},
computed:{
pageTop(){return parseInt(88*uni.getSystemInfoSync().windowWidth/750) + uni.getSystemInfoSync().statusBarHeight}
},
onShow() {
this.hquserinfo();
console.log("角色",uni.getStorageSync('userjs'));
if(uni.getStorageSync('userjs') == '司机'){
this.sjshow = true
}
if(uni.getStorageSync('userjs') == '收敛工'){
this.slgshow = true
}
if(uni.getStorageSync('userjs') == '调度员'){
this.ddyshow = true
}
if(uni.getStorageSync('userjs') == '普通用户'){
this.ptyhshow = true
}
},
onLoad() {
uni.hideTabBar();
this.hquserinfo();
// this.user = uni.getStorageSync('USERS_KEY')
console.log(this.user);
},
methods: {
// 跳转电话报丧
dhbs(){
uni.setStorageSync('dh',2)
uni.navigateTo({
url:'/pages/funeralreport/funeralreport'
})
},
// 获取用户信息
hquserinfo(){
var info = {
userId:uni.getStorageSync("USERS_KEY").userId,
}
this.API.hquserinfo(info).then(res=>{
console.log("获取用户信息",res);
this.user.nickName = res.data.nickName;
this.user.avatar = res.data.avatar
this.user.userId = res.data.userId
console.log("信息",this.user);
})
},
hcxx(){
uni.navigateTo({
url: '/pages/hcxx/hcxx'
})
},
slgxx(){
uni.navigateTo({
url: '/pages/slgxx/slgxx'
})
},
home() {
uni.navigateTo({
url: '/pages/home/home'
})
},
onSkipOrder(type){
if(type === 4){
uni.navigateTo({
url: '/pages/myorder/myorder',
})
return;
}
console.log("type",type);
uni.navigateTo({
url: '/pages/myorder/myorder?type=' + type,
})
},
mydeath() {
uni.navigateTo({
url: '/pages/mydeath/mydeath'
})
},
myevaluate() {
uni.navigateTo({
url: '/pages/myevaluate/myevaluate'
})
},
myreservation() {
uni.navigateTo({
url: '/pages/myreservation/myreservation?type=' + 0
})
},
// 跳转个人信息修改
tzmy(){
uni.navigateTo({
url:'/pages/myinfo/myinfo'
})
},
}
}
</script>
<style scoped lang="scss">
@import 'my.scss';
</style>