ll
liukangdong
2025-01-23 904436a616ca08fc95e1cbbbd13059835ef37e72
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
<template>
    <view class="main_app">
        <view class="title_wrap">
            <view class="name">{{ driverInfo.realname || driverInfo.username }},欢迎登录~</view>
            <view class="btn" @click="loginOut">账号解绑</view>
        </view>
        <!--  -->
        <view class="banner_wrap">
            <view class="h1">安泰物流智慧园区</view>
            <view class="h2">物流车专区</view>
            <image class="banner" src="../../static/driver/wuliuche_banner@2x.png" mode="widthFix"></image>
        </view>
        <!--  -->
        <view v-if="taskList && taskList.length > 0" class="task_list">
            <swiper circular class="task_swiper">
                <swiper-item v-for="item in taskList" :key="item.id" @click="taskClick(item)">
                    <view class="item">
                        <view class="head">
                            <view class="name">{{ item.contractNum ? '合同单' : '运输单' }}{{ item.billCode || item.contractNum }}</view>
                            <view class="status">
                                <view class="text" v-if="item.status == 0">请确认任务</view>
                                <view class="text" v-if="item.status == 1">请于{{ item.arriveDate.slice(5, 11) }}现场签到</view>
                                <view class="text" v-if="item.status == 2">前方排队:{{ item.lineUpNum }}辆</view>
                                <view class="text" v-if="item.status == 3">请入园进入等待区</view>
                                <view class="text" v-if="item.status == 4">请入园停靠{{ item.platformName }}作业</view>
                                <view class="text" v-if="item.status == 5">{{ item.platformName }}作业中</view>
                                <view class="text" v-if="item.status == 6">作业已完成</view>
                                <view class="text" v-if="item.status == 7">转移中</view>
                                <view class="text red" v-if="item.status == 8">异常挂起</view>
                                <view class="time" v-if="item.waitTime && item.status == 2">{{ item.waitTime }}</view>
                                <view class="time" v-if="item.finishTimeStr && item.status == 5">预计完成时间:{{ item.finishTimeStr }}</view>
                            </view>
                        </view>
                        <view class="content">
                            <view class="info">
                                <view class="plate">
                                    <image src="@/static/driver/wuliu_ic_car@2x.png" class="icon" mode=""></image>
                                    <text>{{ item.carCodeFront }}</text>
                                </view>
                                <view class="plate">
                                    <image src="@/static/driver/wuliu_ic_huowu@2x.png" class="icon" mode=""></image>
                                    <text>{{ item.totalNum }}万支</text>
                                </view>
                            </view>
                            <view class="sub">
                                <view class="time" v-if="item.arriveDate && item.contractNum">{{ item.arriveDate.slice(5) }}</view>
                                <view class="time" v-if="item.type != 4 && item.platformWmsJob && item.platformWmsJob.ioCreatedate">
                                    {{ item.platformWmsJob.ioCreatedate.slice(5, 19) }}
                                </view>
                                <view v-if="item.status == 0" class="sub_btn">确认任务</view>
                                <view v-if="item.status == 1" class="sub_btn">立即签到</view>
                                <view v-if="item.status == 2" class="sub_btn" @click.stop="handleQueue(item)">查看排队</view>
                            </view>
                        </view>
                    </view>
                </swiper-item>
            </swiper>
        </view>
        <!--  -->
        <view class="title_wrap">
            <view class="name">业务办理</view>
        </view>
        <view class="container1">
            <view class="left">
                <view class="img_wrap img1" @click="jump('/pages/driver/notice')">
                    <image src="@/static/driver/wuliu_ic_ruyuanyuyue@2x.png" class="img"></image>
                    <view class="h1">入园预约</view>
                    <view class="h2">RESERVATION</view>
                </view>
                <view class="img_wrap img2" @click="jump('/pages/driver/reservedGuide?str=bookingTips')">
                    <image src="@/static/driver/wuliu_ic_zhinan@2x.png" class="img"></image>
                    <view class="h1">预约指南</view>
                    <view class="h2">APPOINTMENT GUIDE</view>
                </view>
            </view>
            <view class="right">
                <view class="img_wrap img2" @click="jump('/pages/driver/reservedRecord')">
                    <image src="@/static/driver/wuliu_ic_yuyuejilu@2x.png" class="img"></image>
                    <view class="h1">预约记录</view>
                    <view class="h2">APPOINTMENT RECORD</view>
                </view>
                <view class="img_wrap img2" @click="jump('/pages/driver/queueUp')">
                    <image src="@/static/driver/wuliu_ic_paidui@2x.png" class="img"></image>
                    <view class="h1">月台排队情况</view>
                    <view class="h2">HIDDEN DANGER</view>
                </view>
                <view class="img_wrap img2" @click="jump('/pages/driver/reservedGuide?str=reservationMap')">
                    <image src="@/static/driver/wuliu_ic_daolan@2x.png" class="img"></image>
                    <view class="h1">园区导览图</view>
                    <view class="h2">GUIDE MAP</view>
                </view>
            </view>
        </view>
        <!--  -->
        <view class="copyright">
            <image src="@/static/logo_s@2x.png" class="mr6" mode="widthFix" />
            <text>安徽安泰物流有限责任公司版权所有</text>
        </view>
    </view>
