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