|
@@ -1,15 +1,5 @@
|
|
<template>
|
|
<template>
|
|
<div id="home">
|
|
<div id="home">
|
|
- <!-- <nut-navbar>
|
|
|
|
-
|
|
|
|
- <template v-slot:left>
|
|
|
|
- 关闭
|
|
|
|
- </template>
|
|
|
|
- <template v-slot:right> </template>
|
|
|
|
- <template v-slot:more-icon>
|
|
|
|
-
|
|
|
|
- </template>
|
|
|
|
- </nut-navbar> -->
|
|
|
|
<!-- <test-user></test-user> -->
|
|
<!-- <test-user></test-user> -->
|
|
<el-image style="width: 100%; height: 10rem" :src="url"></el-image>
|
|
<el-image style="width: 100%; height: 10rem" :src="url"></el-image>
|
|
<el-row type="flex" align="middle" class="menu_list">
|
|
<el-row type="flex" align="middle" class="menu_list">
|
|
@@ -19,23 +9,7 @@
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<el-link type="info" :underline="false">宣讲会</el-link>
|
|
<el-link type="info" :underline="false">宣讲会</el-link>
|
|
</el-col>
|
|
</el-col>
|
|
- <!-- <el-drawer :visible.sync="drawerTalk" direction="btt">
|
|
|
|
- <template #title>
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="20">选择查看类型</el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </template>
|
|
|
|
- <el-row class="drawer__row">
|
|
|
|
- <el-col :span="24" @click.native="toHtml('/talkList.html#/?type=in')">
|
|
|
|
- <el-button type="text">校内宣讲会</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="24" @click.native="toHtml('/talkList.html#/?type=out')">
|
|
|
|
- <el-button type="text">校外宣讲会</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </el-drawer> -->
|
|
|
|
</el-col>
|
|
</el-col>
|
|
- <!-- drawerJobfair = true -->
|
|
|
|
<el-col :span="6" class="list_border" @click.native="toHtml('jobfairList.html#/')">
|
|
<el-col :span="6" class="list_border" @click.native="toHtml('jobfairList.html#/')">
|
|
<el-col :span="24"><div class="el-icon-s-custom icon_zoom"></div></el-col>
|
|
<el-col :span="24"><div class="el-icon-s-custom icon_zoom"></div></el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
@@ -65,44 +39,33 @@
|
|
<el-col :span="24"><div class="el-icon-user icon_zoom"></div></el-col>
|
|
<el-col :span="24"><div class="el-icon-user icon_zoom"></div></el-col>
|
|
<el-col :span="24"><el-link type="info" :underline="false">个人中心</el-link></el-col>
|
|
<el-col :span="24"><el-link type="info" :underline="false">个人中心</el-link></el-col>
|
|
</el-col>
|
|
</el-col>
|
|
- <!-- <el-drawer :visible.sync="drawerCenter" direction="btt">
|
|
|
|
- <template #title>
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="20">选择类型</el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </template>
|
|
|
|
- <el-row class="drawer__row">
|
|
|
|
- <el-col :span="24" >
|
|
|
|
- <el-button type="text">学生个人中心</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="24" @click.native="toHtml('', 'check')">
|
|
|
|
- <el-button type="text">企业中心</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </el-drawer> -->
|
|
|
|
</el-row>
|
|
</el-row>
|
|
<!-- list部分 -->
|
|
<!-- list部分 -->
|
|
<div class="list">
|
|
<div class="list">
|
|
<el-row class="tip" type="flex">
|
|
<el-row class="tip" type="flex">
|
|
- <el-col :span="16"> test<b class="tip_en">TEST</b> </el-col>
|
|
|
|
|
|
+ <el-col :span="16">
|
|
|
|
+ {{ news.title }}<b class="tip_en">{{ news.title }}</b>
|
|
|
|
+ </el-col>
|
|
<el-col :span="8" class="more">
|
|
<el-col :span="8" class="more">
|
|
查看更多
|
|
查看更多
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- <el-row type="flex" v-for="(item, index) in list" :key="index" class="data_list">
|
|
|
|
- <el-col :span="6"> 【{{ item.type === 1 ? '测试1' : '其他类型' }}】 </el-col>
|
|
|
|
|
|
+ <el-row type="flex" v-for="(item, index) in news.infoList" :key="index" class="data_list">
|
|
|
|
+ <el-col :span="6"> 【{{ news.title }}】 </el-col>
|
|
<el-col :span="18">{{ item.title }}</el-col>
|
|
<el-col :span="18">{{ item.title }}</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
<div class="list">
|
|
<div class="list">
|
|
<el-row class="tip" type="flex">
|
|
<el-row class="tip" type="flex">
|
|
- <el-col :span="16"> test1<b class="tip_en">TEST1</b> </el-col>
|
|
|
|
|
|
+ <el-col :span="16">
|
|
|
|
+ {{ notice.title }}<b class="tip_en">{{ notice.title }}</b>
|
|
|
|
+ </el-col>
|
|
<el-col :span="8" class="more">
|
|
<el-col :span="8" class="more">
|
|
查看更多
|
|
查看更多
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- <el-row type="flex" v-for="(item, index) in list" :key="index" class="data_list">
|
|
|
|
- <el-col :span="6"> 【{{ item.type === 1 ? '测试1' : '招聘' }}】 </el-col>
|
|
|
|
|
|
+ <el-row type="flex" v-for="(item, index) in notice.infoList" :key="index" class="data_list">
|
|
|
|
+ <el-col :span="6"> 【{{ notice.title }}】 </el-col>
|
|
<el-col :span="18">{{ item.title }}</el-col>
|
|
<el-col :span="18">{{ item.title }}</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
@@ -111,23 +74,27 @@
|
|
<el-col :span="24"> 联系我们<b class="tip_en">CONTACT</b> </el-col>
|
|
<el-col :span="24"> 联系我们<b class="tip_en">CONTACT</b> </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row style="font-size: 0.85rem;padding: 0 0.6rem;">
|
|
<el-row style="font-size: 0.85rem;padding: 0 0.6rem;">
|
|
- <el-col :span="24">联系地址: 吉林省长春市朝阳区卫星路6543号,综合楼C区203室 </el-col>
|
|
|
|
- <el-col :span="24">邮政编码: 130000</el-col>
|
|
|
|
- <el-col :span="24">服务热线: 0431-88888888</el-col>
|
|
|
|
|
|
+ <el-col :span="24" v-html="site.content"></el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
<div class="list">
|
|
<div class="list">
|
|
<el-row class="tip" type="flex">
|
|
<el-row class="tip" type="flex">
|
|
<el-col :span="24"> 关注我们<b class="tip_en">WECHAT</b> </el-col>
|
|
<el-col :span="24"> 关注我们<b class="tip_en">WECHAT</b> </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- qrcode
|
|
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24" style="text-align:center">
|
|
|
|
+ <canvas id="canvas"></canvas>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import QRCode from 'qrcode';
|
|
import { mapActions, mapState } from 'vuex';
|
|
import { mapActions, mapState } from 'vuex';
|
|
import testUser from '@/components/test-user.vue';
|
|
import testUser from '@/components/test-user.vue';
|
|
|
|
+import _ from 'lodash';
|
|
export default {
|
|
export default {
|
|
name: 'home',
|
|
name: 'home',
|
|
props: {},
|
|
props: {},
|
|
@@ -135,25 +102,28 @@ export default {
|
|
// testUser,
|
|
// testUser,
|
|
},
|
|
},
|
|
data: () => ({
|
|
data: () => ({
|
|
- url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
|
|
|
|
- list: [
|
|
|
|
- { type: '1', title: '测试标题1' },
|
|
|
|
- { type: '1', title: '测试标题2' },
|
|
|
|
- { type: '1', title: '测试标题3' },
|
|
|
|
- { type: '1', title: '测试标题4' },
|
|
|
|
- { type: '1', title: '测试标题5' },
|
|
|
|
- ],
|
|
|
|
|
|
+ url: '',
|
|
drawerTalk: false,
|
|
drawerTalk: false,
|
|
drawerJobfair: false,
|
|
drawerJobfair: false,
|
|
drawerCenter: false,
|
|
drawerCenter: false,
|
|
|
|
+ site: {},
|
|
|
|
+ news: {},
|
|
|
|
+ notice: {},
|
|
}),
|
|
}),
|
|
- created() {},
|
|
|
|
|
|
+ async created() {
|
|
|
|
+ await this.getSite();
|
|
|
|
+ await this.getModule();
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.initQrcode();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
...mapState({
|
|
...mapState({
|
|
user: state => state.user.user,
|
|
user: state => state.user.user,
|
|
}),
|
|
}),
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...mapActions(['siteOperation', 'moduleOperation', 'columnOperation', 'newsOperation']),
|
|
toHtml(uri, type) {
|
|
toHtml(uri, type) {
|
|
if (type) {
|
|
if (type) {
|
|
let url = '';
|
|
let url = '';
|
|
@@ -167,6 +137,109 @@ export default {
|
|
window.location.href = uri;
|
|
window.location.href = uri;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async getSite() {
|
|
|
|
+ let site = sessionStorage.getItem('site');
|
|
|
|
+ if (!site) {
|
|
|
|
+ let result = await this.siteOperation({ type: 'search', data: { site: this.$site } });
|
|
|
|
+ if (`${result.errcode}` === `0`) {
|
|
|
|
+ sessionStorage.setItem('site', JSON.stringify(result.data));
|
|
|
|
+ this.$set(this, `site`, result.data);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$set(this, `site`, JSON.parse(site));
|
|
|
|
+ }
|
|
|
|
+ this.$set(this, `url`, this.site.banner);
|
|
|
|
+ },
|
|
|
|
+ //获取固定的4个模块
|
|
|
|
+ async getModule() {
|
|
|
|
+ //获取分站所有模块 TODO:site=>_tenant
|
|
|
|
+ let result = await this.moduleOperation({ type: 'list' });
|
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
|
+ let moduleList = result.data;
|
|
|
|
+ for (let item of moduleList) {
|
|
|
|
+ //item为模块信息,拿着模块信息去查该模块下有什么栏目
|
|
|
|
+ if (`${item.is_use}` === '0') {
|
|
|
|
+ item = await this.getColumn(item);
|
|
|
|
+ await this.makeList(item);
|
|
|
|
+ } // console.log(item);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //根据条件获取栏目
|
|
|
|
+ async getColumn(item) {
|
|
|
|
+ let res = await this.columnOperation({ type: 'list', data: { parent_id: item.id } });
|
|
|
|
+ //查詢模块下所有的栏目(因为修改关联方是:抓取栏目和正常栏目关联,栏目类型(type)为bugList.所以bugList需要用content_id再去查下面关联的信息
|
|
|
|
+ if (`${res.errcode}` === '0') {
|
|
|
|
+ for (const col of res.data) {
|
|
|
|
+ if (col.type === 'bugList') {
|
|
|
|
+ col.path = `/info/list/${col.content_id}`;
|
|
|
|
+ col.children = await this.getNewsList(col, '0');
|
|
|
|
+ } else if (col.type === 'column') {
|
|
|
|
+ col.path = `/info/list/${col.id}`;
|
|
|
|
+ col.children = await this.getNewsList(col, '1');
|
|
|
|
+ } else if (col.type === 'content') {
|
|
|
|
+ col.path = `/info/detail?id=${col.content_id}`;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ item.children = res.data;
|
|
|
|
+ }
|
|
|
|
+ return item;
|
|
|
|
+ },
|
|
|
|
+ //根据条件获取信息
|
|
|
|
+ async getNewsList(item, news_type) {
|
|
|
|
+ let data = { skip: 0, limit: 4, news_type: news_type };
|
|
|
|
+ data.parent_id = news_type === '1' ? item.id : item.content_id;
|
|
|
|
+ let res = await this.newsOperation({ type: 'list', data: data });
|
|
|
|
+ if (`${res.errcode}` === '0') {
|
|
|
|
+ for (const val of res.data) {
|
|
|
|
+ let result = await this.newsOperation({ type: 'search', data: { id: val.id } });
|
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
|
+ val.content = result.data.content;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return res.data;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.errmsg ? res.errmsg : 'error');
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //组合数据
|
|
|
|
+ makeList(item) {
|
|
|
|
+ if (!item) return;
|
|
|
|
+ if (item.category === 'news') {
|
|
|
|
+ let arr = [];
|
|
|
|
+ let colObject = {};
|
|
|
|
+ for (const col of item.children) {
|
|
|
|
+ if (!colObject.id) colObject = col;
|
|
|
|
+ for (const news of col.children) {
|
|
|
|
+ arr.push(news);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let object = { ...JSON.parse(JSON.stringify(item)), infoList: arr, column: colObject };
|
|
|
|
+ this.$set(this, `news`, object);
|
|
|
|
+ } else if (item.category === 'notice') {
|
|
|
|
+ let arr = [];
|
|
|
|
+ let colObject = {};
|
|
|
|
+ for (const col of item.children) {
|
|
|
|
+ if (!colObject.id) colObject = col;
|
|
|
|
+ for (const news of col.children) {
|
|
|
|
+ arr.push(news);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let object = { ...JSON.parse(JSON.stringify(item)), infoList: arr, column: colObject };
|
|
|
|
+ // console.log(object);
|
|
|
|
+ this.$set(this, `notice`, object);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async initQrcode() {
|
|
|
|
+ let url = 'http://smart.cc-lotus.info/weixin/auth?redirect_uri=http://smart.cc-lotus.info/mobile/#/';
|
|
|
|
+ await QRCode.toCanvas(document.getElementById('canvas'), url, {
|
|
|
|
+ width: 100,
|
|
|
|
+ margin: 0,
|
|
|
|
+ // color: { dark: '#ff4400' }, //{ dark: this.$route.query.type === '0' ? '#00ff14' : '#FF9900' }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|