</template>
 
<script>
    import {
        logoutPost,
        driverHomeData,
        app_url,
        getLastWaitJob
    } from '@/api'
    export default {
        data() {
            return {
                taskList: [],
                driverInfo: uni.getStorageSync('driverInfo'),
            }
        },
        onLoad() {
            const ywinfo = uni.getStorageSync('ywinfo') || {}
            if (ywinfo.ywid && ywinfo.type == 0) {
                uni.setStorageSync('ywinfo',{})
                const yw = ywinfo.yw
                setTimeout(() => {
                    if (yw == 7) {
                        this.jump('/pages/driver/reservedDetail?id=' + ywinfo.ywid)
                    } else if (yw == 8) {
                        this.jump('/pages/driver/taskDetail?id=' + ywinfo.ywid)
                    } else if (yw == 0) {
                        getLastWaitJob({
                            uuid: ywinfo.ywid
                        }).then(res => {
                            if (res.data && res.data.id) {
                                this.taskClick(res.data)
                            }
                        })
                    }
                }, 100)
            }
        },
        onShow() {
            this.initData()
        },
 
        methods: {
            jump(path) {
                this.$jump(path)
            },
            initData() {
                driverHomeData().then(res => {
                    if (res.code == 200) {
                        uni.setStorageSync('driverGuide', {
                            bookingTips: res.data.bookingTips,
                            reservationMap: res.data.reservationMap,
                            signDistance: res.data.signDistance
                        })
                        this.taskList = res.data.platformJobList || []
                    }
                })
            },
            loginOut() {
                logoutPost({
                    isH5: 1
                }).then(res => {
                    this.$store.commit('empty')
                    setTimeout(() => {
                        window.location.href = app_url
                    }, 300)
                })
            },
            taskClick(item) {
                const status = item.status
                if (status == 0) {
                    uni.navigateTo({
                        url: '/pages/driver/taskConfirm?id=' + item.id
                    })
                }
                // else if(status == 2){
                //     uni.navigateTo({url:'/pages/driver/queueUp?jobId=' + item.id})
                // }
                else {
                    uni.navigateTo({
                        url: `/pages/driver/taskDetail?id=${item.id}&status=${item.status}`
                    })
                }
            },
            handleTask(item) {
                uni.navigateTo({
                    url: '/pages/driver/taskConfirm?id=' + item.id
                })
            },
            handleSign(item) {
                uni.navigateTo({
                    url: `/pages/driver/taskDetail?id=${item.id}&status=${item.status}`
                })
            },
            handleQueue(item) {
                uni.navigateTo({
                    url: '/pages/driver/queueUp?jobId=' + item.id
                })
            },
        }
    }
</script>
 
