|
@@ -10,7 +10,7 @@
|
|
<view class="type-wrap">
|
|
<view class="type-wrap">
|
|
<up-scroll-list :indicator="typeList && typeList.length>5" indicatorColor="#FF770033" indicatorActiveColor="#FF7700" :indicatorWidth="30"
|
|
<up-scroll-list :indicator="typeList && typeList.length>5" indicatorColor="#FF770033" indicatorActiveColor="#FF7700" :indicatorWidth="30"
|
|
:indicatorBarWidth="15">
|
|
:indicatorBarWidth="15">
|
|
- <view class="item-type" :class="{'active': activeType === 0}" @click="handleSelectType(0)">
|
|
|
|
|
|
+ <view class="item-type" :class="{'active': activeType === '0'}" @click="handleSelectType('0')">
|
|
<image class="type-img" :src="`${config.BASIC_IMG}home/type-icon.png`" alt="" />
|
|
<image class="type-img" :src="`${config.BASIC_IMG}home/type-icon.png`" alt="" />
|
|
<view class="type-text">
|
|
<view class="type-text">
|
|
全部
|
|
全部
|
|
@@ -97,7 +97,7 @@
|
|
const typeSearch = ref(null)
|
|
const typeSearch = ref(null)
|
|
|
|
|
|
const filterIndex = ref(0)
|
|
const filterIndex = ref(0)
|
|
- const activeType = ref(0)
|
|
|
|
|
|
+ const activeType = ref('0')
|
|
const orderType = ref(true)
|
|
const orderType = ref(true)
|
|
|
|
|
|
const discoverData = ref([])
|
|
const discoverData = ref([])
|
|
@@ -120,16 +120,16 @@
|
|
onShow(() => {
|
|
onShow(() => {
|
|
const selectedType = uni.getStorageSync('selectedCategoryType');
|
|
const selectedType = uni.getStorageSync('selectedCategoryType');
|
|
if (selectedType) {
|
|
if (selectedType) {
|
|
- activeType.value = selectedType
|
|
|
|
- uni.setStorageSync('selectedCategoryType', 0);
|
|
|
|
- handleSelectType(selectedType||0)
|
|
|
|
|
|
+ uni.setStorageSync('selectedCategoryType', null);
|
|
|
|
+ handleSelectType(selectedType)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- console.log('onMounted')
|
|
|
|
getTypeList()
|
|
getTypeList()
|
|
- getGoodsList()
|
|
|
|
|
|
+ if (activeType.value === '0') {
|
|
|
|
+ getGoodsList()
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
@@ -162,7 +162,7 @@
|
|
function handleSelectType(id) {
|
|
function handleSelectType(id) {
|
|
activeType.value = id
|
|
activeType.value = id
|
|
let params = {}
|
|
let params = {}
|
|
- if (id) {
|
|
|
|
|
|
+ if (id!=='0') {
|
|
params = {
|
|
params = {
|
|
categoryId: id
|
|
categoryId: id
|
|
}
|
|
}
|
|
@@ -282,7 +282,7 @@
|
|
|
|
|
|
.discover-content {
|
|
.discover-content {
|
|
padding: 0rpx 24rpx 24rpx;
|
|
padding: 0rpx 24rpx 24rpx;
|
|
- height: calc(100% - 320rpx);
|
|
|
|
|
|
+ height: calc(100% - 338rpx);
|
|
overflow: auto;
|
|
overflow: auto;
|
|
background: #F2F3F5;
|
|
background: #F2F3F5;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|