mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:13:26 +08:00
Merge branch 'dev' into 'master'
uniapp【修复】:首页商品tab组,默认没有显示数据问题 See merge request jianweie/coreshoppro!101
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
<template #goodPrice>
|
||||
<view class="price-msg" v-if="goodsState.column == 1" @click="hanldeClickGoods(item)">
|
||||
<view class="tag-box">
|
||||
<view class="tag tag-buy">已售{{ item.buyCount+item.initialSales }}{{ item.unit }}</view>
|
||||
<view class="tag tag-buy">已售{{ item.buyCount+item.initialSales }}{{ item.unit }}
|
||||
</view>
|
||||
<view class="tag tag-view">{{ item.viewCount }}人访问</view>
|
||||
</view>
|
||||
<view class="price-box">
|
||||
@@ -46,7 +47,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, watch } from 'vue';
|
||||
import { reactive, watchEffect } from 'vue';
|
||||
import Point from '../home-goods/point.vue';
|
||||
import { handleRouteNavigateTo, splitArrayByStep } from '@/core/utils';
|
||||
|
||||
@@ -64,7 +65,12 @@
|
||||
column: 1,
|
||||
})
|
||||
|
||||
watch(() => props.data.list[0], () => {
|
||||
const hanlderChangeTab = (e : any) => {
|
||||
goodsState.column = e.column;
|
||||
goodsState.goodsList = splitArrayByStep(e.list.slice(0, e.limit), e.column);
|
||||
}
|
||||
|
||||
watchEffect(() => {
|
||||
hanlderChangeTab(props.data.list?.[0]);
|
||||
})
|
||||
|
||||
@@ -92,11 +98,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
const hanlderChangeTab = (e : any) => {
|
||||
goodsState.column = e.column;
|
||||
goodsState.goodsList = splitArrayByStep(e.list.slice(0, e.limit), e.column);
|
||||
}
|
||||
|
||||
const hanldeClickGoods = (data : any) => {
|
||||
handleRouteNavigateTo(`/pages/goods/detail?id=${data?.id}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user