徐总多门店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
11 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-d82352e0"],{"1e0c":function(t,e,a){"use strict";a.r(e);var i=a("2f62"),r=a("b0e7"),o=a("b7be"),s=a("c4ad"),n=a("d708");function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function d(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?c(Object(a),!0).forEach((function(e){u(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):c(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function u(t,e,a){return(e=function(t){var e=function(t,e){if("object"!=l(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=l(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==l(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var m={name:"create",components:{uploadPictures:r.a,goodsList:s.default},data:function(){return{roterPre:n.a.roterPre,currentTab:"1",modals:!1,gridBtn:{xl:4,lg:8,md:8,sm:8,xs:8},gridPic:{xl:6,lg:8,md:12,sm:12,xs:12},headeNum:[{type:"1",name:"基础设置"},{type:"2",name:"关联商品"}],formValidate:{desc:"",image:"",sort:0,video_url:"",product_id:[]},modalPic:!1,isChoice:"单选",ruleValidate:{desc:[{required:!0,message:"请输入视频简介",trigger:"blur"}],video_url:[{required:!0,message:"请上传视频",validator:function(t,e,a){if(!e)return a(new Error("请上传视频"));a()},trigger:"change"}],image:[{required:!0,validator:function(t,e,a){if(!e)return a(new Error("请上传视频封面图"));a()},trigger:"change"}]},columns:[{type:"selection",width:60,align:"center"},{title:"商品信息",slot:"info",minWidth:180},{title:"商品分类",key:"cate_name",minWidth:180},{title:"售价",key:"price",minWidth:180},{title:"库存",key:"stock",minWidth:180},{title:"操作",slot:"action",fixed:"right",width:100}],tableData:[],id:0,formSelection:[],typeTit:""}},computed:d(d({},Object(i.e)("admin/layout",["isMobile","menuCollapse"])),{},{labelWidth:function(){return this.isMobile?void 0:90},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.id=this.$route.params.id||0,this.id&&this.getInfo()},methods:{delVideo:function(){this.$set(this.formValidate,"video_url",""),this.$refs.formValidate.validateField("video_url")},del:function(t){var e=this;this.tableData.forEach((function(a,i){if(t.id===a.id)return e.tableData.splice(i,1)}))},batchDel:function(){for(var t=0;t<this.formSelection.length;t++)for(var e=0;e<this.tableData.length;e++)this.tableData[e].id===this.formSelection[t].id&&(this.tableData.splice(e,1),e--)},selectChange:function(t){this.formSelection=t},addGoods:function(){this.modals=!0},cancel:function(){this.modals=!1},unique:function(t){var e=new Map;return t.filter((function(t){return!e.has(t.id)&&e.set(t.id,1)}))},getProductId:function(t){this.modals=!1;var e=this.tableData.concat(t);this.tableData=this.unique(e)},getInfo:function(){var t=this;Object(o.Qb)(this.id).then((function(e){t.formValidate=e.data,t.tableData=e.data.productInfo})).catch((function(e){t.$Message.error(e.msg)}))},upTab:function(){this.currentTab="1"},downTab:function(t){var e=this;this.$refs[t].validate((function(t){t?e.currentTab="2":e.$Message.warning("请完善数据")}))},handleSubmit:function(t){var e=this;this.$refs[t].validate((function(t){if(t){var a=[];e.tableData.forEach((function(t){a.push(t.id)})),e.formValidate.product_id=a,Object(o.Tb)(e.formValidate,e.id).then((function(t){e.$router.push({path:"".concat(e.roterPre,"/marketing/short_video/index")}),e.$Message.success(t.msg)})).catch((function(t){e.$Message.error(t.msg)}))}else e.$Message.warning("请完善数据")}))},modalPicTap:function(t){this.typeTit=t,this.modalPic=!0},getPic:function(t){this.modalPic=!1,"image"==this.typeTit?(this.formValidate.image=t.att_dir,this.$refs.formValidate.validateField("image")):(this.formValidate.video_url=t.att_dir,this.$refs.formValidate.validateField("video_url"))},handleRemove:function(){this.formValidate.image="",this.$refs.formValidate.validateField("image")}}},f=(a("a11be"),a("2877")),p=Object(f.a)(m,(function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"i-layout-page-header"},[e("PageHeader",{staticClass:"product_tabs",attrs:{"hidden-breadcrumb":""}},[e("div",{staticClass:"acea-row row-middle",attrs:{slot:"title"},slot:"title"},[e("router-link",{attrs:{to:{path:"".concat(t.roterPre,"/marketing/short_video/index")}}},[e("div",{staticClass:"font-sm after-line"},[e("span",{staticClass:"iconfont iconfanhui"}),e("span",{staticClass:"pl10"},[t._v("返回")])])]),e("span",{staticClass:"mr20 ml16",domProps:{textContent:t._s(t.$route.params.id?"编辑短视频":"添加短视频")}})],1)])],1),e("Card",{staticClass:"ivu-mt mb79",attrs:{bordered:!1,"dis-hover":""}},[e("div",{staticClass:"new_tab"},[e("Tabs",{model:{value:t.currentTab,callback:function(e){t.currentTab=e},expression:"currentTab"}},t._l(t.headeNum,(function(t,a){return e("TabPane",{key:a,attrs:{label:t.name,name:t.type}})})),1)],1),"2"===t.currentTab?e("div",{staticClass:"Button"},[e("Button",{staticClass:"bnt mr15",attrs:{type:"primary"},on:{click:t.addGoods}},[t._v("添加商品")]),e("Tooltip",{attrs:{content:"本页至少选中一项",disabled:!!t.formSelection.length}},[e("Button",{staticClass:"bnt mr15",attrs:{disabled:!t.formSelection.length},on:{click:t.batchDel}},[t._v("批量删除")])],1)],1):t._e(),e("Form",{ref:"formValidate",staticClass:"formValidate mt20",attrs:{rules:t.ruleValidate,model:t.formValidate,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[e("Row",{directives:[{name:"show",rawName:"v-show",value:"1"===t.currentTab,expression:"currentTab === '1'"}],attrs:{gutter:24,type:"flex"}},[e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"视频简介:",prop:"desc"}},[e("Input",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{type:"textarea",rows:3,placeholder:"请输入视频简介",maxlength:"220","show-word-limit":""},model:{value:t.formValidate.desc,callback:function(e){t.$set(t.formValidate,"desc",e)},expression:"formValidate.desc"}})],1)],1),e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"上传视频:",prop:"video_url"}},[e("Button",{on:{click:function(e){return t.modalPicTap("video")}}},[t._v("上传视频")]),e("div",{staticClass:"tips"},[t._v("建议时长:9~30秒,视频宽高比9:16(不建议本地储存)")]),t.formValidate.video_url?e("div",{staticClass:"iview-video-style"},[e("video",{staticClass:"video-style",attrs:{src:t.formValidate.video_url,controls:"controls"}}),e("div",{staticClass:"mark"}),e("Icon",{staticClass:"iconv",attrs:{type:"ios-trash-outline"},on:{click:t.delVideo}})],1):t._e()],1)],1),e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"封面图:",prop:"image"}},[e("div",{staticClass:"pictrueBox"},[t.formValidate.image?e("div",{staticClass:"pictrue"},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.formValidate.image,expression:"formValidate.image"}]}),e("Button",{staticClass:"btndel",attrs:{shape:"circle",icon:"md-close"},nativeOn:{click:function(e){return t.handleRemove.apply(null,arguments)}}})],1):e("div",{staticClass:"upLoad acea-row row-center-wrapper",on:{click:function(e){return t.modalPicTap("image")}}},[e("Input",{staticClass:"input-display",model:{value:t.formValidate.image,callback:function(e){t.$set(t.formValidate,"image",e)},expression:"formValidate.image"}}),e("Icon",{attrs:{type:"ios-add",size:"26"}})],1)]),e("div",{staticClass:"tips"},[t._v("建议尺寸:226 * 300px")])])],1),e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"排序:"}},[e("InputNumber",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{min:0,max:99999999},model:{value:t.formValidate.sort,callback:function(e){t.$set(t.formValidate,"sort",e)},expression:"formValidate.sort"}})],1)],1)],1),e("div",{directives:[{name:"show",rawName:"v-show",value:"2"===t.currentTab,expression:"currentTab === '2'"}]},[e("Table",{staticClass:"ivu-mt",attrs:{columns:t.columns,data:t.tableData,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},on:{"on-selection-change":t.selectChange},scopedSlots:t._u([{key:"info",fn:function(a){var i=a.row;return[e("div",{staticClass:"imgPic acea-row row-middle"},[e("viewer",[e("div",{staticClass:"pictrue"},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:i.image,expression:"row.image"}]})])]),e("div",{staticClass:"info"},[e("Tooltip",{attrs:{"max-width":"200",placement:"bottom",transfer:""}},[e("span",{staticClass:"line2"},[t._v(t._s(i.store_name)+t._s(i.suk))]),e("p",{attrs:{slot:"content"},slot:"content"},[t._v(t._s(i.store_name)+t._s(i.suk))])])],1)],1)]}},{key:"action",fn:function(a){var i=a.row;return a.index,[e("a",{on:{click:function(e){return t.del(i)}}},[t._v("删除")])]}}])})],1)],1)],1),e("Card",{staticClass:"fixed-card",style:{left:"".concat(t.menuCollapse?t.isMobile?"0":"80px":"200px")},attrs:{bordered:!1,"dis-hover":""}},[e("Form",[e("FormItem",["1"!==t.currentTab?e("Button",{staticStyle:{"margin-right":"10px"},on:{click:t.upTab}},[t._v("上一步")]):t._e(),"2"!==t.currentTab?e("Button",{staticClass:"submission",attrs:{type:"primary"},on:{click:function(e){return t.downTab("formValidate")}}},[t._v("下一步")]):e("Button",{staticClass:"submission",attrs:{type:"primary"},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("保存")])],1)],1)],1),e("Modal",{attrs:{width:"960px",scrollable:"","footer-hide":"",closable:"",title:"上传商品图","mask-closable":!1,"z-index":1},model:{value:t.modalPic,callback:function(e){t.modalPic=e},expression:"modalPic"}},[t.modalPic?e("uploadPictures",{attrs:{isChoice:t.isChoice,gridBtn:t.gridBtn,gridPic:t.gridPic},on:{getPic:t.getPic}}):t._e()],1),e("Modal",{staticClass:"paymentFooter",attrs:{title:"商品列表",footerHide:"",scrollable:"",width:"900"},on:{"on-cancel":t.cancel},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[t.modals?e("goods-list",{ref:"goodslist",attrs:{ischeckbox:!0,isdiy:!0},on:{getProductId:t.getProductId}}):t._e()],1)],1)}),[],!1,null,"047db158",null);e.default=p.exports},"1f1d":function(t,e,a){},a11be:function(t,e,a){"use strict";a("1f1d")}}]);