(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-68e5deb8"],{"1fba":function(e,t,a){"use strict";a.d(t,"e",(function(){return n})),a.d(t,"d",(function(){return r})),a.d(t,"c",(function(){return l})),a.d(t,"g",(function(){return s})),a.d(t,"f",(function(){return o})),a.d(t,"a",(function(){return c})),a.d(t,"b",(function(){return d})),a.d(t,"i",(function(){return u})),a.d(t,"h",(function(){return m}));var i=a("b775");function n(e){return Object(i["a"])({url:"/admin/platform/pagediy/save",method:"post",data:e})}function r(e){return Object(i["a"])({url:"/admin/platform/pagediy/list",method:"get",params:e})}function l(e){return Object(i["a"])({url:"/admin/platform/pagediy/info/".concat(e),method:"get"})}function s(e){return Object(i["a"])({url:"/admin/platform/pagediy/update",method:"post",data:e})}function o(e){return Object(i["a"])({url:"/admin/platform/pagediy/setdefault/".concat(e),method:"get"})}function c(e){return Object(i["a"])({url:"/admin/platform/pagediy/delete",method:"get",params:e})}function d(){return Object(i["a"])({url:"/admin/platform/pagediy/getdefault",method:"get"})}function u(e){return Object(i["a"])({url:"/admin/platform/wechat/get/qrcode",method:"post",data:e})}function m(e){return Object(i["a"])({url:"/admin/platform/pagediy/updatename",method:"post",data:e})}},"38c3":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"divBox"},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"acea-row"},[a("div",{staticClass:"tab_view"},e._l(e.tabList,(function(t,i){return a("div",{key:i,staticClass:"cell_item",class:{tab_active:e.listActive===i},on:{click:function(t){return e.ProductNavTab(i)}}},[e._v("\n "+e._s(t)+"\n ")])})),0),e._v(" "),0===e.listActive?a("div",{staticClass:"rightModel acea-row"},[a("div",{staticClass:"leftModel"},[a("div",{staticClass:"current_home"},[a("div",{staticClass:"model_header"},[a("iframe",{ref:"iframe",staticClass:"iframe-box",attrs:{id:"iframe",src:e.frontDomain,frameborder:"0"}})]),e._v(" "),a("div",{staticClass:"mask"})])]),e._v(" "),a("div",{staticStyle:{width:"100%"}},[a("el-row",[a("el-col",e._b({},"el-col",e.grid,!1),[a("div",{staticClass:"flex_between"},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:pagediy:update","platform:pagediy:getdefault","platform:pagediy:info"],expression:"['platform:pagediy:update', 'platform:pagediy:getdefault', 'platform:pagediy:info']"}],staticClass:"mb35",staticStyle:{"font-size":"12px"},attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handlerDiyHomePage()}}},[e._v("首页装修")]),e._v(" "),a("el-card",{staticClass:"mb20 Qrcode-card",attrs:{"body-style":"background-color: #F9F9F9;"}},[a("el-row",[a("el-col",e._b({},"el-col",e.grid2,!1),[a("div",{staticClass:"acea-row row-between-wrapper Qrcode-box"},[a("div",[a("div",{staticClass:"title mb20"},[e._v("微信小程序")]),e._v(" "),a("div",{staticClass:"tips"},[e._v("扫描右侧二维码查看")])])])]),e._v(" "),a("el-col",e._b({},"el-col",e.grid2,!1),[a("div",{staticStyle:{"text-align":"right"}},[a("el-image",{staticClass:"Qrcode_img",attrs:{src:e.Qrcode}})],1)])],1)],1),e._v(" "),a("el-card",{staticClass:"Qrcode-card",attrs:{"body-style":"background-color: #F9F9F9;"}},[a("el-row",[a("el-col",e._b({},"el-col",e.grid2,!1),[a("div",{staticClass:"acea-row row-between-wrapper Qrcode-box"},[a("div",[a("div",{staticClass:"title mb20"},[e._v("微信公众号")]),e._v(" "),a("div",{staticClass:"tips"},[e._v("扫描右侧二维码查看")])])])]),e._v(" "),a("el-col",e._b({},"el-col",e.grid2,!1),[a("div",{staticClass:"acea-row",staticStyle:{"justify-content":"right"}},[a("div",{attrs:{id:"diyQrcode"}})])])],1)],1)],1)])],1)],1)]):a("div",{staticClass:"rightModel"},[a("div",{staticClass:"clearfix mb20",attrs:{slot:"header"},slot:"header"},[a("div",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:pagediy:list"],expression:"['platform:pagediy:list']"}],staticClass:"container"},[a("el-form",{attrs:{size:"small",inline:""},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"模板名称:"}},[a("el-input",{staticStyle:{width:"350px"},attrs:{placeholder:"请输入模板名称",clearable:""},model:{value:e.name,callback:function(t){e.name="string"===typeof t?t.trim():t},expression:"name"}},[a("el-button",{attrs:{slot:"append",icon:"el-icon-search",size:"small"},on:{click:function(t){return e.getList(1)}},slot:"append"})],1)],1)],1)],1),e._v(" "),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:pagediy:save"],expression:"['platform:pagediy:save']"}],staticStyle:{"font-size":"12px"},attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handlerEditDiyPage(0)}}},[a("i",{staticClass:"el-icon-plus",staticStyle:{"margin-right":"4px"}}),e._v("添加")]),e._v(" "),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:pagediy:list"],expression:"['platform:pagediy:list']"}],staticStyle:{"font-size":"12px"},attrs:{size:"small"},on:{click:function(t){return e.getList(1)}}},[e._v("刷新")])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticClass:"table",attrs:{data:e.tableData.data,"highlight-current-row":"","cell-class-name":e.tableCellClassName,"header-cell-style":{fontWeight:"bold"}},on:{"row-dblclick":e.handleName}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"50"}}),e._v(" "),a("el-table-column",{attrs:{label:"模板名称","min-width":"200","show-overflow-tooltip":!0},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"acea-row"},[a("el-tag",{directives:[{name:"show",rawName:"v-show",value:1===t.row.isDefault,expression:"scope.row.isDefault === 1"}],staticClass:"mr5",attrs:{effect:"plain"}},[e._v("首页")]),e._v(" "),t.row.index+","+t.column.index==e.currentCell&&e.checkPermi(["platform:pagediy:updatename"])?a("el-input",{ref:t.row.index+","+t.column.index,attrs:{size:"mini",maxlength:"15"},on:{blur:function(a){return e.hideInput(t.row)}},model:{value:t.row.name,callback:function(a){e.$set(t.row,"name",a)},expression:"scope.row.name"}}):a("span",{staticStyle:{cursor:"pointer"}},[e._v(e._s(t.row.name))])],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"addTime",label:"添加时间","min-width":"180"}}),e._v(" "),a("el-table-column",{attrs:{prop:"updateTime",label:"更新时间","min-width":"180"}}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"190",fixed:"right",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:pagediy:update","platform:pagediy:info"],expression:"['platform:pagediy:update', 'platform:pagediy:info']"}],attrs:{type:"text",size:"small"},on:{click:function(a){return e.handlerEditDiyPage(t.row.id)}}},[e._v("设计")]),e._v(" "),1!==t.row.isDefault&&e.checkPermi(["platform:pagediy:setdefault"])?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.setHomepage(t.row.id)}}},[e._v("设为首页")]):e._e(),e._v(" "),1!==t.row.isDefault&&e.checkPermi(["platform:pagediy:delete"])?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.handleDelete(t.row.id,t.$index)}}},[e._v("删除")]):e._e(),e._v(" "),a("el-button",{attrs:{slot:"reference",type:"text",size:"small"},on:{click:function(a){return e.previewProtol(t.row.id)}},slot:"reference"},[e._v("预览")])]}}])})],1),e._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{"page-sizes":[10,20,30],"page-size":e.tableForm.limit,"current-page":e.tableForm.page,layout:"total, sizes, prev, pager, next, jumper",total:e.tableData.total},on:{"size-change":e.handleSizeChange,"current-change":e.pageChange}})],1)],1)])]),e._v(" "),a("el-dialog",{attrs:{visible:e.perViewDia.visible,title:"DIY 模版预览",width:"430px",top:"1","destroy-on-close":"","close-on-click-modal":!1},on:{"update:visible":function(t){return e.$set(e.perViewDia,"visible",t)}}},[e.perViewDia.visible?a("iframe",{staticStyle:{width:"390px",height:"800px"},attrs:{id:"ifPerviewShop",src:e.perViewDia.perViewUrl,frameborder:"0"}}):e._e()])],1)},n=[],r=a("1fba"),l=a("d044"),s=a.n(l),o=a("e350"),c={name:"index",data:function(){return{grid:{xl:16,lg:20,md:20,sm:24,xs:24},grid2:{xl:12,lg:12,md:20,sm:24,xs:24},listActive:0,tabList:["商城首页","自定义页面"],tableForm:{page:1,limit:10,name:""},name:"",listLoading:!1,tableData:{data:[],total:0},frontDomain:"",perViewDia:{visible:!1,perViewUrl:""},Qrcode:"",currentCell:null}},mounted:function(){var e=["https://","http://"],t=localStorage.getItem("frontDomain"),a=e.some((function(e){return t.includes(e)}));this.frontDomain=a?t:"https://".concat(t),Object(o["a"])(["platform:pagediy:list"])&&this.getList(),this.getWechatQrcode(),this.getQRcode()},methods:{checkPermi:o["a"],tableCellClassName:function(e){var t=e.row,a=e.column,i=e.rowIndex,n=e.columnIndex;t.index=i,a.index=n},handleName:function(e,t){var a=this;this.currentCell=e.index+","+t.index,setTimeout((function(){a.$refs[e.index+","+t.index].focus()}))},hideInput:function(e){var t=this;if(!e.name)return this.$message.warning("模板名称不能为空");this.currentCell=null,Object(r["h"])({id:e.id,name:e.name}).then((function(e){t.$message.success("编辑成功")}))},getQRcode:function(){document.getElementById("diyQrcode").innerHTML="",new s.a("diyQrcode",{width:120,height:120,text:this.frontDomain})},getWechatQrcode:function(){var e=this;Object(r["i"])({scene:"id=0",path:"pages/index/index",env_version:"trial"}).then((function(t){e.Qrcode=t.code}))},ProductNavTab:function(e){this.listActive=e},previewProtol:function(e){e&&(this.perViewDia.perViewUrl=this.frontDomain+"?id="+e,this.perViewDia.visible=!0)},setHomepage:function(e){var t=this;this.$modalSure("把该模板设为首页").then((function(){Object(r["f"])(e).then((function(e){t.$message.success("操作成功"),t.getList()}))}))},handlerDiyHomePage:function(){var e=this;Object(r["b"])().then((function(t){console.info("homePageId",t),e.handlerEditDiyPage(t)}))},handlerEditDiyPage:function(e){var t=this.$router.resolve({path:"/page/design/creatDevise/".concat(e)}),a=t.href;window.open(a)},getList:function(e){var t=this;this.listLoading=!0,this.tableForm.page=e||this.tableForm.page,this.tableForm.name=encodeURIComponent(this.name),Object(r["d"])(this.tableForm).then((function(e){t.listLoading=!1,t.tableData.data=e.list,t.tableData.total=e.total})).then((function(e){t.listLoading=!1}))},handleDelete:function(e,t){var a=this;this.$modalSure("删除模板吗").then((function(){Object(r["a"])({id:e}).then((function(e){a.$message.success("删除成功"),1===a.tableData.data.length&&a.tableForm.page>1&&(a.tableForm.page=a.tableForm.page-1),a.getList()}))}))},handleSizeChange:function(e){this.tableForm.limit=e,this.getList()},pageChange:function(e){this.tableForm.page=e,this.getList()}}},d=c,u=(a("9055"),a("2877")),m=Object(u["a"])(d,i,n,!1,null,"0f26aaf7",null);t["default"]=m.exports},9055:function(e,t,a){"use strict";a("d7a2")},d7a2:function(e,t,a){}}]);