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
a84bad3e
Commit
a84bad3e
authored
May 15, 2021
by
郭晓清
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、实时地址
parent
5aec1478
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
6 deletions
+46
-6
detail.vue
src/pages/order/detail.vue
+46
-6
No files found.
src/pages/order/detail.vue
View file @
a84bad3e
...
...
@@ -123,7 +123,7 @@
<view>
<u-toast
ref=
"uToast"
/>
</view>
<view
v-if=
"showCenterBtn"
@
click=
"$u.throttle(handleBtn, 500)"
class=
"button"
:class=
"['center-button-view', btnClass]"
>
<view
v-if=
"showCenterBtn"
@
click=
"$u.throttle(handleBtn, 500)"
class=
"button"
:class=
"['center-button-view', btnClass]"
>
<text>
{{
centerButtonText
}}
</text>
<view
v-if=
"order.currentOverTime && showTimeOut"
class=
"time-view"
>
<text
style=
"padding-right: 8rpx;"
>
{{
order
.
currentOverTime
>
new
Date
().
getTime
()?
'剩'
:
'超'
}}
</text>
...
...
@@ -232,7 +232,8 @@
num
:
0
,
showTimeOut
:
true
,
clicking
:
false
,
dateItem
:
null
dateItem
:
null
,
centerBtnDisabled
:
false
}
},
onLoad
(
option
)
{
...
...
@@ -245,6 +246,11 @@
this
.
getLocation
()
this
.
getSignDistance
()
},
onHide
()
{
this
.
closeLocationChange
()
},
onUnload
()
{
this
.
closeLocationChange
()
},
computed
:
{
phoneIcon
()
{
...
...
@@ -301,6 +307,32 @@
});
}
},
updateLocation
(){
let
self
=
this
wx
.
startLocationUpdate
({
success
:
function
(){
self
.
openLocationChange
()
}
})
},
_locationChangeFn
(
res
)
{
console
.
log
(
'location change'
,
res
)
if
(
this
.
getDistance
(
res
.
latitude
,
res
.
longitude
)
>
this
.
signDistance
){
// 计算签到距离
this
.
btnClass
=
"isGan-btn"
this
.
centerBtnDisabled
=
false
}
else
{
this
.
centerBtnDisabled
=
true
}
},
openLocationChange
(){
console
.
log
(
"openLocationChange"
)
wx
.
onLocationChange
(
this
.
_locationChangeFn
);
},
closeLocationChange
(){
console
.
log
(
"closeLocationChange"
)
wx
.
offLocationChange
(
this
.
_locationChangeFn
);
},
phoneToCustomer
(
phone
){
// 联系客户
if
(
this
.
isAllowDianhuaAndDaohang
){
uni
.
makePhoneCall
({
...
...
@@ -515,7 +547,8 @@
this
.
submitType
=
"maintainWorkerCheckin"
this
.
isAllowDianhuaAndDaohang
=
true
this
.
errorSignIn
=
true
this
.
addressToCoordinate
()
// this.addressToCoordinate()
this
.
updateLocation
()
}
else
if
(
orderStatus
>
31
&&
orderStatus
<
80
)
{
// 完工
this
.
centerButton
=
"filish"
...
...
@@ -554,9 +587,15 @@
}
data
.
appointmentDatetimeRange
=
this
.
appointmentDatetimeRange
.
pkey
}
else
if
(
this
.
submitType
===
'maintainWorkerCheckin'
)
{
// 签到
// 检查见到距离是否符合
if
(
!
this
.
isErrorSign
){
if
(
this
.
getDistance
(
this
.
contactAddressLatitud
,
this
.
contactAddressLongitud
)
>
this
.
signDistance
){
if
(
!
this
.
centerBtnDisabled
){
return
}
else
{
this
.
closeLocationChange
()
}
if
(
this
.
getDistance
(
this
.
order
.
contactAddressLatitud
,
this
.
order
.
contactAddressLongitud
)
>
this
.
signDistance
){
this
.
commonToast
(
'签到失败,请点击异常签到处理或联系客服'
,
'error'
)
return
}
...
...
@@ -603,13 +642,14 @@
}
})
}
else
{
let
self
=
this
this
.
$refs
.
uToast
.
show
({
title
:
res
.
data
.
message
!==
undefined
?
res
.
data
.
message
:
res
.
message
,
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
type
:
'warning'
,
callback
:
function
()
{
this
.
clicking
=
false
res
.
data
.
message
===
'抱歉,手快的师傅已经抢到此单!'
?
this
.
isGan
():
''
res
.
data
.
message
===
'抱歉,手快的师傅已经抢到此单!'
?
self
.
isGan
():
''
}
})
}
...
...
@@ -720,7 +760,7 @@
var
nowTime
=
new
Date
();
// 当前时间
if
(
currentOverTime
&&
nowTime
.
getTime
()
>
currentOverTime
){
this
.
btnClass
=
'timeOut-btn'
self
.
$refs
[
'uCountDown'
].
seconds
+=
2
this
.
$refs
[
'uCountDown'
].
seconds
+=
2
}
},
handleClick
(){
...
...
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