|
@@ -21,7 +21,12 @@
|
|
|
<div class="header__body">
|
|
|
<div class="container clearfix">
|
|
|
<a class="logo">
|
|
|
- <h1></h1>
|
|
|
+ <img
|
|
|
+ v-if="header.companyLogo"
|
|
|
+ :src="$tools.splitImgHost(header.companyLogo)"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <h1 v-else></h1>
|
|
|
</a>
|
|
|
<div class="search">
|
|
|
<div class="search__select">
|
|
@@ -35,9 +40,11 @@
|
|
|
</div>
|
|
|
<div class="search__btn">搜索</div>
|
|
|
</div>
|
|
|
- <div class="contact">
|
|
|
- <div class="contact__phone">020-87085982</div>
|
|
|
- <div class="contact__time">周一至周日 8:00-22:30</div>
|
|
|
+ <div class="contact" v-if="header.serviceTel.status == 1">
|
|
|
+ <div class="contact__phone">{{ header.serviceTel.tel }}</div>
|
|
|
+ <div class="contact__time">
|
|
|
+ 周一至周日 {{ header.serviceTel.time }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -46,15 +53,33 @@
|
|
|
<section class="section">
|
|
|
<div class="container">
|
|
|
<div class="tabs">
|
|
|
- <a class="tab active">首页</a>
|
|
|
- <a
|
|
|
- class="tab"
|
|
|
- target="view_window"
|
|
|
- href="https://www.xyyxt.net/abount"
|
|
|
- >走进祥粤</a
|
|
|
- >
|
|
|
- <a class="tab" @click="go('/course-list')">课程</a>
|
|
|
- <a class="tab" @click="go('/bank-list')">题库</a>
|
|
|
+ <template v-for="(item, index) in showNav(header.Nav)">
|
|
|
+ <a v-if="item.name === '首页'" :key="index" class="tab active"
|
|
|
+ >首页</a
|
|
|
+ >
|
|
|
+ <a
|
|
|
+ v-if="item.name === '走进祥粤'"
|
|
|
+ :key="index"
|
|
|
+ class="tab"
|
|
|
+ target="view_window"
|
|
|
+ href="https://www.xyyxt.net/abount"
|
|
|
+ >走进祥粤</a
|
|
|
+ >
|
|
|
+ <a
|
|
|
+ v-if="item.name === '课程'"
|
|
|
+ :key="index"
|
|
|
+ class="tab"
|
|
|
+ @click="go('/course-list')"
|
|
|
+ >课程</a
|
|
|
+ >
|
|
|
+ <a
|
|
|
+ v-if="item.name === '题库'"
|
|
|
+ :key="index"
|
|
|
+ class="tab"
|
|
|
+ @click="go('/bank-list')"
|
|
|
+ >题库</a
|
|
|
+ >
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="swiper-wrap" :style="{ background: color }">
|
|
@@ -224,25 +249,38 @@
|
|
|
<div class="course__header">
|
|
|
<div class="title">推荐课程</div>
|
|
|
<div class="tabs">
|
|
|
- <div class="tab active">二级建造师</div>
|
|
|
- <div class="tab">七大员新考</div>
|
|
|
- <div class="tab">一级建造师</div>
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in goodsList1"
|
|
|
+ :key="index"
|
|
|
+ class="tab"
|
|
|
+ :class="active1 === index ? 'active' : ''"
|
|
|
+ @click="active1 = index"
|
|
|
+ >
|
|
|
+ {{ item.projectName + " - " + item.businessName }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="course__body">
|
|
|
<ul class="list clearfix">
|
|
|
- <li class="course-item" v-for="(item, index) in 8" :key="index">
|
|
|
- <div class="course-item__img">
|
|
|
- <div class="note">2022</div>
|
|
|
- </div>
|
|
|
- <div class="course-item__title">
|
|
|
- 2022年二建建设工程法规及相关知识(黄金基础班)
|
|
|
- </div>
|
|
|
- <div class="course-item__desc">
|
|
|
- <div class="price">¥100</div>
|
|
|
- <a class="add">加购物车</a>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
+ <template v-for="(item, index) in goodsList1[active1].goodsList">
|
|
|
+ <li class="course-item" v-if="index < 8" :key="index">
|
|
|
+ <div class="course-item__img">
|
|
|
+ <div class="note" v-if="item.year">{{ item.year }}</div>
|
|
|
+ <img
|
|
|
+ v-if="item.coverUrl"
|
|
|
+ :src="$tools.splitImgHost(item.coverUrl)"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="course-item__title">
|
|
|
+ {{ item.goodsName }}
|
|
|
+ </div>
|
|
|
+ <div class="course-item__desc">
|
|
|
+ <div class="price">¥{{ item.standPrice }}</div>
|
|
|
+ <a class="add">加购物车</a>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </template>
|
|
|
</ul>
|
|
|
</div>
|
|
|
|
|
@@ -257,25 +295,38 @@
|
|
|
<div class="bank__header">
|
|
|
<div class="title">推荐课程</div>
|
|
|
<div class="tabs">
|
|
|
- <div class="tab active">二级建造师</div>
|
|
|
- <div class="tab">七大员新考</div>
|
|
|
- <div class="tab">一级建造师</div>
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in goodsList2"
|
|
|
+ :key="index"
|
|
|
+ class="tab"
|
|
|
+ :class="active2 === index ? 'active' : ''"
|
|
|
+ @click="active2 = index"
|
|
|
+ >
|
|
|
+ {{ item.projectName + " - " + item.businessName }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="bank__body">
|
|
|
<ul class="list clearfix">
|
|
|
- <li class="bank-item" v-for="(item, index) in 8" :key="index">
|
|
|
- <div class="bank-item__img">
|
|
|
- <div class="note">2022</div>
|
|
|
- </div>
|
|
|
- <div class="bank-item__title">
|
|
|
- 2022年二建建设工程法规及相关知识(黄金基础班)
|
|
|
- </div>
|
|
|
- <div class="bank-item__desc">
|
|
|
- <div class="price">¥100</div>
|
|
|
- <a class="add">加购物车</a>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
+ <template v-for="(item, index) in goodsList2[active2].goodsList">
|
|
|
+ <li class="bank-item" v-if="index < 8" :key="index">
|
|
|
+ <div class="bank-item__img">
|
|
|
+ <div class="note" v-if="item.year">{{ item.year }}</div>
|
|
|
+ <img
|
|
|
+ v-if="item.coverUrl"
|
|
|
+ :src="$tools.splitImgHost(item.coverUrl)"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="bank-item__title">
|
|
|
+ {{ item.goodsName }}
|
|
|
+ </div>
|
|
|
+ <div class="bank-item__desc">
|
|
|
+ <div class="price">¥{{ item.standPrice }}</div>
|
|
|
+ <a class="add">加购物车</a>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </template>
|
|
|
</ul>
|
|
|
</div>
|
|
|
|
|
@@ -343,7 +394,19 @@ export default {
|
|
|
ToolBar,
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(["userInfo", "token"]),
|
|
|
+ ...mapGetters(["userInfo", "token", "header"]),
|
|
|
+
|
|
|
+ showNav: function () {
|
|
|
+ return function (list) {
|
|
|
+ var newList = [];
|
|
|
+ if (list) {
|
|
|
+ newList = list.filter((item) => {
|
|
|
+ return item.status === 1;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return newList;
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -400,21 +463,63 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
bannerList: [],
|
|
|
+ goodsList1: [{}], //推荐课程列表
|
|
|
+ goodsList2: [{}], //推荐题库列表
|
|
|
+ active1: 0, //推荐课程index
|
|
|
+ active2: 0, //推荐题库index
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.color = this.colors[0];
|
|
|
+ this.getActivityList();
|
|
|
+ // this.color = this.colors[0];
|
|
|
this.advertisingList();
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(["setUserInfo"]),
|
|
|
+ getActivityList() {
|
|
|
+ this.$request
|
|
|
+ .appCommonActivityRecommendList({ platform: 2, status: 1 })
|
|
|
+ .then((res) => {
|
|
|
+ let goodsList1 = []; //推荐视频商品
|
|
|
+ let goodsList2 = []; //推荐题库商品
|
|
|
+ res.rows.forEach((item) => {
|
|
|
+ if (item.type === 1) {
|
|
|
+ goodsList1.push(item);
|
|
|
+ }
|
|
|
+ if (item.type === 2) {
|
|
|
+ goodsList2.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.goodsList1 = goodsList1;
|
|
|
+ this.goodsList2 = goodsList2;
|
|
|
+ });
|
|
|
+ },
|
|
|
slideChangeTransitionStart(e) {
|
|
|
this.color = this.colors[this.$refs.mySwiper.swiper.realIndex];
|
|
|
},
|
|
|
advertisingList() {
|
|
|
- this.$request.advertisingList().then((res) => {
|
|
|
- this.bannerList = res.rows;
|
|
|
- });
|
|
|
+ this.$request
|
|
|
+ .advertisinghomeLocationList({
|
|
|
+ platform: 2, //1小程序2PC网站
|
|
|
+ status: 1,
|
|
|
+ locationKey: "home-banner", //首页轮播KEY
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ /**
|
|
|
+ * 如果存在-调用轮播图列表
|
|
|
+ */
|
|
|
+ if (res.data.length) {
|
|
|
+ this.$request
|
|
|
+ .advertisingList({ locationId: res.data[0].locationId })
|
|
|
+ .then((res) => {
|
|
|
+ this.bannerList = res.rows;
|
|
|
+ this.colors = res.rows.map((item) => {
|
|
|
+ return item.color ? item.color : "rgba(225,225,225,0.1)";
|
|
|
+ });
|
|
|
+ this.color = this.colors[0];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
go(path) {
|
|
|
this.$router.push({
|
|
@@ -625,7 +730,10 @@ export default {
|
|
|
margin-top: 16px;
|
|
|
.logo {
|
|
|
float: left;
|
|
|
-
|
|
|
+ img {
|
|
|
+ width: 162px;
|
|
|
+ height: 33px;
|
|
|
+ }
|
|
|
h1 {
|
|
|
background: url("~@/assets/logo.png") no-repeat center;
|
|
|
width: 162px;
|
|
@@ -959,7 +1067,10 @@ export default {
|
|
|
align-items: center;
|
|
|
|
|
|
.tab {
|
|
|
- width: 88px;
|
|
|
+ cursor: pointer;
|
|
|
+ user-select: none;
|
|
|
+ // width: 88px;
|
|
|
+ padding: 0px 6px;
|
|
|
height: 24px;
|
|
|
border: 1px solid #f84e05;
|
|
|
border-radius: 12px;
|
|
@@ -1004,8 +1115,11 @@ export default {
|
|
|
top: -78px;
|
|
|
background: rgba(122, 136, 246, 1);
|
|
|
overflow: hidden;
|
|
|
-
|
|
|
.note {
|
|
|
+ position: absolute;
|
|
|
+ top: 0px;
|
|
|
+ left: 0px;
|
|
|
+ z-index: 2;
|
|
|
width: 80px;
|
|
|
height: 24px;
|
|
|
background: #d94404;
|
|
@@ -1015,6 +1129,10 @@ export default {
|
|
|
line-height: 24px;
|
|
|
color: #fff;
|
|
|
}
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
&__title {
|
|
@@ -1111,7 +1229,10 @@ export default {
|
|
|
align-items: center;
|
|
|
|
|
|
.tab {
|
|
|
- width: 88px;
|
|
|
+ cursor: pointer;
|
|
|
+ user-select: none;
|
|
|
+ padding: 0px 6px;
|
|
|
+ // width: 88px;
|
|
|
height: 24px;
|
|
|
border: 1px solid #437cff;
|
|
|
border-radius: 12px;
|
|
@@ -1158,6 +1279,10 @@ export default {
|
|
|
overflow: hidden;
|
|
|
|
|
|
.note {
|
|
|
+ position: absolute;
|
|
|
+ top: 0px;
|
|
|
+ left: 0px;
|
|
|
+ z-index: 2;
|
|
|
width: 80px;
|
|
|
height: 24px;
|
|
|
background: #437cff;
|
|
@@ -1167,6 +1292,10 @@ export default {
|
|
|
line-height: 24px;
|
|
|
color: #fff;
|
|
|
}
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
&__title {
|