|
@@ -1,89 +1,93 @@
|
|
<template>
|
|
<template>
|
|
- <div class="mainBox">
|
|
|
|
- <div class="layerBox" v-if="this.$store.state.template.stepStatus">
|
|
|
|
- <tableTitle :name="templateStepTitle"/>
|
|
|
|
- <step :activeNumber="2"/>
|
|
|
|
- </div>
|
|
|
|
- <!--搜索功能 start------------------------------------------------------------>
|
|
|
|
- <div class="layerBox_search">
|
|
|
|
- <div class="layerBoxLine">
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="8">
|
|
|
|
- <div class="searchBox">
|
|
|
|
- <div class="searchTitle">按风格搜索</div>
|
|
|
|
- <el-select v-model="getApiData.template_class_id" placeholder="请选择..">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in allClass"
|
|
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value">
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <div class="mainBox">
|
|
|
|
+ <div class="layerBox">
|
|
|
|
+ <tableTitle :name="templateStepTitle" />
|
|
|
|
+ <step :activeNumber="2" />
|
|
|
|
+ </div>
|
|
|
|
+ <!--搜索功能 start------------------------------------------------------------>
|
|
|
|
+ <div class="layerBox_search">
|
|
|
|
+ <div class="layerBoxLine">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <div class="searchBox">
|
|
|
|
+ <div class="searchTitle">按风格搜索</div>
|
|
|
|
+ <el-select v-model="getApiData.template_class_id" placeholder="请选择..">
|
|
|
|
+ <el-option v-for="item in allClass" :key="item.value" :label="item.label"
|
|
|
|
+ :value="item.value">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <div class="searchBox">
|
|
|
|
+ <div class="searchTitle">按关键字搜索</div>
|
|
|
|
+ <el-input v-model="getApiData.keyword[0]" placeholder="根据描述推荐皮肤"></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <div class="searchBtnBox">
|
|
|
|
+ <el-button type="primary" @click="getData('search')">搜索</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
</div>
|
|
</div>
|
|
- </el-col>
|
|
|
|
- <el-col :span="8">
|
|
|
|
- <div class="searchBox">
|
|
|
|
- <div class="searchTitle">按关键字搜索</div>
|
|
|
|
- <el-input v-model="getApiData.keyword" placeholder="根据您的描述自动推荐皮肤"></el-input>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <!--搜索功能 end------------------------------------------------------------>
|
|
|
|
+ <!--表格内容 start------------------------------------------------------------>
|
|
|
|
+ <div class="layerBox">
|
|
|
|
+ <tableTitle :name="tableDivTitle" />
|
|
|
|
+ <div class="templateStyleBox">
|
|
|
|
+ <div class="templateStyleItem" v-for="(item, index) in tableData" :key="index">
|
|
|
|
+ <div :class="['templateStyleItemBox', { active: item.status == 1 || item.id == userTemplateId }]" @click="useIt(item)">
|
|
|
|
+ <img :src="item.template_img[0].url">
|
|
|
|
+ <div class="templateStyleItemTitle">{{ item.template_name }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- </el-col>
|
|
|
|
- <el-col :span="8">
|
|
|
|
- <div class="searchBtnBox">
|
|
|
|
- <el-button type="primary" @click="getData('search')">搜索</el-button>
|
|
|
|
|
|
+ <div class="paginationBox">
|
|
|
|
+ <el-pagination
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ :current-page="getApiData.page"
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ :page-size="10"
|
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
|
+ :total="allCount"
|
|
|
|
+ >
|
|
|
|
+ </el-pagination>
|
|
</div>
|
|
</div>
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <!--搜索功能 end------------------------------------------------------------>
|
|
|
|
- <!--表格内容 start------------------------------------------------------------>
|
|
|
|
- <div class="layerBox">
|
|
|
|
- <tableTitle :name="tableDivTitle"/>
|
|
|
|
- <div class="templateStyleBox">
|
|
|
|
- <div class="templateStyleItem" v-for="(item,index) in tableData" :key="index">
|
|
|
|
- <div :class="['templateStyleItemBox',{active:item.status === 1}]" @click="useIt(item)">
|
|
|
|
- <img :src="item.template_img[0].url">
|
|
|
|
- <div class="templateStyleItemTitle">{{item.template_name}}</div>
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <div class="paginationBox">
|
|
|
|
- <el-pagination @size-change="handleSizeChange" :current-page="getApiData.page" @current-change="handleCurrentChange" :page-size="10" layout="total, prev, pager, next, jumper" :total="allCount"></el-pagination>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="layerBox">
|
|
|
|
- <tableTitle :name="useTemplateName"/>
|
|
|
|
- <div class="thumbnailBox">
|
|
|
|
- <div class="thumbnailItem" @click="showImg(item.url)" v-for="item in userData">
|
|
|
|
- <div class="thumbnailItemBox">
|
|
|
|
- <img :src="item.url">
|
|
|
|
- <div class="thumbnailItemTitle">{{item.name}}</div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="layerBox">
|
|
|
|
+ <tableTitle :name="useTemplateName" />
|
|
|
|
+ <div class="thumbnailBox">
|
|
|
|
+ <div class="thumbnailItem" @click="showImg(item.url)" v-for="item in userData">
|
|
|
|
+ <div class="thumbnailItemBox">
|
|
|
|
+ <img :src="item.url">
|
|
|
|
+ <div class="thumbnailItemTitle">{{ item.name }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <!--步骤按钮 start------------------------------------------------------------>
|
|
|
|
- <div class="btnBox">
|
|
|
|
- <el-button type="info" @click="goBase">上一步</el-button>
|
|
|
|
- <el-button type="primary" @click="editData" v-if="this.$route.query.step>=2">编辑并进入下一步</el-button>
|
|
|
|
- <el-button type="primary" @click="addData" v-else>保存并进入下一步</el-button>
|
|
|
|
- </div>
|
|
|
|
- <!--步骤按钮 end------------------------------------------------------------>
|
|
|
|
- <!--表格内容 end------------------------------------------------------------>
|
|
|
|
-
|
|
|
|
- <!--弹出框 start------------------------------------------------------------>
|
|
|
|
- <el-dialog title="模板详情" :visible.sync="windowStatus" :close-on-click-modal="false">
|
|
|
|
- <div class="imgZoomBox">
|
|
|
|
- <img :src="classPic">
|
|
|
|
- </div>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <div class="alignCenterBox">
|
|
|
|
- <el-button @click="windowStatus=false">关闭</el-button>
|
|
|
|
|
|
+ <!--步骤按钮 start------------------------------------------------------------>
|
|
|
|
+ <div class="btnBox">
|
|
|
|
+ <el-button type="info" @click="goBase">上一步</el-button>
|
|
|
|
+ <el-button type="primary" @click="addData">下一步</el-button>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
- <!--弹出框 end------------------------------------------------------------>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <!--步骤按钮 end------------------------------------------------------------>
|
|
|
|
+ <!--表格内容 end------------------------------------------------------------>
|
|
|
|
+
|
|
|
|
+ <!--弹出框 start------------------------------------------------------------>
|
|
|
|
+ <el-dialog title="模板详情" :visible.sync="windowStatus" :close-on-click-modal="false">
|
|
|
|
+ <div class="imgZoomBox">
|
|
|
|
+ <img :src="classPic">
|
|
|
|
+ </div>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <div class="alignCenterBox">
|
|
|
|
+ <el-button @click="windowStatus = false">关闭</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <!--弹出框 end------------------------------------------------------------>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -95,323 +99,302 @@ import '@/styles/global.less';
|
|
import step from './public/step';
|
|
import step from './public/step';
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- components: {
|
|
|
|
- tableTitle,//表格标题
|
|
|
|
- step//步骤条
|
|
|
|
- },
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- //1.列表和分页相关 start ------------------------------------------------------------>
|
|
|
|
- templateStepTitle:"仅需四步,即可完成模板创建",
|
|
|
|
- tableDivTitle:"模板列表",
|
|
|
|
- useTemplateName:"已选择风格",
|
|
|
|
- allClass:[],//所有风格
|
|
|
|
- windowStatus:false,//弹出框
|
|
|
|
- classPic:"",//放大缩略图
|
|
|
|
- tableData:[],//内容
|
|
|
|
- getApiData:{//搜索功能
|
|
|
|
- website_id:"",
|
|
|
|
- template_class_id:"",
|
|
|
|
- page:1,
|
|
|
|
- pageSize:10
|
|
|
|
- },
|
|
|
|
- //用户选择的页面模板
|
|
|
|
- userData:[],
|
|
|
|
- userTemplateId:"",//用户选择的模板风格id
|
|
|
|
- allCount:0,//总条数
|
|
|
|
- //分页相关 end ------------------------------------------------------------>
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- //0.全局操作 start ------------------------------------------------------------>
|
|
|
|
- //上一步
|
|
|
|
- goBase(){
|
|
|
|
- //先判断当前的url里面是否存在website_id和step
|
|
|
|
- if(this.$route.query.step!=undefined&&this.$route.query.website_id!=undefined){
|
|
|
|
- this.$router.push({
|
|
|
|
- path: '/templateBase',
|
|
|
|
- query: {
|
|
|
|
- website_id: this.$route.query.website_id,
|
|
|
|
- step:this.$route.query.step
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }else{
|
|
|
|
- this.$router.push({
|
|
|
|
- path: '/templateBase',
|
|
|
|
- query: {
|
|
|
|
- website_id: this.$route.query.website_id
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //放大缩略图
|
|
|
|
- showImg(img){
|
|
|
|
- this.windowStatus = true;
|
|
|
|
- this.classPic = img;
|
|
|
|
|
|
+ components: {
|
|
|
|
+ tableTitle,//表格标题
|
|
|
|
+ step//步骤条
|
|
},
|
|
},
|
|
- //0.全局操作 end ------------------------------------------------------------>
|
|
|
|
-
|
|
|
|
- //1.风格列表 start ------------------------------------------------------------>
|
|
|
|
- //1.1 获得所有风格
|
|
|
|
- getAllClass(type){
|
|
|
|
- this.$store.dispatch('template/getAllTemplateClass',this.getApiData).then(res=> {
|
|
|
|
- if(res.code!=200){
|
|
|
|
- this.$message.error(res.message)
|
|
|
|
- }else{
|
|
|
|
- for(let item of res.data){
|
|
|
|
- let data = {};
|
|
|
|
- data.value = item.id
|
|
|
|
- data.label = item.name
|
|
|
|
- this.allClass.push(data)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- //1.2 获得所有模板
|
|
|
|
- getData(type){
|
|
|
|
- this.$store.dispatch('template/getWebsiteTemplateList',this.getApiData).then(res=> {
|
|
|
|
- if(res.code != 200){
|
|
|
|
- this.$message.error(res.message)
|
|
|
|
- //展示数据
|
|
|
|
- this.tableData = [];
|
|
|
|
- //总条数
|
|
|
|
- this.allCount = 0;
|
|
|
|
- //还原当前页数
|
|
|
|
- this.getApiData.page = 1;
|
|
|
|
- }else{
|
|
|
|
- for(let item of res.data.rows){
|
|
|
|
- item.status = 0;
|
|
|
|
- }
|
|
|
|
- console.log(res.data.rows)
|
|
|
|
- //展示数据
|
|
|
|
- this.tableData = res.data.rows;
|
|
|
|
- //总条数
|
|
|
|
- this.allCount = res.data.count;
|
|
|
|
- //判断是否需要回显选择
|
|
|
|
- if(this.$route.query.step!=undefined&&this.$route.query.step>=2){
|
|
|
|
- this.getUserTemplate();
|
|
|
|
- }
|
|
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ //1.列表和分页相关 start ------------------------------------------------------------>
|
|
|
|
+ templateStepTitle: "仅需四步,即可完成模板创建",
|
|
|
|
+ tableDivTitle: "模板列表",
|
|
|
|
+ useTemplateName: "已选择风格",
|
|
|
|
+ allClass: [],//所有风格
|
|
|
|
+ windowStatus: false,//弹出框
|
|
|
|
+ classPic: "",//放大缩略图
|
|
|
|
+ tableData: [],//内容
|
|
|
|
+ getApiData: {//搜索功能
|
|
|
|
+ website_id: "",
|
|
|
|
+ template_class_id: "",
|
|
|
|
+ keyword: [],
|
|
|
|
+ page: 1,
|
|
|
|
+ page_size: 10
|
|
|
|
+ },
|
|
|
|
+ //用户选择的页面模板
|
|
|
|
+ userData: [],
|
|
|
|
+ userTemplateId: "",//用户选择的模板风格id
|
|
|
|
+ allCount: 0,//总条数
|
|
|
|
+ //分页相关 end ------------------------------------------------------------>
|
|
}
|
|
}
|
|
- })
|
|
|
|
- },
|
|
|
|
- //1.3 选中一个模板
|
|
|
|
- useIt(item){
|
|
|
|
- for(let item of this.tableData){
|
|
|
|
- item.status = 0;
|
|
|
|
- }
|
|
|
|
- item.status = 1;
|
|
|
|
- this.userData = item.template_img;
|
|
|
|
- this.userTemplateId = item.id;
|
|
|
|
},
|
|
},
|
|
- //1.4 列表内容分页
|
|
|
|
- //直接跳转
|
|
|
|
- handleSizeChange(val) {
|
|
|
|
- this.getApiData.page = val;
|
|
|
|
- this.getData();
|
|
|
|
- },
|
|
|
|
- //1.5 点击分页
|
|
|
|
- handleCurrentChange(val) {
|
|
|
|
- this.getApiData.page = val;
|
|
|
|
- this.getData();
|
|
|
|
- },
|
|
|
|
- //1.风格列表 end ------------------------------------------------------------>
|
|
|
|
- //2.提交风格模板 start ------------------------------------------------------------>
|
|
|
|
- addData(){
|
|
|
|
- //2.1 判断是否已经选择了模板
|
|
|
|
- console.log(this.userData.length)
|
|
|
|
- if(this.userData.length==0){
|
|
|
|
- console.log("未选择模板")
|
|
|
|
- this.$message.error("必须选择一个模板风格!")
|
|
|
|
- }else{
|
|
|
|
- let data = {
|
|
|
|
- website_id:this.$route.query.website_id,
|
|
|
|
- template_id:this.userTemplateId
|
|
|
|
- }
|
|
|
|
- //console.log(this.userTemplateId)
|
|
|
|
- //this.$route.query.website_id
|
|
|
|
- this.$store.dispatch('template/addWebsiteTemplateclassintel',data).then(res=> {
|
|
|
|
- if(res.code!=200){
|
|
|
|
- this.$message.error(res.message)
|
|
|
|
- }else{
|
|
|
|
- this.$message.success('模板风格保存成功!');
|
|
|
|
- //保存模板风格成功,开始构建网站
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ //0.全局操作 start ------------------------------------------------------------>
|
|
|
|
+ //上一步
|
|
|
|
+ goBase() {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
- path: '/templateCreat',
|
|
|
|
- query: {
|
|
|
|
- website_id: this.$route.query.website_id,
|
|
|
|
- step:2,
|
|
|
|
- style:1
|
|
|
|
- }
|
|
|
|
|
|
+ path: '/templateBase',
|
|
|
|
+ query: {
|
|
|
|
+ website_id: this.$route.query.website_id
|
|
|
|
+ }
|
|
});
|
|
});
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //回显数据
|
|
|
|
- getUserTemplate(){
|
|
|
|
- this.$store.dispatch('template/getWebsiteTemplateclassintel',{website_id:this.$route.query.website_id}).then(res=> {
|
|
|
|
- let that = this;
|
|
|
|
- if(res.code!=200){
|
|
|
|
- this.$message.error(res.message)
|
|
|
|
- }else{
|
|
|
|
- for(let item of that.tableData){
|
|
|
|
- if(item.id == res.data.tid){
|
|
|
|
- item.status = 1;
|
|
|
|
|
|
+ },
|
|
|
|
+ //放大缩略图
|
|
|
|
+ showImg(img) {
|
|
|
|
+ this.windowStatus = true;
|
|
|
|
+ this.classPic = img;
|
|
|
|
+ },
|
|
|
|
+ //0.全局操作 end ------------------------------------------------------------>
|
|
|
|
+
|
|
|
|
+ //1.风格列表 start ------------------------------------------------------------>
|
|
|
|
+ //1.1 获得所有风格
|
|
|
|
+ getAllClass(type) {
|
|
|
|
+ this.$store.dispatch('template/getAllTemplateClass', this.getApiData).then(res => {
|
|
|
|
+ if (res.code != 200) {
|
|
|
|
+ this.$message.error(res.message)
|
|
|
|
+ } else {
|
|
|
|
+ for (let item of res.data) {
|
|
|
|
+ let data = {};
|
|
|
|
+ data.value = item.id
|
|
|
|
+ data.label = item.name
|
|
|
|
+ this.allClass.push(data)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //1.2 获得所有模板
|
|
|
|
+ getData(type) {
|
|
|
|
+ this.$store.dispatch('template/getWebsiteTemplateList', this.getApiData).then(res => {
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ console.log(res.data)
|
|
|
|
+ let data = res.data.template.data;
|
|
|
|
+ //格式化data中的template_img
|
|
|
|
+ for(let item of data){
|
|
|
|
+ item.template_img = JSON.parse(item.template_img);
|
|
|
|
+ console.log(item.template_img[0].url)
|
|
|
|
+ item.status = 0;
|
|
|
|
+ }
|
|
|
|
+ console.log(data)
|
|
|
|
+ //展示数据
|
|
|
|
+ this.tableData = data;
|
|
|
|
+ //总条数
|
|
|
|
+ this.allCount = res.data.template.total;
|
|
|
|
+ //标记用户之前的选择
|
|
|
|
+ if(res.data.template_id==0||res.data.template_id==null){
|
|
|
|
+ console.log("用户从未选择过皮肤!")
|
|
|
|
+ }else{
|
|
|
|
+ this.userTemplateId = res.data.template_id;
|
|
|
|
+ for(let item of this.tableData){
|
|
|
|
+ if(item.id == this.userTemplateId){
|
|
|
|
+ item.status = 1;
|
|
|
|
+ this.userData = item.template_img;
|
|
|
|
+ this.userTemplateId = item.id;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.error(res.message)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //1.3 选中一个模板
|
|
|
|
+ useIt(item) {
|
|
|
|
+ for (let item of this.tableData) {
|
|
|
|
+ item.status = 0;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //给与所选缩略图
|
|
|
|
- this.userData = res.data.template_img;
|
|
|
|
- //给与所选id
|
|
|
|
- this.userTemplateId = res.data.tid;
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- editData(){
|
|
|
|
- //编辑的时候就不用判断是否有选中了,因为必定有选中的
|
|
|
|
- let data = {
|
|
|
|
- website_id:this.$route.query.website_id,
|
|
|
|
- template_id:this.userTemplateId
|
|
|
|
- }
|
|
|
|
- //console.log(this.userTemplateId)
|
|
|
|
- //this.$route.query.website_id
|
|
|
|
- this.$store.dispatch('template/addWebsiteTemplateclassintel',data).then(res=> {
|
|
|
|
- if(res.code!=200){
|
|
|
|
- this.$message.error(res.message)
|
|
|
|
- }else{
|
|
|
|
- this.$message.success('模板风格编辑成功!');
|
|
|
|
- //保存模板风格成功,开始构建网站
|
|
|
|
- this.$router.push({
|
|
|
|
- path: '/templateCreat',
|
|
|
|
- query: {
|
|
|
|
- website_id: this.$route.query.website_id,
|
|
|
|
- step:this.$route.query.step,
|
|
|
|
- style:1
|
|
|
|
|
|
+ item.status = 1;
|
|
|
|
+ this.userData = item.template_img;
|
|
|
|
+ this.userTemplateId = item.id;
|
|
|
|
+ },
|
|
|
|
+ //1.4 列表内容分页
|
|
|
|
+ //直接跳转
|
|
|
|
+ handleSizeChange(val) {
|
|
|
|
+ this.getApiData.page = val;
|
|
|
|
+ this.getData();
|
|
|
|
+ },
|
|
|
|
+ //1.5 点击分页
|
|
|
|
+ handleCurrentChange(val) {
|
|
|
|
+ this.getApiData.page = val;
|
|
|
|
+ this.getData();
|
|
|
|
+ },
|
|
|
|
+ //1.风格列表 end ------------------------------------------------------------>
|
|
|
|
+ //2.提交风格模板 start ------------------------------------------------------------>
|
|
|
|
+ addData() {
|
|
|
|
+ //2.1 判断是否已经选择了模板
|
|
|
|
+ console.log(this.userData.length)
|
|
|
|
+ if (this.userData.length == 0) {
|
|
|
|
+ console.log("未选择模板")
|
|
|
|
+ this.$message.error("必须选择一个模板风格!")
|
|
|
|
+ } else {
|
|
|
|
+ let data = {
|
|
|
|
+ website_id: this.$route.query.website_id,
|
|
|
|
+ template_id: this.userTemplateId
|
|
|
|
+ }
|
|
|
|
+ //console.log(this.userTemplateId)
|
|
|
|
+ //this.$route.query.website_id
|
|
|
|
+ this.$store.dispatch('template/addWebsiteTemplateclassintel', data).then(res => {
|
|
|
|
+ if (res.code != 200) {
|
|
|
|
+ this.$message.error(res.message)
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.success('模板风格保存成功!');
|
|
|
|
+ //保存模板风格成功,开始构建网站
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '/templateCreat',
|
|
|
|
+ query: {
|
|
|
|
+ website_id: this.$route.query.website_id,
|
|
|
|
+ style: 1
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- });
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- //2.提交风格模板 end ------------------------------------------------------------>
|
|
|
|
- },
|
|
|
|
- mounted(){
|
|
|
|
- //给与网站id
|
|
|
|
- this.getApiData.website_id = this.$route.query.website_id;
|
|
|
|
- //获取所有风格
|
|
|
|
- this.getAllClass();
|
|
|
|
- //获取所有模板
|
|
|
|
- this.getData();
|
|
|
|
-
|
|
|
|
- if(this.$route.query.step!=undefined&&this.$route.query.step>=2){
|
|
|
|
- console.log("编辑风格!")
|
|
|
|
- //this.getUserTemplate();
|
|
|
|
- }else{
|
|
|
|
- console.log("选择风格!")
|
|
|
|
|
|
+ },
|
|
|
|
+ //回显数据
|
|
|
|
+ getUserTemplate() {
|
|
|
|
+ this.$store.dispatch('template/getWebsiteTemplateclassintel', { website_id: this.$route.query.website_id }).then(res => {
|
|
|
|
+ let that = this;
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ for (let item of that.tableData) {
|
|
|
|
+ if (item.id == res.data.tid) {
|
|
|
|
+ item.status = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //给与所选缩略图
|
|
|
|
+ this.userData = res.data.template_img;
|
|
|
|
+ //给与所选id
|
|
|
|
+ this.userTemplateId = res.data.tid;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.message)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //2.提交风格模板 end ------------------------------------------------------------>
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ //给与网站id
|
|
|
|
+ this.getApiData.website_id = this.$route.query.website_id;
|
|
|
|
+ //获取所有风格
|
|
|
|
+ this.getAllClass();
|
|
|
|
+ //获取所有皮肤
|
|
|
|
+ this.getData();
|
|
}
|
|
}
|
|
- }
|
|
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|
|
<style scoped lang="less">
|
|
- .searchBtnBox {
|
|
|
|
|
|
+.searchBtnBox {
|
|
padding-top: 26px;
|
|
padding-top: 26px;
|
|
text-align: right;
|
|
text-align: right;
|
|
- }
|
|
|
|
- .paginationBox {
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.paginationBox {
|
|
padding: 20px 0 0 0;
|
|
padding: 20px 0 0 0;
|
|
text-align: center;
|
|
text-align: center;
|
|
- }
|
|
|
|
- .btnBox {
|
|
|
|
- padding:0 0 40px 0;
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.btnBox {
|
|
|
|
+ padding: 0 0 40px 0;
|
|
text-align: center;
|
|
text-align: center;
|
|
- }
|
|
|
|
- .thumbnailBox {
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.thumbnailBox {
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
- justify-content:flex-start;
|
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+
|
|
.thumbnailItem {
|
|
.thumbnailItem {
|
|
- //width: 12.5%;
|
|
|
|
- width: 180px;
|
|
|
|
- height: 180px;
|
|
|
|
- text-align: center;
|
|
|
|
- padding: 0 10px 10px 10px;
|
|
|
|
- .thumbnailItemBox {
|
|
|
|
- background: #ECEFFD;
|
|
|
|
- border-radius: 10px;
|
|
|
|
- padding: 10px;
|
|
|
|
- position: relative;
|
|
|
|
- cursor: pointer;
|
|
|
|
- .thumbnailItemTitle {
|
|
|
|
- position: absolute;
|
|
|
|
- bottom: 10px;
|
|
|
|
- left: 10px;
|
|
|
|
- background: rgba(0,0,0,0.5);
|
|
|
|
- color: #fff;
|
|
|
|
- font-size: 14px;
|
|
|
|
- text-align: center;
|
|
|
|
- padding: 5px 10px;
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
|
+ //width: 12.5%;
|
|
|
|
+ width: 180px;
|
|
|
|
+ height: 180px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 0 10px 10px 10px;
|
|
|
|
+
|
|
|
|
+ .thumbnailItemBox {
|
|
|
|
+ background: #ECEFFD;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ padding: 10px;
|
|
|
|
+ position: relative;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+
|
|
|
|
+ .thumbnailItemTitle {
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: 10px;
|
|
|
|
+ left: 10px;
|
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 5px 10px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
img {
|
|
img {
|
|
- width: 140px;
|
|
|
|
- height: 140px;
|
|
|
|
- display: block;
|
|
|
|
|
|
+ width: 140px;
|
|
|
|
+ height: 140px;
|
|
|
|
+ display: block;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- .templateStyleBox {
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.templateStyleBox {
|
|
padding: 20px 20px 0 20px;
|
|
padding: 20px 20px 0 20px;
|
|
background-color: #F5F7FB;
|
|
background-color: #F5F7FB;
|
|
display: flex;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
|
|
+
|
|
.templateStyleItem {
|
|
.templateStyleItem {
|
|
- width: 20%;
|
|
|
|
- box-sizing: border-box;
|
|
|
|
- padding: 10px 10px 10px 10px;
|
|
|
|
- text-align: center;
|
|
|
|
- cursor: pointer;
|
|
|
|
- margin-bottom: 20px;
|
|
|
|
- .templateStyleItemBox {
|
|
|
|
- background: #fff;
|
|
|
|
- border-radius: 10px;
|
|
|
|
- padding:20px 20px 0 20px;
|
|
|
|
- border-top: 5px solid #E9EDF7;
|
|
|
|
- border-bottom: 5px solid #E9EDF7;
|
|
|
|
- border-left: 1px solid #E9EDF7;
|
|
|
|
- border-right: 1px solid #E9EDF7;
|
|
|
|
- // &:hover {
|
|
|
|
- // border-top: 5px solid #E9EDF7;
|
|
|
|
- // border-bottom: 5px solid #E9EDF7;
|
|
|
|
- // border-left: 1px solid #E9EDF7;
|
|
|
|
- // border-right: 1px solid #E9EDF7;
|
|
|
|
- // }
|
|
|
|
- }
|
|
|
|
- .active {
|
|
|
|
- border-top: 5px solid #5570F1;
|
|
|
|
- border-bottom: 5px solid #5570F1;
|
|
|
|
- border-left: 1px solid #5570F1;
|
|
|
|
- border-right: 1px solid #5570F1;
|
|
|
|
- }
|
|
|
|
- .templateStyleItemTitle {
|
|
|
|
- font-size: 14px;
|
|
|
|
- color: #333;
|
|
|
|
|
|
+ width: 20%;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 10px 10px 10px 10px;
|
|
text-align: center;
|
|
text-align: center;
|
|
- padding: 10px 0;
|
|
|
|
- }
|
|
|
|
- img {
|
|
|
|
- width: 200px;
|
|
|
|
- height: 340px;
|
|
|
|
- }
|
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+
|
|
|
|
+ .templateStyleItemBox {
|
|
|
|
+ background: #fff;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ padding: 20px 20px 0 20px;
|
|
|
|
+ border-top: 5px solid #E9EDF7;
|
|
|
|
+ border-bottom: 5px solid #E9EDF7;
|
|
|
|
+ border-left: 1px solid #E9EDF7;
|
|
|
|
+ border-right: 1px solid #E9EDF7;
|
|
|
|
+ // &:hover {
|
|
|
|
+ // border-top: 5px solid #E9EDF7;
|
|
|
|
+ // border-bottom: 5px solid #E9EDF7;
|
|
|
|
+ // border-left: 1px solid #E9EDF7;
|
|
|
|
+ // border-right: 1px solid #E9EDF7;
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .active {
|
|
|
|
+ border-top: 5px solid #5570F1;
|
|
|
|
+ border-bottom: 5px solid #5570F1;
|
|
|
|
+ border-left: 1px solid #5570F1;
|
|
|
|
+ border-right: 1px solid #5570F1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .templateStyleItemTitle {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ color: #333;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 10px 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ img {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 340px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- .imgZoomBox {
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.imgZoomBox {
|
|
img {
|
|
img {
|
|
- width: 100%;
|
|
|
|
|
|
+ width: 100%;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- .alignCenterBox {
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.alignCenterBox {
|
|
text-align: center;
|
|
text-align: center;
|
|
- }
|
|
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
-
|
|
|