mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-12 19:12:49 +00:00
1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-98e705ee"],{"42e4":function(t,e,r){"use strict";var i=r("86d4");r.n(i).a},6359:function(t,e,r){"use strict";r.r(e),r("d28b"),r("3ca3"),r("ddb0"),r("b636"),r("944a"),r("0c47"),r("23dc"),r("3410"),r("d9e2"),r("b0c0"),r("131a"),r("fb6a");var i=r("0122"),n=r("d0ff"),a=r("c964"),o=r("f3f3"),s=(r("d3b7"),r("99af"),r("159b"),r("a434"),r("a9e3"),r("a4d3"),r("e01a"),r("d81d"),r("2f62")),c=r("c4ad"),l=r("b0e7"),u=r("b7be");function d(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(e){l=function(t,e,r){return t[e]=r}}function u(t,e,r,i){var a,o,s,c;e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype),i=new k(i||[]);return n(e,"_invoke",{value:(a=t,o=r,s=i,c="suspendedStart",function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return P()}for(s.method=t,s.arg=e;;){var r=s.delegate;if(r&&(r=function t(e,r){var i=r.method,n=e.iterator[i];return void 0===n?(r.delegate=null,"throw"===i&&e.iterator.return&&(r.method="return",r.arg=void 0,t(e,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),f):(i=h(n,e.iterator,r.arg),"throw"===i.type?(r.method="throw",r.arg=i.arg,r.delegate=null,f):(n=i.arg,n?n.done?(r[e.resultName]=n.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):n:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)))}(r,s),r)){if(r===f)continue;return r}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===c)throw c="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);if(c="executing",r=h(a,o,s),"normal"===r.type){if(c=s.done?"completed":"suspendedYield",r.arg===f)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(c="completed",s.method="throw",s.arg=r.arg)}})}),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function m(){}function g(){}a={};var v=(l(a,o,(function(){return this})),Object.getPrototypeOf),b=(v=v&&v(v(C([]))),v&&v!==e&&r.call(v,o)&&(a=v),g.prototype=p.prototype=Object.create(a));function y(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var a;n(this,"_invoke",{value:function(n,o){function s(){return new e((function(a,s){!function n(a,o,s,c){var l;a=h(t[a],t,o);if("throw"!==a.type)return(o=(l=a.arg).value)&&"object"==Object(i.a)(o)&&r.call(o,"__await")?e.resolve(o.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):e.resolve(o).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,c)}));c(a.arg)}(n,o,a,s)}))}return a=a?a.then(s,s):s()}})}function x(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function C(t){if(t){var e,i=t[o];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(i=function i(){for(;++e<t.length;)if(r.call(t,e))return i.value=t[e],i.done=!1,i;return i.value=void 0,i.done=!0,i}).next=i}return{next:P}}function P(){return{value:void 0,done:!0}}return n(b,"constructor",{value:m.prototype=g,configurable:!0}),n(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},y(w.prototype),l(w.prototype,s,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,i,n,a){void 0===a&&(a=Promise);var o=new w(u(e,r,i,n),a);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},y(b),l(b,c,"Generator"),l(b,o,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,r=Object(t),i=[];for(e in r)i.push(e);return i.reverse(),function t(){for(;i.length;){var e=i.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=C,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(r,i){return o.type="throw",o.arg=t,e.next=r,i&&(e.method="next",e.arg=void 0),!!i}for(var n=this.tryEntries.length-1;0<=n;--n){var a=this.tryEntries[n],o=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;0<=i;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}var o=(a=a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc?null:a)?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(o)},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),f},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,i,n=this.tryEntries[e];if(n.tryLoc===t)return"throw"===(r=n.completion).type&&(i=r.arg,_(n)),i}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}c={name:"storeIntegralCreate",components:{goodsList:c.default,uploadPictures:l.a},data:function(){return{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},myConfig:{autoHeightEnabled:!1,initialFrameHeight:500,initialFrameWidth:"100%",UEDITOR_HOME_URL:"/UEditor/",serverUrl:""},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:Object(o.a)(Object(o.a)({},Object(s.d)("media",["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,i){var n=e;Object(u.eb)(t.product_id,4).then((function(t){t=t.data.info,n.specsData=n.specsData.concat(t.attrs),n.specsData.forEach((function(t,e){n.$set(n.specsData[e],"id",e)})),n.columns=t.header,n.columns.unshift({type:"selection",width:60,align:"center"}),n.inputChange(t),r(),e.loading=!1})).catch((function(t){e.loading=!1,i(),n.$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 i=t.title,n=t.key;e.columns.splice(t.index,1,{title:i,key:n,align:"center",minWidth:120,render:function(t,r){return t("div",[t("InputNumber",{props:{min:0,precision:0,value:"price"===n?r.row.price:r.row.quota},on:{"on-change":function(t){"price"===n?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,i){t.id===r.row.id&&e.formValidate.attrs.splice(i,1,r.row)}))}}})])}})}))},changeCheckbox:function(t){this.formValidate.attrs=t},getProductId:function(t){var e=this;return Object(a.a)(d().mark((function r(){var i,n,a;return d().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=0;case 1:if(i<e.goodsImg.length){if(e.goodsImg[i].product_id===t.product_id)return e.$Message.error("该商品已经添加"),r.abrupt("return");r.next=6}else r.next=9;break;case 6:i++,r.next=1;break;case 9:e.modal_loading=!1,e.modals=!1,e.goodsImg=e.goodsImg.concat(t),n=0;case 13:if(n<t.length)return a=t[n],r.next=17,e.productAttrs(a);r.next=20;break;case 17:n++,r.next=13;break;case 20:case"end":return r.stop()}}),r)})))()},cancel:function(){this.modals=!1},onchangeTime:function(t){this.formValidate.section_time=t},getInfo:function(){var t=this;this.spinShow=!0,Object(u.O)(this.$route.params.id).then(function(){var e=Object(a.a)(d().mark((function e(r){var i,n,a,o,s;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(s in i=t,n=r.data.info,a={type:"selection",width:60,align:"center"},t.formValidate=n,t.columns=n.attrs.header,t.columns.unshift(a),t.specsData=n.attrs.value,i.specsData.forEach((function(t,e){i.$set(i.specsData[e],"id",e)})),a=n.attrs,o=[],n.attrs.value)n.attrs.value[s]._checked&&o.push(n.attrs.value[s]);i.formValidate.attrs=o,i.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,r=this;if(!this.formValidate.attrs.length)return this.$Message.error("请先选择商品规格");for(e in this.formValidate.attrs)if(this.formValidate.attrs[e].quota<=0)return this.$Message.error("商品限量必须大于0");this.$refs[t].validate((function(t){if(!t)return!1;1==r.copy&&(r.formValidate.copy=1),r.formValidate.id=Number(r.$route.params.id)||0,r.submitOpen=!0,Object(u.M)(r.formValidate).then(function(){var t=Object(a.a)(d().mark((function t(e){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.submitOpen=!1,r.$Message.success(e.msg),setTimeout((function(){r.$router.push({path:r.$routeProStr+"/marketing/store_integral/index"})}),500);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){r.submitOpen=!1,r.$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){"danFrom"===this.picTit?this.formValidate.image=t.att_dir:(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){var r;t.dataTransfer.effectAllowed="move",e!==this.dragging&&(r=(t=Object(n.a)(this.formValidate.images)).indexOf(this.dragging),e=t.indexOf(e),t.splice.apply(t,[e,0].concat(Object(n.a)(t.splice(r,1)))),this.formValidate.images=t)},addCustomDialog:function(t){window.UE.registerUI("test-dialog",(function(t,e){var r=new window.UE.ui.Dialog({iframeUrl:this.$routeProStr+"/widget.images/index.html?fodder=dialog",editor:t,name:e,title:"上传图片",cssRules:"width:960px;height:550px;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)}}},r("42e4"),l=r("2877"),o=Object(l.a)(c,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"i-layout-page-header"},[r("div",{staticClass:"i-layout-page-header"},[r("router-link",{attrs:{to:{path:t.$routeProStr+"/marketing/store_integral/index"}}},[r("Button",{staticClass:"mr20",attrs:{icon:"ios-arrow-back",size:"small"}},[t._v("返回")])],1),r("span",{staticClass:"ivu-page-header-title mr20",domProps:{textContent:t._s(t.$route.params.id?"编辑积分商品":"添加积分商品")}})],1)]),r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Row",{staticClass:"mt30 acea-row row-middle row-center",attrs:{type:"flex"}},[r("Col",{attrs:{span:"23"}},[r("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()}}},[r("FormItem",{attrs:{label:"选择商品:",prop:"image_input"}},[r("div",{staticClass:"picBox",on:{click:t.changeGoods}},[t._l(t.goodsImg,(function(e,i){return r("div",{key:i,staticClass:"pictrue"},[e.image?r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.image,expression:"item.image"}]}):t._e(),r("span",{staticClass:"iconfont icondel_1",on:{click:function(e){return e.stopPropagation(),t.bindDelete(i)}}})])})),r("div",{staticClass:"upLoad acea-row row-center-wrapper"},[r("Icon",{staticClass:"iconfonts",attrs:{type:"ios-camera-outline",size:"26"}})],1)],2)]),r("Col",{attrs:{type:"flex"}},[r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"规格选择:"}},[r("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(e){var i=e.row,n=e.index;return[r("div",{staticClass:"acea-row row-middle row-center-wrapper",on:{click:function(e){return t.modalPicTap("dan","danTable",n)}}},[i.pic?r("div",{staticClass:"pictrue pictrueTab"},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:i.pic,expression:"row.pic"}]})]):r("div",{staticClass:"upLoad pictrueTab acea-row row-center-wrapper"},[r("Icon",{staticClass:"iconfont",attrs:{type:"ios-camera-outline",size:"21"}})],1)])]}}])})],1)],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"上架状态:",props:"is_show","label-for":"is_show"}},[r("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"}},[r("Radio",{attrs:{label:0}},[t._v("关闭")]),r("Radio",{staticClass:"radio",attrs:{label:1}},[t._v("开启")])],1)],1)],1)],1),r("Col",{attrs:{span:"24"}},[r("FormItem",[r("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 ")]),r("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?r("Spin",{attrs:{size:"large",fix:""}}):t._e()],1)],1)],1),r("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?r("goods-list",{ref:"goodslist",attrs:{ischeckbox:!0},on:{getProductId:t.getProductId}}):t._e()],1),r("Modal",{attrs:{width:"950px",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?r("uploadPictures",{attrs:{isChoice:t.isChoice,gridBtn:t.gridBtn,gridPic:t.gridPic},on:{getPic:t.getPic,getPicD:t.getPicD}}):t._e()],1)],1)}),[],!1,null,"14925bf5",null),e.default=o.exports},"86d4":function(t,e,r){}}]); |