Commit a2315167 by 施宇

11111

parent 0494273d
......@@ -19,7 +19,7 @@ const mutations = {
},
goodList(state, payload) {
let arr = [];
for(let k in payload.data){
for (let k in payload.data) {
arr.push(payload.data[k])
}
state.goodList = state.goodList.concat(arr)
......@@ -33,7 +33,7 @@ const actions = {
let data = res.data;
if (data.err_code == 0) {
commit("classListM", {
data: data.data,
data: data.data || [],
});
} else {
commit("classListM", {
......@@ -55,7 +55,7 @@ const actions = {
if (p == 1) {
state.goodList = [];
}
let params ={
let params = {
...payload.data,
limit: 10,
}
......@@ -63,8 +63,12 @@ const actions = {
state.loading = false;
let data = res.data;
if (data.err_code == 0) {
let totalPage = Math.ceil(data.data.total / 10);
if (p == totalPage) {
let totalPage = 0;
if (data.data.total) {
totalPage = Math.ceil(data.data.total / 10);
}
console.log(totalPage)
if (p == totalPage || !totalPage) {
state.finished = true;
}
if (data.data.total) {
......
......@@ -7,7 +7,7 @@
<span>猎芯自营</span>
<font>品现货 1片起订 3小时发货</font>
</div>
<div class="nav">
<div class="nav" v-if="classList.length">
<van-tabs
v-model="active"
:color="color"
......@@ -117,10 +117,12 @@ export default {
this.loadingYp = now;
},
classList(now) {
if(now.length){
this.p = 1;
this.classId = now[0].id;
this.getGoodList();
}
}
},
created() {
this.$store.dispatch({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment