This commit is contained in:
nyoung 2024-08-22 22:04:46 +08:00
parent adf1e5b60b
commit 40dc3c5e9c
3 changed files with 35 additions and 11 deletions

View File

@ -2,7 +2,7 @@
<view> <view>
<view class="orderCard" @click="onShowDetail"> <view class="orderCard" @click="onShowDetail">
<view class="orderCardHeader"> <view class="orderCardHeader">
<text class="orderCardType">{{orderData.rescueTypeStr}}</text> <text class="orderCardType">{{ getRescueTypeStr() }}</text>
<text class="orderCardTitle">{{ orderData.rescuePosition }}</text> <text class="orderCardTitle">{{ orderData.rescuePosition }}</text>
</view> </view>
<view class="orderCardStatus"> <view class="orderCardStatus">
@ -27,13 +27,13 @@
系统正在派单中... 系统正在派单中...
</view> </view>
<view v-if="orderData.rescueStatus > 2"> <view v-if="orderData.rescueStatus > 2">
<text class="orderCardDriver">先伟</text> <text class="orderCardDriver">{{ orderData.driverName || "" }}</text>
驾驶 驾驶
<text class="orderCardCarNo">鲁A12345</text> <text class="orderCardCarNo">{{ orderData.driverCarNum || "" }}</text>
</view> </view>
</view> </view>
<view class="orderCardFooter"> <view class="orderCardFooter">
<text class="orderCardDateTime">2024-08-18 10:33</text> <text class="orderCardDateTime">{{ orderData.rescueTime || "" }}</text>
<view class="orderCardBtnGroup"> <view class="orderCardBtnGroup">
<template v-if="role == 'ddzx' && orderData.rescueStatus <= 2"> <template v-if="role == 'ddzx' && orderData.rescueStatus <= 2">
<view @click.stop="deleteId" class="orderCardBtnGroupItem" style="background-color: #fff;color: #317DFA"> <view @click.stop="deleteId" class="orderCardBtnGroupItem" style="background-color: #fff;color: #317DFA">
@ -76,6 +76,29 @@
} }
}, },
methods: { methods: {
getRescueTypeStr(){
if(this.orderData.rescueTypeStr){
return this.orderData.rescueTypeStr
}
switch (this.orderData.rescueType){
case '1':
return '拖车'
case '2':
return '送油'
case '3':
return '搭电'
case '4':
return '换胎'
case '5':
return '扣车'
case '6':
return '事故'
case '7':
return '秩序'
default:
return ''
}
},
onShowDetail() { onShowDetail() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/details/details?id=' + this.orderData.id url: '/pages/details/details?id=' + this.orderData.id
@ -262,4 +285,4 @@
border-radius: 28rpx; border-radius: 28rpx;
} }
} }
</style> </style>

View File

@ -324,14 +324,14 @@
} }
if (this.sfindex == 'police') { if (this.sfindex == 'police') {
request({ request({
url: '/getJjInfo', url: '/rescue/getJjInfo',
method: 'get', method: 'get',
}).then((res) => { }).then((res) => {
let userJson = {} let userJson = {}
userJson.userId = res.user.userId userJson.userId = res.data.user.userId
uni.setStorageSync('userInfo', res.user) uni.setStorageSync('userInfo', res.data.user)
uni.setStorageSync('role', res.role) uni.setStorageSync('role', res.data.roles)
uni.setStorageSync('userId', res.user.userId) uni.setStorageSync('userId', res.data.user.userId)
this.goselect() this.goselect()
}) })
} }

View File

@ -54,6 +54,7 @@ const request = config => {
reject(code) reject(code)
} }
res.data.code = (res.data.code === 0 ? 200 : res.data.code) res.data.code = (res.data.code === 0 ? 200 : res.data.code)
if(res.data.data && res.data.data.records){ if(res.data.data && res.data.data.records){
res.data.rows = res.data.data.records res.data.rows = res.data.data.records
@ -61,7 +62,7 @@ const request = config => {
if(res.data.data && res.data.data.total){ if(res.data.data && res.data.data.total){
res.data.total = res.data.data.total res.data.total = res.data.data.total
} }
console.log(res.data,'res.data')
resolve(res.data) resolve(res.data)
}) })
.catch(error => { .catch(error => {