Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李俊赕
self-support
Commits
ded530f8
Commit
ded530f8
authored
Apr 27, 2021
by
刘用法
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.banshouhui.com/lijundan/self-support
parents
baf030f5
8f578a52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
49 deletions
+117
-49
order.js
src/common/api/order.js
+8
-2
detail.vue
src/pages/order/detail.vue
+109
-47
No files found.
src/common/api/order.js
View file @
ded530f8
...
...
@@ -71,7 +71,12 @@ let orderApiFun = function(vm){
/**
* 获取师傅水印 or 默认水印
*/
let
getWatermark
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'wxh-worker-rest/rest/'
+
vm
.
vuex_token
+
'/photo/watermark'
,
params
);
let
getWatermark
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/wxh-worker-rest/rest/'
+
vm
.
vuex_token
+
'/photo/watermark'
,
params
);
/**
* 联系时间接口
*/
let
contactTime
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
get
(
'/wxh-worker-rest/rest/order/record/'
+
vm
.
vuex_token
+
'/contact/'
+
orderId
,
params
);
const
orderApi
=
{
listByRecommendOrder
,
...
...
@@ -90,7 +95,8 @@ let orderApiFun = function(vm){
rejectOrder
,
orderStandard
,
saveImage
,
getWatermark
getWatermark
,
contactTime
}
return
orderApi
}
...
...
src/pages/order/detail.vue
View file @
ded530f8
...
...
@@ -23,7 +23,7 @@
<text>
客户信息:
</text>
<text>
{{
order
.
contactName
}}
</text>
</view>
<u-image
width=
"60rpx"
height=
"60rpx"
:src=
"phoneIcon"
></u-image>
<u-image
width=
"60rpx"
height=
"60rpx"
:src=
"phoneIcon"
@
click=
"phoneToCustomer(order.contactPhone)"
></u-image>
</view>
<view
class=
"order-cell"
>
<text>
联系方式:
</text>
...
...
@@ -34,7 +34,7 @@
<u-icon
name=
"map"
size=
"28"
></u-icon>
<text
class=
"address-txt"
>
{{
order
.
contactAddress
}}
</text>
</view>
<u-image
width=
"60rpx"
height=
"60rpx"
:src=
"navigationIcon"
></u-image>
<u-image
width=
"60rpx"
height=
"60rpx"
:src=
"navigationIcon"
@
click=
"openLocation"
></u-image>
</view>
</view>
<view
class=
"card order-item"
>
...
...
@@ -79,7 +79,7 @@
<!-- 过程反馈 -->
<view
class=
"left"
>
<view
v-show=
"allowFeedback"
@
click=
"clickFeedback"
class=
"button"
>
过程反馈
<text>
过程反馈
</text>
</view>
</view>
<!--接单,抢单,已被抢, 预约 ,签到 ,去完工 timestampDiff(order.currentOverTime)>0 -->
...
...
@@ -153,7 +153,10 @@
btnClass
:
'appoint-btn'
,
takeStatus
:
false
,
errorSignIn
:
false
,
scenePhoto
:
true
scenePhoto
:
true
,
isErrorSign
:
false
,
errorSignUrl
:
''
,
isAllowDianhuaAndDaohang
:
false
}
},
onLoad
(
option
)
{
...
...
@@ -170,10 +173,22 @@
},
computed
:
{
phoneIcon
()
{
return
process
.
uniEnv
.
qn_base_url
+
'icon/dianhua-1@2x.png'
//self-support/icon/dianhua-0@2x.png
if
(
this
.
isAllowDianhuaAndDaohang
){
return
process
.
uniEnv
.
qn_base_url
+
'icon/dianhua-1@2x.png'
}
else
{
return
process
.
uniEnv
.
qn_base_url
+
'icon/dianhua-0@2x.png'
}
},
navigationIcon
()
{
return
process
.
uniEnv
.
qn_base_url
+
'icon/daohang-1@2x.png'
//self-support/icon/daohang-0@2x.png
if
(
this
.
isAllowDianhuaAndDaohang
){
return
process
.
uniEnv
.
qn_base_url
+
'icon/daohang-1@2x.png'
}
else
{
return
process
.
uniEnv
.
qn_base_url
+
'icon/daohang-0@2x.png'
}
},
centerButtonClass
()
{
let
btnClass
=
"appoint-btn"
...
...
@@ -181,6 +196,45 @@
}
},
methods
:
{
openLocation
(){
if
(
this
.
isAllowDianhuaAndDaohang
){
uni
.
getLocation
({
type
:
'gcj02'
,
//返回可以用于uni.openLocation的经纬度
success
:
function
(
res
)
{
const
latitude
=
res
.
latitude
;
const
longitude
=
res
.
longitude
;
uni
.
openLocation
({
latitude
:
latitude
,
longitude
:
longitude
,
success
:
function
()
{
console
.
log
(
'success'
);
}
});
}
});
}
},
phoneToCustomer
(
phone
){
// 联系客户
if
(
this
.
isAllowDianhuaAndDaohang
){
uni
.
makePhoneCall
({
phoneNumber
:
phone
,
//仅为示例
complete
()
{
}
});
this
.
contactTime
()
}
},
contactTime
()
{
let
self
=
this
var
data
=
{}
self
.
$u
.
api
.
contactTime
(
data
,
this
.
order
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
"==="
,
res
.
data
)
}
else
{
console
.
log
(
res
.
message
);
}
})
},
scenePhotoClick
()
{
// 跳转拍照小程序
uni
.
navigateTo
({
url
:
'pages/photo/list?orderId='
+
this
.
order
.
orderId
+
'&brandId='
+
this
.
order
.
lianbaoBrandId
+
'&brand='
+
this
.
order
.
brandName
...
...
@@ -196,18 +250,13 @@
this
.
takeStatus
=
false
// 获取返回的图片 ,如果返回的图片存在则直接异常签约,成功后跳转到去完工页面,
if
(
img
){
// 拍照完成
this
.
$refs
.
uToast
.
show
({
title
:
'签到成功'
,
type
:
'success'
,
url
:
'pages/order/detail'
,
params
:
{
id
:
1
}
})
this
.
isErrorSign
=
true
this
.
errorSignUrl
=
img
this
.
handleBtn
()
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
'异常签到失败,请先按要求拍照'
,
type
:
'waning'
type
:
'wa
r
ning'
})
}
},
...
...
@@ -222,14 +271,8 @@
console
.
log
(
"==="
,
res
.
data
)
self
.
order
=
res
.
data
this
.
getCurrentBtn
()
this
.
visibale
=
true
// self.order.operationType = "accept"
// }else{
// self.order.operationType = "appointment"
// }
// self.method =self.operationDoing[self.order.operationType].action;
// // 根据工单的状态确定是否需要过程反馈
// self.allowFeedback = self.allowFeedbackStatus.indexOf(self.order.orderStatus)>0
if
(
self
.
order
.
isFirstOrder
){
}
}
else
{
console
.
log
(
res
.
message
,
"获取订单详情失败!"
);
}
...
...
@@ -238,7 +281,7 @@
loadOrderRecord
()
{
let
self
=
this
var
param
=
{
'orderId'
:
self
.
orderId
orderId
:
self
.
orderId
};
self
.
$u
.
api
.
listOrderRecord
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
...
...
@@ -248,9 +291,6 @@
}
})
},
rejectOrder
()
{
// 拒单
console
.
log
(
"点击拒单"
)
},
/**
* 点击下一周
* @param {Object} data
...
...
@@ -297,6 +337,7 @@
this
.
allowFeedback
=
true
this
.
showCenterBtn
=
true
this
.
showTimeSelect
=
true
this
.
isAllowDianhuaAndDaohang
=
true
this
.
submitType
=
"workerAppointment"
}
else
if
(
orderStatus
===
31
&&
this
.
order
.
appointmentDatetime
)
{
// 签到
...
...
@@ -310,36 +351,44 @@
// 完工
this
.
centerButton
=
"filish"
this
.
centerButtonText
=
"去完工"
this
.
submitType
=
"toFilish"
this
.
allowFeedback
=
true
this
.
showCenterBtn
=
true
this
.
scenePhoto
=
true
}
else
{}
},
handleBtn
()
{
if
(
this
.
centerButton
===
"filish"
){
this
.
filish
()
return
}
if
(
!
this
.
submitType
){
return
;
}
const
data
=
{}
// 不同请求类型传递不同数据
if
(
this
.
submitType
===
'maintainWorkerCheckin'
)
{
// 签到
// 检查见到距离是否符合
if
(
this
.
getDistance
(
this
.
order
.
contactAddressLatitud
,
this
.
order
.
contactAddressLongitud
)
>
3
){
this
.
$refs
.
uToast
.
show
({
title
:
'签到失败,请点击异常签到处理或联系客服'
,
type
:
'error'
})
return
}
data
.
remark
=
"123"
data
.
revert
=
true
}
else
if
(
this
.
submitType
===
'orderAccept'
){
// 接单
if
(
this
.
submitType
===
'orderAccept'
){
// 接单
data
.
orderId
=
this
.
order
.
orderId
}
else
if
(
this
.
submitType
===
'orderGan'
){
// 抢单
data
.
orderId
=
this
.
order
.
orderId
}
else
if
(
this
.
submitType
===
'workerAppointment'
){
// 预约
data
.
appointmentDatetime
=
''
data
.
appointmentDatetimeRange
=
''
if
(
!
data
.
appointmentDatetime
||
!
data
.
appointmentDatetimeRange
){
this
.
commonToast
(
'请选择预约时间和时间段'
,
'waring'
)
return
}
}
else
if
(
this
.
submitType
===
'maintainWorkerCheckin'
)
{
// 签到
// 检查见到距离是否符合
if
(
!
this
.
isErrorSign
){
if
(
this
.
getDistance
(
this
.
order
.
contactAddressLatitud
,
this
.
order
.
contactAddressLongitud
)
>
3
){
this
.
commonToast
(
'签到失败,请点击异常签到处理或联系客服'
,
'error'
)
return
}
}
data
.
exception
=
this
.
isErrorSign
data
.
coordinate
=
this
.
dataValue
?
this
.
dataValue
[
0
]
+
','
+
this
.
dataValue
[
1
]:
''
data
.
url
=
this
.
errorSignUrl
?
this
.
errorSignUrl
:
''
}
else
if
(
this
.
submitType
===
'toFilish'
){
// 去完工
this
.
filish
()
return
}
this
.
$u
.
api
[
this
.
submitType
](
data
,
this
.
order
.
orderId
).
then
(
res
=>
{
if
((
res
.
data
.
code
!==
undefined
&&
res
.
data
.
code
===
200
)
...
...
@@ -349,8 +398,7 @@
type
:
'success'
,
url
:
'pages/order/detail'
,
params
:
{
id
:
1
,
menu
:
2
id
:
this
.
order
.
orderId
}
})
}
else
{
...
...
@@ -363,6 +411,14 @@
}
})
},
commonToast
(
message
,
type
,
url
,
params
){
// 统一得toast
this
.
$refs
.
uToast
.
show
({
title
:
message
,
type
:
type
,
url
:
url
,
params
:
params
})
},
isGan
(){
this
.
centerButtonText
=
"已被抢"
this
.
submitType
=
""
...
...
@@ -380,6 +436,11 @@
url
:
'pages/order/complete?orderId='
+
this
.
order
.
orderId
})
},
rejectOrder
()
{
// 拒单
uni
.
navigateTo
({
url
:
'pages/order/refuse?orderId='
+
this
.
order
.
orderId
})
},
/**
* 获取当前位置的经纬度
*/
...
...
@@ -441,13 +502,14 @@
this
.
btnClass
=
'timeOut-btn'
self
.
$refs
[
'uCountDown'
].
seconds
+=
2
}
},
handleClick
(){
},
handleClick
(){
this
.
visibale
=
false
// 去完工
uni
.
navigateTo
({
url
:
'pages/photo/list'
})
}
}
}
};
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment