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
19 KiB
1 lines
19 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-00ca6edb"],{"2cc9":function(t,e,r){"use strict";r("6011")},6011:function(t,e,r){},6359:function(t,e,r){"use strict";r.r(e);var n=r("2f62"),i=r("c4ad"),o=r("b0e7"),a=r("b7be"),s=r("d708");function c(t){return(c="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 l(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function d(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new D(n||[]);return i(a,"_invoke",{value:j(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",m="suspendedYield",g="executing",v="completed",y={};function b(){}function w(){}function x(){}var P={};u(P,a,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(S([])));k&&k!==r&&n.call(k,a)&&(P=k);var O=x.prototype=b.prototype=Object.create(P);function C(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(i,o,a,s){var l=h(t[i],t,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==c(d)&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(l.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function j(e,r,n){var i=p;return function(o,a){if(i===g)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=I(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=g;var l=h(e,r,n);if("normal"===l.type){if(i=n.done?v:m,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=v,n.method="throw",n.arg=l.arg)}}}function I(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=h(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function V(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function S(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(c(e)+" is not iterable")}return w.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=u(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},C(E.prototype),u(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new E(f(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},C(O),u(O,l,"Generator"),u(O,a,(function(){return this})),u(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=S,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(V),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),V(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;V(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function f(t,e,r,n,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,i)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){f(o,n,i,a,s,"next",t)}function s(t){f(o,n,i,a,s,"throw",t)}a(void 0)}))}}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){g(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function g(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var v={name:"storeIntegralCreate",components:{goodsList:i.default,uploadPictures:o.a},data:function(){return{roterPre:s.a.roterPre,loading:!1,goodsImg:[],productsId:[],submitOpen:!1,spinShow:!1,isChoice:"",current:0,modalPic:!1,grid:{xl:12,lg:20,md:24,sm:24,xs:24},grid2:{xl:8,lg:12,md:12,sm:24,xs:24},gridPic:{xl:6,lg:8,md:12,sm:12,xs:12},gridBtn:{xl:4,lg:8,md:8,sm:8,xs:8},modals:!1,modal_loading:!1,images:[],formValidate:{is_show:0,attrs:[]},templateList:[],timeList:[],columns:[],specsData:[],picTit:"",tableIndex:0,ruleValidate:{price:[{required:!0,type:"number",message:"请输入兑换积分",trigger:"blur"}],num:[{required:!0,type:"number",message:"请输入购买数量限制",trigger:"blur"}],once_num:[{required:!0,type:"number",message:"请输入单次购买数量限制",trigger:"blur"}]},copy:0}},computed:m(m({},Object(n.e)("admin/layout",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:135},labelPosition:function(){return this.isMobile?"top":"right"}}),mounted:function(){this.$route.params.id&&(this.copy=this.$route.params.copy,this.current=1,this.getInfo())},methods:{productAttrs:function(t){var e=this;return this.loading=!0,new Promise((function(r,n){var i=e;Object(a.sb)(t.product_id,4).then((function(t){var n=t.data.info;i.specsData=i.specsData.concat(n.attrs),i.specsData.forEach((function(t,e){i.$set(i.specsData[e],"id",e)})),i.columns=n.header,i.columns.unshift({type:"selection",width:60,align:"center"}),i.inputChange(n),r(),e.loading=!1})).catch((function(t){e.loading=!1,n(),i.$Message.error(t.msg)}))}))},inputChange:function(t){var e=this,r=[];t.header.forEach((function(t,e){1===t.type&&r.push({index:e,key:t.key,title:t.title})})),r.forEach((function(t,r){var n=t.title,i=t.key,o={title:n,key:i,align:"center",minWidth:120,render:function(t,r){return t("div",[t("InputNumber",{props:{min:0,precision:0,value:"price"===i?r.row.price:r.row.quota},on:{"on-change":function(t){"price"===i?r.row.price=t:r.row.quota=t,e.specsData[r.index]=r.row,e.formValidate.attrs&&e.formValidate.attrs.length&&e.formValidate.attrs.forEach((function(t,n){t.id===r.row.id&&e.formValidate.attrs.splice(n,1,r.row)}))}}})])}};e.columns.splice(t.index,1,o)}))},changeCheckbox:function(t){this.formValidate.attrs=t},getProductId:function(){var t=h(d().mark((function t(e){var r,n,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r<this.goodsImg.length)){t.next=9;break}if(this.goodsImg[r].product_id!==e.product_id){t.next=6;break}return this.$Message.error("该商品已经添加"),t.abrupt("return");case 6:r++,t.next=1;break;case 9:this.modal_loading=!1,this.modals=!1,this.goodsImg=this.goodsImg.concat(e),n=0;case 13:if(!(n<e.length)){t.next=20;break}return i=e[n],t.next=17,this.productAttrs(i);case 17:n++,t.next=13;break;case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),cancel:function(){this.modals=!1},onchangeTime:function(t){this.formValidate.section_time=t},getInfo:function(){var t=this;this.spinShow=!0,Object(a.gb)(this.$route.params.id).then(function(){var e=h(d().mark((function e(r){var n,i,o,a,s,c;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(c in n=t,i=r.data.info,o={type:"selection",width:60,align:"center"},t.formValidate=i,t.columns=i.attrs.header,t.columns.unshift(o),t.specsData=i.attrs.value,n.specsData.forEach((function(t,e){n.$set(n.specsData[e],"id",e)})),a=i.attrs,s=[],i.attrs.value)i.attrs.value[c]._checked&&s.push(i.attrs.value[c]);n.formValidate.attrs=s,n.inputChange(a),t.spinShow=!1;case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.spinShow=!1,t.$Message.error(e.msg)}))},bindDelete:function(t){this.goodsImg[t].product_id,this.goodsImg.splice(t,1),this.loading=!0},next:function(t){var e=this;if(!this.formValidate.attrs.length)return this.$Message.error("请先选择商品规格");for(var r in this.formValidate.attrs)if(this.formValidate.attrs[r].quota<=0)return this.$Message.error("商品限量必须大于0");this.$refs[t].validate((function(t){if(!t)return!1;1==e.copy&&(e.formValidate.copy=1),e.formValidate.id=Number(e.$route.params.id)||0,e.submitOpen=!0,Object(a.bb)(e.formValidate).then(function(){var t=h(d().mark((function t(r){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.submitOpen=!1,e.$Message.success(r.msg),setTimeout((function(){e.$router.push({path:e.roterPre+"/marketing/store_integral/index"})}),500);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.submitOpen=!1,e.$Message.error(t.msg)}))}))},step:function(){this.current--},getContent:function(t){this.formValidate.description=t},modalPicTap:function(t,e,r){this.modalPic=!0,this.isChoice="dan"===t?"单选":"多选",this.picTit=e,this.tableIndex=r},getPic:function(t){switch(this.picTit){case"danFrom":this.formValidate.image=t.att_dir;break;default:this.formValidate.attrs&&this.formValidate.attrs.length&&this.$set(this.specsData[this.tableIndex],"_checked",!0),this.specsData[this.tableIndex].pic=t.att_dir}this.modalPic=!1},getPicD:function(t){var e=this;this.images=t,this.images.map((function(t){e.formValidate.images.push(t.att_dir),e.formValidate.images=e.formValidate.images.splice(0,10)})),this.modalPic=!1},handleRemove:function(t){this.images.splice(t,1),this.formValidate.images.splice(t,1)},changeGoods:function(){this.modals=!0},handleDragStart:function(t,e){this.dragging=e},handleDragEnd:function(t,e){this.dragging=null},handleDragOver:function(t){t.dataTransfer.dropEffect="move"},handleDragEnter:function(t,e){if(t.dataTransfer.effectAllowed="move",e!==this.dragging){var r=l(this.formValidate.images),n=r.indexOf(this.dragging),i=r.indexOf(e);r.splice.apply(r,[i,0].concat(l(r.splice(n,1)))),this.formValidate.images=r}},addCustomDialog:function(t){window.UE.registerUI("test-dialog",(function(t,e){var r=new window.UE.ui.Dialog({iframeUrl:"/admin/widget.images/index.html?fodder=dialog",editor:t,name:e,title:"上传图片",cssRules:"width:1200px;height:500px;padding:20px;"});return this.dialog=r,new window.UE.ui.Button({name:"dialog-button",title:"上传图片",cssRules:"background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;",onclick:function(){r.render(),r.open()}})}),37,t)}}},y=(r("2cc9"),r("2877")),b=Object(y.a)(v,(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",{attrs:{slot:"title"},slot:"title"},[e("router-link",{attrs:{to:{path:"".concat(t.roterPre,"/marketing/store_integral/index")}}},[e("Button",{staticClass:"mr20",attrs:{icon:"ios-arrow-back",size:"small"}},[t._v("返回")])],1),e("span",{staticClass:"mr20",domProps:{textContent:t._s(t.$route.params.id?"编辑积分商品":"添加积分商品")}})],1)])],1),e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[e("Row",{staticClass:"mt30 acea-row row-middle row-center",attrs:{type:"flex"}},[e("Col",{attrs:{span:"23"}},[e("Form",{ref:"formValidate",staticClass:"form mt30",attrs:{model:t.formValidate,rules:t.ruleValidate,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[e("FormItem",{attrs:{label:"选择商品:",prop:"image_input"}},[e("div",{staticClass:"picBox",on:{click:t.changeGoods}},[t._l(t.goodsImg,(function(r,n){return e("div",{key:n,staticClass:"pictrue"},[r.image?e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:r.image,expression:"item.image"}]}):t._e(),e("span",{staticClass:"iconfont icondel_1",on:{click:function(e){return e.stopPropagation(),t.bindDelete(n)}}})])})),e("div",{staticClass:"upLoad acea-row row-center-wrapper"},[e("Icon",{staticClass:"iconfonts",attrs:{type:"ios-camera-outline",size:"26"}})],1)],2)]),e("Col",{attrs:{type:"flex"}},[e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"规格选择:"}},[e("Table",{staticClass:"mt25",attrs:{data:t.specsData,columns:t.columns,border:"","highlight-row":"",loading:t.loading},on:{"on-selection-change":t.changeCheckbox},scopedSlots:t._u([{key:"pic",fn:function(r){var n=r.row,i=r.index;return[e("div",{staticClass:"acea-row row-middle row-center-wrapper",on:{click:function(e){return t.modalPicTap("dan","danTable",i)}}},[n.pic?e("div",{staticClass:"pictrue pictrueTab"},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:n.pic,expression:"row.pic"}]})]):e("div",{staticClass:"upLoad pictrueTab acea-row row-center-wrapper"},[e("Icon",{staticClass:"iconfont",attrs:{type:"ios-camera-outline",size:"21"}})],1)])]}}])})],1)],1),e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"上架状态:",props:"is_show","label-for":"is_show"}},[e("RadioGroup",{attrs:{"element-id":"is_show"},model:{value:t.formValidate.is_show,callback:function(e){t.$set(t.formValidate,"is_show",e)},expression:"formValidate.is_show"}},[e("Radio",{attrs:{label:0}},[t._v("关闭")]),e("Radio",{staticClass:"radio",attrs:{label:1}},[t._v("开启")])],1)],1)],1)],1),e("Col",{attrs:{span:"24"}},[e("FormItem",[e("Button",{directives:[{name:"show",rawName:"v-show",value:0!==t.current,expression:"current !== 0"}],staticClass:"submission mr15",attrs:{disabled:t.$route.params.id&&1===t.current},on:{click:t.step}},[t._v("上一步\n ")]),e("Button",{staticClass:"submission",attrs:{disabled:t.submitOpen&&1===t.current,type:"primary"},domProps:{textContent:t._s("提交")},on:{click:function(e){return t.next("formValidate")}}})],1)],1)],1),t.spinShow?e("Spin",{attrs:{size:"large",fix:""}}):t._e()],1)],1)],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},on:{getProductId:t.getProductId}}):t._e()],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,getPicD:t.getPicD}}):t._e()],1)],1)}),[],!1,null,"32e09bf5",null);e.default=b.exports}}]); |