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
f27f2ce8
Commit
f27f2ce8
authored
Apr 28, 2021
by
刘用法
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单徽标和下拉刷新
parent
ab1f0f76
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
96 additions
and
33 deletions
+96
-33
pages.json
src/pages.json
+8
-8
index.vue
src/pages/index/index.vue
+26
-1
index.vue
src/pages/order/index.vue
+62
-24
dingdan-0@3x.png
src/static/tab/dingdan-0@3x.png
+0
-0
dingdan-1@3x.png
src/static/tab/dingdan-1@3x.png
+0
-0
shouye-1@3x.png
src/static/tab/shouye-1@3x.png
+0
-0
wode-0@3x.png
src/static/tab/wode-0@3x.png
+0
-0
xuexi-0@3x.png
src/static/tab/xuexi-0@3x.png
+0
-0
xuexi-1@3x.png
src/static/tab/xuexi-1@3x.png
+0
-0
No files found.
src/pages.json
View file @
f27f2ce8
...
@@ -282,26 +282,26 @@
...
@@ -282,26 +282,26 @@
"list"
:
[
"list"
:
[
{
{
"pagePath"
:
"pages/index/index"
,
"pagePath"
:
"pages/index/index"
,
"iconPath"
:
"static/
logo
.png"
,
"iconPath"
:
"static/
tab/shouye-1@3x
.png"
,
"selectedIconPath"
:
"static/
logo
.png"
,
"selectedIconPath"
:
"static/
tab/shouye-1@3x
.png"
,
"text"
:
"首页"
"text"
:
"首页"
},
},
{
{
"pagePath"
:
"pages/order/index"
,
"pagePath"
:
"pages/order/index"
,
"iconPath"
:
"static/
logo
.png"
,
"iconPath"
:
"static/
tab/dingdan-0@3x
.png"
,
"selectedIconPath"
:
"static/
logo
.png"
,
"selectedIconPath"
:
"static/
tab/dingdan-1@3x
.png"
,
"text"
:
"订单"
"text"
:
"订单"
},
},
{
{
"pagePath"
:
"pages/learn/index"
,
"pagePath"
:
"pages/learn/index"
,
"iconPath"
:
"static/
logo
.png"
,
"iconPath"
:
"static/
tab/xuexi-0@3x
.png"
,
"selectedIconPath"
:
"static/
logo
.png"
,
"selectedIconPath"
:
"static/
tab/xuexi-1@3x
.png"
,
"text"
:
"学习"
"text"
:
"学习"
},
},
{
{
"pagePath"
:
"pages/mine/index"
,
"pagePath"
:
"pages/mine/index"
,
"iconPath"
:
"static/
logo
.png"
,
"iconPath"
:
"static/
tab/wode-0@3x
.png"
,
"selectedIconPath"
:
"static/
logo
.png"
,
"selectedIconPath"
:
"static/
tab/wode-0@3x
.png"
,
"text"
:
"我的"
"text"
:
"我的"
}
}
]
]
...
...
src/pages/index/index.vue
View file @
f27f2ce8
...
@@ -125,7 +125,9 @@
...
@@ -125,7 +125,9 @@
return
process
.
uniEnv
.
qn_base_url
+
'weiruzhu.png'
return
process
.
uniEnv
.
qn_base_url
+
'weiruzhu.png'
},
},
},
},
onLoad
()
{},
onLoad
()
{
this
.
getOrderCount
()
},
onShow
()
{
onShow
()
{
// 每次进入页面都刷新入驻状态
// 每次进入页面都刷新入驻状态
if
(
this
.
vuex_token
)
{
if
(
this
.
vuex_token
)
{
...
@@ -274,6 +276,29 @@
...
@@ -274,6 +276,29 @@
});
});
}
}
},
},
// 获取订单数量
getOrderCount
()
{
var
self
=
this
;
// 加载订单列表
self
.
$u
.
api
.
listOrderCount
().
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
"==="
,
res
.
data
)
if
(
res
.
data
)
{
var
count
=
0
for
(
var
i
in
res
.
data
)
{
count
+=
res
.
data
[
i
]
}
// 修改tab总数
uni
.
setTabBarBadge
({
index
:
1
,
text
:
String
(
count
)
})
}
}
else
{
console
.
log
(
res
.
message
,
"获取订单数量失败!"
);
}
});
},
},
},
};
};
</
script
>
</
script
>
...
...
src/pages/order/index.vue
View file @
f27f2ce8
...
@@ -18,16 +18,21 @@
...
@@ -18,16 +18,21 @@
bar-width=
"44"
:offset=
"[0,0]"
:list=
"list"
count=
"total"
:current=
"current"
@
change=
"change"
bar-width=
"44"
:offset=
"[0,0]"
:list=
"list"
count=
"total"
:current=
"current"
@
change=
"change"
:is-scroll=
"false"
font-size=
"28"
bold
></u-tabs>
:is-scroll=
"false"
font-size=
"28"
bold
></u-tabs>
</view>
</view>
<NoOrder
v-if=
"noMore"
customStyle=
"margin-top: 100rpx;background-color: #F4F5F7"
/>
<view
v-else
class=
"tab-view"
>
<view
class=
"tab-view"
>
<!--
<swiper-item
class=
"swiper-item"
v-for=
"(res, ind) in orderList"
:key=
"ind"
>
-->
<!--
<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
>
<scroll-view
scroll-y
style=
"height: 100%;width: 100%;"
@
scrolltolower=
"reachBottom"
scroll-anchoring
<view
v-for=
"(item, index) in orderList"
:key=
"item.orderId"
>
scroll-y=
"true"
refresher-enabled=
"true"
:refresher-triggered=
"triggered"
:refresher-threshold=
"100"
<OrderCell
:orderData=
"item"
:type=
"orderType"
:location=
"dataValue"
@
click=
"handleClick(item)"
refresher-background=
"#F4F5F7"
@
refresherpulling=
"triggered = true"
@
refresherrefresh=
"onRefresh"
@
action=
"handleAction(item)"
>
</OrderCell>
@
refresherrestore=
"onRestore"
@
refresherabort=
"onAbort"
>
</view>
<NoOrder
v-if=
"noMore"
customStyle=
"margin-top: 100rpx;background-color: #F4F5F7"
/>
<u-loadmore
:status=
"loadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
<template
v-else
>
<view
v-for=
"(item, index) in orderList"
:key=
"item.orderId"
>
<OrderCell
:orderData=
"item"
:type=
"orderType"
:location=
"dataValue"
@
click=
"handleClick(item)"
@
action=
"handleAction(item)"
>
</OrderCell>
</view>
<u-loadmore
:status=
"loadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
</
template
>
</scroll-view>
</scroll-view>
<!-- </swiper-item> -->
<!-- </swiper-item> -->
</view>
</view>
...
@@ -80,16 +85,19 @@
...
@@ -80,16 +85,19 @@
current
:
0
,
current
:
0
,
loadStatus
:
'loading'
,
loadStatus
:
'loading'
,
dataValue
:
[],
dataValue
:
[],
loaded
:
false
loaded
:
false
,
triggered
:
false
,
_freshing
:
false
,
};
};
},
},
onLoad
()
{
onLoad
()
{
this
.
_freshing
=
false
;
this
.
getLocation
();
this
.
getLocation
();
// this.getOrderCount();
// this.getOrderCount();
this
.
getOrderList
(
0
);
this
.
getOrderList
(
0
);
},
},
onShow
()
{
onShow
()
{
this
.
getOrderCount
()
this
.
getOrderCount
()
},
},
computed
:
{
computed
:
{
subList
()
{
subList
()
{
...
@@ -137,7 +145,7 @@
...
@@ -137,7 +145,7 @@
this
.
pageNumber
=
0
this
.
pageNumber
=
0
this
.
orderList
=
[]
this
.
orderList
=
[]
this
.
loadStatus
=
'loading'
this
.
loadStatus
=
'loading'
this
.
getOrderList
(
index
===
0
?
this
.
currentIndex
:
5
)
this
.
getOrderList
(
this
.
currentIndex
)
},
},
// tab栏切换
// tab栏切换
change
(
index
)
{
change
(
index
)
{
...
@@ -190,7 +198,7 @@
...
@@ -190,7 +198,7 @@
/*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
/*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
res
.
data
.
type
=
self
.
orderType
res
.
data
.
type
=
self
.
orderType
if
(
res
.
data
.
list
)
{
if
(
res
.
data
.
list
)
{
if
(
res
.
data
.
list
.
length
==
0
&&
res
.
data
.
total
>
0
)
{
if
(
res
.
data
.
list
.
length
==
0
&&
res
.
data
.
total
>
0
)
{
res
.
data
.
total
=
15
res
.
data
.
total
=
15
res
.
data
.
list
=
[{
res
.
data
.
list
=
[{
orderServiceType
:
'安装'
,
// 服务类型:安装、维修
orderServiceType
:
'安装'
,
// 服务类型:安装、维修
...
@@ -210,12 +218,13 @@
...
@@ -210,12 +218,13 @@
submissionTime
:
'2021.04.19 16:24:48'
,
// 提交时间
submissionTime
:
'2021.04.19 16:24:48'
,
// 提交时间
auditResults
:
{},
// 审核结果
auditResults
:
{},
// 审核结果
orderBusinessType
:
'R'
,
// 业务类型 R 为抢单
orderBusinessType
:
'R'
,
// 业务类型 R 为抢单
orderId
:
'1100000216'
orderId
:
'1100000216'
}]
}]
res
.
data
.
list
=
[...
res
.
data
.
list
,
...
res
.
data
.
list
,
...
res
.
data
.
list
,
...
res
.
data
res
.
data
.
list
=
[...
res
.
data
.
list
,
...
res
.
data
.
list
,
...
res
.
data
.
list
,
...
res
.
data
.
list
,
.
list
,
...
res
.
data
.
list
,
...
res
.
data
.
list
,
...
res
.
data
.
list
,
...
res
.
data
.
list
,
...
res
...
res
.
data
.
list
,
...
res
.
data
.
list
,
...
res
.
data
.
list
,
...
res
.
data
.
list
,
...
.
data
.
list
,
...
res
.
data
.
list
res
.
data
.
list
,
...
res
.
data
.
list
]
]
}
}
}
}
...
@@ -223,6 +232,8 @@
...
@@ -223,6 +232,8 @@
// 后台需要返回type,防止数据返回延迟期间点击了其他的tab
// 后台需要返回type,防止数据返回延迟期间点击了其他的tab
if
(
res
.
data
.
type
!=
self
.
orderType
)
return
if
(
res
.
data
.
type
!=
self
.
orderType
)
return
self
.
triggered
=
false
;
self
.
_freshing
=
false
;
if
(
res
.
data
.
list
)
{
if
(
res
.
data
.
list
)
{
self
.
orderList
.
push
(...
res
.
data
.
list
)
self
.
orderList
.
push
(...
res
.
data
.
list
)
if
(
self
.
list
[
self
.
types
[
res
.
data
.
type
]])
{
if
(
self
.
list
[
self
.
types
[
res
.
data
.
type
]])
{
...
@@ -245,6 +256,7 @@
...
@@ -245,6 +256,7 @@
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
console
.
log
(
"==="
,
res
.
data
)
console
.
log
(
"==="
,
res
.
data
)
if
(
res
.
data
)
{
if
(
res
.
data
)
{
var
count
=
0
self
.
list
.
forEach
(
item
=>
{
self
.
list
.
forEach
(
item
=>
{
if
(
item
.
name
===
'待预约'
)
{
if
(
item
.
name
===
'待预约'
)
{
item
.
count
=
res
.
data
.
toAppointmentCount
item
.
count
=
res
.
data
.
toAppointmentCount
...
@@ -258,9 +270,16 @@
...
@@ -258,9 +270,16 @@
item
.
count
=
res
.
data
.
exceptionCount
item
.
count
=
res
.
data
.
exceptionCount
}
}
})
})
}
var
count
=
0
// 修改tab总数
for
(
var
i
in
res
.
data
)
{
// ...
count
+=
res
.
data
[
i
]
}
// 修改tab总数
uni
.
setTabBarBadge
({
index
:
1
,
text
:
String
(
count
)
})
}
}
else
{
}
else
{
console
.
log
(
res
.
message
,
"获取订单数量失败!"
);
console
.
log
(
res
.
message
,
"获取订单数量失败!"
);
}
}
...
@@ -283,6 +302,25 @@
...
@@ -283,6 +302,25 @@
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'pages/order/search'
url
:
'pages/order/search'
})
})
},
onPulling
(
e
)
{
console
.
log
(
"onpulling"
,
e
);
},
onRefresh
()
{
if
(
this
.
_freshing
)
return
;
this
.
_freshing
=
true
;
this
.
pageNumber
=
0
this
.
orderList
=
[]
this
.
loadStatus
=
'loading'
this
.
getOrderCount
();
this
.
getOrderList
(
this
.
currentIndex
);
},
onRestore
()
{
this
.
triggered
=
'restore'
;
// 需要重置
console
.
log
(
"onRestore"
);
},
onAbort
()
{
console
.
log
(
"onAbort"
);
}
}
}
}
};
};
...
...
src/static/tab/dingdan-0@3x.png
0 → 100644
View file @
f27f2ce8
2.21 KB
src/static/tab/dingdan-1@3x.png
0 → 100644
View file @
f27f2ce8
1.46 KB
src/static/tab/shouye-1@3x.png
0 → 100644
View file @
f27f2ce8
1.77 KB
src/static/tab/wode-0@3x.png
0 → 100644
View file @
f27f2ce8
4.17 KB
src/static/tab/xuexi-0@3x.png
0 → 100644
View file @
f27f2ce8
3.75 KB
src/static/tab/xuexi-1@3x.png
0 → 100644
View file @
f27f2ce8
3.22 KB
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