1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-5c309c1c"],{1336:function(t,e,a){"use strict";a.d(e,"e",(function(){return r})),a.d(e,"d",(function(){return n})),a.d(e,"f",(function(){return s})),a.d(e,"a",(function(){return c})),a.d(e,"c",(function(){return o})),a.d(e,"b",(function(){return l})),a.d(e,"h",(function(){return u})),a.d(e,"g",(function(){return d}));var i=a("b6bd");function r(t){return Object(i.a)({url:"cms/cms",method:"get",params:t})}function n(t){return Object(i.a)({url:"cms/cms",method:"post",data:t})}function s(t){return Object(i.a)({url:"cms/cms/".concat(t),method:"get"})}function c(){return Object(i.a)({url:"cms/category/create",method:"GET"})}function o(t){return Object(i.a)({url:"cms/category",method:"GET",params:t})}function l(t){return Object(i.a)({url:"cms/category/".concat(t,"/edit"),method:"GET"})}function u(t){return Object(i.a)({url:"cms/category/set_status/".concat(t.id,"/").concat(t.status),method:"put"})}function d(t,e){return Object(i.a)({url:"cms/cms/relation/".concat(e),method:"put",data:t})}},"467fa":function(t,e,a){"use strict";var i=a("9bcd");a.n(i).a},"7af3":function(t,e,a){"use strict";var i=a("a34a"),r=a.n(i),n=a("f478"),s=a("c4c8"),c=a("b7be"),o=a("1336");function l(t,e,a,i,r,n,s){try{var c=t[n](s),o=c.value}catch(t){return void a(t)}c.done?e(o):Promise.resolve(o).then(i,r)}function u(t){return function(){var e=this,a=arguments;return new Promise((function(i,r){var n=t.apply(e,a);function s(t){l(n,i,r,s,c,"next",t)}function c(t){l(n,i,r,s,c,"throw",t)}s(void 0)}))}}var d={name:"linkaddress",data:function(){return{modals:!1,categoryData:[],currenType:"link",columns:[{title:"ID",key:"id",width:60},{title:"页面名称",key:"name",width:150},{title:"页面链接",key:"url"}],columns7:[{title:"ID",key:"id",width:60},{title:"分类名称",key:"cate_name",tree:!0},{title:"分类图标",slot:"pic"}],columns8:[{title:"ID",key:"id",width:60},{title:"商品图片",slot:"image",width:90},{title:"商品名称",key:"store_name"}],storeHome:[{title:"ID",key:"id",width:60},{title:"门店信息",slot:"storeInfo",width:160},{title:"门店分类",key:"cate_name",width:90},{title:"联系电话",key:"phone",width:100},{title:"门店地址",key:"detailed_address"}],bargain:[{title:"ID",key:"id",width:60},{title:"商品图片",slot:"image",width:90},{title:"商品名称",key:"title"}],news:[{title:"ID",key:"id",width:60},{title:"文章图片",slot:"image_input",width:90},{title:"文章名称",key:"title"}],formValidate:{page:1,limit:15,cate_id:"",store_name:"",keywords:""},total:0,basicsList:[],userList:[],distributionList:[],coupon:[],luckDraw:[],integral:[],presale:[],currenId:"",currenUrl:"",loading:!1,tableList:[],presentId:0,categoryId:"",treeSelect:[],customdate:{url:"",appid:"",mpUrl:"",status:1},customNum:1,ruleValidate:{name:[{required:!0,message:"请输入链接名称",trigger:"blur"}],url:[{required:!0,message:"请输入跳转路径",trigger:"blur"}],appid:[{required:!0,message:"请输入正确APPID",trigger:"blur"}],mpUrl:[{required:!0,message:"请输入正确小程序路径",trigger:"blur"}]},pid:0,currentItem:{}}},computed:{},created:function(){var t=this;this.getSort(),this.goodsCategory();var e={width:60,align:"center",render:function(e,a){var i=a.row.id,r=!1;r=t.presentId===i;var n=t;return e("div",[e("Radio",{props:{value:r},on:{"on-change":function(){n.presentId=i,t.currenUrl=a.row.url}}})])}};this.columns.unshift(e),this.columns7.unshift(e),this.columns8.unshift(e),this.bargain.unshift(e),this.news.unshift(e),this.storeHome.unshift(e)},methods:{radioTap:function(t){this.$refs[t].resetFields()},handleLoadData:function(t,e){t._loading=!0,Object(n.q)(this.categoryId,{pid:t.id}).then((function(a){t._loading=!1,a.data.list.forEach((function(t){t.url="/pages/goods/goods_list/index?sid=".concat(t.id,"&title=").concat(t.cate_name)})),e(a.data.list)}))},delLink:function(t,e,a){var i=this,r={title:e,num:a,url:"diy/del_link/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(r).then((function(t){i.$Message.success(t.msg),i.tableList.splice(a,1),i.tableList.length||(i.customNum=2)})).catch((function(t){i.$Message.error(t.msg)}))},customLink:function(){this.customNum=2},customList:function(){this.customNum=1},getCustomList:function(){var t=this;Object(n.q)(this.categoryId).then((function(e){e.data.list.length||(t.customNum=2),t.tableList=e.data.list})).catch((function(e){t.$Message.error(e.msg)}))},handleSubmit:function(t){var e=this;this.$refs[t].validate((function(t){if(t){var a=e.customdate.url;a=1==e.customdate.status?e.customdate.url:e.customdate.mpUrl+"@APPID="+e.customdate.appid,e.$emit("linkUrl",a),e.modals=!1,e.reset()}else e.$Message.error("请填写信息")}))},handleReset:function(t){this.$refs[t].resetFields()},pageChange:function(t){this.formValidate.page=t,"special"==this.currenType||"store_home"==this.currenType?this.handleCheckChange("",this.currentItem):this.getList()},goodsCategory:function(){var t=this;Object(s.rb)(1).then((function(e){t.treeSelect=e.data})).catch((function(e){t.$Message.error(e.msg)}))},userSearchs:function(){this.formValidate.page=1,"product"==this.currenType?this.getList():this.handleCheckChange("",this.currentItem)},reset:function(){this.currenUrl="",this.presentId=0,this.currenId="",this.customdate.url="",this.customdate.appid="",this.customdate.mpUrl=""},getUrl:function(t){this.currenId=t.id,this.currenUrl=t.url},getSort:function(){var t=this;Object(n.p)().then((function(e){e.data[0].children[0].selected=!0,t.categoryData=e.data,t.handleCheckChange("",e.data[0].children[0])})).catch((function(e){t.$Message.error(e.msg)}))},getList:function(){var t=this;this.loading=!0,"product"==this.currenType?Object(s.i)(this.formValidate).then(function(){var e=u(r.a.mark((function e(a){var i;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i=a.data).list.forEach((function(t){t.url="/pages/goods_details/index?id=".concat(t.id)})),t.tableList=i.list,t.total=a.data.count,t.loading=!1;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)})):"seckill"==this.currenType?Object(c.ub)(this.formValidate).then(function(){var e=u(r.a.mark((function e(a){var i;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i=a.data).list.forEach((function(t){t.url="/pages/activity/goods_seckill_details/index?id=".concat(t.id,"&status=1")})),t.tableList=i.list,t.total=a.data.count,t.loading=!1;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)})):"bargain"==this.currenType?Object(c.k)(this.formValidate).then(function(){var e=u(r.a.mark((function e(a){var i;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i=a.data).list.forEach((function(t){t.url="/pages/activity/goods_bargain_details/index?id=".concat(t.id)})),t.tableList=i.list,t.total=a.data.count,t.loading=!1;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)})):"combination"==this.currenType?Object(c.q)(this.formValidate).then(function(){var e=u(r.a.mark((function e(a){var i;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i=a.data).list.forEach((function(t){t.url="/pages/activity/goods_combination_details/index?id=".concat(t.id)})),t.tableList=i.list,t.total=a.data.count,t.loading=!1;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)})):"news"==this.currenType?Object(o.e)(this.formValidate).then(function(){var e=u(r.a.mark((function e(a){var i;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i=a.data).list.forEach((function(t){t.url="/pages/extension/news_details/index?id=".concat(t.id)})),t.tableList=i.list,t.total=i.count,t.loading=!1;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)})):"integral"==this.currenType&&Object(c.gb)(this.formValidate).then(function(){var e=u(r.a.mark((function e(a){var i;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i=a.data).list.forEach((function(t){t.url="/pages/points_mall/integral_goods_details?id=".concat(t.id)})),t.tableList=i.list,t.total=a.data.count,t.loading=!1;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},handleCheckChange:function(t,e){var a=this;t&&t.length&&(this.formValidate.page=1),this.currentItem=e,this.reset();var i="";if(!e.pid)return!1;if(i=e.id,this.categoryId=e.id,this.loading=!0,this.currenType=e.type,"product"==this.currenType||"seckill"==this.currenType||"bargain"==this.currenType||"combination"==this.currenType||"news"==this.currenType||"integral"==this.currenType)this.getList();else if("custom"==this.currenType)this.getCustomList();else{var r={pid:this.pid};"special"!=this.currenType&&"store_home"!=this.currenType||(r.page=this.formValidate.page,r.limit=this.formValidate.limit),"store_home"==this.currenType&&(r.keywords=this.formValidate.keywords),Object(n.q)(i,r).then((function(t){a.loading=!1;var e=t.data.list;if("marketing_link"==a.currenType||"link"==a.currenType){var i=[],r=[],n=[],s=[],c=[],o=[],l=[];e.forEach((function(t){1==t.type?i.push(t):2==t.type?r.push(t):3==t.type?n.push(t):4==t.type?s.push(t):5==t.type?c.push(t):6==t.type?l.push(t):o.push(t)})),a.basicsList=i,a.distributionList=r,a.userList=n,a.coupon=o,a.luckDraw=c,a.integral=s,a.presale=l}else if("special"==a.currenType){var u=[];t.data.list.forEach((function(t){t.url="/pages/annex/special/index?id=".concat(t.id),t.is_diy&&u.push(t)})),a.total=t.data.count,a.tableList=u}else if("product_category"==a.currenType)e.forEach((function(t){t.hasOwnProperty("children")&&t.children.forEach((function(t){t.url="/pages/goods/goods_list/index?sid=".concat(t.id,"&title=").concat(t.cate_name)})),t.url="/pages/goods/goods_list/index?cid=".concat(t.id,"&title=").concat(t.cate_name)})),a.tableList=e;else if("store_home"==a.currenType){var d=[];t.data.list.forEach((function(t){t.url="/pages/store_cate/store_cate?id=".concat(t.id),d.push(t)})),a.total=t.data.count,a.tableList=d}})).catch((function(t){a.loading=!1,a.$Message.error(t.msg)}))}},ok:function(){if(""==this.currenUrl)return this.$Message.warning("请选择链接");this.$emit("linkUrl",this.currenUrl),this.modals=!1,this.reset()},cancel:function(){this.modals=!1,this.reset()}}},p=(a("467fa"),a("2877")),m=Object(p.a)(d,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Modal",{attrs:{scrollable:"",closable:"",title:"选择链接","mask-closable":!1,width:"860"},on:{"on-cancel":t.cancel},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[a("div",{staticClass:"table_box"},[a("div",{staticClass:"left_box"},[a("Tree",{attrs:{data:t.categoryData},on:{"on-select-change":t.handleCheckChange}})],1),"link"==t.currenType?a("div",{staticClass:"right_box"},[t.basicsList.length?a("div",[a("div",{staticClass:"cont"},[t._v("基础链接")]),a("div",{staticClass:"Box"},t._l(t.basicsList,(function(e,i){return a("div",{key:i,staticClass:"cont_box",class:t.currenId==e.id?"on":"",on:{click:function(a){return t.getUrl(e)}}},[t._v(t._s(e.name))])})),0)]):t._e(),t.userList.length?a("div",[a("div",{staticClass:"cont"},[t._v("个人中心")]),a("div",{staticClass:"Box"},t._l(t.userList,(function(e,i){return a("div",{key:i,staticClass:"cont_box",class:t.currenId==e.id?"on":"",on:{click:function(a){return t.getUrl(e)}}},[t._v(t._s(e.name))])})),0)]):t._e(),t.distributionList.length?a("div",[a("div",{staticClass:"cont"},[t._v("分销")]),a("div",{staticClass:"Box"},t._l(t.distributionList,(function(e,i){return a("div",{key:i,staticClass:"cont_box",class:t.currenId==e.id?"on":"",on:{click:function(a){return t.getUrl(e)}}},[t._v(t._s(e.name))])})),0)]):t._e()]):t._e(),"marketing_link"==t.currenType?a("div",{staticClass:"right_box"},[t.coupon.length?a("div",[a("div",{staticClass:"cont"},[t._v("优惠券")]),a("div",{staticClass:"Box"},t._l(t.coupon,(function(e,i){return a("div",{key:i,staticClass:"cont_box",class:t.currenId==e.id?"on":"",on:{click:function(a){return t.getUrl(e)}}},[t._v(t._s(e.name))])})),0)]):t._e(),t.basicsList.length?a("div",[a("div",{staticClass:"cont"},[t._v("秒杀")]),a("div",{staticClass:"Box"},t._l(t.basicsList,(function(e,i){return a("div",{key:i,staticClass:"cont_box",class:t.currenId==e.id?"on":"",on:{click:function(a){return t.getUrl(e)}}},[t._v(t._s(e.name))])})),0)]):t._e(),t.distributionList.length?a("div",[a("div",{staticClass:"cont"},[t._v("砍价")]),a("div",{staticClass:"Box"},t._l(t.distributionList,(function(e,i){return a("div",{key:i,staticClass:"cont_box",class:t.currenId==e.id?"on":"",on:{click:function(a){return t.getUrl(e)}}},[t._v(t._s(e.name))])})),0)]):t._e(),t.userList.length?a("div",[a("div",{staticClass:"cont"},[t._v("拼团")]),a("div",{staticClass:"Box"},t._l(t.userList,(function(e,i){return a("div",{key:i,staticClass:"cont_box",class:t.currenId==e.id?"on":"",on:{click:function(a){return t.getUrl(e)}}},[t._v(t._s(e.name))])})),0)]):t._e(),t.presale.length?a("div",[a("div",{staticClass:"cont"},[t._v("预售")]),a("div",{staticClass:"Box"},t._l(t.presale,(function(e,i){return a("div",{key:i,staticClass:"cont_box",class:t.currenId==e.id?"on":"",on:{click:function(a){return t.getUrl(e)}}},[t._v(t._s(e.name))])})),0)]):t._e(),t.integral.length?a("div",[a("div",{staticClass:"cont"},[t._v("积分")]),a("div",{staticClass:"Box"},t._l(t.integral,(function(e,i){return a("div",{key:i,staticClass:"cont_box",class:t.currenId==e.id?"on":"",on:{click:function(a){return t.getUrl(e)}}},[t._v(t._s(e.name))])})),0)]):t._e(),t.luckDraw.length?a("div",[a("div",{staticClass:"cont"},[t._v("抽奖")]),a("div",{staticClass:"Box"},t._l(t.luckDraw,(function(e,i){return a("div",{key:i,staticClass:"cont_box",class:t.currenId==e.id?"on":"",on:{click:function(a){return t.getUrl(e)}}},[t._v(t._s(e.name))])})),0)]):t._e()]):t._e(),"special"==t.currenType||"store_home"==t.currenType||"product_category"==t.currenType||"product"==t.currenType||"seckill"==t.currenType||"bargain"==t.currenType||"combination"==t.currenType||"news"==t.currenType||"integral"==t.currenType?a("div",{staticClass:"right_box"},["product"==t.currenType||"store_home"==t.currenType?a("Form",{ref:"formValidate",staticClass:"tabform",attrs:{model:t.formValidate}},["product"==t.currenType?a("Row",{attrs:{type:"flex",gutter:24}},[a("Col",[a("FormItem",{attrs:{label:"","label-for":"pid"}},[a("Select",{staticStyle:{width:"230px"},attrs:{clearable:""},on:{"on-change":t.userSearchs},model:{value:t.formValidate.cate_id,callback:function(e){t.$set(t.formValidate,"cate_id",e)},expression:"formValidate.cate_id"}},t._l(t.treeSelect,(function(e){return a("Option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.html+e.cate_name)+"\n ")])})),1)],1)],1),a("Col",[a("FormItem",{attrs:{label:"","label-for":"store_name"}},[a("Input",{staticClass:"input-add",attrs:{search:"","enter-button":"",placeholder:"请输入商品名称,关键字,编号"},on:{"on-search":t.userSearchs},model:{value:t.formValidate.store_name,callback:function(e){t.$set(t.formValidate,"store_name",e)},expression:"formValidate.store_name"}})],1)],1)],1):t._e(),"store_home"==t.currenType?a("Row",{attrs:{type:"flex",gutter:24}},[a("Col",[a("FormItem",{attrs:{label:"","label-for":"keywords"}},[a("Input",{staticClass:"input-add",attrs:{search:"","enter-button":"",placeholder:"点击搜索门店"},on:{"on-search":t.userSearchs},model:{value:t.formValidate.keywords,callback:function(e){t.$set(t.formValidate,"keywords",e)},expression:"formValidate.keywords"}})],1)],1)],1):t._e()],1):t._e(),a("Table",{ref:"table",attrs:{"row-key":"id","load-data":t.handleLoadData,"no-data-text":"暂无数据","no-filtered-data-text":"暂无筛选结果",columns:"special"==t.currenType?t.columns:"product_category"==t.currenType?t.columns7:"bargain"==t.currenType||"combination"==t.currenType||"integral"==t.currenType?t.bargain:"news"==t.currenType?t.news:"store_home"==t.currenType?t.storeHome:t.columns8,data:t.tableList,loading:t.loading,"max-height":"product_category"==t.currenType?"410":"seckill"==t.currenType||"bargain"==t.currenType||"combination"==t.currenType||"news"==t.currenType||"integral"==t.currenType?"400":"product"==t.currenType?"356":""},scopedSlots:t._u([{key:"pic",fn:function(t){var e=t.row;return t.index,e.hasOwnProperty("pic")?[a("viewer",[a("div",{staticClass:"tabBox_img"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.pic,expression:"row.pic"}]})])])]:void 0}},{key:"image",fn:function(t){var e=t.row;return t.index,e.hasOwnProperty("image")?[a("viewer",[a("div",{staticClass:"tabBox_img"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.image,expression:"row.image"}]})])])]:void 0}},{key:"image_input",fn:function(t){var e=t.row;return t.index,e.hasOwnProperty("image_input")?[a("viewer",[a("div",{staticClass:"tabBox_img"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.image_input[0],expression:"row.image_input[0]"}]})])])]:void 0}},{key:"storeInfo",fn:function(e){var i=e.row;return e.index,i.hasOwnProperty("image")?[a("div",{staticClass:"acea-row row-middle"},[a("viewer",[a("div",{staticClass:"tabBox_img"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:i.image,expression:"row.image"}]})])]),a("div",{staticClass:"ml10 width10"},[t._v(t._s(i.name))])],1)]:void 0}}],null,!0)}),"special"==t.currenType||"store_home"==t.currenType||"product"==t.currenType||"seckill"==t.currenType||"bargain"==t.currenType||"combination"==t.currenType||"news"==t.currenType||"integral"==t.currenType?a("div",{staticClass:"acea-row row-right page"},[a("Page",{attrs:{current:t.formValidate.page,total:t.total,"show-elevator":"","show-total":"","page-size":t.formValidate.limit},on:{"on-change":t.pageChange}})],1):t._e()],1):t._e(),"custom"==t.currenType?a("div",{staticClass:"right_box"},[a("div",{staticStyle:{width:"340px",margin:"150px 100px 0 120px"}},[a("Form",{ref:"customdate",attrs:{model:t.customdate,rules:t.ruleValidate,"label-width":100}},[a("div",{staticClass:"mb30 radioGroup"},[a("RadioGroup",{on:{"on-change":function(e){return t.radioTap("customdate")}},model:{value:t.customdate.status,callback:function(e){t.$set(t.customdate,"status",e)},expression:"customdate.status"}},[a("Radio",{attrs:{label:1}},[a("Icon"),a("span",[t._v("普通链接")])],1),a("Radio",{attrs:{label:2}},[a("Icon"),a("span",[t._v("跳转其他小程序")])],1)],1)],1),1==t.customdate.status?a("FormItem",{attrs:{label:"跳转路径:",prop:"url"}},[a("Input",{attrs:{placeholder:"请输入正确跳转路径"},model:{value:t.customdate.url,callback:function(e){t.$set(t.customdate,"url",e)},expression:"customdate.url"}})],1):t._e(),2==t.customdate.status?a("FormItem",{attrs:{label:"APPID:",prop:"appid"}},[a("Input",{attrs:{placeholder:"请输入正确APPID"},model:{value:t.customdate.appid,callback:function(e){t.$set(t.customdate,"appid",e)},expression:"customdate.appid"}})],1):t._e(),2==t.customdate.status?a("FormItem",{attrs:{label:"小程序路径:",prop:"mpUrl"}},[a("Input",{attrs:{placeholder:"请输入正确小程序路径"},model:{value:t.customdate.mpUrl,callback:function(e){t.$set(t.customdate,"mpUrl",e)},expression:"customdate.mpUrl"}})],1):t._e()],1)],1)]):t._e()]),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("Button",{on:{click:t.cancel}},[t._v("取消")]),"custom"==t.currenType?a("Button",{attrs:{type:"primary"},on:{click:function(e){return t.handleSubmit("customdate")}}},[t._v("确定")]):a("Button",{attrs:{type:"primary"},on:{click:t.ok}},[t._v("确定")])],1)])],1)}),[],!1,null,"16e8bc90",null);e.a=m.exports},"9bcd":function(t,e,a){}}]);
|