修复bug
This commit is contained in:
parent
a32e9b8741
commit
1393b1d3a9
|
@ -1,9 +1,9 @@
|
||||||
let BASE_URL
|
let BASE_URL
|
||||||
import store from "@/store/user.js"
|
import store from "@/store/user.js"
|
||||||
// 环境
|
// 环境
|
||||||
let env = "dev"
|
// let env = "dev"
|
||||||
// let env = "test"
|
// let env = "test"
|
||||||
// let env = "prod"
|
let env = "prod"
|
||||||
// let env = "local"
|
// let env = "local"
|
||||||
|
|
||||||
switch (env) {
|
switch (env) {
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='headScoll' ref='headscroll' :style="{height:isScroll?'0':'200rpx'}">
|
<view class='headScoll' ref='headscroll' :style="{height:isScroll?'0':'200rpx'}">
|
||||||
<scroll-view class="head-view" scroll-x @scrolltolower="getgoodClassList()">
|
<scroll-view class="head-view" scroll-x @scrolltolower="getgoodClassList(0)">
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item" :class="{'item-active': topActive===item.id}"
|
<view class="item" :class="{'item-active': topActive===item.id}"
|
||||||
v-for="(item, index) in goodClassList" :key="index" @click="changeOne(item, index)">
|
v-for="(item, index) in goodClassList" :key="index" @click="changeOne(item, index)">
|
||||||
|
@ -311,6 +311,7 @@
|
||||||
page_size: 30
|
page_size: 30
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (pid == 0) { // 加载一级分类时设置全部分类
|
if (pid == 0) { // 加载一级分类时设置全部分类
|
||||||
|
if(!res.data?.lists?.length) return ;
|
||||||
res.data?.lists?.unshift({
|
res.data?.lists?.unshift({
|
||||||
id: "",
|
id: "",
|
||||||
name: "全部",
|
name: "全部",
|
||||||
|
@ -336,7 +337,7 @@
|
||||||
return item;
|
return item;
|
||||||
})
|
})
|
||||||
// 给所有子级分配
|
// 给所有子级分配
|
||||||
goodClassList.value = res.data?.lists || [];
|
goodClassList.value = [...goodClassList.value, ...res.data?.lists];
|
||||||
goodClassTow.value = goodClassList.value[0]?.children || [];
|
goodClassTow.value = goodClassList.value[0]?.children || [];
|
||||||
goodClassThree.value = goodClassTow.value[0]?.children || [];
|
goodClassThree.value = goodClassTow.value[0]?.children || [];
|
||||||
topActive.value = goodClassList.value[0]?.id;
|
topActive.value = goodClassList.value[0]?.id;
|
||||||
|
@ -426,7 +427,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getgoodClassList();
|
getgoodClassList(0);
|
||||||
getGoodList();
|
getGoodList();
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue