|
@@ -4,17 +4,14 @@
|
|
|
<StoreHeaderCat ref="headercat" @sendGoodsName="sendGoodsName"/>
|
|
|
<div
|
|
|
class="sld_store_goods_list clearfix"
|
|
|
- :class="{ skeleton_sld_store_goods_list: firstLoading }"
|
|
|
>
|
|
|
<!-- 左侧分类 start -->
|
|
|
<div
|
|
|
+ v-loading="cat_wrap_loading"
|
|
|
class="left_cat_wrap"
|
|
|
- v-show="firstLoading ? true : storeData.cat.length"
|
|
|
>
|
|
|
<template
|
|
|
- v-for="(item, index) in firstLoading
|
|
|
- ? skeletonData.category
|
|
|
- : storeData.cat"
|
|
|
+ v-for="(item, index) in storeData.cat"
|
|
|
:key="index"
|
|
|
>
|
|
|
<dl
|
|
@@ -24,11 +21,12 @@
|
|
|
}"
|
|
|
>
|
|
|
<dt class="grade_one_cat">
|
|
|
- <router-link
|
|
|
+ <a
|
|
|
+ @click="(e) => { e.preventDefault(); clacRouteParams('/store/goods/'+ calcProductName(storeName) +'_v-'+ vid + '_c-' + item.innerLabelId, true)}"
|
|
|
:to="'/store/goods/'+ calcProductName(storeName) +'_v-'+ vid + '_c-' + item.innerLabelId"
|
|
|
>
|
|
|
{{ item.innerLabelName }}
|
|
|
- </router-link>
|
|
|
+ </a>
|
|
|
<i
|
|
|
v-if="item.children.length"
|
|
|
class="more"
|
|
@@ -41,13 +39,15 @@
|
|
|
!(item.openFlag != undefined && !item.openFlag)
|
|
|
"
|
|
|
>
|
|
|
- <router-link
|
|
|
+ <a
|
|
|
v-for="(item_child, index_child) in item.children"
|
|
|
:key="index_child"
|
|
|
+ @click="(e) => { e.preventDefault(); clacRouteParams('/store/goods/'+ calcProductName(storeName) +'_v-'+ vid + '_c-' + item_child.innerLabelId, true)}"
|
|
|
+
|
|
|
:to="'/store/goods/'+ calcProductName(storeName) +'_v-'+ vid + '_c-' + item_child.innerLabelId"
|
|
|
>
|
|
|
{{ item_child.innerLabelName }}
|
|
|
- </router-link>
|
|
|
+ </a>
|
|
|
</dd>
|
|
|
</dl>
|
|
|
</template>
|
|
@@ -56,6 +56,7 @@
|
|
|
|
|
|
<!-- 右侧商品 start -->
|
|
|
<div
|
|
|
+ v-loading="firstLoading"
|
|
|
:class="{
|
|
|
right_goods_wrap: true,
|
|
|
fr: storeData.cat.length,
|
|
@@ -142,7 +143,7 @@
|
|
|
</li>
|
|
|
</ul>
|
|
|
<!-- 分页 start -->
|
|
|
- <div class="flex_row_center_center sld_pagination">
|
|
|
+ <div class="flex_row_center_center sld_pagination" v-if="storeData.goods.list.length">
|
|
|
<el-pagination
|
|
|
@current-change="handleCurrentChange"
|
|
|
v-model:currentPage.sync="pagitionCurrent"
|
|
@@ -154,17 +155,19 @@
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
<!-- 分页 end -->
|
|
|
+
|
|
|
+ <!-- 空页面 start-->
|
|
|
+ <SldCommonEmpty
|
|
|
+ v-if="!firstLoading && !storeData.goods.list.length"
|
|
|
+ totalWidth="979"
|
|
|
+ totalHeight="700"
|
|
|
+ paddingTop="200"
|
|
|
+ />
|
|
|
+ <!-- 空页面 end-->
|
|
|
</div>
|
|
|
<!-- 右侧商品 end -->
|
|
|
|
|
|
- <!-- 空页面 start-->
|
|
|
- <SldCommonEmpty
|
|
|
- v-if="!firstLoading && !storeData.goods.list.length"
|
|
|
- totalWidth="979"
|
|
|
- totalHeight="700"
|
|
|
- paddingTop="200"
|
|
|
- />
|
|
|
- <!-- 空页面 end-->
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -181,6 +184,7 @@ const route = useRoute();
|
|
|
// const L = lang_zn;
|
|
|
const L = getCurLanguage();
|
|
|
const firstLoading = ref(true); //是否第一次加载
|
|
|
+const cat_wrap_loading = ref(true)
|
|
|
const router = useRouter();
|
|
|
const storeData = reactive({ cat: [], goods: { list: [], pagination: {} } }); //店铺数据,cat:店铺分类,goods:店铺商品列表
|
|
|
const sort = ref(0); //0:默认/综合;1、销量从高到底;3、价格从低到高;4、价格从高到低;5、人气从高到低
|
|
@@ -204,22 +208,25 @@ const sendGoodsName = (val) => {
|
|
|
storeName.value = val
|
|
|
}
|
|
|
|
|
|
-const clacRouteParams = () => {
|
|
|
- if (calcUrlPagination(route.path)) {
|
|
|
- currentPage.value = calcUrlPagination(route.path)
|
|
|
+
|
|
|
+const clacRouteParams = (path, noLoadCat) => {
|
|
|
+ firstLoading.value = true;
|
|
|
+ const usePath = path || route.path;
|
|
|
+ if (calcUrlPagination(usePath)) {
|
|
|
+ currentPage.value = calcUrlPagination(usePath)
|
|
|
}
|
|
|
- if (calcUrlShopId(route.path)) {
|
|
|
- vid.value = calcUrlShopId(route.path)
|
|
|
+ if (calcUrlShopId(usePath)) {
|
|
|
+ vid.value = calcUrlShopId(usePath)
|
|
|
}
|
|
|
- if (calcUrlCatId(route.path)) {
|
|
|
- categoryId.value = calcUrlCatId(route.path);
|
|
|
+ if (calcUrlCatId(usePath)) {
|
|
|
+ categoryId.value = calcUrlCatId(usePath);
|
|
|
}
|
|
|
- if (calcUrlKeywords(route.path)) {
|
|
|
- keyword.value = calcUrlKeywords(route.path);
|
|
|
+ if (calcUrlKeywords(usePath)) {
|
|
|
+ keyword.value = calcUrlKeywords(usePath);
|
|
|
}
|
|
|
- proxy.refs.headercat.setVid(calcUrlShopId(route.path));
|
|
|
+ !noLoadCat && proxy.refs.headercat.setVid(calcUrlShopId(usePath));
|
|
|
getStoreGoodsList();
|
|
|
- getStoreCatData();
|
|
|
+ !noLoadCat && getStoreCatData();
|
|
|
};
|
|
|
|
|
|
watch(
|
|
@@ -306,13 +313,17 @@ const initSkeletonData = () => {
|
|
|
};
|
|
|
|
|
|
//获取店铺分类数据
|
|
|
-const getStoreCatData = async () => {
|
|
|
+const getStoreCatData = async (_vid) => {
|
|
|
+ if (_vid) {
|
|
|
+ vid.value = _vid;
|
|
|
+ }
|
|
|
const { data: value } = await useFetchRaw(
|
|
|
apiUrl + "v3/seller/front/store/storeCategory?storeId=" + vid.value
|
|
|
);
|
|
|
const res = value._rawValue;
|
|
|
if (res.state == 200) {
|
|
|
storeData.cat = res.data;
|
|
|
+ cat_wrap_loading.value = false;
|
|
|
}
|
|
|
setSEO();
|
|
|
};
|