Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a2315167
authored
Oct 08, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
11111
parent
0494273d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
6 deletions
src/store/modules/sample/index.js
src/views/sample/sample.vue
view/14.js
view/app.js
src/store/modules/sample/index.js
View file @
a2315167
...
@@ -19,7 +19,7 @@ const mutations = {
...
@@ -19,7 +19,7 @@ const mutations = {
},
},
goodList
(
state
,
payload
)
{
goodList
(
state
,
payload
)
{
let
arr
=
[];
let
arr
=
[];
for
(
let
k
in
payload
.
data
)
{
for
(
let
k
in
payload
.
data
)
{
arr
.
push
(
payload
.
data
[
k
])
arr
.
push
(
payload
.
data
[
k
])
}
}
state
.
goodList
=
state
.
goodList
.
concat
(
arr
)
state
.
goodList
=
state
.
goodList
.
concat
(
arr
)
...
@@ -33,7 +33,7 @@ const actions = {
...
@@ -33,7 +33,7 @@ const actions = {
let
data
=
res
.
data
;
let
data
=
res
.
data
;
if
(
data
.
err_code
==
0
)
{
if
(
data
.
err_code
==
0
)
{
commit
(
"classListM"
,
{
commit
(
"classListM"
,
{
data
:
data
.
data
,
data
:
data
.
data
||
[]
,
});
});
}
else
{
}
else
{
commit
(
"classListM"
,
{
commit
(
"classListM"
,
{
...
@@ -55,7 +55,7 @@ const actions = {
...
@@ -55,7 +55,7 @@ const actions = {
if
(
p
==
1
)
{
if
(
p
==
1
)
{
state
.
goodList
=
[];
state
.
goodList
=
[];
}
}
let
params
=
{
let
params
=
{
...
payload
.
data
,
...
payload
.
data
,
limit
:
10
,
limit
:
10
,
}
}
...
@@ -63,8 +63,12 @@ const actions = {
...
@@ -63,8 +63,12 @@ const actions = {
state
.
loading
=
false
;
state
.
loading
=
false
;
let
data
=
res
.
data
;
let
data
=
res
.
data
;
if
(
data
.
err_code
==
0
)
{
if
(
data
.
err_code
==
0
)
{
let
totalPage
=
Math
.
ceil
(
data
.
data
.
total
/
10
);
let
totalPage
=
0
;
if
(
p
==
totalPage
)
{
if
(
data
.
data
.
total
)
{
totalPage
=
Math
.
ceil
(
data
.
data
.
total
/
10
);
}
console
.
log
(
totalPage
)
if
(
p
==
totalPage
||
!
totalPage
)
{
state
.
finished
=
true
;
state
.
finished
=
true
;
}
}
if
(
data
.
data
.
total
)
{
if
(
data
.
data
.
total
)
{
...
...
src/views/sample/sample.vue
View file @
a2315167
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<span>
猎芯自营
</span>
<span>
猎芯自营
</span>
<font>
品现货 1片起订 3小时发货
</font>
<font>
品现货 1片起订 3小时发货
</font>
</div>
</div>
<div
class=
"nav"
>
<div
class=
"nav"
v-if=
"classList.length"
>
<van-tabs
<van-tabs
v-model=
"active"
v-model=
"active"
:color=
"color"
:color=
"color"
...
@@ -117,10 +117,12 @@ export default {
...
@@ -117,10 +117,12 @@ export default {
this
.
loadingYp
=
now
;
this
.
loadingYp
=
now
;
},
},
classList
(
now
)
{
classList
(
now
)
{
if
(
now
.
length
){
this
.
p
=
1
;
this
.
p
=
1
;
this
.
classId
=
now
[
0
].
id
;
this
.
classId
=
now
[
0
].
id
;
this
.
getGoodList
();
this
.
getGoodList
();
}
}
}
},
},
created
()
{
created
()
{
this
.
$store
.
dispatch
({
this
.
$store
.
dispatch
({
...
...
view/14.js
View file @
a2315167
This diff is collapsed.
Click to expand it.
view/app.js
View file @
a2315167
This diff is collapsed.
Click to expand it.
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