@ -102,7 +102,7 @@
< text class = "xshui" > { { item . rescueTime || '' } } < / text >
< / view >
< view class = "dis-tt" v-if ="rescueStatus == 2" >
< view class = "inanniu" @click ="dialogToggle(item.rescueDriverId)" >
< view class = "inanniu" @ click = "dialogToggle(item.rescueDriverId, item.id)" >
< uni -icons type = "checkmarkempty" color = "#3CBC6F" size = "20" > < / u n i - i c o n s >
< text > 接受 < / text >
< / view >
@ -118,7 +118,7 @@
< / view >
< / view >
< view class = "dis-tt" v-if ="rescueStatus == 3" >
< view class = "inanniu" @click ="diyshow(item.id)" >
<!-- < view class = "inanniu" @click ="diyshow(item.id)" >
< uni -icons type = "location" color = "#3CBC6F" size = "20" > < / u n i - i c o n s >
< text > 记录 < / text >
< / view >
@ -131,7 +131,7 @@
@ click = "diyshow2(item.id)" >
< uni -icons type = "checkmarkempty" color = "#3CBC6F" size = "20" > < / u n i - i c o n s >
< text > 完成 < / text >
< / view >
< / view > -- >
< view class = "anniua" @click ="GOdetails(item.id)" >
< view class = "shiwuimg" >
< image src = "../../static/images/cldd.png" mode = "" > < / image >
@ -166,8 +166,8 @@
< u -popup :show ="show" mode = "center" :round ="10" @close ="close2" @open ="open" >
< view class = "popup-box" >
< view class = "p-title" > 描述 < / view >
<!-- < view class = "p-hui" > 已经到达救援现场 < / view > -- >
<!-- < view class = "wrap-du" >
<!-- < view class = "p-hui" > 已经到达救援现场 < / view >
< view class = "wrap-du" >
< view class = "wrap-div" v-for ="(item,index) in dulist " :key ="index" >
< text > { { item . dictLabel } } < / text >
< / view >
@ -190,6 +190,29 @@
< / view >
< / view >
< / u - p o p u p >
< u -popup :show ="acceptShow" mode = "center" :round ="10" @close ="closeAcceptPopup" @open ="open" ref = "acceptPopup"
: closeOnClickOverlay = "false" >
< view class = "popup-box" >
< view class = "p-title" > 接受订单 < / view >
< view class = "huinput" >
< text > 车辆里程数 : < / text >
< u - -textarea v -model = " remark " placeholder = "请输入车辆里程数" border = "bottom" autoHeight > < / u - - t e x t a r e a >
< / view >
< view class = "p-title" > 车辆里程表图片 < / view >
< view class = "huinput" >
< u -upload :fileList ="fileList1" @afterRead ="afterRead" @delete ="deletePic" name = "1" multiple
: maxCount = "5" > < / u - u p l o a d >
< / view >
< view class = "button-group" >
< view class = "cancel-button" @click ="closeAcceptPopup" >
< text > 取消 < / text >
< / view >
< view class = "qzanniu" @click ="getdaodaAccept" >
< text > 确认 < / text >
< / view >
< / view >
< / view >
< / u - p o p u p >
< u -popup :show ="show1" mode = "center" :round ="10" @close ="close" @open ="open" >
< view class = "popup-box" >
< view class = "p-title" > 金额 < / view >
@ -254,7 +277,8 @@
import tabBar from '../../components/tabBar/tabBar.vue'
import upload from '@/utils/upload.js'
import {
getToken
getToken ,
getUserInfo
} from '@/utils/auth'
const keepAlivePlugin = uni . requireNativePlugin ( 'Ba-KeepAlive' )
const jyJPush = uni . requireNativePlugin ( 'JY-JPush' ) ;
@ -278,6 +302,7 @@
fileList1 : [ ] ,
uesrInfo : { } ,
show : false ,
acceptShow : false ,
show1 : false ,
show2 : false ,
show3 : false ,
@ -309,6 +334,7 @@
latitude : '' ,
tabindex : 0 ,
rescueId : 0 ,
rescueInfoId : null ,
setMoney : '' ,
title : 'user' ,
checkedindex : false ,
@ -318,6 +344,7 @@
rescueStatus : 2 ,
dulist : [ ] ,
nowPageInterval : null ,
driverInfo : [ ] ,
keepLive : {
channelId : 'Ba-KeepAlive' ,
channelName : "Ba-KeepAlive" ,
@ -333,6 +360,8 @@
this . $startSocketConnect ( uni . getStorageSync ( 'driverInfo' ) )
this . $startMsgSocket ( uni . getStorageSync ( 'userId' ) )
this . driverInfo = uni . getStorageSync ( 'userinfo' )
console . log ( 'name' , this . driverInfo . nickname )
/ / # i f d e f A P P
this . register ( )
this . jyPushStart ( )
@ -673,6 +702,96 @@
} ,
async getdaodaAccept ( ) {
if ( this . images . length === 0 ) {
uni . showToast ( {
title : '请上传图片再完成' ,
icon : 'none'
} ) ;
return ;
}
try {
uni . showLoading ( {
title : '提交中...' ,
mask : true
} ) ;
const tempImage = JSON . parse ( JSON . stringify ( this . images ) ) ;
const data = {
rescueInfoId : this . rescueInfoId ,
title : '司机 ' + this . driverInfo . nickname + ' 已接单,正在赶来的路上' ,
images : tempImage . join ( "," ) ,
remark : this . remark ,
type : 1 ,
} ;
/ / 尝 试 获 取 位 置 , 但 不 阻 塞 提 交
const location = await this . getLocationSilently ( ) ;
if ( location ) {
data . lng = location . longitude ;
data . lat = location . latitude ;
}
await this . submitAcceptData ( data ) ;
uni . hideLoading ( ) ;
} catch ( error ) {
uni . hideLoading ( ) ;
uni . showToast ( {
title : '提交失败: ' + ( error . message || '未知错误' ) ,
icon : 'none'
} ) ;
}
} ,
async getLocationSilently ( ) {
try {
const res = await uni . getLocation ( {
isHighAccuracy : true
} ) ;
return {
longitude : res . longitude ,
latitude : res . latitude
} ;
} catch ( error ) {
console . warn ( '获取位置失败:' , error ) ;
return null ;
}
} ,
async submitAcceptData ( data ) {
try {
const res = await request ( {
url : '/app/driver/uploadDetailByDriver' ,
method : 'post' ,
data : data
} ) ;
if ( res . code == 200 ) {
this . resetForm ( ) ;
uni . showToast ( {
title : '提交成功'
} ) ;
this . acceptShow = false ;
this . singleList = [ ] ;
await this . driverRescuePage ( ) ;
} else {
throw new Error ( res . msg || '提交失败' ) ;
}
} catch ( error ) {
throw error ;
}
} ,
resetForm ( ) {
this . images = [ ] ;
this . remark = '' ;
this . dictLabel = '请选择类型' ;
this . dictValue = '' ;
this . fileList1 = [ ] ;
} ,
diyshow ( id ) {
this . rescueId = id
this . show = true
@ -778,15 +897,16 @@
} )
} ,
dialogToggle ( id ) {
dialogToggle ( id , rescueInfoId ) {
this . id = id
this . rescueInfoId = rescueInfoId ;
this . $refs . alertDialog . open ( )
} ,
inputDialogToggle ( id ) {
this . id = id
this . $refs . inputDialog . open ( )
} ,
dialogConfirm ( ) {
/ * d i a l o g C o n f i r m ( ) {
let data = {
rescueDriverId : this . id ,
choose : 1 ,
@ -801,6 +921,47 @@
this . getthreelist ( )
} )
} , * /
dialogConfirm ( ) {
let data = {
rescueDriverId : this . id ,
choose : 1 ,
}
request ( {
url : '/app/driver/driverAccept' ,
method : 'post' ,
params : data
} ) . then ( ( res ) => {
if ( res . code == 200 ) {
/ / 直 接 执 行 接 单 成 功 后 的 操 作 , 不 再 打 开 接 受 订 单 弹 框
uni . showToast ( {
title : '接单成功'
} ) ;
/ / 刷 新 数 据
this . singleList = [ ] ;
this . getList ( ) ;
this . getthreelist ( ) ;
this . driverRescuePage ( ) ;
}
} )
} ,
closeAcceptPopup ( ) {
/ * i f ( t h i s . i m a g e s . l e n g t h = = = 0 ) {
uni . showToast ( {
title : '请上传现场图片' ,
icon : 'none'
} ) ;
return ;
}
this . acceptShow = false ; * /
/ / 重 置 表 单 数 据
this . images = [ ] ;
this . remark = '' ;
this . fileList1 = [ ] ;
/ / 关 闭 弹 窗
this . acceptShow = false ;
} ,
dialogClose ( ) {
@ -822,7 +983,6 @@
this . getList ( )
this . $refs . inputDialog . close ( )
this . getthreelist ( )
} )
} ,
@ -918,7 +1078,7 @@
if ( ! areNotificationsEnabled ) {
uni . showModal ( {
title : '通知权限开启提醒' ,
content : '您还没有开启通知权限,无法接 受 到消息通知,是否前往设置?',
content : '您还没有开启通知权限,无法接 收 到消息通知,是否前往设置?',
success : function ( res ) {
if ( res . confirm ) {
var Intent = plus . android . importClass ( 'android.content.Intent' ) ;
@ -962,7 +1122,7 @@
if ( isOn == false ) {
uni . showModal ( {
title : '通知权限开启提醒' ,
content : '您还没有开启通知权限,无法接 受 到消息通知,是否前往设置?',
content : '您还没有开启通知权限,无法接 收 到消息通知,是否前往设置?',
success : function ( res ) {
if ( res . confirm ) {
var app = plus . ios . invoke ( 'UIApplication' , 'sharedApplication' ) ;
@ -1348,7 +1508,40 @@
margin : 15 px auto ;
}
. button - group {
display : flex ;
justify - content : space - between ;
margin - top : 20 px ;
}
. cancel - button {
width : 45 % ;
height : 40 px ;
border - radius : 6 px ;
background : # f0f0f0 ;
display : flex ;
align - items : center ;
justify - content : center ;
color : # 333 ;
font - size : 16 px ;
font - weight : 700 ;
border : 1 px solid # ddd ;
}
. qzanniu {
width : 45 % ;
height : 40 px ;
border - radius : 6 px ;
background : # 0 D2E8D ;
display : flex ;
align - items : center ;
justify - content : center ;
color : white ;
font - size : 16 px ;
font - weight : 700 ;
}
/ * . q z a n n i u {
width : 100 % ;
height : 40 px ;
border - radius : 6 px ;
@ -1360,5 +1553,5 @@
color : rgb ( 255 , 255 , 255 ) ;
font - size : 16 px ;
font - weight : 700 ;
}
} * /
< / style >