Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
Overview
Details
Activity
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
fengzhaoyu
schedule
Commits
395df0c4
Commit
395df0c4
authored
Apr 22, 2020
by
xiexiaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:首页添加刷新
parent
7dcbc113
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
13 deletions
+60
-13
login.js
api/login.js
+0
-1
xFetch.js
api/xFetch.js
+2
-3
app.acss
app.acss
+11
-0
index.acss
pages/index/index.acss
+2
-0
index.axml
pages/index/index.axml
+2
-1
index.js
pages/index/index.js
+18
-8
index.acss
template/refresh/index.acss
+18
-0
index.axml
template/refresh/index.axml
+7
-0
No files found.
api/login.js
View file @
395df0c4
...
...
@@ -51,7 +51,6 @@ export default async function login() {
async
function
waitLockRelease
(
retry
)
{
for
(
let
i
=
0
;
i
<
retry
;
i
++
)
{
if
(
lock
==
false
)
{
console
.
log
(
i
);
return
;
}
await
sleep
(
100
);
...
...
api/xFetch.js
View file @
395df0c4
...
...
@@ -14,17 +14,16 @@ export default function xFetch({ url, method, data, type }) {
method
:
method
,
dataType
:
"json"
,
data
:
data
,
// timeout: 28
0,
timeout
:
1000
0
,
success
:
function
(
res
)
{
if
(
res
.
data
.
code
==
0
)
{
resolve
(
res
);
}
else
{
rejects
(
res
);
rejects
(
{
...
res
.
data
,
refresh
:
true
}
);
dd
.
alert
({
content
:
res
.
data
.
msg
||
"请求数据异常"
,
buttonText
:
"确定"
});
}
},
fail
:
function
(
err
)
{
...
...
app.acss
View file @
395df0c4
...
...
@@ -11,3 +11,13 @@ view {
.addPaddingBottom {
padding-bottom: 68rpx;
}
.btn {
font-size: 32rpx;
height: 72rpx;
line-height: 72rpx;
border-radius: 48rpx;
text-align: center;
color: #fff;
background: rgba(234, 12, 40, 1);
}
\ No newline at end of file
pages/index/index.acss
View file @
395df0c4
@import "../../template/loading/loading.acss";
@import "../../template/affairBlank/index.acss";
@import "../../template/fullScreen/fullScreen.acss";
@import "../../template/refresh/index.acss";
.dynamicBox {
width: 100%;
overflow: hidden;
...
...
@@ -100,6 +101,7 @@
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.scroll-lock {
...
...
pages/index/index.axml
View file @
395df0c4
<import src="../../template/loading/loading.axml"/>
<import src="../../template/fullScreen/fullScreen.axml"/>
<view a:if='{{refresh}}' onTap="onLoad">连接超时,请重试,刷新按钮</view>
<import src="../../template/refresh/index.axml"/>
<template is="refresh" a:if='{{refresh}}' ></template>
<block a:else>
<view hidden="{{$data.tabBarIndex === '1'}}">
<import src="../../template/affairBlank/index.axml"/>
...
...
pages/index/index.js
View file @
395df0c4
...
...
@@ -85,12 +85,16 @@ create.Page({
this
.
update
();
}
},
onLoad
(
event
)
{
if
(
JSON
.
stringify
(
event
)
!=
"{}"
)
{
refresh
()
{
this
.
onLoad
()
},
onLoad
(
query
)
{
console
.
log
(
query
);
if
(
query
&&
JSON
.
stringify
(
query
)
!==
'{}'
)
{
this
.
setData
({
listLoading
:
false
});
const
scheduleItem
=
JSON
.
parse
(
Object
.
keys
(
event
)[
0
].
split
(
"="
)[
1
]);
const
scheduleItem
=
JSON
.
parse
(
Object
.
keys
(
query
)[
0
].
split
(
"="
)[
1
]);
dd
.
navigateTo
({
url
:
`./../meetingDetail/meetingDetail?scheduleItem=
${
encodeURIComponent
(
JSON
.
stringify
(
scheduleItem
)
...
...
@@ -184,11 +188,11 @@ create.Page({
callBack
();
}
}).
catch
(
err
=>
{
//
if (err && err.refresh) {
//
this.setData({
//
refresh: true
//
})
//
}
if
(
err
&&
err
.
refresh
)
{
this
.
setData
({
refresh
:
true
})
}
});
},
//动态置顶
...
...
@@ -290,6 +294,12 @@ create.Page({
endTime
:
"2025-12-30 23:59:59"
}).
then
(
res
=>
{
this
.
getScheduleList
(
res
.
data
.
data
);
}).
catch
(
err
=>
{
if
(
err
&&
err
.
refresh
)
{
this
.
setData
({
refresh
:
true
})
}
});
},
//生成DateMap值
...
...
template/refresh/index.acss
0 → 100644
View file @
395df0c4
.refresh-bg {
position: fixed;
left: 0;
top: 0;
background: #FFFFFF;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.refresh-btn {
padding: 0 48rpx;
margin-top: 32rpx;
}
\ No newline at end of file
template/refresh/index.axml
0 → 100644
View file @
395df0c4
<template name="refresh">
<view class="refresh-bg">
<view>您的网络好像不给力,请重试</view>
<button class="btn refresh-btn" onTap="refresh">刷新</button>
</view>
</template>
\ No newline at end of file
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