底部组件添加

master
Lee-1203 2022-03-03 17:38:35 +08:00
parent 9ef6aeeb3e
commit 9bf0d50852
6 changed files with 382 additions and 387 deletions

View File

@ -13,8 +13,8 @@
<span><img src="../assets/images/home/main/evaluation.png" alt=""></span>
<p>测评</p>
</li>
<li :class="{my:true, active:myStyle}" @click="goPage('/my')">
<span><img src="../../../assets/images/home/main/my.png" alt=""></span>
<li :class="{my:true, active:myStyle}" @click="goPage('/ucenter')">
<span><img src="../assets/images/home/main/my.png" alt=""></span>
<p>我的</p>
</li>
</ul>
@ -23,52 +23,50 @@
<script>
export default {
name: "home",
name: "tabbar",
props: ['current'],
data() {
return {
homeStyle: true,
expertStyle: false,
evaluationStyle: false,
myStyle: false,
isLogin: false
isLogin: false,
}
},
created() {
this.changeStyleNav(this.current);
},
beforeRouteUpdate(to, from, next) {
// console.log(to);
document.title = to.meta.title;
this.changeStyleNav(to.name);
this.changeStyleNav(this.current);
next();
},
activated() {
document.title = this.$route.meta.title;
this.changeStyleNav(this.$route.name);
this.changeStyleNav(this.current);
},
methods: {
//
changeStyleNav(name) {
switch (name) {
case "index":
changeStyleNav(number) {
switch (number) {
case 1:
this.homeStyle = true;
this.expertStyle = false;
this.evaluationStyle = false;
this.myStyle = false;
break;
case "expert":
case 2:
this.homeStyle = false;
this.expertStyle = true;
this.evaluationStyle = false;
this.myStyle = false;
break;
case "evaluation":
case 3:
this.homeStyle = false;
this.expertStyle = false;
this.evaluationStyle = true;
this.myStyle = false;
break;
case "my":
case 4:
this.homeStyle = false;
this.expertStyle = false;
this.evaluationStyle = false;

View File

@ -2,7 +2,7 @@ import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '../views/login.vue' //登录
import index from '../views/index/index.vue' //登录
import index from '../views/index/index.vue' //首页
import verification from '../views/login/verification.vue' //手机验证
import start from '../views/home/start/index.vue' //开屏
@ -30,12 +30,13 @@ import editdetail from '../views/consultant/detail.vue' //预览详情
Vue.use(VueRouter)
const routes = [{
const routes = [
{
path: '/',
name: 'login',
component: login
},
{
{
path: '/index',
name: 'index',
component: index

View File

@ -91,12 +91,17 @@
</ul>
<div class="tips-btn" @click="noTips()"></div>
</div>
<tabbar :current="3"></tabbar>
</div>
</template>
<script>
import tabbar from '../../../components/tabbar.vue'
export default {
name: "evaluation",
components: {
tabbar
},
data(){
return {
isScrollTop: false,

View File

@ -75,12 +75,17 @@
<span @click="closeEV()"></span>
</div>
</div>
<tabbar :current="2"></tabbar>
</div>
</template>
<script>
import tabbar from '../../../components/tabbar.vue'
export default {
name: "expert",
components: {
tabbar
},
data(){
return {
isScrollTop: false,

View File

@ -1,221 +1,210 @@
<template>
<div class="content main-content">
<!-- 头部 -->
<div :class="{ header: true, 'scroll white': isScrollTop }">
<div class="back"></div>
<div class="header-title">首页</div>
</div>
<!-- 轮播图 -->
<div class="banner-wrap">
<div class="swiper-container" ref="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<img :src="host + bannerSrc" alt="" />
</div>
</div>
<div class="swiper-pagination" ref="swiper-pagination"></div>
</div>
</div>
<!-- 领取咨询卡 -->
<div
class="index-receive"
@click="goPage('/information')"
v-if="consult_amount == 0"
>
<img src="../../assets/images/home/index/receive.jpg" alt="" />
<span>完善信息立即领取免费咨询卡(1小时)</span>
</div>
<!-- 专家 -->
<div class="index-expert section">
<div class="index-title">
<h2>专家<em>团队</em></h2>
<span @click="goPage('/expert')"></span>
</div>
<ul class="index-expert-list">
<li v-for="(item, index) in expertData" :key="index">
<div class="expert-img">
<img :src="item.avatar" alt="" />
</div>
<div class="expert-name">
{{ item.name }}<span>{{ item.keywords_list[1] }}</span>
</div>
<div class="expert-honor">
<span>{{ item.keywords_list[0] }}</span>
<span>{{ item.keywords_list[1] }}</span>
</div>
</li>
</ul>
</div>
<!-- 计划 -->
<div class="index-plan">
<ul class="index-plan-list">
<li v-for="(item, index) in planData" :key="index">
<img src="../../assets/images/home/index/plan-01.png" alt="" />
<p>{{ item.title }}</p>
</li>
</ul>
</div>
<!-- 测评 -->
<div class="index-evaluation section">
<div class="index-title">
<h2>专业<em>测评</em></h2>
<span @click="goPage('/evaluation')"></span>
</div>
<ul class="index-evaluation-list">
<li
@click="cpUrl()"
v-for="(item, index) in evaluationData"
:key="index"
>
<div class="evaluation-img">
<img
src="../../assets/images/home/index/evaluation-01.png"
alt=""
/>
</div>
<p>{{ item.title }}</p>
<div class="evaluation-btn" @click="goPage()"></div>
</li>
</ul>
</div>
<!-- 直播 -->
<div class="index-live section">
<div class="index-title">
<h2>有谱<em>直播</em></h2>
<span @click="goPage()"></span>
</div>
<ul class="index-live-list">
<li><img src="../../assets/images/home/index/live-01.png" alt="" /></li>
<li><img src="../../assets/images/home/index/live-02.png" alt="" /></li>
</ul>
</div>
<!-- 头条 -->
<div class="index-headlines section">
<div class="index-title">
<h2>有谱<em>头条</em></h2>
<span @click="goPage()"></span>
</div>
<ul class="index-headlines-list">
<li v-for="(item, index) in headlinesData" :key="index">
<p>{{ item.title }}</p>
<span>{{ item.time }}</span>
</li>
</ul>
</div>
</div>
<div class="content main-content">
<!-- 头部 -->
<div :class="{ header: true, 'scroll white': isScrollTop }">
<div class="back"></div>
<div class="header-title">首页</div>
</div>
<!-- 轮播图 -->
<div class="banner-wrap">
<div class="swiper-container" ref="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<img :src="host + bannerSrc" alt="" />
</div>
</div>
<div class="swiper-pagination" ref="swiper-pagination"></div>
</div>
</div>
<!-- 领取咨询卡 -->
<div class="index-receive" @click="goPage('/information')" v-if="consult_amount == 0">
<img src="../../assets/images/home/index/receive.jpg" alt="" />
<span>完善信息立即领取免费咨询卡(1小时)</span>
</div>
<!-- 专家 -->
<div class="index-expert section">
<div class="index-title">
<h2>专家<em>团队</em></h2>
<span @click="goPage('/expert')"></span>
</div>
<ul class="index-expert-list">
<li v-for="(item, index) in expertData" :key="index">
<div class="expert-img">
<img :src="host + item.avatar" alt="" />
</div>
<div class="expert-name">
{{ item.name }}<span>{{ item.keywords_list[1] }}</span>
</div>
<div class="expert-honor">
<span>{{ item.keywords_list[0] }}</span>
<span>{{ item.keywords_list[1] }}</span>
</div>
</li>
</ul>
</div>
<!-- 计划 -->
<div class="index-plan">
<ul class="index-plan-list">
<li v-for="(item, index) in planData" :key="index">
<img src="../../assets/images/home/index/plan-01.png" alt="" />
<p>{{ item.title }}</p>
</li>
</ul>
</div>
<!-- 测评 -->
<div class="index-evaluation section">
<div class="index-title">
<h2>专业<em>测评</em></h2>
<span @click="goPage('/evaluation')"></span>
</div>
<ul class="index-evaluation-list">
<li @click="cpUrl()" v-for="(item, index) in evaluationData" :key="index">
<div class="evaluation-img">
<img src="../../assets/images/home/index/evaluation-01.png" alt="" />
</div>
<p>{{ item.title }}</p>
<div class="evaluation-btn" @click="goPage()"></div>
</li>
</ul>
</div>
<!-- 直播 -->
<div class="index-live section">
<div class="index-title">
<h2>有谱<em>直播</em></h2>
<span @click="goPage()"></span>
</div>
<ul class="index-live-list">
<li><img src="../../assets/images/home/index/live-01.png" alt="" /></li>
<li><img src="../../assets/images/home/index/live-02.png" alt="" /></li>
</ul>
</div>
<!-- 头条 -->
<div class="index-headlines section">
<div class="index-title">
<h2>有谱<em>头条</em></h2>
<span @click="goPage()"></span>
</div>
<ul class="index-headlines-list">
<li v-for="(item, index) in headlinesData" :key="index">
<p>{{ item.title }}</p>
<span>{{ item.time }}</span>
</li>
</ul>
</div>
<tabbar :current="1"></tabbar>
</div>
</template>
<script>
export default {
name: "index",
data() {
return {
isScrollTop: false,
isReceive: 0, //
bannerSrc: "",
expertData: [
{
name: "赵晓",
imgSrc: "",
year: "从业5年",
honor: [{ title: "硕士" }, { title: "中科院" }],
},
{
name: "赵晓",
imgSrc: "",
year: "从业3年",
honor: [{ title: "硕士" }, { title: "中科院" }],
},
{
name: "赵晓",
imgSrc: "",
year: "从业8年",
honor: [{ title: "硕士" }, { title: "中科院" }],
},
],
planData: [
{ imgSrc: "", title: "强基计划" },
{ imgSrc: "", title: "综合评价" },
{ imgSrc: "", title: "专项计划" },
],
evaluationData: [
{ imgSrc: "", title: "霍兰德职业兴趣测评" },
{ imgSrc: "", title: "MBIT职业性格测试" },
],
headlinesData: [
{ title: "全国各省市最好大学+王牌专业盘点", time: "2022年2月12日" },
{
title: "批次、批次线、大类招生到底是什么20个名词帮 你快速了解",
time: "2022年2月12日",
},
{
title: "教育部公布2021年度全国高等学校名单共计3012所",
time: "2022年2月12日",
},
{
title: "人民日报权威解读:热门专业和相似专业如何区分!",
time: "2022年2月12日",
},
{
title:
"比普通批低100多分从高一准备到高三报考2022 年强基计划最新报考指南",
time: "2022年2月12日",
},
],
};
},
created() {
this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop);
this.consult_amount = JSON.parse(localStorage.userData).consult_amount;
},
mounted() {
this.getBanner();
this.getExpertData();
},
computed: {},
methods: {
cpUrl() {},
getBanner() {
let that = this;
this.axios
.post(this.HOME + "/api/dictionary/get-slide-list", {
position: "h5_home_banner",
})
.then(function (res) {
that.bannerSrc = res.data.data[0].src;
});
},
eventScrollTop() {
let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop;
if (scrollTop >= 5) {
if (this.isScroll) {
this.isScroll = false;
this.isScrollTop = true;
}
} else {
if (!this.isScroll) {
this.isScroll = true;
this.isScrollTop = false;
}
}
},
//
getExpertData() {
let that = this;
this.axios
.post(this.HOME + "/api/consumer/expert-list", {
page: "1",
size: "3",
})
.then(function (res) {
console.log(res.data.data);
that.expertData = res.data.data.list;
});
},
},
};
import tabbar from '../../components/tabbar.vue'
export default {
name: "index",
components: {
tabbar
},
data() {
return {
isScrollTop: false,
isReceive: 0, //
bannerSrc: "",
expertData: [],
planData: [{
imgSrc: "",
title: "强基计划"
},
{
imgSrc: "",
title: "综合评价"
},
{
imgSrc: "",
title: "专项计划"
},
],
evaluationData: [{
imgSrc: "",
title: "霍兰德职业兴趣测评"
},
{
imgSrc: "",
title: "MBIT职业性格测试"
},
],
headlinesData: [{
title: "全国各省市最好大学+王牌专业盘点",
time: "2022年2月12日"
},
{
title: "批次、批次线、大类招生到底是什么20个名词帮 你快速了解",
time: "2022年2月12日",
},
{
title: "教育部公布2021年度全国高等学校名单共计3012所",
time: "2022年2月12日",
},
{
title: "人民日报权威解读:热门专业和相似专业如何区分!",
time: "2022年2月12日",
},
{
title: "比普通批低100多分从高一准备到高三报考2022 年强基计划最新报考指南",
time: "2022年2月12日",
},
],
};
},
created() {
this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop);
this.consult_amount = JSON.parse(localStorage.userData).consult_amount;
},
mounted() {
this.getBanner();
this.getExpertData();
},
computed: {},
methods: {
cpUrl() {},
getBanner() {
let that = this;
this.axios
.post(this.HOME + "/api/dictionary/get-slide-list", {
position: "h5_home_banner",
})
.then(function(res) {
that.bannerSrc = res.data.data[0].src;
});
},
eventScrollTop() {
let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop;
if (scrollTop >= 5) {
if (this.isScroll) {
this.isScroll = false;
this.isScrollTop = true;
}
} else {
if (!this.isScroll) {
this.isScroll = true;
this.isScrollTop = false;
}
}
},
//
getExpertData() {
let that = this;
this.axios
.post(this.HOME + "/api/consumer/expert-list", {
page: "1",
size: "3",
})
.then(function(res) {
console.log(res.data.data);
that.expertData = res.data.data.list;
});
},
},
};
</script>
<style scoped>

View File

@ -1,161 +1,158 @@
<template>
<div class="content my-content main-content">
<!-- 头部 -->
<div :class="{ header: true, 'scroll white': isScrollTop }">
<div class="back"></div>
<div class="header-title">我的</div>
</div>
<!-- 轮播图 -->
<div class="banner my-banner">
<img src="../../../assets/images/user/banner.jpg" alt="" />
<div class="my-photo">
<span><img src="../../../assets/images/user/photo.png" /></span>
<p>张桑</p>
</div>
</div>
<!-- 免费咨询卡 -->
<div class="user-receive" @click="toPage()" v-if="isUse == 0">
<img src="../../../assets/images/user/card.png" alt="" />
<div class="receive-txt">
<span class="use-btn" v-if="isReceive == 1">使</span>
<span class="receive-btn" v-if="isReceive == 0"></span>
<p>有效期2022.2.1-2022.2.15</p>
</div>
</div>
<div class="line" v-if="isReceive == 1"></div>
<ul class="student-information">
<li @click="goPage('/bind')">
<span
><img src="../../../assets/images/user/icon-phone.png" alt=""
/></span>
<p>手机号<em>18683958573</em></p>
<img src="../../../assets/images/home/expert/arrow-right.png" alt="" />
</li>
<li @click="goPage('/info')">
<span
><img src="../../../assets/images/user/icon-student.png" alt=""
/></span>
<p>考生信息</p>
<img src="../../../assets/images/home/expert/arrow-right.png" alt="" />
</li>
</ul>
<div class="feedback" @click="goPage('/feedback')">
<span
><img src="../../../assets/images/user/icon-feedback.png" alt=""
/></span>
<p>意见和反馈</p>
<img src="../../../assets/images/home/expert/arrow-right.png" alt="" />
</div>
<div :class="{ 'my-report': true, open: isOpen }" @click="isOpen = !isOpen">
<span
><img src="../../../assets/images/user/icon-report.png" alt=""
/></span>
<p>我的报告</p>
<img src="../../../assets/images/home/expert/arrow-right.png" alt="" />
</div>
<ul :class="{ 'report-list': true, open: isOpen }">
<li @click="goPage('/report')">
<p>职业与专业定位整合测试融合版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>职业与专业定位整合测试融合版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>霍兰德职业兴趣测评完整版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>DISC性格测评</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>职业与专业定位整合测试融合版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>职业与专业定位整合测试融合版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>霍兰德职业兴趣测评完整版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>DISC性格测评</p>
<span>2022-05-12 13:28</span>
</li>
</ul>
<div class="feedback-btn">退出登录</div>
</div>
<div class="content my-content main-content">
<!-- 头部 -->
<div :class="{ header: true, 'scroll white': isScrollTop }">
<div class="back"></div>
<div class="header-title">我的</div>
</div>
<!-- 轮播图 -->
<div class="banner my-banner">
<img src="../../../assets/images/user/banner.jpg" alt="" />
<div class="my-photo">
<span><img src="../../../assets/images/user/photo.png" /></span>
<p>张桑</p>
</div>
</div>
<!-- 免费咨询卡 -->
<div class="user-receive" @click="toPage()" v-if="isUse == 0">
<img src="../../../assets/images/user/card.png" alt="" />
<div class="receive-txt">
<span class="use-btn" v-if="isReceive == 1">使</span>
<span class="receive-btn" v-if="isReceive == 0"></span>
<p>有效期2022.2.1-2022.2.15</p>
</div>
</div>
<div class="line" v-if="isReceive == 1"></div>
<ul class="student-information">
<li @click="goPage('/bind')">
<span><img src="../../../assets/images/user/icon-phone.png" alt="" /></span>
<p>手机号<em>18683958573</em></p>
<img src="../../../assets/images/home/expert/arrow-right.png" alt="" />
</li>
<li @click="goPage('/info')">
<span><img src="../../../assets/images/user/icon-student.png" alt="" /></span>
<p>考生信息</p>
<img src="../../../assets/images/home/expert/arrow-right.png" alt="" />
</li>
</ul>
<div class="feedback" @click="goPage('/feedback')">
<span><img src="../../../assets/images/user/icon-feedback.png" alt="" /></span>
<p>意见和反馈</p>
<img src="../../../assets/images/home/expert/arrow-right.png" alt="" />
</div>
<div :class="{ 'my-report': true, open: isOpen }" @click="isOpen = !isOpen">
<span><img src="../../../assets/images/user/icon-report.png" alt="" /></span>
<p>我的报告</p>
<img src="../../../assets/images/home/expert/arrow-right.png" alt="" />
</div>
<ul :class="{ 'report-list': true, open: isOpen }">
<li @click="goPage('/report')">
<p>职业与专业定位整合测试融合版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>职业与专业定位整合测试融合版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>霍兰德职业兴趣测评完整版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>DISC性格测评</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>职业与专业定位整合测试融合版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>职业与专业定位整合测试融合版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>霍兰德职业兴趣测评完整版</p>
<span>2022-05-12 13:28</span>
</li>
<li @click="goPage('/report')">
<p>DISC性格测评</p>
<span>2022-05-12 13:28</span>
</li>
</ul>
<div class="feedback-btn">退出登录</div>
<tabbar :current="4"></tabbar>
</div>
</template>
<script>
export default {
name: "expert",
data() {
return {
isScrollTop: false,
isReceive: 1, //
isUse: 0, //使
isOpen: false,
};
},
created() {
this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop);
},
methods: {
//
toPage() {
if (this.isReceive == 1) {
this.$router.push("/expert");
} else if (this.isReceive == 0) {
this.$router.push("/information");
} else {
return false;
}
},
//
goPage(path) {
this.$router.push(path);
},
//
eventScrollTop() {
let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop;
if (scrollTop >= 5) {
if (this.isScroll) {
this.isScroll = false;
this.isScrollTop = true;
}
} else {
if (!this.isScroll) {
this.isScroll = true;
this.isScrollTop = false;
}
}
},
},
destroyed() {
window.removeEventListener("scroll", this.eventScrollTop);
},
//keep-alive
activated() {
this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop);
},
//keep-alive
deactivated() {
window.removeEventListener("scroll", this.eventScrollTop);
},
};
import tabbar from '../../../components/tabbar.vue'
export default {
name: "expert",
components: {
tabbar
},
data() {
return {
isScrollTop: false,
isReceive: 1, //
isUse: 0, //使
isOpen: false,
};
},
created() {
this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop);
},
methods: {
//
toPage() {
if (this.isReceive == 1) {
this.$router.push("/expert");
} else if (this.isReceive == 0) {
this.$router.push("/information");
} else {
return false;
}
},
//
goPage(path) {
this.$router.push(path);
},
//
eventScrollTop() {
let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop;
if (scrollTop >= 5) {
if (this.isScroll) {
this.isScroll = false;
this.isScrollTop = true;
}
} else {
if (!this.isScroll) {
this.isScroll = true;
this.isScrollTop = false;
}
}
},
},
destroyed() {
window.removeEventListener("scroll", this.eventScrollTop);
},
//keep-alive
activated() {
this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop);
},
//keep-alive
deactivated() {
window.removeEventListener("scroll", this.eventScrollTop);
},
};
</script>
<style scoped>
.banner,
.banner img {
width: 100%;
}
</style>
.banner,
.banner img {
width: 100%;
}
</style>