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
5b812f62
Commit
5b812f62
authored
Apr 23, 2021
by
Facius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.banshouhui.com/lijundan/self-support
parents
7ada66f9
eb807255
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
127 additions
and
32 deletions
+127
-32
order.js
src/common/api/order.js
+22
-2
index.vue
src/pages/order/index.vue
+105
-30
No files found.
src/common/api/order.js
View file @
5b812f62
...
...
@@ -4,18 +4,38 @@ let orderApiFun = function(vm){
/**
* 工单数量查询接口
*/
let
listOrderCount
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'
+
util
.
getToken
()
+
'/order/queryOrdersCount/V2'
,
params
);
let
listOrderCount
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'
+
vm
.
vuex_token
+
'/order/queryOrdersCount/V2'
,
params
);
/**
* 工单列表接口
*/
let
listOrder
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'
+
util
.
getToken
()
+
'/order/revision/list'
,
params
);
let
listOrder
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'
+
vm
.
vuex_token
+
'/order/revision/list'
,
params
);
/**
* 获取师傅的预约日历
*/
let
workerCalendar
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'
+
vm
.
vuex_token
+
'/wokerOrder/appointment/calendar'
,
params
);
/**
* 师傅预约
*/
let
workerAppointment
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/order/traceAndAppointment/traceOrder/'
+
vm
.
vuex_token
+
'/order/{orderId}'
,
params
,{
'content-type'
:
'application/x-www-form-urlencoded'
});
// 联系顾客时间更新接口,暂时没有
/**
* 师傅签到接口
*/
let
maintainWorkerCheckin
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'
+
vm
.
vuex_token
+
'/order/{orderId}/maintainWorkerCheckin'
,
params
,{
'content-type'
:
'application/x-www-form-urlencoded'
});
const
orderApi
=
{
listByRecommendOrder
,
listOrderCount
,
listOrder
,
workerCalendar
,
workerAppointment
,
maintainWorkerCheckin
}
return
orderApi
}
...
...
src/pages/order/index.vue
View file @
5b812f62
...
...
@@ -4,13 +4,14 @@
<view
class=
"tools-box"
>
<view
class=
"search-sub"
>
<u-subsection
:current=
"
0
"
:list=
"['待受理', '
待
完工']"
:current=
"
curNow
"
:list=
"['待受理', '
已
完工']"
active-color=
"white"
bg-color=
"white"
inactive-color=
"#666"
button-color=
"#2272FF"
border-radius=
"36"
@
change=
"sectionChange"
></u-subsection>
</view>
<view
class=
"search-btn"
>
...
...
@@ -18,7 +19,7 @@
<text
class=
"search-btn-text"
>
搜订单
</text>
</view>
</view>
<view
class=
"u-tabs-box"
>
<view
class=
"u-tabs-box"
v-show=
"showSview"
>
<u-tabs-swiper
activeColor=
"#2272FF"
bg-color=
"none"
...
...
@@ -33,7 +34,7 @@
swiperWidth=
"750"
></u-tabs-swiper>
</view>
<swiper
class=
"swiper-box"
:current=
"swiperCurrent"
@
transition=
"transition"
@
animationfinish=
"animationfinish"
>
<swiper
v-show=
"showSview"
class=
"swiper-box"
:current=
"swiperCurrent"
@
transition=
"transition"
@
animationfinish=
"animationfinish"
>
<swiper-item
class=
"swiper-item"
>
<scroll-view
scroll-y
style=
"height: 100%;width: 100%;"
@
scrolltolower=
"reachBottom"
>
<view
class=
"page-box"
>
...
...
@@ -58,14 +59,13 @@
</view>
<view
class=
"right"
>
{{
getDistance
(
res
.
contactAddressLatitud
,
res
.
contactAddressLongitud
)
}}
km
</view>
</view>
<u-divider
margin-top=
"16"
half-width=
"630"
border-color=
"#F4F5F7"
:use-slot=
"false"
>
</u-divider>
<view
class=
"bottom"
>
<view
class=
"left"
>
<view
class=
"tag"
>
剩
</view>
<u-count-down
:timestamp=
"timestamp"
font-size=
"44"
color=
"#FF930D"
></u-count-down>
<view
class=
"tag"
>
{{
res
.
currentOverTime
*
1000
>
new
Date
().
getTime
()?
'剩'
:
'超'
}}
</view>
<u-count-down
:timestamp=
"timestampDiff(res.currentOverTime)"
font-size=
"44"
color=
"#FF930D"
:ref=
"'uCountDown' + index"
@
change=
"timeChange(res.currentOverTime,index)"
>
</u-count-down>
</view>
<view
class=
"right-btn"
@
click=
"viewOderItem"
>
<text>
去预约
</text>
...
...
@@ -107,8 +107,9 @@
<view
class=
"bottom"
>
<view
class=
"left"
>
<view
class=
"tag"
>
剩
</view>
<u-count-down
:timestamp=
"timestamp"
font-size=
"44"
color=
"#FF930D"
></u-count-down>
<view
class=
"tag"
>
{{
res
.
currentOverTime
*
1000
>
new
Date
().
getTime
()?
'剩'
:
'超'
}}
</view>
<u-count-down
:timestamp=
"timestampDiff(res.currentOverTime)"
font-size=
"44"
color=
"#FF930D"
:ref=
"'uCountDown' + index"
@
change=
"timeChange(res.currentOverTime,index)"
>
</u-count-down>
</view>
<view
class=
"right-btn"
>
<text>
去签到
</text>
...
...
@@ -163,8 +164,9 @@
<view
class=
"bottom"
>
<view
class=
"left"
>
<view
class=
"tag"
>
剩
</view>
<u-count-down
:timestamp=
"timestamp"
font-size=
"44"
color=
"#FF930D"
></u-count-down>
<view
class=
"tag"
>
{{
res
.
currentOverTime
*
1000
>
new
Date
().
getTime
()?
'剩'
:
'超'
}}
</view>
<u-count-down
:timestamp=
"timestampDiff(res.currentOverTime)"
font-size=
"44"
color=
"#FF930D"
:ref=
"'uCountDown' + index"
@
change=
"timeChange(res.currentOverTime,index)"
>
</u-count-down>
</view>
<view
class=
"right-btn"
@
click=
"viewOderItem"
>
<text>
去完工
</text>
...
...
@@ -205,8 +207,9 @@
<view
class=
"bottom"
>
<view
class=
"left"
>
<view
class=
"tag"
>
剩
</view>
<u-count-down
:timestamp=
"timestamp"
font-size=
"44"
color=
"#FF930D"
></u-count-down>
<view
class=
"tag"
>
{{
res
.
currentOverTime
*
1000
>
new
Date
().
getTime
()?
'剩'
:
'超'
}}
</view>
<u-count-down
:timestamp=
"timestampDiff(res.currentOverTime)"
font-size=
"44"
color=
"#FF930D"
:ref=
"'uCountDown' + index"
@
change=
"timeChange(res.currentOverTime,index)"
>
</u-count-down>
</view>
<view
class=
"right-btn"
@
click=
"viewOderItem"
>
<text>
审核中
</text>
...
...
@@ -247,8 +250,9 @@
<view
class=
"bottom"
>
<view
class=
"left"
>
<view
class=
"tag"
>
剩
</view>
<u-count-down
:timestamp=
"timestamp"
font-size=
"44"
color=
"#FF930D"
></u-count-down>
<view
class=
"tag"
>
{{
res
.
currentOverTime
*
1000
>
new
Date
().
getTime
()?
'剩'
:
'超'
}}
</view>
<u-count-down
:timestamp=
"timestampDiff(res.currentOverTime)"
font-size=
"44"
color=
"#FF930D"
:ref=
"'uCountDown' + index"
@
change=
"timeChange(res.currentOverTime,index)"
>
</u-count-down>
</view>
<view
class=
"right-btn"
@
click=
"viewOderItem"
>
<text>
去处理
</text>
...
...
@@ -260,6 +264,52 @@
</scroll-view>
</swiper-item>
</swiper>
<swiper
v-show=
"!showSview"
class=
"swiper-box"
:current=
"swiperCurrent"
@
transition=
"transition"
@
animationfinish=
"animationfinish"
>
<swiper-item
class=
"swiper-item"
>
<scroll-view
scroll-y
style=
"height: 100%;width: 100%;"
@
scrolltolower=
"reachBottom"
>
<view
class=
"page-box"
>
<view
class=
"order"
v-for=
"(res, index) in orderList"
:key=
"res.id"
>
<view
class=
"top"
>
<view
class=
"left"
>
<view
class=
"tag"
>
{{
res
.
orderServiceType
}}
</view>
<view
class=
"store"
>
{{
res
.
categoryName
}}
</view>
<view
>
{{
res
.
orderNumber
}}
</view>
</view>
<view
class=
"right"
>
{{
res
.
orderBusinessTypeText
}}
</view>
</view>
<view
class=
"content"
>
<view
class=
"title u-line-2"
>
<text>
{{
res
.
contactName
}}
</text>
<text
style=
"margin-left: 8rpx;"
>
{{
res
.
contactPhone
}}
</text>
</view>
</view>
<view
class=
"address u-line-2"
>
<view
class=
"left"
>
<view
>
<u-icon
name=
"map"
size=
"32"
></u-icon>
<text
style=
"margin-left: 8rpx;"
>
{{
res
.
contactAddress
}}
</text>
<text
style=
"margin-left: 200rpx; font-size:large;"
@
click=
"viewOderItem"
>
>
</text>
</view>
</view>
</view>
<u-divider
margin-top=
"16"
half-width=
"630"
border-color=
"#F4F5F7"
:use-slot=
"false"
>
</u-divider>
<view
class=
"bottom"
>
<view
class=
"left"
>
<text>
审核时间 :
</text><text>
{{
res
.
auditDatetime
}}
</text>
</view>
<view
>
<text>
已完工
</text>
</view>
</view>
</view>
<!--
<u-loadmore
:status=
"loadStatus[0]"
bgColor=
"#f2f2f2"
></u-loadmore>
-->
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</view>
</
template
>
...
...
@@ -268,9 +318,11 @@
export
default
{
data
()
{
return
{
timestamp
:
1
,
showSview
:
true
,
curNow
:
0
,
timestamp
:
1000
,
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
indexStatus
:{
0
:
'waitAccept'
,
1
:
'waitAppointment'
,
2
:
'waitCheckIn'
,
3
:
'waitFinish'
,
4
:
'exception'
,
4
:
'finish'
},
indexStatus
:{
0
:
'waitAccept'
,
1
:
'waitAppointment'
,
2
:
'waitCheckIn'
,
3
:
'waitFinish'
,
4
:
'exception'
,
5
:
'finish'
},
orderList
:
[],
dataList
:
[
{
...
...
@@ -402,6 +454,34 @@ export default {
}
},
methods
:
{
sectionChange
(
index
){
if
(
index
===
1
){
this
.
showSview
=
false
// 加载已完工的数据
this
.
getOrderList
(
5
)
}
else
{
this
.
showSview
=
true
// 加载已完工的数据
this
.
getOrderList
(
0
)
}
this
.
curNow
=
index
;
},
timeChange
(
currentOverTime
,
index
){
let
self
=
this
var
nowTime
=
new
Date
();
// 当前时间
if
(
nowTime
.
getTime
()
>
currentOverTime
*
1000
){
self
.
$refs
[
'uCountDown'
+
index
][
0
].
seconds
+=
2
}
},
timestampDiff
(
currentOverTime
){
var
nowTime
=
new
Date
();
// 当前时间
if
(
nowTime
.
getTime
()
>
currentOverTime
*
1000
){
var
diff
=
nowTime
.
getTime
()
-
(
currentOverTime
*
1000
);
}
else
{
var
diff
=
(
currentOverTime
*
1000
)
-
nowTime
.
getTime
();
}
return
diff
;
},
/**
* 获取当前位置的经纬度
*/
...
...
@@ -466,6 +546,13 @@ export default {
console
.
log
(
"getOrderList"
,
res
.
data
)
if
(
res
.
data
)
{
self
.
orderList
=
res
.
data
.
list
;
//测试使用
self
.
orderList
.
forEach
((
item
,
index
)
=>
{
if
(
index
===
1
){
item
.
currentOverTime
-=
10
}
})
self
.
total
=
res
.
data
.
total
;
}
}
else
{
...
...
@@ -507,18 +594,6 @@ export default {
}
});
},
getOrderList1
()
{
// 加载工单列表
var
self
=
this
;
self
.
$u
.
api
.
listOrder
().
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
"==="
,
res
.
data
)
if
(
res
.
data
)
{
}
}
else
{
console
.
log
(
res
.
message
,
"获取订单数量失败!"
);
}
});
},
// 总价
totalPrice
(
item
)
{
let
price
=
0
;
...
...
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