<style lang="scss">
    .title_wrap {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24rpx;
        padding-top: 10rpx;
 
        .name {
            font-weight: 600;
            font-size: 34rpx;
            color: #222222;
        }
 
        .btn {
            width: 144rpx;
            height: 56rpx;
            border-radius: 36rpx;
            border: 1rpx solid $uni-color-primary;
            font-size: 26rpx;
            color: $uni-color-primary;
            display: flex;
            justify-content: center;
            align-items: center;
        }
    }
 
    .main_app {
        padding-top: 12rpx;
    }
 
    .banner_wrap {
        padding: 54rpx 44rpx;
        color: #fff;
        position: relative;
        width: 688rpx;
        height: 270rpx;
        margin-bottom: 28rpx;
 
        .h1 {
            font-weight: bold;
            line-height: 66rpx;
            font-size: 44rpx;
            margin-bottom: 14rpx;
        }
 
        .h2 {
            font-weight: 600;
            font-size: 28rpx;
            width: 192rpx;
            color: $uni-color-primary;
            height: 48rpx;
            line-height: 48rpx;
            text-align: center;
            background: #ffffff;
            box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(39, 155, 170, 0.31);
            border-radius: 24rpx;
        }
 
        .banner {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            z-index: -1;
        }
    }
 
    .container1 {
        display: flex;
        flex-wrap: wrap;
 
        view {
            width: 336rpx;
        }
 
        .left {
            margin-right: 18rpx;
        }
 
        .img_wrap {
            position: relative;
            padding: 24rpx 0rpx 0 28rpx;
            border-radius: 8rpx;
            overflow: hidden;
 
            .h1 {
                font-weight: 600;
                font-size: 32rpx;
                color: #222222;
                line-height: 48rpx;
                margin-bottom: 4rpx;
            }
 
            .h2 {
                font-size: 22rpx;
                color: #7b9da1;
                line-height: 34rpx;
            }
 
            .img {
                width: 100%;
                height: 100%;
                position: absolute;
                top: 0;
                left: 0;
                z-index: -1;
            }
        }
 
        .img1 {
            width: 336rpx;
            height: 296rpx;
            margin-bottom: 16rpx;
        }
 
        .img2 {
            width: 336rpx;
            height: 140rpx;
            margin-bottom: 16rpx;
        }
    }
 
    .task_list {
        margin-bottom: 0rpx;
 
        .task_swiper {
            padding: 12rpx 10rpx;
            height: 340rpx;
            width: 730rpx;
            margin-left: -20rpx;
            box-sizing: border-box;
        }
 
        .item {
            background: #ffffff;
            box-shadow: 0rpx 6rpx 24rpx 0rpx rgba(39, 155, 170, 0.32);
            border-radius: 16rpx;
            height: 260rpx;
            width: 98%;
            margin-left: 1%;
 
            .head {
                display: flex;
                justify-content: space-between;
                align-items: center;
                background: linear-gradient(270deg, #fefeff 0%, #e1f7fe 100%);
                padding: 0rpx 30rpx;
                height: 92rpx;
 
                .name {
                    font-weight: 600;
                    font-size: 36rpx;
                    color: #222222;
                }
 
                .status {
                    color: $uni-color-primary;
                    font-weight: 600;
                    text-align: right;
 
                    .time {
                        font-size: 24rpx;
                        font-weight: 360;
                    }
                }
            }
 
            .content {
                height: 180rpx;
 
                .info {
                    display: flex;
                    padding: 24rpx 30rpx;
 
                    .plate {
                        flex: 1;
                        display: flex;
                        align-items: center;
 
                        .icon {
                            width: 26rpx;
                            height: 26rpx;
                            margin-right: 10rpx;
                        }
                    }
                }
 
                .sub {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    height: 68rpx;
                    padding: 0 30rpx 0;
 
                    .time {
                        font-size: 26rpx;
                        color: #999999;
                    }
 
                    .sub_btn {
                        height: 68rpx;
                        line-height: 68rpx;
                        padding: 0 34rpx;
                        color: #ffffff;
                        background: $uni-color-primary;
                        box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(39, 155, 170, 0.4);
                        border-radius: 40rpx;
                    }
                }
            }
        }
    }
 
    .copyright {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 44rpx;
        font-size: 24rpx;
        color: #666666;
 
        image {
            width: 40rpx;
            height: 40rpx;
        }
    }
</style>