Compare commits

...

5 Commits

Author SHA1 Message Date
dengjie d73a8d6f2e 邓洁 : 修改bug 2023-05-27 21:39:17 +08:00
odjbin 1028f801d8 Merge pull request '邓洁 : 更改域名' (#22) from dj into master
Reviewed-on: #22
2023-05-26 02:46:50 +00:00
odjbin 92e131fd39 Merge pull request '邓洁 : 修改产品中心bug' (#21) from dj into master
Reviewed-on: #21
2023-05-22 17:20:59 +00:00
odjbin 66aaace5da Merge pull request '邓洁 : 部署到宝塔' (#20) from dj into master
Reviewed-on: #20
2023-05-22 14:20:09 +00:00
odjbin d90e69902c Merge pull request '邓洁 : footer跳转' (#19) from dj into master
Reviewed-on: #19
2023-05-22 13:15:29 +00:00
18 changed files with 452 additions and 282 deletions

View File

@ -20,6 +20,7 @@
"script-ext-html-webpack-plugin": "^2.1.5", "script-ext-html-webpack-plugin": "^2.1.5",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-i18n": "^8.26.7", "vue-i18n": "^8.26.7",
"vue-meta": "^2.4.0",
"vue-router": "^3.2.0" "vue-router": "^3.2.0"
}, },
"devDependencies": { "devDependencies": {

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico">--> <!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico">-->
<title>艺鹏瓷砖|广东祥睿陶瓷有限公司</title> <title>蒙彼利瓷砖 | 广东蒙彼利陶瓷有限公司</title>
<script> <script>
fnResize(); fnResize();
window.onresize = function() { window.onresize = function() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

View File

@ -97,13 +97,23 @@ export default {
} }
}, },
handleChangeMenu(childrenItem) { handleChangeMenu(childrenItem) {
this.$router.push({ if(childrenItem.id){
path: "/products_center", // this.$router.push({
query: { // path: "/products_center", //
menu: childrenItem.id, query: { //
menuTitle:childrenItem.title//type menu: childrenItem.id,
} menuTitle:childrenItem.title//type
}); }
});
}else {
this.$router.push({
path: "/products_center", //
query: { //
menu: 1,
menuTitle:childrenItem.title//type
}
});
}
} }
} }
}; };

View File

