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
5.9 KiB
1 lines
5.9 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6e773e64"],{"10ec":function(t,e,i){"use strict";i("62af")},"62af":function(t,e,i){},d7d0:function(t,e,i){"use strict";i.r(e);var o=i("2f62"),r=i("c4ad"),n=i("47c5"),s=i("d708");function a(t){return(a="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 i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function l(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?c(Object(i),!0).forEach((function(e){u(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function u(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!=a(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var d={name:"add_goods",components:{goodsList:r.default},computed:l(l({},Object(o.e)("admin/layout",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:100},labelPosition:function(){return this.isMobile?"top":"right"}}),data:function(){var t=this;return{roterPre:s.a.roterPre,isShowBox:!1,loading:!1,modals:!1,goodsList:[],tempGoods:{},formValidate:{},columns1:[{key:"id",title:"商品ID",width:80},{slot:"img",title:"商品信息",minWidth:250},{key:"price",title:"直播售价",minWidth:100,render:function(e,i){return e("Input",{props:{type:"number",value:i.row.price},on:{input:function(e){t.tabList[i.index].price=e}}})}},{key:"cost_price",title:"直播原价",minWidth:100,render:function(e,i){return e("Input",{props:{type:"number",value:i.row.cost_price},on:{input:function(e){t.tabList[i.index].cost_price=e}}})}},{key:"stock",title:"库存",minWidth:80},{slot:"action",fixed:"right",title:"操作",width:100}],tabList:[]}},methods:{liveGoods:function(){var t=this,e=[];this.goodsList.map((function(t){e.push(t.product_id)})),Object(n.g)({product_id:e}).then((function(e){t.tabList=e.data,t.isShowBox=!0})).catch((function(e){t.$Message.error(e.msg)}))},unique:function(t){var e=new Map;return t.filter((function(t){return!e.has(t.product_id)&&e.set(t.product_id,1)}))},getProductId:function(t){var e=this,i=this.goodsList.concat(t),o=this.unique(i);this.goodsList=o,this.$nextTick((function(t){setTimeout((function(){e.modals=!1}),300)}))},bindDelete:function(t){this.goodsList.splice(t,1)},del:function(t,e){this.tabList.splice(e,1)},bindSub:function(){var t=this;Object(n.f)({goods_info:this.tabList}).then((function(e){t.$Message.success("添加成功"),setTimeout((function(){t.$router.push({path:"".concat(t.roterPre,"/marketing/live/live_goods")})}),500)})).catch((function(e){t.$Message.error(e.msg)}))}}},f=(i("10ec"),i("2877")),p=Object(f.a)(d,(function(){var t=this,e=t._self._c;return e("div",[e("PageHeader",{staticClass:"product_tabs",attrs:{title:t.$route.meta.title,"hidden-breadcrumb":""}},[e("div",{attrs:{slot:"title"},slot:"title"},[e("router-link",{attrs:{to:{path:"".concat(t.roterPre,"/marketing/live/live_goods")}}},[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.meta.title)}})],1)]),e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[e("Form",{ref:"formValidate",staticClass:"tabform",attrs:{model:t.formValidate,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[e("Row",{attrs:{gutter:24,type:"flex"}},[e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"选择商品:"}},[e("div",{staticClass:"box"},[t._l(t.goodsList,(function(i,o){return e("div",{key:o,staticClass:"box-item"},[e("img",{attrs:{src:i.image,alt:""}}),e("Icon",{attrs:{type:"ios-close-circle",size:"20"},on:{click:function(e){return t.bindDelete(o)}}})],1)})),e("div",{staticClass:"upload-box",on:{click:function(e){t.modals=!0}}},[e("Icon",{attrs:{type:"ios-camera-outline",size:"36"}})],1)],2)])],1)],1)],1),t.goodsList.length>0?e("div",{staticClass:"active-btn"},[e("Button",{attrs:{type:"success"},on:{click:t.liveGoods}},[t._v("生成直播商品")])],1):t._e(),t.isShowBox?e("div",{staticClass:"table-box"},[e("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns1,data:t.tabList,loading:t.loading,"no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"img",fn:function(i){var o=i.row;return i.index,[e("div",{staticClass:"product_box"},[e("img",{attrs:{src:o.image,alt:""}}),e("span",{staticClass:"goods_title line1"},[t._v(t._s(o.store_name))])])]}},{key:"action",fn:function(i){var o=i.row,r=i.index;return[e("a",{on:{click:function(e){return t.del(o,r)}}},[t._v("删除")])]}}],null,!1,1104088942)})],1):t._e(),e("Card",{staticClass:"fixed-card",attrs:{bordered:!1,"dis-hover":""}},[e("div",{staticClass:"acea-row row-center"},[e("Button",{staticStyle:{width:"8%"},attrs:{type:"primary"},on:{click:t.bindSub}},[t._v("提交")])],1)])],1),e("Modal",{staticClass:"paymentFooter",attrs:{title:"商品列表",scrollable:"",width:"900","footer-hide":!0},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[t.modals?e("goods-list",{ref:"goodslist",attrs:{ischeckbox:!0,isLive:!0},on:{getProductId:t.getProductId}}):t._e()],1)],1)}),[],!1,null,"06187d32",null);e.default=p.exports}}]); |