Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client-taro
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6c0dac39
authored
Nov 26, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化加载提示
parent
d65d1f52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
src/actions/asyncCounter.ts
+7
-0
src/pages/home/film/film_list/index.tsx
+6
-1
src/pages/home/film/schedule_add/components/films/index.tsx
+1
-7
No files found.
src/actions/asyncCounter.ts
View file @
6c0dac39
import
Taro
from
'@tarojs/taro'
import
api
from
'@/api/index'
import
{
setTempList
,
setDeviceList
,
setFilmData
,
setShopData
}
from
'./counter'
/** 获取 模板市场 数据列表 */
...
...
@@ -5,7 +6,9 @@ export function getTempList(page: number) {
return
async
(
dispatch
,
state
)
=>
{
const
oldState
=
state
().
counter
try
{
Taro
.
showLoading
({
title
:
'数据加载中'
})
let
{
list
,
count
}
=
await
api
.
common
.
getTempList
(
page
)
Taro
.
hideLoading
()
if
(
page
!==
1
&&
oldState
.
tempData
)
{
list
=
[...
oldState
.
tempData
.
list
,
...
list
]
}
...
...
@@ -21,7 +24,9 @@ export function getDeviceList(page: number, showTemplate: string = '') {
return
async
(
dispatch
,
state
)
=>
{
const
oldState
=
state
().
counter
try
{
Taro
.
showLoading
({
title
:
'数据加载中'
})
let
{
list
,
count
}
=
await
api
.
common
.
getMyFilmsList
(
page
,
showTemplate
)
Taro
.
hideLoading
()
if
(
page
!==
1
&&
oldState
.
deviceData
)
{
list
=
[...
oldState
.
deviceData
.
list
,
...
list
]
}
...
...
@@ -37,7 +42,9 @@ export function getFilmList(page: number) {
return
async
(
dispatch
,
state
)
=>
{
const
oldState
=
state
().
counter
try
{
Taro
.
showLoading
({
title
:
'数据加载中'
})
let
{
list
,
count
}
=
await
api
.
common
.
getMyDeviceList
(
page
)
Taro
.
hideLoading
()
if
(
page
!==
1
&&
oldState
.
filmData
)
{
list
=
[...
oldState
.
filmData
.
list
,
...
list
]
}
...
...
src/pages/home/film/film_list/index.tsx
View file @
6c0dac39
...
...
@@ -94,9 +94,14 @@ class Films extends Component {
{
showTemplate
:
value
},
()
=>
{
async
()
=>
{
Taro
.
showLoading
({
title
:
'数据加载中'
})
this
.
page
=
1
this
.
getData
()
let
time
=
setTimeout
(()
=>
{
Taro
.
hideLoading
()
clearTimeout
(
time
)
},
500
)
}
)
}
...
...
src/pages/home/film/schedule_add/components/films/index.tsx
View file @
6c0dac39
...
...
@@ -75,16 +75,10 @@ class Films extends Component {
async
componentWillMount
()
{
Taro
.
getStorage
({
key
:
'schedule-add-films'
})
.
then
(
res
=>
{
console
.
log
(
res
.
data
,
'schedule-add-films'
)
let
data
=
JSON
.
parse
(
res
.
data
)
let
arr
=
data
.
map
(
item
=>
{
return
item
.
filmId
})
// this.setState({
// oldFilms: data,
// oldArr: arr
// })
console
.
log
(
arr
,
data
)
this
.
setState
(
{
oldFilms
:
data
,
...
...
@@ -271,7 +265,7 @@ class Films extends Component {
checked=
{
checked
.
has
(
item
.
filmId
)
}
/>
<
View
className=
"films-bind-item-info"
>
<
FilmListItem
is
is
Choose=
{
true
}
key=
{
item
.
filmId
}
{
...
item
}
/>
<
FilmListItem
isChoose=
{
true
}
key=
{
item
.
filmId
}
{
...
item
}
/>
</
View
>
</
Label
>
</
View
>
...
...
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