@ -1,10 +1,15 @@
<template> <template>
<div class="newsCenter"> <div class="newsCenter">
<a href="/about_us"> <div class="news_bg">
<div class="news_bg"> <div class="news_title">
<img src="../assets/index/b1.jpg" alt=""> <div>MENGBILI</div>
<div>CERAMIC WORLD</div>
<div>蒙彼利陶瓷 艺术无处不在</div>
<div class="case_more">
<a href="/about_us">READ MORE</a>
</div>
</div> </div>
</a> </div>
<div class="newsWidth"> <div class="newsWidth">
<div class="news_left"> <div class="news_left">
<div class="items"> <div class="items">
@ -83,20 +88,20 @@ export default {
this.itemList = res.data.list; this.itemList = res.data.list;
}); });
}, },
methods:{ methods: {
handleChangeMenu(item){ handleChangeMenu(item) {
this.$router.push({ this.$router.push({
path: "/news", // path: "/news", //
query: { // query: { //
menu: item.id, menu: item.id
} }
}); });
}, },
handleToDetail(item){ handleToDetail(item) {
this.$router.push({ this.$router.push({
path: "/news", // path: "/news", //
query: { // query: { //
menuDetail: item.id, newsId: item.id
} }
}); });
} }
@ -121,10 +126,46 @@ export default {
min-width: 1300px; min-width: 1300px;
.news_bg { .news_bg {
img { //min-width: 1300px;
background: #ffffff url('../assets/index/cbg0.jpg') no-repeat center 0;
background-size: cover;
height: 380px;
.news_title {
position: relative;
display: block;
width: 100%; width: 100%;
height: 380px; float: left;
object-fit: cover; padding: 100px 0 80px;
text-align: center;
> div:first-child {
font-size: 40px;
color: #ffffff;
font-weight: 700;
}
> div:nth-child(2) {
font-size: 40px;
color: #ffffff;
font-weight: 700;
}
> div:nth-child(3) {
font-size: 18px;
color: #eceaea;
}
.case_more {
margin: 30px 0 0;
a {
color: #ffffff;
display: inline-block;
width: 120px;
height: 40px;
line-height: 40px;
font-size: 14px;
border: 1px solid #ffffff;
}
}
} }
} }

View File

@ -85,6 +85,12 @@ export default {
} }
}); });
} else if (this.type == 11) { } else if (this.type == 11) {
this.$router.push({
path: "/news", //
query: { //
newsId: item.id //type
}
});
this.$emit("getNewsIdClick", item.id); this.$emit("getNewsIdClick", item.id);
} else if (this.type == 22) { } else if (this.type == 22) {
this.showMask = true; this.showMask = true;

View File

@ -5,6 +5,7 @@ import router from './router'
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import 'element-ui/lib/theme-chalk/display.css'; import 'element-ui/lib/theme-chalk/display.css';
import VueMeta from 'vue-meta'
//要添加的代码 //要添加的代码
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
@ -19,6 +20,7 @@ router.beforeEach((to, from, next) => {
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(VueMeta)
Vue.use(Vuex) Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {

View File

@ -47,12 +47,6 @@ const routes = [
name: 'products_center', name: 'products_center',
component: () => import('../views/productsCenter/index') component: () => import('../views/productsCenter/index')
}, },
{
path: '/products_center/:menu/:menuTitle',
name: 'products_center',
props:true,
component: () => import('../views/productsCenter/index')
},
{ {
path: '/products_detail', path: '/products_detail',
name: 'products_detail', name: 'products_detail',

View File

@ -24,11 +24,17 @@ import {getArticleInfo} from "@/api";
export default { export default {
name: "index", name: "index",
metaInfo() {
return {
title: this.aboutName+" | " + localStorage.getItem("corporate_name")
};
},
components: {ProductsTabsItem}, components: {ProductsTabsItem},
data() { data() {
return { return {
aboutTabs: [], aboutTabs: [],
pList: [] pList: [],
aboutName:''
}; };
}, },
watch:{ watch:{
@ -38,10 +44,7 @@ export default {
this.$refs.ProductsTabsItem.activeName= i+''; this.$refs.ProductsTabsItem.activeName= i+'';
} }
} }
getArticleInfo(to.query.menu).then(res => { this.getInfo(to.query.menu)
this.aboutTabs = res.data.articlelist;
this.pList = res.data.articleinfo.content;
});
} }
}, },
beforeUpdate() { beforeUpdate() {
@ -54,26 +57,33 @@ export default {
mounted() { mounted() {
if(this.$route.query.menu){ if(this.$route.query.menu){
// //
getArticleInfo(this.$route.query.menu).then(res => { this.getInfo(this.$route.query.menu)
this.aboutTabs = res.data.articlelist;
this.pList = res.data.articleinfo.content;
});
}else { }else {
getArticleInfo(1).then(res => { this.getInfo(1)
this.aboutTabs = res.data.articlelist;
this.pList = res.data.articleinfo.content;
});
} }
}, },
methods: { methods: {
//
getInfo(infoId){
getArticleInfo(infoId).then(res => {
this.aboutTabs = res.data.articlelist;
this.pList = res.data.articleinfo.content;
if(infoId===1){
this.aboutName=this.aboutTabs[0].title
}
});
},
handleClick(tab) { handleClick(tab) {
for (let i = 0; i < this.aboutTabs.length; i++) { for (let i = 0; i < this.aboutTabs.length; i++) {
console.log('this.aboutTabs[i].id',this.aboutTabs[i].id);
if (this.aboutTabs[i].title === tab._props.label) { if (this.aboutTabs[i].title === tab._props.label) {
getArticleInfo(this.aboutTabs[i].id).then(res => { this.$router.push({
this.aboutTabs = res.data.articlelist; path: "/about_us",
this.pList = res.data.articleinfo.content; query: {
menu: this.aboutTabs[i].id,
}
}); });
this.aboutName=this.aboutTabs[i].title
this.getInfo(this.aboutTabs[i].id)
} }
} }
} }

View File

@ -25,10 +25,15 @@
<script> <script>
import ProductsTabsItem from "@/components/ProductsTabsItem"; import ProductsTabsItem from "@/components/ProductsTabsItem";
import {getArticleInfo, getPublicData} from "@/api"; import {getArticleInfo} from "@/api";
export default { export default {
name: "index", name: "index",
metaInfo() {
return {
title:'招商加盟 | '+localStorage.getItem('corporate_name')
};
},
components: {ProductsTabsItem}, components: {ProductsTabsItem},
data() { data() {
return { return {

View File

@ -28,6 +28,11 @@ import {getPublicData} from "@/api";
export default { export default {
name: "index", name: "index",
metaInfo() {
return {
title:'联系我们 | '+localStorage.getItem('corporate_name')
};
},
components: {ProductsTabsItem}, components: {ProductsTabsItem},
data() { data() {
return { return {

View File

@ -4,7 +4,7 @@
<div class="upHeaderBox"> <div class="upHeaderBox">
<div class="up_header"> <div class="up_header">
<span class="up_left"> <span class="up_left">
艺鹏瓷砖 拒绝千篇一律艺术无处不在 蒙彼利瓷砖 拒绝千篇一律艺术无处不在
</span> </span>
<span class="up_right"> <span class="up_right">
{{ corporate_name }} {{ corporate_name }}
@ -14,8 +14,7 @@
<div class="down_header"> <div class="down_header">
<div class="down_left"> <div class="down_left">
<a href="/"> <a href="/">
<el-image <img :src="logo" alt=""/>
:src="logo"></el-image>
</a> </a>
</div> </div>
<div class="down_right"> <div class="down_right">
@ -130,6 +129,7 @@ export default {
}, },
mounted() { mounted() {
getPublicData().then(res => { getPublicData().then(res => {
localStorage.setItem('corporate_name',res.data.corporate_name)
this.logo = res.data.logo; this.logo = res.data.logo;
this.corporate_name = res.data.corporate_name; this.corporate_name = res.data.corporate_name;
this.navList[1].children = res.data.aboutus; this.navList[1].children = res.data.aboutus;
@ -250,12 +250,11 @@ export default {
.down_left { .down_left {
position: absolute; position: absolute;
float: left; float: left;
height: 85px;
/deep/ .el-image { img {
.el-image__inner { width: 100%;
width: 323px !important; height: 100%;
height: 85px !important;
}
} }
> a:hover:after { > a:hover:after {
@ -274,8 +273,9 @@ export default {
> .nav { > .nav {
position: relative; position: relative;
display: inline; display: inline;
width: 100px;
float: left; float: left;
width: 100px;
//margin-right: 10px;
> .nav_item { > .nav_item {
color: #fff; color: #fff;

View File

@ -24,6 +24,11 @@ import {getArticleList} from "@/api";
export default { export default {
name: "index", name: "index",
metaInfo() {
return {
title: "形象展示 | " + localStorage.getItem("corporate_name")
};
},
components: {ProductsTabsItem, PicturesBox,Pagination}, components: {ProductsTabsItem, PicturesBox,Pagination},
data() { data() {
return { return {
@ -86,8 +91,20 @@ export default {
this.classIndex = parseInt(tab.index); this.classIndex = parseInt(tab.index);
if (tab.index == 0) { if (tab.index == 0) {
this.getArticleList(2, this.page, this.limit); this.getArticleList(2, this.page, this.limit);
this.$router.push({
path: "/image_display",
query: {
menu: 2
}
});
} else if (tab.index == 1) { } else if (tab.index == 1) {
this.getArticleList(8, this.page, this.limit); this.getArticleList(8, this.page, this.limit);
this.$router.push({
path: "/image_display",
query: {
menu: 8
}
});
} }
}, },
// //

View File

@ -21,6 +21,11 @@ import NewsCenter from "@/components/NewsCenter";
export default { export default {
name: "index", name: "index",
metaInfo() {
return {
title:'蒙彼利瓷砖 | '+localStorage.getItem('corporate_name')
};
},
components: {NewsCenter, AboutUs, ProjectCase, ProductsShow, ProductsClassify, FastFindProducts, Carousel} components: {NewsCenter, AboutUs, ProjectCase, ProductsShow, ProductsClassify, FastFindProducts, Carousel}
} }
</script> </script>

View File

@ -15,15 +15,20 @@
</div> </div>
<div class="shares"> <div class="shares">
分享到 分享到
<span @click="shareToMicroblog()"> <span @click="shareToMicroblog()">
<img src="@/assets/weibo.png" alt=""/> <img src="@/assets/weibo.png" alt=""/>
</span> </span>
<span @click="shareToQQRom()"> <span @click="shareToQQRom()">
<img src="@/assets/QQKJ.png" alt=""/> <img src="@/assets/QQKJ.png" alt=""/>
</span> </span>
</div> </div>
</div> </div>
<div class="html_text" v-html="htmlStr"></div> <div class="detail_content">
<div class="title">
{{ detail_title }}
</div>
<div class="html_text" v-html="htmlStr"></div>
</div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -35,24 +40,31 @@ import {getArticleInfo} from "@/api";
export default { export default {
name: "detail", name: "detail",
metaInfo() {
return {
title: this.detail_title + " | " + localStorage.getItem("corporate_name")
};
},
props: { props: {
newsId: Number, newsId: Number,
classIndex: Number classIndex: Number
}, },
data() { data() {
return { return {
tabs_title: '公司新闻', tabs_title: "公司新闻",
htmlStr: '', htmlStr: "",
} detail_title: ""
};
}, },
mounted() { mounted() {
if(this.classIndex==1){ if (this.classIndex == 1) {
this.tabs_title='行业动态' this.tabs_title = "行业动态";
}else if(this.classIndex==2){ } else if (this.classIndex == 2) {
this.tabs_title='瓷砖百科' this.tabs_title = "瓷砖百科";
} }
getArticleInfo(this.newsId).then(res => { getArticleInfo(this.newsId).then(res => {
this.htmlStr=res.data.articleinfo.content this.detail_title = res.data.articleinfo.title;
this.htmlStr = res.data.articleinfo.content;
}); });
}, },
methods: { methods: {
@ -81,26 +93,29 @@ export default {
// "&summary=" + // "&summary=" +
// this.sysInfo // this.sysInfo
); );
}, }
} }
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
/deep/.el-breadcrumb { /deep/ .el-breadcrumb {
margin-top: 2px; margin-top: 2px;
} }
/deep/.el-breadcrumb__inner.is-link:hover {
color: #333!important; /deep/ .el-breadcrumb__inner.is-link:hover {
color: #333 !important;
text-decoration: underline; text-decoration: underline;
} }
.news_detail { .news_detail {
padding: 40px 0; padding: 40px 0;
.detail { .detail {
.html_text{ .html_text {
padding: 45px; padding: 45px;
} }
.detail_top { .detail_top {
width: 100%; width: 100%;
height: 20px; height: 20px;
@ -125,6 +140,13 @@ export default {
} }
} }
.detail_content {
.title {
padding: 30px 0;
font-size: 25px;
text-align: center;
}
}
} }
} }
</style> </style>

View File

@ -29,6 +29,11 @@ import {getArticleList} from "@/api";
export default { export default {
name: "index", name: "index",
metaInfo() {
return {
title:'新闻资讯 | '+localStorage.getItem('corporate_name')
};
},
components: {Detail, PicturesBox, Pagination, ProductsTabsItem}, components: {Detail, PicturesBox, Pagination, ProductsTabsItem},
data() { data() {
return { return {
@ -71,6 +76,11 @@ export default {
this.$refs.ProductsTabsItem.activeName = i + ""; this.$refs.ProductsTabsItem.activeName = i + "";
} }
} }
if(this.$route.query.newsId!==undefined){
this.newsId = this.$route.query.newsId;
this.showDetail = true;
this.showImage = false;
}
}, },
mounted() { mounted() {
if(this.$route.query.menuDetail){ if(this.$route.query.menuDetail){
@ -110,11 +120,30 @@ export default {
this.classIndex = parseInt(tab.index); this.classIndex = parseInt(tab.index);
if (tab.index == 0) { if (tab.index == 0) {
this.getArticleList(5, this.page, this.limit); this.getArticleList(5, this.page, this.limit);
this.$router.push({
path: "/news",
query: {
menu: 5
}
});
} else if (tab.index == 1) { } else if (tab.index == 1) {
this.getArticleList(6, this.page, this.limit); this.getArticleList(6, this.page, this.limit);
this.$router.push({
path: "/news",
query: {
menu: 6
}
});
} else if (tab.index == 2) { } else if (tab.index == 2) {
this.getArticleList(7, this.page, this.limit); this.getArticleList(7, this.page, this.limit);
this.$router.push({
path: "/news",
query: {
menu: 7
}
});
} }
}, },
// //
handleChangePage(value) { handleChangePage(value) {

View File

@ -10,12 +10,12 @@
</div> </div>
<div class="img_right"> <div class="img_right">
<div class="title"> <div class="title">
产品名称{{detailList.name}} 产品名称{{ detailList.name }}
</div> </div>
<div class="space_style"> <div class="space_style">
<p>产品分类{{classifyName}}</p> <p>产品分类{{ classifyName }}</p>
<p>适用空间{{detailList.space}}</p> <p>适用空间{{ detailList.space }}</p>
<p>所属风格{{detailList.style}}</p> <p>所属风格{{ detailList.style }}</p>
</div> </div>
<div class="img_part"> <div class="img_part">
<ul> <ul>
@ -29,7 +29,7 @@
<span @click="shareToMicroblog()"> <span @click="shareToMicroblog()">
<img src="@/assets/weibo.png" alt=""/> <img src="@/assets/weibo.png" alt=""/>
</span> </span>
<span @click="shareToQQRom()"> <span @click="shareToQQRom()">
<img src="@/assets/QQKJ.png" alt=""/> <img src="@/assets/QQKJ.png" alt=""/>
</span> </span>
</div> </div>
@ -44,10 +44,10 @@
<div class="same_title">同类产品推荐</div> <div class="same_title">同类产品推荐</div>
<div> <div>
<ul> <ul>
<li v-for="(item,index) in goodsList" :key="index"> <li v-for="(item,index) in goodsList" :key="index" @click="handleClickSameProducts(item)">
<div class="sameItem"> <div class="sameItem">
<img :src="item.image" alt=""/> <img :src="item.image" alt=""/>
<div class="info">{{item.name}}</div> <div class="info">{{ item.name }}</div>
</div> </div>
</li> </li>
</ul> </ul>
@ -63,79 +63,107 @@
</template> </template>
<script> <script>
import ProductsTabsItem from "@/components/ProductsTabsItem"; import {getGoodsInfo, getGoodsList} from "@/api";
import {getGoodsInfo, getGoodsList, getPublicData} from "@/api";
export default { export default {
name: "detail", name: "detail",
metaInfo() {
return {
title: this.detailList.name + " | " + localStorage.getItem("corporate_name")
};
},
data() { data() {
return { return {
showNull:false, showNull: false,
mainSrc: '', mainSrc: "",
detailList:[], detailList: [],
imgList: [], imgList: [],
classifyName:'', classifyName: "",
goodsList:[], goodsList: [],
allGoodList:[] allGoodList: []
} };
}, },
mounted() { mounted() {
this.getGoodsInfo(this.$route.query.classid) this.getGoodsInfo(this.$route.query.classid);
this.getGoodsList() this.getGoodsList();
}, },
methods: { methods: {
//
handleClickSameProducts(item) {
this.$router.push({
path: "/products_detail", //
query: { //
classid: item.id
}
});
this.getGoodsInfo(item.id);
},
// //
getGoodsList(){ getGoodsList() {
getGoodsList({ getGoodsList({
classid:1, classid: 1,
page:1, page: 1,
limit:50, limit: 50
}).then(res => { }).then(res => {
this.allGoodList=res.data.list this.allGoodList = res.data.list;
}); });
}, },
// //
getGoodsInfo(classid){ getGoodsInfo(classid) {
getGoodsInfo(classid).then(res => { getGoodsInfo(classid).then(res => {
if(res.data.goods_lists){ if (res.data.goods_lists) {
this.goodsList=res.data.goods_lists this.goodsList = res.data.goods_lists;
} }
if(res.data.goods_lists.length==0){ if (res.data.goods_lists.length == 0) {
this.showNull=true this.showNull = true;
} else {
this.showNull = false;
} }
if(res.data.info){ if (res.data.info) {
this.detailList = res.data.info this.detailList = res.data.info;
this.classifyName = res.data.info.goods_category.name this.classifyName = res.data.info.goods_category.name;
} }
if(res.data.img_list){ if (res.data.img_list) {
this.imgList = res.data.img_list this.imgList = res.data.img_list;
if(this.imgList[0]){ if (this.imgList[0]) {
this.mainSrc=this.imgList[0].ori_image this.mainSrc = this.imgList[0].ori_image;
} }
} }
}); });
}, },
// //
prevProduct(id){ prevProduct(id) {
const middleId=id-1 const middleId = id - 1;
this.$router.push({
path: "/products_detail", //
query: { //
classid: middleId
}
});
for (let i = 0; i < this.allGoodList.length; i++) { for (let i = 0; i < this.allGoodList.length; i++) {
if(this.allGoodList[i].id===middleId){ if (this.allGoodList[i].id === middleId) {
this.getGoodsInfo(middleId) this.getGoodsInfo(middleId);
} }
} }
}, },
// //
nextProduct(id){ nextProduct(id) {
const middleId=id+1 const middleId = id + 1;
this.$router.push({
path: "/products_detail", //
query: { //
classid: middleId
}
});
for (let i = 0; i < this.allGoodList.length; i++) { for (let i = 0; i < this.allGoodList.length; i++) {
if(this.allGoodList[i].id===middleId){ if (this.allGoodList[i].id === middleId) {
this.getGoodsInfo(middleId) this.getGoodsInfo(middleId);
} }
} }
}, },
// //
changeMainImg(index) { changeMainImg(index) {
this.mainSrc = this.imgList[index].ori_image this.mainSrc = this.imgList[index].ori_image;
}, },
/** /**
* 分享到微博 * 分享到微博
@ -162,21 +190,23 @@ export default {
// "&summary=" + // "&summary=" +
// this.sysInfo // this.sysInfo
); );
}, }
} }
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
* { * {
font: 14px/1.8 "微软正黑体", "Microsoft JhengHei", "Microsoft Yahei", "微软雅黑", "Hiragino Sans GB", "冬青黑体", "Arial", "Helvetica", "SimHei", "黑体", "STXihei", "华文细黑", sans-serif; font: 14px/1.8 "微软正黑体", "Microsoft JhengHei", "Microsoft Yahei", "微软雅黑", "Hiragino Sans GB", "冬青黑体", "Arial", "Helvetica", "SimHei", "黑体", "STXihei", "华文细黑", sans-serif;
} }
.nullData{
.nullData {
display: block; display: block;
height: 150px; height: 150px;
line-height: 150px; line-height: 150px;
text-align: center; text-align: center;
} }
/deep/ .el-button:focus, .el-button:hover { /deep/ .el-button:focus, .el-button:hover {
color: #333; color: #333;
border-color: #ddd; border-color: #ddd;
@ -270,8 +300,9 @@ export default {
.shares { .shares {
display: flex; display: flex;
line-height: 35px; line-height: 35px;
span{
img{ span {
img {
cursor: pointer; cursor: pointer;
} }
} }
@ -280,10 +311,11 @@ export default {
} }
} }
.sameProducts{ .sameProducts {
padding: 50px 0; padding: 50px 0;
background-color: #f4f4f4; background-color: #f4f4f4;
.same_title{
.same_title {
display: inline; display: inline;
width: 100%; width: 100%;
float: left; float: left;
@ -292,22 +324,26 @@ export default {
font-size: 18px; font-size: 18px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
} }
ul{
li{ ul {
li {
display: inline; display: inline;
width: 20%; width: 20%;
float: left; float: left;
cursor: pointer; cursor: pointer;
.sameItem{
.sameItem {
display: block; display: block;
margin: 10px; margin: 10px;
padding: 10px; padding: 10px;
border: 1px solid #e9e9e9; border: 1px solid #e9e9e9;
background-color: #fff; background-color: #fff;
img{
img {
width: 100%; width: 100%;
} }
.info{
.info {
padding: 5px 0 5px 0; padding: 5px 0 5px 0;
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;

View File

@ -48,10 +48,15 @@
import ProductsTabsItem from "@/components/ProductsTabsItem"; import ProductsTabsItem from "@/components/ProductsTabsItem";
import Pagination from "@/components/Pagination"; import Pagination from "@/components/Pagination";
import PicturesBox from "@/components/PicturesBox"; import PicturesBox from "@/components/PicturesBox";
import {getPublicData, getGoodsCategory, getGoodsList} from "../../api"; import {getGoodsCategory, getGoodsList, getPublicData} from "../../api";
export default { export default {
name: "index", name: "index",
metaInfo() {
return {
title: "产品中心 | " + localStorage.getItem("corporate_name")
};
},
components: {PicturesBox, Pagination, ProductsTabsItem}, components: {PicturesBox, Pagination, ProductsTabsItem},
data() { data() {
return { return {
@ -69,33 +74,51 @@ export default {
}, },
watch: { watch: {
$route(to) { $route(to) {
if (to.query.menu!==undefined&&to.query.classify===undefined&&to.query.style===undefined&&to.query.space===undefined) { //
if (to.query.menu !== undefined && to.query.classify === undefined && to.query.style === undefined && to.query.space === undefined) {
console.log("点击产品中心的一级分类切换");
//
for (let i = 0; i < this.productTabs.length; i++) { for (let i = 0; i < this.productTabs.length; i++) {
if (this.productTabs[i].id == to.query.menu) { if (this.productTabs[i].id == to.query.menu) {
this.$refs.ProductsTabsItem.activeName = i + ""; this.$refs.ProductsTabsItem.activeName = i + "";
} }
} }
getGoodsCategory(to.query.menu).then(res => { this.getCategory(to.query.menu);
this.classifyList = res.data.categorylist;
});
// //
getGoodsList({ this.getList(to.query.menu, 1, this.pageSize);
classid: to.query.menu,
page: 1,
limit: this.pageSize
}).then(res => {
this.total = res.data.count;
this.imgList = res.data.list;
});
} }
if (to.query.classify == 0) {
if(to.query.classify!==0&&to.query.classify!==undefined){ if (to.query.style == "全部") {
this.getGoodsList(to.query.classify, 1, this.pageSize, to.query.style, to.query.space); this.getList(to.query.menu, 1, this.pageSize, 0, to.query.space);
} else if (to.query.classify == 0) { if (to.query.space == "全部") {
this.getGoodsList(to.query.menu, 1, this.pageSize, to.query.style, to.query.space); this.getList(to.query.menu, 1, this.pageSize, 0, 0);
}
} else if (to.query.space == "全部") {
this.getList(to.query.menu, 1, this.pageSize, to.query.style, 0);
if (to.query.style == "全部") {
this.getList(to.query.menu, 1, this.pageSize, 0, 0);
}
} else {
this.getList(to.query.menu, 1, this.pageSize, to.query.style, to.query.space);
}
} else if (to.query.classify != 0) {
if (to.query.style == "全部") {
this.getList(to.query.classify, 1, this.pageSize, 0, to.query.space);
if (to.query.space == "全部") {
this.getList(to.query.classify, 1, this.pageSize, 0, 0);
}
} else if (to.query.space == "全部") {
this.getList(to.query.classify, 1, this.pageSize, to.query.style, 0);
if (to.query.style == "全部") {
this.getList(to.query.classify, 1, this.pageSize, 0, 0);
}
} else {
this.getList(to.query.classify, 1, this.pageSize, to.query.style, to.query.space);
}
} }
} }
}, },
//,
beforeUpdate() { beforeUpdate() {
if (this.$route.query.menu) { if (this.$route.query.menu) {
for (let i = 0; i < this.productTabs.length; i++) { for (let i = 0; i < this.productTabs.length; i++) {
@ -113,37 +136,43 @@ export default {
red.style = "color: #000!important;"; red.style = "color: #000!important;";
} }
} }
}else { } else {
for (let i = 0; i < this.classifyList.length; i++) { for (let i = 0; i < this.classifyList.length; i++) {
const red = document.getElementById("classify_" + i); const red = document.getElementById("classify_" + i);
red.style = "color: #000!important;"; red.style = "color: #000!important;";
} }
} }
if (this.$route.query.space) { if (this.$route.query.space || this.$route.query.menuTitle) {
for (let i = 0; i < this.spaceList.length; i++) { for (let i = 0; i < this.spaceList.length; i++) {
const red = document.getElementById("space_" + i); const red = document.getElementById("space_" + i);
if (this.spaceList[i].title == this.$route.query.space) { if (this.spaceList[i].title == this.$route.query.space) {
red.style = "color: #f00!important;text-decoration: underline!important;"; red.style = "color: #f00!important;text-decoration: underline!important;";
} else if (this.spaceList[i].title == this.$route.query.menuTitle) {
red.style = "color: #f00!important;text-decoration: underline!important;";
this.getList(this.$route.query.menu, 1, this.pageSize, "", this.$route.query.menuTitle);
} else { } else {
red.style = "color: #000!important;"; red.style = "color: #000!important;";
} }
} }
}else { } else {
for (let i = 0; i < this.spaceList.length; i++) { for (let i = 0; i < this.spaceList.length; i++) {
const red = document.getElementById("space_" + i); const red = document.getElementById("space_" + i);
red.style = "color: #000!important;"; red.style = "color: #000!important;";
} }
} }
if (this.$route.query.style) { if (this.$route.query.style || this.$route.query.menuTitle) {
for (let i = 0; i < this.styleList.length; i++) { for (let i = 0; i < this.styleList.length; i++) {
const red = document.getElementById("style_" + i); const red = document.getElementById("style_" + i);
if (this.styleList[i].title == this.$route.query.style) { if (this.styleList[i].title == this.$route.query.style) {
red.style = "color: #f00!important;text-decoration: underline!important;"; red.style = "color: #f00!important;text-decoration: underline!important;";
} else if (this.styleList[i].title == this.$route.query.menuTitle) {
red.style = "color: #f00!important;text-decoration: underline!important;";
this.getList(this.$route.query.menu, 1, this.pageSize, this.$route.query.menuTitle, "");
} else { } else {
red.style = "color: #000!important;"; red.style = "color: #000!important;";
} }
} }
}else { } else {
for (let i = 0; i < this.styleList.length; i++) { for (let i = 0; i < this.styleList.length; i++) {
const red = document.getElementById("style_" + i); const red = document.getElementById("style_" + i);
red.style = "color: #000!important;"; red.style = "color: #000!important;";
@ -151,37 +180,48 @@ export default {
} }
}, },
mounted() { mounted() {
if(this.$route.query.menu&&this.$route.query.space){ //
getGoodsCategory(this.$route.query.menu).then(res => {
this.classifyList = res.data.categorylist;
});
this.getGoodsList(this.classIndex, 1, this.pageSize, "", this.$route.query.space);
}
getPublicData().then(res => { getPublicData().then(res => {
this.productTabs = res.data.goodscategory_list; this.productTabs = res.data.goodscategory_list;
this.spaceList = [
{
title: "全部"
},
...res.data.space_list
];
this.styleList = [
{
title: "全部"
},
...res.data.style_list
];
}); });
//
getPublicData().then(res => { //,,
this.spaceList = res.data.space_list; if (this.$route.query.menu) {
this.styleList = res.data.style_list; this.getCategory(this.$route.query.menu);
}); this.getList(this.$route.query.menu, 1, this.pageSize, this.$route.query.style, this.$route.query.space);
if (this.$route.query.menu&&this.$route.query.space==undefined) { } else if (this.$route.query.menu == undefined) {
//, //,
getGoodsCategory(this.$route.query.menu).then(res => { this.getCategory(1);
this.classifyList = res.data.categorylist; this.getList(1, 1, this.pageSize);
});
this.getGoodsList(this.$route.query.menu, 1, this.pageSize);
}else if (this.$route.query.menu==undefined&&this.$route.query.space==undefined){
//,
getGoodsCategory(1).then(res => {
this.classifyList = res.data.categorylist;
});
this.getGoodsList(1, 1, this.pageSize);
} }
}, },
methods: { methods: {
//
getCategory(category) {
getGoodsCategory(category).then(res => {
this.classifyList = [
{
id: 0,
name: "全部"
},
...res.data.categorylist
];
});
},
// //
getGoodsList(classid, page, limit, stylename, spacename) { getList(classid, page, limit, stylename, spacename) {
getGoodsList({ getGoodsList({
classid: classid, classid: classid,
page: page, page: page,
@ -194,7 +234,7 @@ export default {
if (res.data.list.length == 0) { if (res.data.list.length == 0) {
this.showNull = true; this.showNull = true;
this.showPagination = false; this.showPagination = false;
}else { } else {
this.showNull = false; this.showNull = false;
this.showPagination = true; this.showPagination = true;
} }
@ -210,9 +250,7 @@ export default {
menu: index menu: index
} }
}); });
getGoodsCategory(index).then(res => { this.getCategory(index);
this.classifyList = res.data.categorylist;
});
this.getGoodsList(index, 1, this.pageSize); this.getGoodsList(index, 1, this.pageSize);
}, },
// //
@ -221,103 +259,68 @@ export default {
}, },
//, //,
changeClassify(item) { changeClassify(item) {
let menu=this.$route.query.menu let menu = this.$route.query.menu;
let space=this.$route.query.space let space = this.$route.query.space;
let style=this.$route.query.style let style = this.$route.query.style;
if(menu===undefined){ if (menu === undefined) {
const menuOne=1 const menuOne = 1;
menu=menuOne menu = menuOne;
}if(space===undefined){
const menuOne=0
space=menuOne
}if(style===undefined){
const menuOne=0
style=menuOne
} }
// if(space==undefined&&style==undefined){ if (space === undefined || space === "全部") {
// this.$router.push({ const menuOne = 0;
// path: '/products_center', space = menuOne;
// query: { }
// classify: item.name if (style === undefined || style === "全部") {
// } const menuOne = 0;
// }); style = menuOne;
// }else if(style==undefined){ }
// this.$router.push({ this.$router.push({
// path: `/products_center?menu=${menu}&space=${space}`, path: `/products_center?menu=${menu}&space=${space}&style=${style}`,
// query: { query: {
// classify: item.name classify: item.id
// } }
// }); });
// }else if(space==undefined){
// this.$router.push({
// path: `/products_center?menu=${menu}&style=${style}`,
// query: {
// classify: item.name
// }
// });
// }else {
this.$router.push({
path: `/products_center?menu=${menu}&space=${space}&style=${style}`,
query: {
classify: item.id
}
});
// }
// this.getGoodsList(item.id, 1, this.pageSize);
}, },
//, //,
changeSpace(item) { changeSpace(item) {
let menu=this.$route.query.menu let menu = this.$route.query.menu;
let style=this.$route.query.style let style = this.$route.query.style;
let classify=this.$route.query.classify let classify = this.$route.query.classify;
if(menu===undefined){ if (menu === undefined) {
const menuOne=1 const menuOne = 1;
menu=menuOne menu = menuOne;
}if(style===undefined){
const menuOne=0
style=menuOne
}if(classify===undefined){
const menuOne=0
classify=menuOne
} }
// if(style!==undefined){ if (style === undefined) {
// this.$router.push({ const menuOne = 0;
// path: `/products_center?menu=${menu}&style=${style}`, style = menuOne;
// query: { }
// space: item.title if (classify === undefined) {
// } const menuOne = 0;
// }); classify = menuOne;
// }else if(style==undefined&&classify==undefined){ }
// this.$router.push({ this.$router.push({
// path: `/products_center?menu=${menu}`, path: `/products_center?menu=${menu}&classify=${classify}&style=${style}`,
// query: { query: {
// space: item.title space: item.title
// } }
// }); });
// }else if(style!==undefined&&space!==undefined){
this.$router.push({
path: `/products_center?menu=${menu}&classify=${classify}&style=${style}`,
query: {
space: item.title
}
});
// }
// this.getGoodsList(this.classIndex, 1, this.pageSize, "", item.title);
}, },
//, //,
changeStyle(item) { changeStyle(item) {
let menu=this.$route.query.menu let menu = this.$route.query.menu;
let space=this.$route.query.space let space = this.$route.query.space;
let classify=this.$route.query.classify let classify = this.$route.query.classify;
if(menu===undefined){ if (menu === undefined) {
const menuOne=1 const menuOne = 1;
menu=menuOne menu = menuOne;
} if(space===undefined){ }
const menuOne=0 if (space === undefined) {
space=menuOne const menuOne = 0;
} if(classify===undefined){ space = menuOne;
const menuOne=0 }
classify=menuOne if (classify === undefined) {
const menuOne = 0;
classify = menuOne;
} }
this.$router.push({ this.$router.push({
path: `/products_center?menu=${menu}&classify=${classify}&space=${space}`, path: `/products_center?menu=${menu}&classify=${classify}&space=${space}`,
@ -325,22 +328,6 @@ export default {
style: item.title style: item.title
} }
}); });
// if(space!==undefined){
// this.$router.push({
// path: `/products_center?menu=${menu}&space=${space}`,
// query: {
// style: item.title
// }
// });
// }else {
// this.$router.push({
// path: `/products_center?menu=${menu}`,
// query: {
// style: item.title
// }
// });
// }
// this.getGoodsList(this.classIndex, 1, this.pageSize, item.title, "");
} }
} }
}; };