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
488c1baf
Commit
488c1baf
authored
Apr 26, 2021
by
刘用法
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工单列表
parent
9ebfd832
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
69 deletions
+40
-69
http.interceptor.js
src/common/http.interceptor.js
+8
-8
index.vue
src/pages/index/index.vue
+4
-3
index.vue
src/pages/order/index.vue
+28
-58
No files found.
src/common/http.interceptor.js
View file @
488c1baf
...
...
@@ -58,14 +58,14 @@ const install = (Vue, vm) => {
return
config
;
}
function
getCode
(
res
){
const
result
=
res
.
data
||
res
let
code
if
(
result
.
hasOwnProperty
(
'statusCode'
)){
code
=
res
.
statusCode
}
else
if
(
result
.
hasOwnProperty
(
'code'
)){
code
=
result
.
code
}
return
code
//
const result = res.data || res
//
let code
//
if(result.hasOwnProperty('statusCode')){
//
code = res.statusCode
//
}else if(result.hasOwnProperty('code')){
//
code = result.code
//
}
return
res
.
statusCode
||
res
.
code
||
res
.
data
.
statusCode
||
res
.
data
.
code
}
function
getMsg
(
res
){
res
=
res
.
data
||
res
...
...
src/pages/index/index.vue
View file @
488c1baf
...
...
@@ -162,7 +162,9 @@
}
};
await
app
.
getBaseInfo
(
self
,
callBack
);
this
.
orderList
=
[]
this
.
messageList
=
[]
// 加载消息列表
self
.
loadMessageList
();
self
.
loadOrderList
();
...
...
@@ -184,7 +186,6 @@
},
loadOrderList
()
{
console
.
log
(
'-----------准备加载推荐列表-----------'
)
return
let
self
=
this
;
// 加载订单列表
self
.
search
.
token
=
self
.
vuex_token
;
...
...
@@ -192,7 +193,7 @@
uni
.
stopPullDownRefresh
()
// 结束下拉刷新
if
(
res
.
code
==
200
)
{
if
(
res
.
data
&&
res
.
data
.
length
>
0
)
{
self
.
orderList
.
push
(
).
apply
(
res
.
data
);
self
.
orderList
.
push
(
...
res
.
data
);
}
}
else
{
console
.
log
(
res
.
message
,
"初始化订单列表异常"
);
...
...
src/pages/order/index.vue
View file @
488c1baf
...
...
@@ -13,24 +13,23 @@
</view>
</view>
<view
class=
"u-tabs-box"
v-show=
"curNow == 0"
>
<u-tabs
-swiper
activeColor=
"#2272FF"
bg-color=
"none"
inactive-color=
"#999"
bar-height=
"4"
bar-width=
"44"
:offset=
"[-1,10]"
ref=
"tabs"
:list=
"list"
count=
"total"
:current=
"current"
@
change=
"change"
:is-scroll=
"false"
swiperWidth=
"750"
></u-tabs-swiper
>
<u-tabs
activeColor=
"#2272FF"
bg-color=
"none"
inactive-color=
"#999"
bar-height=
"4"
bar-width=
"44"
:offset=
"[-1,10]"
:list=
"list"
count=
"total"
:current=
"current"
@
change=
"change"
:is-scroll=
"false"
></u-tabs
>
</view>
<swiper
class=
"swiper-box"
:current=
"swiperCurrent"
@
transition=
"transition"
@
animationfinish=
"animationfinish"
>
<swiper-item
class=
"swiper-item"
v-for=
"(res, ind) in orderList"
:key=
"ind"
>
<!--
<swiper
class=
"swiper-box"
:current=
"swiperCurrent"
@
transition=
"transition"
@
animationfinish=
"animationfinish"
>
-->
<!--
<swiper-item
class=
"swiper-item"
v-for=
"(res, ind) in orderList"
:key=
"ind"
>
-->
<scroll-view
scroll-y
style=
"height: 100%;width: 100%;"
@
scrolltolower=
"reachBottom"
scroll-anchoring
>
<view
class=
"page-box"
>
<view
v-for=
"(item, index) in
res
"
:key=
"item.orderId"
>
<view
v-for=
"(item, index) in
orderList
"
:key=
"item.orderId"
>
<OrderCell
:orderData=
"item"
:orderType=
"orderType"
:location=
"dataValue"
@
click=
"handleClick(item)"
@
action=
"handleAction(item)"
>
</OrderCell>
</view>
<u-loadmore
:status=
"loadStatus
[ind]
"
bgColor=
"#F4F5F7"
></u-loadmore>
<u-loadmore
:status=
"loadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
</view>
</scroll-view>
</swiper-item>
</swiper>
<!--
</swiper-item>
</swiper>
-->
<!--
</view>
-->
</TabBarPage>
...
...
@@ -48,8 +47,6 @@
return
{
showSview
:
true
,
curNow
:
0
,
timestamp
:
1000
,
triggered
:
false
,
pageNumber
:
0
,
pageSize
:
10
,
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
...
...
@@ -61,8 +58,7 @@
4
:
'exception'
,
5
:
'finish'
},
orderList
:
[[],[],[],[],[],[]],
dataList
:
[],
orderList
:
[],
list
:
[{
name
:
'待预约'
,
total
:
0
,
...
...
@@ -85,12 +81,8 @@
}
],
current
:
0
,
swiperCurrent
:
0
,
tabsHeight
:
0
,
dx
:
0
,
loadStatus
:
[
'loading'
,
'loading'
,
'loading'
,
'loading'
,
'loading'
,
'loading'
],
loadStatus
:
'loading'
,
dataValue
:
[],
total
:
0
};
},
onLoad
()
{
...
...
@@ -107,22 +99,23 @@
return
this
.
currentIndex
+
1
},
currentIndex
()
{
return
this
.
curNow
==
0
?
this
.
swiperC
urrent
:
5
return
this
.
curNow
==
0
?
this
.
c
urrent
:
5
}
},
methods
:
{
sectionChange
(
index
)
{
this
.
curNow
=
index
;
this
.
pageNumber
=
0
if
(
index
===
1
)
{
this
.
showSview
=
false
// 加载已完工的数据
this
.
getOrderList
(
5
)
}
else
{
this
.
showSview
=
true
// 加载已完工的数据
this
.
getOrderList
(
0
)
}
this
.
pageNumber
=
0
this
.
orderList
=
[]
this
.
loadStatus
=
'loading'
this
.
getOrderList
(
index
===
0
?
0
:
5
)
},
// tab栏切换
change
(
index
)
{
this
.
current
=
index
;
this
.
orderList
=
[]
this
.
loadStatus
=
'loading'
this
.
getOrderList
(
index
);
},
/**
* 获取当前位置的经纬度
...
...
@@ -145,10 +138,8 @@
},
reachBottom
(
e
)
{
console
.
log
(
e
)
console
.
log
(
this
.
loadStatus
[
this
.
currentIndex
])
if
(
this
.
loadStatus
[
this
.
currentIndex
]
!=
'loadmore'
)
return
this
.
loadStatus
[
this
.
currentIndex
]
==
'loading'
if
(
this
.
loadStatus
!=
'loadmore'
)
return
this
.
loadStatus
==
'loading'
this
.
getOrderList
(
this
.
currentIndex
)
},
// 页面数据
...
...
@@ -196,11 +187,11 @@
...
res
.
data
.
list
,...
res
.
data
.
list
,...
res
.
data
.
list
,...
res
.
data
.
list
,...
res
.
data
.
list
,...
res
.
data
.
list
]
/*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/
// 后台需要返回order
_t
ype,防止数据返回延迟期间点击了其他的tab
// 后台需要返回order
T
ype,防止数据返回延迟期间点击了其他的tab
if
(
res
.
data
)
{
self
.
orderList
[
res
.
data
.
orderType
]
.
push
(...
res
.
data
.
list
)
self
.
orderList
.
push
(...
res
.
data
.
list
)
self
.
list
[
res
.
data
.
orderType
].
total
=
res
.
data
.
total
self
.
loadStatus
[
res
.
data
.
orderType
]
=
res
.
data
.
total
>
self
.
orderList
[
res
.
data
.
orderType
]
.
length
?
'loadmore'
:
'nomore'
self
.
loadStatus
=
res
.
data
.
total
>
self
.
orderList
.
length
?
'loadmore'
:
'nomore'
}
}
else
{
console
.
log
(
res
.
message
,
"获取订单数量失败!"
);
...
...
@@ -235,27 +226,6 @@
}
});
},
// tab栏切换
change
(
index
)
{
this
.
swiperCurrent
=
index
;
this
.
getOrderList
(
index
);
},
transition
({
detail
:
{
dx
}
})
{
this
.
$refs
.
tabs
.
setDx
(
dx
);
},
animationfinish
({
detail
:
{
current
}
})
{
this
.
$refs
.
tabs
.
setFinishCurrent
(
current
);
this
.
swiperCurrent
=
current
;
this
.
current
=
current
;
},
viewOderItem
(
orderId
)
{
// 跳转工单详情页面
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
orderId
...
...
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