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
8d439199
authored
Oct 21, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix listPage bug
parent
40b09ef1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
src/actions/asyncCounter.ts
+25
-10
No files found.
src/actions/asyncCounter.ts
View file @
8d439199
import
api
from
'@/api/index'
import
{
setTempList
,
setDeviceList
,
setFilmData
,
setShopData
}
from
'./counter'
/** 获取 模板市场 数据列表 */
export
function
getTempList
(
page
:
number
)
{
return
async
dsipatch
=>
{
return
async
(
dispatch
,
state
)
=>
{
const
oldState
=
state
().
counter
try
{
const
{
list
,
count
}
=
await
api
.
common
.
getTempList
(
page
)
dsipatch
(
setTempList
(
list
,
count
))
let
{
list
,
count
}
=
await
api
.
common
.
getTempList
(
page
)
if
(
page
!==
1
&&
oldState
.
tempData
)
{
list
=
[...
oldState
.
tempData
.
list
,
...
list
]
}
dispatch
(
setTempList
(
list
,
count
))
}
catch
(
error
)
{
console
.
error
(
error
)
}
...
...
@@ -15,9 +18,13 @@ export function getTempList(page: number) {
/** 获取我的视片列表 */
export
function
getDeviceList
(
page
:
number
)
{
return
async
dispatch
=>
{
return
async
(
dispatch
,
state
)
=>
{
const
oldState
=
state
().
counter
try
{
const
{
list
,
count
}
=
await
api
.
common
.
getMyFilmsList
(
page
)
let
{
list
,
count
}
=
await
api
.
common
.
getMyFilmsList
(
page
)
if
(
page
!==
1
&&
oldState
.
deviceData
)
{
list
=
[...
oldState
.
deviceData
.
list
,
...
list
]
}
dispatch
(
setDeviceList
(
list
,
count
))
}
catch
(
error
)
{
console
.
error
(
error
)
...
...
@@ -27,9 +34,13 @@ export function getDeviceList(page: number) {
/** 获取我的设备数据 */
export
function
getFilmList
(
page
:
number
)
{
return
async
dispatch
=>
{
return
async
(
dispatch
,
state
)
=>
{
const
oldState
=
state
().
counter
try
{
const
{
list
,
count
}
=
await
api
.
common
.
getMyDeviceList
(
page
)
let
{
list
,
count
}
=
await
api
.
common
.
getMyDeviceList
(
page
)
if
(
page
!==
1
&&
oldState
.
filmData
)
{
list
=
[...
oldState
.
filmData
.
list
,
...
list
]
}
dispatch
(
setFilmData
(
list
,
count
))
}
catch
(
error
)
{
console
.
error
(
error
)
...
...
@@ -38,9 +49,13 @@ export function getFilmList(page: number) {
}
/** 获取商城设备数据 */
export
function
getShopDeviceList
(
page
:
number
)
{
return
async
dispatch
=>
{
return
async
(
dispatch
,
state
)
=>
{
const
oldState
=
state
().
counter
try
{
const
{
list
,
count
}
=
await
api
.
common
.
getShopDeviceList
(
page
)
let
{
list
,
count
}
=
await
api
.
common
.
getShopDeviceList
(
page
)
if
(
page
!==
1
&&
oldState
.
shopData
)
{
list
=
[...
oldState
.
shopData
.
list
,
...
list
]
}
dispatch
(
setShopData
(
list
,
count
))
}
catch
(
error
)
{
console
.
error
(
error
)
...
...
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