Commit 6f68e4c2 by Jianli Ou

Merge branch 'master' of https://gitee.com/gs1-office-web-sit/gs1

parents 50649d1f aebc7365
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
"vue-puzzle-vcode": "^1.1.9", "vue-puzzle-vcode": "^1.1.9",
"vue-router": "^3.1.6", "vue-router": "^3.1.6",
"vue-slick-carousel": "^1.0.6", "vue-slick-carousel": "^1.0.6",
"vue-social-share": "^0.0.3",
"vuex": "^3.1.3", "vuex": "^3.1.3",
"wangeditor": "^3.1.1", "wangeditor": "^3.1.1",
"xss": "^1.0.6" "xss": "^1.0.6"
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<meta name="referrer" content="never"> <meta name="referrer" content="never">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href='https://cdn.bootcss.com/social-share.js/1.0.16/css/share.min.css' rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" ></script> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" ></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" ></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" ></script>
<!-- <link rel="shortcut icon" href="/favicon.ico"/> --> <!-- <link rel="shortcut icon" href="/favicon.ico"/> -->
......
<template> <template>
<div class="container d-none d-xl-block d-lg-block"> <div class="container d-none d-xl-block d-lg-block">
<div class="top-banner"> <div class="top-banner">
<div>全球商业语言</div> <!-- <div>全球商业语言</div>
<div class="top-banner-item language"> <div class="top-banner-item language">
<el-dropdown class="language-dropdown"> <el-dropdown class="language-dropdown">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<el-dropdown-item>英文</el-dropdown-item> <el-dropdown-item>英文</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div> -->
<div class="top-banner-item tb-hover">咨询电话:400-7000-690</div> <div class="top-banner-item tb-hover">咨询电话:400-7000-690</div>
<div class="top-banner-item"> <div class="top-banner-item">
<img src="../../assets/image/head/wx.png" alt="" /> <img src="../../assets/image/head/wx.png" alt="" />
......
...@@ -18,6 +18,10 @@ import './utils/codeTable' ...@@ -18,6 +18,10 @@ import './utils/codeTable'
// 百度地图 // 百度地图
import BaiduMap from 'vue-baidu-map' import BaiduMap from 'vue-baidu-map'
import Share from 'vue-social-share'
import 'vue-social-share/dist/client.css';
import '../node_modules/social-share.js/dist/js/social-share.min.js'
Vue.use(BaiduMap, { Vue.use(BaiduMap, {
// ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */ // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
ak: 'EoRpk2HWln2YKTEYYH5wutFX' ak: 'EoRpk2HWln2YKTEYYH5wutFX'
...@@ -25,6 +29,8 @@ Vue.use(BaiduMap, { ...@@ -25,6 +29,8 @@ Vue.use(BaiduMap, {
// 公共样式、布局样式 // 公共样式、布局样式
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(Share)
// 主题色调修改在assets/_style.scss 修改里面的变量即可 // 主题色调修改在assets/_style.scss 修改里面的变量即可
// 页面内容区布局分为2大块 // 页面内容区布局分为2大块
......
...@@ -6,24 +6,34 @@ ...@@ -6,24 +6,34 @@
<div class="msg-cont"> <div class="msg-cont">
<div class="container"> <div class="container">
<div class="msg-title"> <div class="msg-title">
{{title}} {{ title }}
</div> </div>
<div class="msg-head"> <div class="msg-head">
<div class="msg-head-left"> <div class="msg-head-left">
<span>作者:{{author}}</span> <span>作者:{{ author }}</span>
<span>日期:{{showtime}}</span> <span>日期:{{ showtime }}</span>
<span>编辑:{{editor}}</span> <span>编辑:{{ editor }}</span>
<span>来源:{{source}}</span> <span>来源:{{ source }}</span>
</div> </div>
<div class="msg-head-right"> <div class="msg-head-right">
<span>分享至:</span> <span>分享至:</span>
<img src="../../assets/image/news/icon_weibo.png" alt="" @click="toweibo" /> <share :config="config"></share>
<img src="../../assets/image/news/icon_weixin.png" alt="" @click="weixinShareTimeline"/> </div>
<div class="msg-head-right" v-if="false">
<span>分享至:</span>
<img
src="../../assets/image/news/icon_weibo.png"
alt=""
@click="toweibo"
/>
<img
src="../../assets/image/news/icon_weixin.png"
alt=""
@click="weixinShareTimeline"
/>
</div> </div>
</div> </div>
<div class="msg-text" v-html="content"> <div class="msg-text" v-html="content"></div>
</div>
</div> </div>
</div> </div>
<div class="xglj"> <div class="xglj">
...@@ -32,7 +42,7 @@ ...@@ -32,7 +42,7 @@
<span>相关连接</span> <span>相关连接</span>
<!-- <span>更多>></span> --> <!-- <span>更多>></span> -->
</div> </div>
<list :list="xgljListArr" @getInfo='getInfo' /> <list :list="xgljListArr" @getInfo="getInfo" />
</div> </div>
</div> </div>
</div> </div>
...@@ -44,14 +54,21 @@ ...@@ -44,14 +54,21 @@
</div> </div>
<div class="top10-ul"> <div class="top10-ul">
<div v-for="(tmp, i) in top10.data" :key="i" class="top10-li"> <div v-for="(tmp, i) in top10.data" :key="i" class="top10-li">
<div v-if="i<3"> <div v-if="i < 3">
<img :src="require(`../../assets/image/news/icon_${i+1}.png`)" alt="" > <img
:src="require(`../../assets/image/news/icon_${i + 1}.png`)"
alt=""
/>
<span class="no"></span> <span class="no"></span>
<span class="name" @click="getInfo(tmp.id,tmp.directpath)">{{ tmp.title }}</span> <span class="name" @click="getInfo(tmp.id, tmp.directpath)">{{
tmp.title
}}</span>
</div> </div>
<div v-else> <div v-else>
<span class="no">{{i+1}}</span> <span class="no">{{ i + 1 }}</span>
<span class="name" @click="getInfo(tmp.id,tmp.directpath)">{{ tmp.title }}</span> <span class="name" @click="getInfo(tmp.id, tmp.directpath)">{{
tmp.title
}}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -62,7 +79,7 @@ ...@@ -62,7 +79,7 @@
<div class="cate"> <div class="cate">
<span>公告通知</span> <span>公告通知</span>
</div> </div>
<list2 :list="announceListArr" @getInfo='getInfo' /> <list2 :list="announceListArr" @getInfo="getInfo" />
</div> </div>
</div> </div>
<div class="zttj"> <div class="zttj">
...@@ -70,7 +87,7 @@ ...@@ -70,7 +87,7 @@
<div class="cate"> <div class="cate">
<span>专题推荐</span> <span>专题推荐</span>
</div> </div>
<list2 :list="zttjListListArr" @getInfo='getInfo'/> <list2 :list="zttjListListArr" @getInfo="getInfo" />
</div> </div>
</div> </div>
</div> </div>
...@@ -96,13 +113,20 @@ export default { ...@@ -96,13 +113,20 @@ export default {
}, },
data() { data() {
return { return {
id:this.$route.query.id, config: {
content:'', sites: ["weibo", "wechat"],
title:'', wechatQrcodeTitle: "微信扫一扫:分享",
showtime:'', wechatQrcodeHelper:
author:'', "<p>扫一扫</p><p>二维码便可将本文分享至朋友圈。</p>",
source:'', },
editor:'',
id: this.$route.query.id,
content: "",
title: "",
showtime: "",
author: "",
source: "",
editor: "",
breadcrumb: [{ name: "资讯中心", path: "/News/index" }], breadcrumb: [{ name: "资讯中心", path: "/News/index" }],
xglj: { xglj: {
data: [ data: [
...@@ -119,54 +143,48 @@ export default { ...@@ -119,54 +143,48 @@ export default {
top10: { top10: {
data: [], data: [],
}, },
announceListArr:[], announceListArr: [],
xgljListArr:[], xgljListArr: [],
zttjListListArr:[], zttjListListArr: [],
url:window.location.href, url: window.location.href,
sharesinastring:null sharesinastring: null,
}; };
}, },
created() { created() {
this.InfoFn() this.InfoFn();
this.newsTop10() this.newsTop10();
this.announceList() this.announceList();
this.zttjList() this.zttjList();
}, },
methods: { methods: {
async InfoFn() { async InfoFn() {
const params = { const params = {
id:this.id, id: this.id,
}; };
const listRes = const listRes = await this.$api.news.newsInfo(params);
await this.$api.news.newsInfo(params);
const { returnCode, data } = listRes; const { returnCode, data } = listRes;
if (returnCode === "0") { if (returnCode === "0") {
this.content=data.content; this.content = data.content;
this.title=data.title this.title = data.title;
this.showtime = data.showtime this.showtime = data.showtime;
this.author=data.author this.author = data.author;
this.source=data.source this.source = data.source;
this.editor=data.editor this.editor = data.editor;
this.breadcrumb = this.breadcrumb.concat(this.matche); this.breadcrumb = this.breadcrumb.concat(this.matche);
this.breadcrumb.push( this.breadcrumb.push({
{
name: this.title, name: this.title,
}); });
this.$store.commit("system/SET_BREADCRUMB", this.breadcrumb); this.$store.commit("system/SET_BREADCRUMB", this.breadcrumb);
this.xgljList(data.keyword) this.xgljList(data.keyword);
} }
}, },
// top列表 // top列表
async newsTop10() { async newsTop10() {
const policyListRes = const policyListRes = await this.$api.news.syzxphList();
await this.$api.news.syzxphList();
const { returnCode, data } = policyListRes; const { returnCode, data } = policyListRes;
if (returnCode === "0") { if (returnCode === "0") {
this.top10.data = data this.top10.data = data;
} }
}, },
// 公告 // 公告
async announceList() { async announceList() {
...@@ -174,65 +192,57 @@ export default { ...@@ -174,65 +192,57 @@ export default {
page: 1, page: 1,
limit: 10, limit: 10,
}; };
const listRes = const listRes = await this.$api.news.announceList(params);
await this.$api.news.announceList(params);
const { returnCode, data } = listRes; const { returnCode, data } = listRes;
if (returnCode === "0") { if (returnCode === "0") {
this.announceListArr = data.list this.announceListArr = data.list;
} }
}, },
// 专题 // 专题
async zttjList() { async zttjList() {
const params = { const params = {
page: 1, page: 1,
limit: 10, limit: 10,
}; };
const listRes = const listRes = await this.$api.news.zttjList(params);
await this.$api.news.zttjList(params);
const { returnCode, data } = listRes; const { returnCode, data } = listRes;
if (returnCode === "0") { if (returnCode === "0") {
this.zttjListListArr = data this.zttjListListArr = data;
} }
}, },
// 相关链接 // 相关链接
async xgljList(keyword) { async xgljList(keyword) {
const params = { const params = {
id:9979, id: 9979,
keyword:keyword keyword: keyword,
}; };
const listRes = const listRes = await this.$api.news.relatedLinks(params);
await this.$api.news.relatedLinks(params);
const { returnCode, data } = listRes; const { returnCode, data } = listRes;
if (returnCode === "0") { if (returnCode === "0") {
this.xgljListArr = data this.xgljListArr = data;
} }
}, },
getInfo(id,directpath){ getInfo(id, directpath) {
if(directpath&&directpath!==''&& directpath.length>0){ if (directpath && directpath !== "" && directpath.length > 0) {
window.open(directpath,'_blank'); window.open(directpath, "_blank");
}else{ } else {
let link = this.$router.resolve({ let link = this.$router.resolve({
path: `/news/msg?id=${id}`, path: `/news/msg?id=${id}`,
}); });
window.open(link.href,'_blank') window.open(link.href, "_blank");
} }
}, },
// weibo // weibo
toweibo(){ toweibo() {
this.sharesinastring ='http://service.weibo.com/share/share.php?title=' +this.title+'&url='+this.url; this.sharesinastring =
window.open(this.sharesinastring, '_blank');//微博在新页面打开 "http://service.weibo.com/share/share.php?title=" +
}, this.title +
//weixin "&url=" +
weixinShareTimeline(){ this.url;
window.open(this.sharesinastring, "_blank"); //微博在新页面打开
} },
//weixin
weixinShareTimeline() {},
}, },
}; };
</script> </script>
...@@ -280,6 +290,7 @@ export default { ...@@ -280,6 +290,7 @@ export default {
padding: 20px 0; padding: 20px 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
font-size: 12px; font-size: 12px;
flex-wrap: wrap; flex-wrap: wrap;
.msg-head-left { .msg-head-left {
...@@ -321,20 +332,20 @@ export default { ...@@ -321,20 +332,20 @@ export default {
.top10-ul { .top10-ul {
margin: 0; margin: 0;
padding: 0; padding: 0;
.top10-li { .top10-li {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 10px 0; padding: 10px 0;
margin: 0; margin: 0;
> div { > div {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
@include ellipsis; @include ellipsis;
font-size: 13px; font-size: 13px;
img{ img {
position: absolute; position: absolute;
left: -4px; left: -4px;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment