51.js 6.5 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[51],{1686:function(t,n,e){"use strict";e.r(n);var a={data:function(){return{columns:[{title:"ID",dataIndex:"id",key:"id"},{title:"创建时间",dataIndex:"created_at",key:"created_at"},{title:"页面名称",dataIndex:"name",key:"name"},{title:"类型",dataIndex:"type",key:"type",scopedSlots:{customRender:"type"}},{title:"显示规则",dataIndex:"show_rule",key:"show_rule",scopedSlots:{customRender:"show_rule"}},{title:"操作",key:"operation",scopedSlots:{customRender:"operation"}}],page_name:"",advertising_type:"",loading:!1,main_page_list:[],main_page_pagination:{current:1,pageSize:10,total:0}}},created:function(){this.currentChange(1)},methods:{toPage:function(t,n){1==t&&(n?this.$router.push(this.fun.getUrl("/advertising",{},{id:n})):this.$router.push(this.fun.getUrl("/advertising"))),2==t&&(n?this.$router.push(this.fun.getUrl("/full_screen",{},{id:n})):this.$router.push(this.fun.getUrl("/full_screen")))},currentChange:function(t){var n=this;this.main_page_pagination.current=t,$http.post("plugin.decorate.admin.decorate-advertising.get-list",{page:t,name:this.page_name,advertising_type:this.advertising_type},"loading").then((function(t){1===t.result?(n.main_page_pagination.total=t.data.total,n.main_page_pagination.pageSize=t.data.per_page,n.main_page_list=t.data.data):(n.main_page_list=[],-1===t.data.status&&n.currentChange(1))})).catch((function(t){console.error(t)}))},switchIt:function(t){var n=this;$http.post("plugin.decorate.admin.decorate-advertising.advertising-switch",{advertising_id:t.id,is_default:1==t.is_default?0:1},"loading").then((function(t){1===t.result?(n.currentChange(n.main_page_pagination.current),n.$message.success("设置成功")):t.msg&&n.$message.error(t.msg)})).catch((function(t){console.log(t)}))},deleteIt:function(t){var n=this;this.$confirm({title:"确认删除该广告?",onOk:function(){$http.post("plugin.decorate.admin.decorate-advertising.del",{id:t},"loading").then((function(t){1===t.result?(n.currentChange(n.main_page_pagination.current),n.$message.success("删除成功")):t.msg&&n.$message.error(t.msg)})).catch((function(t){console.log(t)}))}})}}},i=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"first-banner"},[e("div",{staticClass:"header"},[e("a-select",{staticStyle:{width:"25%","margin-right":"5%"},on:{change:function(n){return t.currentChange(1)}},model:{value:t.advertising_type,callback:function(n){t.advertising_type=n},expression:"advertising_type"}},[e("a-select-option",{attrs:{value:""}},[t._v("\n 页面类型\n ")]),t._v(" "),e("a-select-option",{attrs:{value:"1"}},[t._v("\n 弹窗广告\n ")]),t._v(" "),e("a-select-option",{attrs:{value:"2"}},[t._v("\n 全屏广告\n ")])],1),t._v(" "),e("a-input",{staticClass:"search-input",attrs:{placeholder:"输入页面名称进行搜索"},model:{value:t.page_name,callback:function(n){t.page_name="string"==typeof n?n.trim():n},expression:"page_name"}},[e("a-icon",{attrs:{slot:"prefix",type:"search"},slot:"prefix"})],1),t._v(" "),e("a-button",{staticClass:"search-btn",attrs:{type:"primary"},on:{click:function(n){return t.currentChange(1)}}},[t._v("搜索")])],1),t._v(" "),e("div",{staticClass:"content-head"},[e("div",{staticClass:"left"},[t._v("\n 广告总数:"+t._s(t.main_page_pagination.total)+"\n ")]),t._v(" "),e("div",{attrs:{content:"right"}},[e("a-button",{attrs:{icon:"plus"},on:{click:function(n){return t.toPage("1")}}},[t._v("添加弹窗广告")]),t._v(" "),e("a-button",{attrs:{icon:"plus"},on:{click:function(n){return t.toPage("2")}}},[t._v("添加全屏广告")])],1)]),t._v(" "),e("div",{staticClass:"content"},[e("a-spin",{attrs:{spinning:t.loading}},[e("a-table",{staticClass:"table-box",attrs:{pagination:{pageSize:t.main_page_pagination.pageSize,current:t.main_page_pagination.current,total:t.main_page_pagination.total,showQuickJumper:!0,onChange:t.currentChange},columns:t.columns,"data-source":t.main_page_list,rowKey:function(t){return t.id}},scopedSlots:t._u([{key:"show_rule",fn:function(n,a){return e("span",{staticClass:"operation-box"},[e("span",[t._v(t._s(1==a.show_rule?"每次进入页面":"每日首次登录小程序"))])])}},{key:"type",fn:function(n,a){return e("span",{staticClass:"operation-box"},[e("span",[t._v(t._s(1==a.type?"弹窗广告":"全屏广告"))])])}},{key:"operation",fn:function(n,a){return e("span",{staticClass:"operation-box"},[e("a-tooltip",[e("template",{slot:"title"},[t._v("\n\t\t\t\t\t\t\t编辑\n\t\t\t\t\t\t ")]),t._v(" "),e("i",{staticClass:"iconfont icon-ht_operation_edit",on:{click:function(n){return t.toPage(a.type,a.id)}}})],2),t._v(" "),e("a-tooltip",{on:{click:function(t){}}},[e("template",{slot:"title"},[t._v("\n\t\t\t\t\t\t\t删除\n\t\t\t\t\t\t ")]),t._v(" "),e("i",{staticClass:"iconfont icon-ht_operation_delete",on:{click:function(n){return t.deleteIt(a.id)}}})],2)],1)}}])})],1)],1)])};i._withStripped=!0;var s=e(11);var o=function(t){e(2065)},r=Object(s.a)(a,i,[],!1,o,"data-v-4976d753",null);r.options.__file="src\\views\\first-banner\\index.vue";n.default=r.exports},2065:function(t,n,e){var a=e(2066);"string"==typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);(0,e(19).default)("0c382790",a,!1,{})},2066:function(t,n,e){(t.exports=e(16)(!1)).push([t.i,'\n.first-banner[data-v-4976d753] {\n padding: 30px 20px 20px 20px;\n}\n.first-banner .search-input[data-v-4976d753] {\n width: 40%;\n}\n.first-banner .search-btn[data-v-4976d753] {\n width: 10%;\n margin-left: 5%;\n}\n.first-banner .operation-box[data-v-4976d753] {\n display: flex;\n}\n.first-banner .operation-box i[data-v-4976d753] {\n color: #999999;\n margin-left: 15px;\n cursor: pointer;\n}\n.first-banner .operation-box i[data-v-4976d753]:hover {\n color: #ffa800;\n}\n.first-banner .table-box[data-v-4976d753] {\n font-weight: bold;\n}\n.first-banner .content-head[data-v-4976d753] {\n display: flex;\n margin: 15px 0;\n}\n.first-banner .content-head .left[data-v-4976d753] {\n position: relative;\n font-weight: bold;\n font-size: 16px;\n margin-left: 10px;\n display: flex;\n align-self: center;\n justify-self: center;\n flex: 1;\n}\n.first-banner .content-head .left[data-v-4976d753]::before {\n content: "";\n width: 5px;\n height: 25px;\n position: absolute;\n top: 0;\n left: -10px;\n background: #29ba9c;\n}\n.first-banner .content-head .right[data-v-4976d753] {\n display: flex;\n align-self: center;\n justify-self: center;\n flex: 0 0 100px;\n}\n.first-banner .page-pagination[data-v-4976d753] {\n text-align: center;\n margin-top: 24px;\n}\n',""])}}]);