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
5e3bcaf6
Commit
5e3bcaf6
authored
Aug 09, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 【ID1001298】 前台-工单排序调整
parent
3842edcf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
416 additions
and
335 deletions
+416
-335
order.vue
src/pages/index/order.vue
+416
-335
No files found.
src/pages/index/order.vue
View file @
5e3bcaf6
...
@@ -2,9 +2,18 @@
...
@@ -2,9 +2,18 @@
<TabBarPage
title=
"订单"
:fixed=
"true"
@
click=
"goTop"
>
<TabBarPage
title=
"订单"
:fixed=
"true"
@
click=
"goTop"
>
<view
class=
"tools-box"
>
<view
class=
"tools-box"
>
<view
class=
"search-sub"
>
<view
class=
"search-sub"
>
<u-subsection
:current=
"curNow"
:list=
"subList"
active-color=
"white"
bg-color=
"white"
<u-subsection
inactive-color=
"#666"
button-color=
"#2272FF"
border-radius=
"36"
@
change=
"sectionChange"
height=
"72"
:current=
"curNow"
bold
>
:list=
"subList"
active-color=
"white"
bg-color=
"white"
inactive-color=
"#666"
button-color=
"#2272FF"
border-radius=
"36"
@
change=
"sectionChange"
height=
"72"
bold
>
</u-subsection>
</u-subsection>
</view>
</view>
<view
class=
"search-btn"
@
click=
"handleClickSearch"
>
<view
class=
"search-btn"
@
click=
"handleClickSearch"
>
...
@@ -13,53 +22,91 @@
...
@@ -13,53 +22,91 @@
</view>
</view>
</view>
</view>
<view
class=
"u-tabs-box"
v-show=
"curNow == 0"
>
<view
class=
"u-tabs-box"
v-show=
"curNow == 0"
>
<u-tabs
height=
"66"
activeColor=
"#2272FF"
bg-color=
"none"
inactive-color=
"#999"
bar-height=
"4"
<u-tabs
bar-width=
"44"
:offset=
"[0,0]"
:list=
"list"
count=
"total"
:current=
"current"
@
change=
"change"
height=
"66"
:is-scroll=
"false"
font-size=
"28"
bold
></u-tabs>
activeColor=
"#2272FF"
bg-color=
"none"
inactive-color=
"#999"
bar-height=
"4"
bar-width=
"44"
:offset=
"[0, 0]"
:list=
"list"
count=
"total"
:current=
"current"
@
change=
"change"
:is-scroll=
"false"
font-size=
"28"
bold
></u-tabs>
</view>
</view>
<view
class=
"tab-view"
>
<view
class=
"tab-view"
>
<scroll-view
scroll-y
style=
"height: 100%;width: 100%;"
@
scrolltolower=
"reachBottom"
scroll-anchoring
<scroll-view
refresher-enabled=
"true"
:refresher-triggered=
"triggered"
:refresher-threshold=
"100"
:scroll-top=
"scrollTop"
scroll-y
refresher-background=
"#F4F5F7"
@
refresherrefresh=
"onRefresh"
style=
"height: 100%;width: 100%;"
@
refresherrestore=
"onRestore"
@
scroll=
"scroll"
enable-back-to-top
>
@
scrolltolower=
"reachBottom"
scroll-anchoring
refresher-enabled=
"true"
:refresher-triggered=
"triggered"
:refresher-threshold=
"100"
:scroll-top=
"scrollTop"
refresher-background=
"#F4F5F7"
@
refresherrefresh=
"onRefresh"
@
refresherrestore=
"onRestore"
@
scroll=
"scroll"
enable-back-to-top
>
<view
class=
"loading-view"
v-if=
"!loaded && !_freshing"
>
<view
class=
"loading-view"
v-if=
"!loaded && !_freshing"
>
<u-loading
mode=
"flower"
></u-loading>
<u-loading
mode=
"flower"
></u-loading>
</view>
</view>
<NoOrder
v-else-if=
"noMore"
imageName=
"zwdd.png"
:customStyle=
"noOrderCustomStyle"
/>
<NoOrder
v-else-if=
"noMore"
imageName=
"zwdd.png"
:customStyle=
"noOrderCustomStyle"
/>
<template
v-else
>
<template
v-else
>
<view
v-for=
"(item, index) in orderList"
:key=
"item.orderId"
>
<view
v-for=
"(item, index) in orderList"
:key=
"item.orderId"
>
<OrderCell
:orderData=
"item"
:type=
"orderType"
:location=
"dataValue"
@
click=
"handleClick"
<OrderCell
@
action=
"handleClickCellButton"
>
</OrderCell>
:orderData=
"item"
:type=
"orderType"
:location=
"dataValue"
@
click=
"handleClick"
@
action=
"handleClickCellButton"
>
</OrderCell>
</view>
</view>
<view
class=
"load-more-view"
>
<view
class=
"load-more-view"
>
<u-loadmore
v-show=
"(pageNumber == 1 && loaded) || pageNumber > 1"
:status=
"loadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
<u-loadmore
v-show=
"(pageNumber == 1 && loaded) || pageNumber > 1"
:status=
"loadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
</view>
</view>
</
template
>
</
template
>
</scroll-view>
</scroll-view>
</view>
</view>
</TabBarPage>
</TabBarPage>
</template>
</template>
<
script
>
<
script
>
import
TabBarPage
from
"@/components/tabBarList/index.vue"
import
TabBarPage
from
'@/components/tabBarList/index.vue'
import
OrderCell
from
"@/components/order/index.vue"
import
OrderCell
from
'@/components/order/index.vue'
import
NoOrder
from
"@/components/order/noOrder.vue"
import
NoOrder
from
'@/components/order/noOrder.vue'
export
default
{
export
default
{
components
:
{
components
:
{
TabBarPage
,
TabBarPage
,
OrderCell
,
OrderCell
,
NoOrder
NoOrder
,
},
},
data
()
{
data
()
{
return
{
return
{
curNow
:
0
,
curNow
:
0
,
pageNumber
:
0
,
pageNumber
:
0
,
pageSize
:
20
,
pageSize
:
1000
,
// 因为要排序,暂时去掉分页
orderList
:
[],
orderList
:
[],
list
:
[{
list
:
[
{
name
:
'待预约'
,
name
:
'待预约'
,
total
:
0
,
total
:
0
,
},
},
...
@@ -78,7 +125,7 @@
...
@@ -78,7 +125,7 @@
{
{
name
:
'异常单'
,
name
:
'异常单'
,
total
:
0
,
total
:
0
,
}
},
],
],
current
:
0
,
current
:
0
,
loadStatus
:
'loading'
,
loadStatus
:
'loading'
,
...
@@ -88,9 +135,9 @@
...
@@ -88,9 +135,9 @@
_freshing
:
false
,
_freshing
:
false
,
scrollTop
:
0
,
scrollTop
:
0
,
old
:
{
old
:
{
scrollTop
:
0
scrollTop
:
0
,
},
}
}
};
},
},
computed
:
{
computed
:
{
subList
()
{
subList
()
{
...
@@ -108,12 +155,12 @@
...
@@ -108,12 +155,12 @@
},
},
types
()
{
types
()
{
return
{
return
{
'waitAppointment'
:
0
,
// 待预约、
waitAppointment
:
0
,
// 待预约、
'waitCheckIn'
:
1
,
// 待签到、
waitCheckIn
:
1
,
// 待签到、
'waitFinish'
:
2
,
// 待完工、
waitFinish
:
2
,
// 待完工、
'audit'
:
3
,
// 审核中、
audit
:
3
,
// 审核中、
'exception'
:
4
,
// 异常单、
exception
:
4
,
// 异常单、
'finish'
:
5
,
//已完工
finish
:
5
,
//已完工
}
}
},
},
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
...
@@ -124,23 +171,30 @@
...
@@ -124,23 +171,30 @@
2
:
'waitFinish'
,
2
:
'waitFinish'
,
3
:
'audit'
,
3
:
'audit'
,
4
:
'exception'
,
4
:
'exception'
,
5
:
'finish'
5
:
'finish'
,
}
}
},
},
countKeys
()
{
countKeys
()
{
return
[
'toAppointmentCount'
,
'toCheckinCount'
,
'toFinishCount'
,
'reviewingCount'
,
'exceptionCount'
]
return
[
'toAppointmentCount'
,
'toCheckinCount'
,
'toFinishCount'
,
'reviewingCount'
,
'exceptionCount'
,
]
},
},
noMore
()
{
noMore
()
{
return
this
.
orderList
.
length
==
0
&&
this
.
loaded
return
this
.
orderList
.
length
==
0
&&
this
.
loaded
},
},
noOrderCustomStyle
()
{
noOrderCustomStyle
()
{
return
this
.
curNow
==
0
?
'margin-top: 100rpx;background-color: #F4F5F7'
:
'margin-top: 200rpx;background-color: #F4F5F7'
return
this
.
curNow
==
0
}
?
'margin-top: 100rpx;background-color: #F4F5F7'
:
'margin-top: 200rpx;background-color: #F4F5F7'
},
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
getApp
().
trackPage
(
'订单首页'
)
getApp
().
trackPage
(
'订单首页'
)
this
.
_freshing
=
false
;
this
.
_freshing
=
false
if
(
e
&&
e
.
type
)
{
if
(
e
&&
e
.
type
)
{
this
.
current
=
e
.
type
this
.
current
=
e
.
type
}
}
...
@@ -150,12 +204,12 @@
...
@@ -150,12 +204,12 @@
},
},
methods
:
{
methods
:
{
sectionChange
(
index
)
{
sectionChange
(
index
)
{
this
.
curNow
=
index
;
this
.
curNow
=
index
this
.
reloadOrderList
()
this
.
reloadOrderList
()
},
},
// tab栏切换
// tab栏切换
change
(
index
)
{
change
(
index
)
{
this
.
current
=
index
;
this
.
current
=
index
this
.
reloadOrderList
()
this
.
reloadOrderList
()
},
},
...
@@ -175,9 +229,9 @@
...
@@ -175,9 +229,9 @@
pageNumber
:
this
.
pageNumber
,
pageNumber
:
this
.
pageNumber
,
pageSize
:
this
.
pageSize
,
pageSize
:
this
.
pageSize
,
keyword
:
''
,
keyword
:
''
,
type
:
this
.
indexStatus
[
index
]
type
:
this
.
indexStatus
[
index
],
}
}
var
self
=
this
;
var
self
=
this
self
.
$u
.
api
.
listOrder
(
param
).
then
((
res
)
=>
{
self
.
$u
.
api
.
listOrder
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
if
(
res
.
data
.
type
!=
self
.
orderType
)
return
if
(
res
.
data
.
type
!=
self
.
orderType
)
return
...
@@ -190,20 +244,26 @@
...
@@ -190,20 +244,26 @@
if
(
self
.
list
[
self
.
types
[
res
.
data
.
type
]])
{
if
(
self
.
list
[
self
.
types
[
res
.
data
.
type
]])
{
self
.
list
[
self
.
types
[
res
.
data
.
type
]].
total
=
res
.
data
.
total
self
.
list
[
self
.
types
[
res
.
data
.
type
]].
total
=
res
.
data
.
total
}
}
self
.
loadStatus
=
res
.
data
.
total
>
self
.
orderList
.
length
&&
res
.
data
.
list
.
length
==
self
.
pageSize
?
'loadmore'
:
'nomore'
self
.
orderList
.
sort
((
x
,
y
)
=>
{
return
x
.
currentOverTime
<=
y
.
currentOverTime
?
1
:
-
1
})
self
.
loadStatus
=
res
.
data
.
total
>
self
.
orderList
.
length
&&
res
.
data
.
list
.
length
==
self
.
pageSize
?
'loadmore'
:
'nomore'
}
}
}
else
{
}
else
{
console
.
log
(
res
.
message
,
"获取订单数量失败!"
);
console
.
log
(
res
.
message
,
'获取订单数量失败!'
)
}
}
self
.
$nextTick
(()
=>
{
self
.
$nextTick
(()
=>
{
if
(
self
.
_freshing
)
{
if
(
self
.
_freshing
)
{
self
.
triggered
=
false
;
self
.
triggered
=
false
self
.
_freshing
=
false
;
self
.
_freshing
=
false
}
}
})
})
this
.
loaded
=
true
this
.
loaded
=
true
});
})
},
},
// 获取订单数量
// 获取订单数量
...
@@ -225,61 +285,82 @@
...
@@ -225,61 +285,82 @@
if
(
count
>
0
)
{
if
(
count
>
0
)
{
uni
.
setTabBarBadge
({
uni
.
setTabBarBadge
({
index
:
1
,
index
:
1
,
text
:
String
(
count
)
text
:
String
(
count
),
})
})
}
else
{
}
else
{
uni
.
removeTabBarBadge
({
uni
.
removeTabBarBadge
({
index
:
1
index
:
1
,
})
})
}
}
}
}
}
else
{
}
else
{
console
.
log
(
res
.
message
,
"获取订单数量失败!"
);
console
.
log
(
res
.
message
,
'获取订单数量失败!'
)
}
}
});
})
},
},
handleClickCellButton
(
item
)
{
handleClickCellButton
(
item
)
{
// 去完工
// 去完工
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'pages/order/complete?orderId='
+
item
.
orderId
url
:
+
"&categoryId="
+
item
.
categoryId
'pages/order/complete?orderId='
+
+
"&orderServiceType="
+
item
.
orderServiceType
item
.
orderId
+
+
"&inGuaranteePeriod="
+
item
.
inGuaranteePeriod
'&categoryId='
+
+
"&partnerCompanyId="
+
item
.
partnerCompanyId
item
.
categoryId
+
+
"&auditResultsId="
+
(
item
.
auditResults
?
Object
.
keys
(
item
.
auditResults
)[
Object
.
keys
(
item
.
auditResults
).
length
-
1
]:
''
)
'&orderServiceType='
+
+
"&maintainStep="
+
item
.
maintainStep
item
.
orderServiceType
+
+
'&orderStatus='
+
item
.
orderStatus
'&inGuaranteePeriod='
+
+
'&brandId='
+
item
.
lianbaoBrandId
item
.
inGuaranteePeriod
+
'&partnerCompanyId='
+
item
.
partnerCompanyId
+
'&auditResultsId='
+
(
item
.
auditResults
?
Object
.
keys
(
item
.
auditResults
)[
Object
.
keys
(
item
.
auditResults
).
length
-
1
]
:
''
)
+
'&maintainStep='
+
item
.
maintainStep
+
'&orderStatus='
+
item
.
orderStatus
+
'&brandId='
+
item
.
lianbaoBrandId
,
})
})
},
},
handleClick
(
item
,
type
,
showCountTime
)
{
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
handleClick
(
item
,
type
,
showCountTime
)
{
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
item
.
orderId
+
'&type='
+
type
+
'&showCountTime='
+
showCountTime
url
:
'pages/order/detail?id='
+
item
.
orderId
+
'&type='
+
type
+
'&showCountTime='
+
showCountTime
,
})
})
},
},
handleClickSearch
()
{
handleClickSearch
()
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'pages/order/search'
url
:
'pages/order/search'
,
})
})
},
},
onRefresh
()
{
onRefresh
()
{
if
(
this
.
_freshing
)
return
;
if
(
this
.
_freshing
)
return
this
.
_freshing
=
true
;
this
.
_freshing
=
true
this
.
reloadOrderInfo
()
this
.
reloadOrderInfo
()
},
},
onRestore
()
{
onRestore
()
{
this
.
triggered
=
'restore'
;
// 需要重置
this
.
triggered
=
'restore'
// 需要重置
},
},
reloadOrderInfo
()
{
reloadOrderInfo
()
{
this
.
reloadOrderList
()
this
.
reloadOrderList
()
this
.
getOrderCount
();
this
.
getOrderCount
()
},
},
reloadOrderList
()
{
reloadOrderList
()
{
this
.
pageNumber
=
0
this
.
pageNumber
=
0
this
.
loadStatus
=
'loading'
this
.
loadStatus
=
'loading'
this
.
getOrderList
(
this
.
currentIndex
);
this
.
getOrderList
(
this
.
currentIndex
)
},
},
scroll
(
e
)
{
scroll
(
e
)
{
this
.
old
.
scrollTop
=
e
.
detail
.
scrollTop
this
.
old
.
scrollTop
=
e
.
detail
.
scrollTop
...
@@ -288,18 +369,18 @@
...
@@ -288,18 +369,18 @@
this
.
scrollTop
=
this
.
old
.
scrollTop
this
.
scrollTop
=
this
.
old
.
scrollTop
this
.
$nextTick
(
function
()
{
this
.
$nextTick
(
function
()
{
this
.
scrollTop
=
0
this
.
scrollTop
=
0
});
})
},
},
}
},
};
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.u-tabs-box
{
.u-tabs-box
{
margin-bottom
:
30rpx
;
margin-bottom
:
30rpx
;
}
}
.tab-view
{
.tab-view
{
height
:
100%
;
height
:
100%
;
overflow
:
auto
;
overflow
:
auto
;
// padding-bottom: 20rpx;
// padding-bottom: 20rpx;
...
@@ -314,9 +395,9 @@
...
@@ -314,9 +395,9 @@
margin-top
:
300rpx
;
margin-top
:
300rpx
;
position
:
absolute
;
position
:
absolute
;
}
}
}
}
.tools-box
{
.tools-box
{
display
:
flex
;
display
:
flex
;
flex-direction
:
row
;
flex-direction
:
row
;
justify-content
:
space-between
;
justify-content
:
space-between
;
...
@@ -350,5 +431,5 @@
...
@@ -350,5 +431,5 @@
font-size
:
26rpx
;
font-size
:
26rpx
;
}
}
}
}
}
}
</
style
>
</
style
>
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