|
@@ -310,29 +310,40 @@
|
|
|
<!--open 市场分类-->
|
|
|
<div class="index_head_btn_box">
|
|
|
<div class="index_head_btn index_head_btn_only">
|
|
|
- <a class="index_head_a" href="" title="">市场分类</a>
|
|
|
+ <span class="index_head_a">市场分类</span>
|
|
|
</div>
|
|
|
+ <!-- 长度最多可以放8个 -->
|
|
|
<div class="index_head_right_btn_box">
|
|
|
- <a class="index_2_head_right_a" href="" title="">农产商家</a>
|
|
|
- <a class="index_2_head_right_a" href="" title="">市场信息</a>
|
|
|
- <a class="index_2_head_right_a" href="" title="">书刊音像</a>
|
|
|
- <a class="index_2_head_right_a" href="" title="">生活用品</a>
|
|
|
+ <a class="index_2_head_right_a" v-for="(item, index) in navigation.slice(0, 8)" :key="index"
|
|
|
+ :href="getLinkPath(item)" :title="item.alias">
|
|
|
+ {{ item.alias }}
|
|
|
+ </a>
|
|
|
</div>
|
|
|
<div class="index_head_btn_right_box">
|
|
|
- <a class="index_head_btn_right_a" href="" title="">发布信息</a>
|
|
|
+ <span class="index_head_btn_right_a" @click="goAddShop">发布信息</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="index_4_in clearfix">
|
|
|
<div class="index_4_img_box back100">
|
|
|
</div>
|
|
|
<div class="index_4_ol clearfix">
|
|
|
- <div class="index_4_ol_li" v-for="(per_obj, per_index) in 10" :key="per_obj">
|
|
|
+ <div class="index_4_ol_li" v-for="(item, index) in navigation" :key="index">
|
|
|
<div class="index_4_ol_li_head clearfix">
|
|
|
- <a class="index_4_ol_li_head_a dot1" href="" title="">粮油茶糖</a>
|
|
|
+ <a class="index_4_ol_li_head_a dot1" :href="getLinkPath(item)" :title="item.alias">
|
|
|
+ {{ item.alias }}
|
|
|
+ </a>
|
|
|
</div>
|
|
|
<div class="index_4_ol_in clearfix">
|
|
|
- <a class="index_4_ol_in_li_a dot1" href="" title="" v-for="(per_obj, per_index) in 6"
|
|
|
- :key="per_obj">粮油茶糖粮</a>
|
|
|
+ <a class="index_4_ol_in_li_a dot1"
|
|
|
+ :href="`${item.aLIas_pinyin}/${item1.aLIas_pinyin}/list-1.html`"
|
|
|
+ :title="item1.alias" v-for="(item1, index1) in item.children.slice(0, 5)"
|
|
|
+ :key="index1">
|
|
|
+ {{ item1.alias }}
|
|
|
+ </a>
|
|
|
+ <a class="index_4_ol_in_li_a dot1" :href="getLinkPath(item)" :title="item.alias"
|
|
|
+ v-if="item.children.length > 5">
|
|
|
+ 更多 >
|
|
|
+ </a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -646,6 +657,9 @@
|
|
|
//0.加载页面必备组件 start---------------------------------------->
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
+import { getToken } from '@/store/useCookieStore'
|
|
|
+//获得全局url
|
|
|
+const { $BwebUrl, $CwebUrl } = useNuxtApp();
|
|
|
//0.加载页面必备组件 end---------------------------------------->
|
|
|
|
|
|
//1.获取头条新闻 start---------------------------------------->
|
|
@@ -680,6 +694,15 @@ async function getModelData1() {
|
|
|
}
|
|
|
getModelData1()
|
|
|
|
|
|
+// 1.2 跳转
|
|
|
+let goAddShop = () => {
|
|
|
+ if (getToken()) {
|
|
|
+ window.open($BwebUrl + '/#/addGood', '_blank');
|
|
|
+ } else {
|
|
|
+ ElMessage.error('请先登录!')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//1.3 今日热点
|
|
|
const hotNewsList = ref("")
|
|
|
async function getModelData3() {
|
|
@@ -702,6 +725,24 @@ async function getModelData3() {
|
|
|
}
|
|
|
}
|
|
|
getModelData3()
|
|
|
+
|
|
|
+// 1.4 获取商城导航菜单
|
|
|
+const navigation = ref([]);
|
|
|
+async function getNavigation() {
|
|
|
+ const mkdata = await requestDataPromise('/web/getWebsiteModelCategory', {
|
|
|
+ method: 'GET',
|
|
|
+ query: {
|
|
|
+ 'pid': 0,
|
|
|
+ 'num': 12,
|
|
|
+ 'placeid': 13,
|
|
|
+ 'type': 1,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ console.log("获取商城导航菜单", mkdata.data);
|
|
|
+
|
|
|
+ navigation.value = mkdata.data;
|
|
|
+}
|
|
|
+getNavigation();
|
|
|
//1.获取头条新闻 end---------------------------------------->
|
|
|
|
|
|
//2.选项卡 start---------------------------------------->
|