|
@@ -3,18 +3,12 @@
|
|
|
<div class="container">
|
|
|
<el-row class="mt2rem" :gutter="20">
|
|
|
<el-col :span="4">
|
|
|
- <mymenu></mymenu>
|
|
|
+ <category />
|
|
|
</el-col>
|
|
|
<el-col :span="14">
|
|
|
- <el-carousel class="bannerD marquee" :autoplay="false">
|
|
|
- <el-carousel-item>
|
|
|
- <img class="banner" src="@assets/lunbo1.png" att />
|
|
|
- </el-carousel-item>
|
|
|
- <el-carousel-item>
|
|
|
- <img class="banner" src="@assets/lunbo2.png" att />
|
|
|
- </el-carousel-item>
|
|
|
- <el-carousel-item>
|
|
|
- <img class="banner" src="@assets/lunbo3.png" att />
|
|
|
+ <el-carousel class="bannerD marquee">
|
|
|
+ <el-carousel-item v-for="x in 3" :key="`banner${x}`">
|
|
|
+ <img class="banner" :src="require(`@assets/lunbo${x}.png`)" />
|
|
|
</el-carousel-item>
|
|
|
</el-carousel>
|
|
|
</el-col>
|
|
@@ -22,15 +16,11 @@
|
|
|
<div class="loginDiv">
|
|
|
<div class="txDiv">
|
|
|
<img
|
|
|
- v-if="loginAccount == ''"
|
|
|
- src="@assets/touxiang01.png"
|
|
|
- alt=""
|
|
|
+ :src="require(`@assets/touxiang0${userName ? '2' : '1'}.png`)"
|
|
|
/>
|
|
|
- <img v-else src="@assets/touxiang02.png" alt="" />
|
|
|
</div>
|
|
|
- <div class="username" v-if="loginAccount == ''">您还未登录哦!</div>
|
|
|
- <div class="username" v-else>{{ loginAccount }}</div>
|
|
|
- <div class="btnDiv" v-if="loginAccount == ''">
|
|
|
+ <div class="username">{{ userName || "您还未登录哦!" }}</div>
|
|
|
+ <div class="btnDiv" v-if="!userName">
|
|
|
<router-link to="/login">
|
|
|
<el-button class="leftBtn">登录</el-button>
|
|
|
</router-link>
|
|
@@ -48,11 +38,7 @@
|
|
|
></span>
|
|
|
</router-link>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="notice"
|
|
|
- v-for="item in noticeListTzgg"
|
|
|
- :key="item.noticeId"
|
|
|
- >
|
|
|
+ <div class="notice" v-for="item in notices[0]" :key="item.noticeId">
|
|
|
<router-link :to="`/news/newsDetail?noticeId=${item.noticeId}`">
|
|
|
{{ item.noticeTitle }}
|
|
|
</router-link>
|
|
@@ -119,7 +105,7 @@
|
|
|
<router-link
|
|
|
:to="`/shop/${item.companyId}/${item.id}`"
|
|
|
class="product"
|
|
|
- v-for="item in hotlistArr"
|
|
|
+ v-for="item in products"
|
|
|
:key="item.id"
|
|
|
>
|
|
|
<div class="rmspItem">
|
|
@@ -152,21 +138,27 @@
|
|
|
<div class="partTitle"><span class="orangeLine"></span>需求供应</div>
|
|
|
<el-row :gutter="20" class="xqgy">
|
|
|
<el-col :span="4">
|
|
|
- <mymenu></mymenu>
|
|
|
+ <category />
|
|
|
</el-col>
|
|
|
- <el-col :span="10">
|
|
|
+ <el-col :span="10" v-for="(info, index) in infos" :key="`info${index}`">
|
|
|
<div class="xqDiv">
|
|
|
<div class="xqTitle">
|
|
|
- <img src="@assets/xuqiu.png" alt />需求
|
|
|
- <router-link to="/info?active=demand">
|
|
|
+ <img
|
|
|
+ :src="
|
|
|
+ require(`@assets/${index ? 'gongyingshang' : 'xuqiu'}.png`)
|
|
|
+ "
|
|
|
+ alt
|
|
|
+ />{{ index ? "供应商" : "需求" }}
|
|
|
+ <router-link :to="`/info?active=${index ? 'supply' : 'demand'}`">
|
|
|
<span class="more"
|
|
|
>more<i class="el-icon-d-arrow-right"></i
|
|
|
></span>
|
|
|
</router-link>
|
|
|
</div>
|
|
|
+
|
|
|
<router-link
|
|
|
:to="`/info/buyDetail?id=${item.id}`"
|
|
|
- v-for="item in demandList"
|
|
|
+ v-for="item in info"
|
|
|
:key="item.id"
|
|
|
>
|
|
|
<div class="xq">
|
|
@@ -176,95 +168,41 @@
|
|
|
</router-link>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
- <el-col :span="10">
|
|
|
- <div class="xqDiv">
|
|
|
- <div class="xqTitle">
|
|
|
- <img src="@assets/gongyingshang.png" alt />供应商
|
|
|
- <router-link to="/info?active=supply">
|
|
|
- <span class="more"
|
|
|
- >more<i class="el-icon-d-arrow-right"></i
|
|
|
- ></span>
|
|
|
- </router-link>
|
|
|
- </div>
|
|
|
- <router-link
|
|
|
- :to="`/info/supplyDetail?id=${item.id}`"
|
|
|
- v-for="item in supplyList"
|
|
|
- :key="item.id"
|
|
|
- >
|
|
|
- <div class="xq">
|
|
|
- <div class="con">【供应】{{ item.supplyTitle }}</div>
|
|
|
- <div class="date">{{ item.releaseTime }}</div>
|
|
|
- </div>
|
|
|
- </router-link>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
</el-row>
|
|
|
<!-- 广告位 -->
|
|
|
<div class="ggzw bg-88 mt2rem">智能家具保险柜广告占位</div>
|
|
|
<el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col
|
|
|
+ :span="12"
|
|
|
+ v-for="([item, ...items], index) in notices.slice(1)"
|
|
|
+ :key="`notices${index}`"
|
|
|
+ >
|
|
|
<div class="partTitle">
|
|
|
- <span class="orangeLine"></span>行业资讯
|
|
|
+ <span class="orangeLine"></span
|
|
|
+ >{{ index ? "家具保养" : "行业资讯" }}
|
|
|
<router-link to="/news?active=second">
|
|
|
<span class="more"
|
|
|
>more<i class="el-icon-d-arrow-right"></i
|
|
|
></span>
|
|
|
</router-link>
|
|
|
</div>
|
|
|
- <div class="hyzxDiv">
|
|
|
- <router-link
|
|
|
- :to="`/news/newsDetail?noticeId=${hyzxFirst.noticeId}`"
|
|
|
- >
|
|
|
- <div class="topDiv">
|
|
|
- <div class="leftDiv">
|
|
|
- <div>
|
|
|
- <img :src="hyzxFirst.fmzFileUrl" alt />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="rightDiv">
|
|
|
- <div class="title">{{ hyzxFirst.noticeTitle }}</div>
|
|
|
- <div class="content" v-html="hyzxFirst.noticeContent"></div>
|
|
|
- <div class="date">{{ hyzxFirst.createTime }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </router-link>
|
|
|
- <ul class="bottomUl">
|
|
|
- <li v-for="item in hyzxOther" :key="item.noticeId">
|
|
|
- <router-link :to="`/news/newsDetail?noticeId=${item.noticeId}`">
|
|
|
- {{ item.noticeTitle }}
|
|
|
- </router-link>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <div class="partTitle">
|
|
|
- <span class="orangeLine"></span>家具保养
|
|
|
- <router-link to="/news?active=third">
|
|
|
- <span class="more"
|
|
|
- >more<i class="el-icon-d-arrow-right"></i
|
|
|
- ></span>
|
|
|
- </router-link>
|
|
|
- </div>
|
|
|
- <div class="hyzxDiv">
|
|
|
- <router-link
|
|
|
- :to="`/news/newsDetail?noticeId=${jjbyFirst.noticeId}`"
|
|
|
- >
|
|
|
+ <div class="hyzxDiv" v-if="item">
|
|
|
+ <router-link :to="`/news/newsDetail?noticeId=${item.noticeId}`">
|
|
|
<div class="topDiv">
|
|
|
<div class="leftDiv">
|
|
|
<div>
|
|
|
- <img :src="hyzxFirst.fmzFileUrl" alt />
|
|
|
+ <img :src="`${$basePath}${item.fmzFileUrl}`" alt />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="rightDiv">
|
|
|
- <div class="title">{{ jjbyFirst.noticeTitle }}</div>
|
|
|
- <div class="content" v-html="jjbyFirst.noticeContent"></div>
|
|
|
- <div class="date">{{ jjbyFirst.createTime }}</div>
|
|
|
+ <div class="title">{{ item.noticeTitle }}</div>
|
|
|
+ <div class="content" v-html="item.noticeContent"></div>
|
|
|
+ <div class="date">{{ item.createTime }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</router-link>
|
|
|
<ul class="bottomUl">
|
|
|
- <li v-for="item in hyzxOther" :key="item.noticeId">
|
|
|
+ <li v-for="item in items" :key="item.noticeId">
|
|
|
<router-link :to="`/news/newsDetail?noticeId=${item.noticeId}`">
|
|
|
{{ item.noticeTitle }}
|
|
|
</router-link>
|
|
@@ -276,107 +214,38 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-<script>
|
|
|
-import { Component, Vue } from "vue-property-decorator";
|
|
|
-import mymenu from "@/components/menu.vue";
|
|
|
-export default {
|
|
|
- name: "app",
|
|
|
- components: {
|
|
|
- mymenu
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- shangpin: [],
|
|
|
- demandList: [],
|
|
|
- supplyList: [],
|
|
|
- noticeListTzgg: [],
|
|
|
- noticeListHyzx: [],
|
|
|
- hyzxFirst: {},
|
|
|
- hyzxOther: [],
|
|
|
- noticeListJjby: [],
|
|
|
- jjbyFirst: {},
|
|
|
- jjbyOther: [],
|
|
|
- loginAccount: "",
|
|
|
- hotlistArr: []
|
|
|
- };
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 通知公告前5条 liuqiwen
|
|
|
- noticeList(noticeType) {
|
|
|
- var that = this;
|
|
|
- that
|
|
|
- .$post("/interface/notice/getNoticeListTop5", {
|
|
|
- noticeType: noticeType
|
|
|
- })
|
|
|
- .then(function(res) {
|
|
|
- if (!res[0]) {
|
|
|
- for (let i = 0; i < res[1].list.length; i++) {
|
|
|
- res[1].list[i].fmzFileUrl =
|
|
|
- that.$basePath + res[1].list[i].fmzFileUrl;
|
|
|
- }
|
|
|
- if (noticeType == 1) {
|
|
|
- that.noticeListTzgg = res[1].list;
|
|
|
- } else if (noticeType == 2) {
|
|
|
- that.noticeListHyzx = res[1].list;
|
|
|
- that.hyzxFirst = that.noticeListHyzx[0];
|
|
|
- that.hyzxOther = that.noticeListHyzx.splice(1, 4);
|
|
|
- } else {
|
|
|
- that.noticeListJjby = res[1].list;
|
|
|
- that.jjbyFirst = that.noticeListJjby[0];
|
|
|
- that.jjbyOther = that.noticeListJjby.splice(1, 4);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 需求信息前十条数据 liuqiwen
|
|
|
- demandInfoTenList() {
|
|
|
- var that = this;
|
|
|
- that.$post("/demand/info/getDemandInfoTenList").then(function(res) {
|
|
|
- console.log(res);
|
|
|
- if (!res[0]) {
|
|
|
- that.demandList = res[1].demandList;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 供应信息前10条 liuqiwen
|
|
|
- supplyInfoTenLsit() {
|
|
|
- var that = this;
|
|
|
- that.$post("/supply/info/getSupplyInfoTenLsit").then(function(res) {
|
|
|
- console.log(res);
|
|
|
- if (!res[0]) {
|
|
|
- that.supplyList = res[1].supplyList;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 热门商品 liuqiwen
|
|
|
- hotlist() {
|
|
|
- var that = this;
|
|
|
- that.$post("/goods/info/hotlist").then(function(res) {
|
|
|
- console.log(res);
|
|
|
- if (!res[0]) {
|
|
|
- for (let i = 0; i < res[1].list.length; i++) {
|
|
|
- res[1].list[i].cover = that.$basePath + res[1].list[i].cover;
|
|
|
- }
|
|
|
- that.hotlistArr = res[1].list;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- activated() {
|
|
|
- if (this.$store.state.user.UserInfo) {
|
|
|
- this.loginAccount = this.$store.state.user.UserInfo.loginAccount;
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.noticeList(1);
|
|
|
- this.noticeList(2);
|
|
|
- this.noticeList(3);
|
|
|
- this.demandInfoTenList();
|
|
|
- this.supplyInfoTenLsit();
|
|
|
- this.hotlist();
|
|
|
+<script lang="ts">
|
|
|
+import { Component, Vue, Watch, Prop } from "vue-property-decorator";
|
|
|
+import user from "@/store/modules/user";
|
|
|
+@Component
|
|
|
+export default class extends Vue {
|
|
|
+ private notices: IAny[] = [];
|
|
|
+ private infos: IAny[] = [];
|
|
|
+ private products: IAny[] = [];
|
|
|
+ get userName() {
|
|
|
+ return user.UserInfo && user.UserInfo.loginAccount;
|
|
|
}
|
|
|
-};
|
|
|
+ async created() {
|
|
|
+ const [
|
|
|
+ [, { list: p }],
|
|
|
+ [, { demandList: d }],
|
|
|
+ [, { supplyList: s }],
|
|
|
+ ...n
|
|
|
+ ] = await Promise.all([
|
|
|
+ this.$post("/goods/info/hotlist"),
|
|
|
+ this.$post("/demand/info/getDemandInfoTenList"),
|
|
|
+ this.$post("/supply/info/getSupplyInfoTenLsit"),
|
|
|
+ this.$post("/interface/notice/getNoticeListTop5", { noticeType: 1 }),
|
|
|
+ this.$post("/interface/notice/getNoticeListTop5", { noticeType: 2 }),
|
|
|
+ this.$post("/interface/notice/getNoticeListTop5", { noticeType: 3 })
|
|
|
+ ]);
|
|
|
+ this.products = p;
|
|
|
+ this.infos = [d, s];
|
|
|
+ this.notices = n.map(([, { list }]) => list);
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
+
|
|
|
<style lang="scss" scoped>
|
|
|
.bannerD {
|
|
|
height: 39rem;
|
|
@@ -714,7 +583,4 @@ export default {
|
|
|
.mt15px {
|
|
|
margin-top: 1.5rem;
|
|
|
}
|
|
|
-.mt2rem {
|
|
|
- margin-top: 2rem;
|
|
|
-}
|
|
|
</style>
|