|
|
@@ -328,8 +328,23 @@ export default {
|
|
|
adPlaceList:[]
|
|
|
}
|
|
|
console.log(this.$store.state.template.webSiteData)
|
|
|
- //第一步:获得全局的顶部广告
|
|
|
- data.adPlaceList.push(this.$store.state.template.webSiteData.ad.top);
|
|
|
+
|
|
|
+ //判断当前的皮肤是否需要提交顶部广告
|
|
|
+ if(this.$store.state.template.webSiteData.style.styleId == 5 ||
|
|
|
+ this.$store.state.template.webSiteData.style.styleId == 6 ||
|
|
|
+ this.$store.state.template.webSiteData.style.styleId == 7 ||
|
|
|
+ this.$store.state.template.webSiteData.style.styleId == 8){
|
|
|
+
|
|
|
+ console.log("广告列表不能为空,提交一个空的顶部广告防止报错")
|
|
|
+ this.$store.state.template.webSiteData.ad.top.name = "顶部广告占位";
|
|
|
+ this.$store.state.template.webSiteData.ad.top.introduce = "顶部广告占位";
|
|
|
+ this.$store.state.template.webSiteData.ad.top.price = 0;
|
|
|
+ data.adPlaceList.push(this.$store.state.template.webSiteData.ad.top);
|
|
|
+ }else{
|
|
|
+ //需要提交顶部广告
|
|
|
+ data.adPlaceList.push(this.$store.state.template.webSiteData.ad.top);
|
|
|
+ }
|
|
|
+
|
|
|
//第二步:遍历每一个页面的广告位
|
|
|
const adTypes = ['index', 'class', 'list', 'article', 'search', 'aloneList', 'aloneArticle'];
|
|
|
adTypes.forEach(type => {
|
|
|
@@ -359,7 +374,8 @@ export default {
|
|
|
//第三步:保存网站
|
|
|
let data = JSON.stringify(this.$store.state.template.webSiteData);
|
|
|
this.$store.dispatch('template/saveWebsiteTemplate',{
|
|
|
- website_id:this.$route.query.website_id,
|
|
|
+ website_id:parseFloat(this.$route.query.website_id),
|
|
|
+ template_id:parseFloat(this.$route.query.style),
|
|
|
template_data:data,
|
|
|
canvas_data:canvasData
|
|
|
}).then(res=>{
|