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
15 KiB
1 lines
15 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a1562cca"],{1214:function(t,e,o){"use strict";var a=o("4218"),n=o.n(a);n.a},"27ae":function(t,e,o){(function(o){var a,n;(function(e,o){t.exports=o(e)})("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof o?o:this,(function(o){"use strict";o=o||{};var r,i=o.Base64,s="2.6.4",c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=function(t){for(var e={},o=0,a=t.length;o<a;o++)e[t.charAt(o)]=o;return e}(c),l=String.fromCharCode,d=function(t){if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?l(192|e>>>6)+l(128|63&e):l(224|e>>>12&15)+l(128|e>>>6&63)+l(128|63&e)}e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return l(240|e>>>18&7)+l(128|e>>>12&63)+l(128|e>>>6&63)+l(128|63&e)},f=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(t){return t.replace(f,d)},p=function(t){var e=[0,2,1][t.length%3],o=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0),a=[c.charAt(o>>>18),c.charAt(o>>>12&63),e>=2?"=":c.charAt(o>>>6&63),e>=1?"=":c.charAt(63&o)];return a.join("")},h=o.btoa&&"function"==typeof o.btoa?function(t){return o.btoa(t)}:function(t){if(t.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return t.replace(/[\s\S]{1,3}/g,p)},b=function(t){return h(m(String(t)))},g=function(t){return t.replace(/[+\/]/g,(function(t){return"+"==t?"-":"_"})).replace(/=/g,"")},y=function(t,e){return e?g(b(t)):b(t)},v=function(t){return y(t,!0)};o.Uint8Array&&(r=function(t,e){for(var o="",a=0,n=t.length;a<n;a+=3){var r=t[a],i=t[a+1],s=t[a+2],u=r<<16|i<<8|s;o+=c.charAt(u>>>18)+c.charAt(u>>>12&63)+("undefined"!=typeof i?c.charAt(u>>>6&63):"=")+("undefined"!=typeof s?c.charAt(63&u):"=")}return e?g(o):o});var A,S=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,P=function(t){switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),o=e-65536;return l(55296+(o>>>10))+l(56320+(1023&o));case 3:return l((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return l((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},T=function(t){return t.replace(S,P)},O=function(t){var e=t.length,o=e%4,a=(e>0?u[t.charAt(0)]<<18:0)|(e>1?u[t.charAt(1)]<<12:0)|(e>2?u[t.charAt(2)]<<6:0)|(e>3?u[t.charAt(3)]:0),n=[l(a>>>16),l(a>>>8&255),l(255&a)];return n.length-=[0,0,2,1][o],n.join("")},D=o.atob&&"function"==typeof o.atob?function(t){return o.atob(t)}:function(t){return t.replace(/\S{1,4}/g,O)},x=function(t){return D(String(t).replace(/[^A-Za-z0-9\+\/]/g,""))},j=function(t){return T(D(t))},k=function(t){return String(t).replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},C=function(t){return j(k(t))};o.Uint8Array&&(A=function(t){return Uint8Array.from(x(k(t)),(function(t){return t.charCodeAt(0)}))});var w=function(){var t=o.Base64;return o.Base64=i,t};if(o.Base64={VERSION:s,atob:x,btoa:h,fromBase64:C,toBase64:y,utob:m,encode:y,encodeURI:v,btou:T,decode:C,noConflict:w,fromUint8Array:r,toUint8Array:A},"function"===typeof Object.defineProperty){var B=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}};o.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",B((function(){return C(this)}))),Object.defineProperty(String.prototype,"toBase64",B((function(t){return y(this,t)}))),Object.defineProperty(String.prototype,"toBase64URI",B((function(){return y(this,!0)})))}}return o["Meteor"]&&(Base64=o.Base64),t.exports?t.exports.Base64=o.Base64:(a=[],n=function(){return o.Base64}.apply(e,a),void 0===n||(t.exports=n)),{Base64:o.Base64}}))}).call(this,o("c8ba"))},4218:function(t,e,o){},"4fad":function(t,e,o){var a=o("23e7"),n=o("6f53").entries;a({target:"Object",stat:!0},{entries:function(t){return n(t)}})},"6f53":function(t,e,o){var a=o("83ab"),n=o("df75"),r=o("fc6a"),i=o("d1e7").f,s=function(t){return function(e){var o,s=r(e),c=n(s),u=c.length,l=0,d=[];while(u>l)o=c[l++],a&&!i.call(s,o)||d.push(t?[o,s[o]]:s[o]);return d}};t.exports={entries:s(!0),values:s(!1)}},"736b":function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"edit_add_page"},[o("div",{staticClass:"content"},[o("div",{staticClass:"title"},[t._v(" 活动列表/报名 "),o("div",{staticClass:"btn_list"},[o("span",{on:{click:t.cancel}},[t._v("取消")]),o("span",{on:{click:t.save}},[t._v("保存")])])]),o("el-col",{attrs:{span:12}},[o("el-form",{ref:"form",attrs:{model:t.form,"label-width":"100px"}},[o("h2",[t._v("基础信息")]),o("el-form-item",{attrs:{label:"活动名称:"}},[o("el-input",{attrs:{placeholder:"请输入活动名称",disabled:t.unStart},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),o("el-form-item",{attrs:{label:"活动介绍:"}},[o("el-input",{attrs:{type:"textarea",placeholder:"请输入活动介绍",disabled:t.unStart},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1),o("el-form-item",{attrs:{label:"报名时间:"}},[o("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"yyyy-MM-dd HH:mm","picker-options":t.pickerOptions1},model:{value:t.date2,callback:function(e){t.date2=e},expression:"date2"}})],1),o("el-form-item",{attrs:{label:"活动时间:"}},[o("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"yyyy-MM-dd HH:mm",disabled:t.applyEnd,"picker-options":t.pickerOptions},model:{value:t.date1,callback:function(e){t.date1=e},expression:"date1"}})],1),o("el-form-item",{attrs:{label:"活动保证金:"}},[o("el-radio-group",{model:{value:t.form.isNeedSecurityDeposit,callback:function(e){t.$set(t.form,"isNeedSecurityDeposit",e)},expression:"form.isNeedSecurityDeposit"}},[o("el-radio",{attrs:{label:1,disabled:t.unStart}},[t._v("需要")]),o("el-radio",{attrs:{label:0,disabled:t.unStart}},[t._v("不需要")])],1)],1),1===t.form.isNeedSecurityDeposit?o("el-form-item",{attrs:{label:"保证金金额:"}},[o("el-input",{attrs:{placeholder:"请输入活动保证金金额",disabled:t.unStart},model:{value:t.form.securityDeposit,callback:function(e){t.$set(t.form,"securityDeposit",e)},expression:"form.securityDeposit"}})],1):t._e(),o("el-form-item",{attrs:{label:"活动标签"}},[o("el-input",{attrs:{placeholder:"请输入活动标签",disabled:t.unStart},model:{value:t.form.tag,callback:function(e){t.$set(t.form,"tag",e)},expression:"form.tag"}})],1),o("h2",[t._v("优惠规则")]),o("el-form-item",{attrs:{label:"优惠方式:"}},[o("el-radio-group",{on:{change:t.selectDiscount},model:{value:t.form.promotionType,callback:function(e){t.$set(t.form,"promotionType",e)},expression:"form.promotionType"}},[o("el-radio",{attrs:{label:1,disabled:t.unStart}},[t._v("满减")]),o("el-radio",{attrs:{label:2,disabled:t.unStart}},[t._v("优惠券")])],1)],1),o("el-form-item",{attrs:{label:"优惠方案:"}},[o("el-radio-group",{on:{change:t.selectPreScheme},model:{value:t.form.promotionPlan,callback:function(e){t.$set(t.form,"promotionPlan",e)},expression:"form.promotionPlan"}},[o("el-radio",{attrs:{label:1,disabled:2===t.form.promotionType||t.unStart}},[t._v("叠加优惠")]),o("el-radio",{attrs:{label:2,disabled:t.unStart}},[t._v("阶梯优惠")])],1)],1),t._l(t.list,(function(e,a){return o("el-form-item",{key:a},[o("el-col",{attrs:{span:10}},[t._v(" 满 "),o("el-input",{staticStyle:{width:"80%"},attrs:{disabled:t.unStart},model:{value:e.fullAmount,callback:function(o){t.$set(e,"fullAmount",o)},expression:"item.fullAmount"}})],1),o("el-col",{attrs:{span:10}},[t._v(" 减 "),o("el-input",{staticStyle:{width:"80%"},attrs:{disabled:t.unStart},model:{value:e.discountAmount,callback:function(o){t.$set(e,"discountAmount",o)},expression:"item.discountAmount"}})],1)],1)})),2===t.form.promotionPlan?o("el-form-item",[o("el-button",{attrs:{type:"primary",disabled:t.unStart},on:{click:t.add}},[t._v("添加层级")])],1):t._e()],2)],1),o("el-col",{attrs:{span:12}},[o("div",{staticClass:"photo"},[o("el-upload",{staticClass:"avatar-uploader",attrs:{headers:t.headers,data:t.dataObj,action:t.action,"show-file-list":!1,"on-success":t.handleAvatarSuccess,disabled:t.unStart}},[t.form.image?o("img",{staticClass:"avatar",attrs:{src:t.form.image,width:"80",height:"80"}}):o("i",{staticClass:"el-icon-plus avatar-uploader-icon"}),o("el-button",{attrs:{size:"small",type:"primary",disabled:t.unStart}},[t._v("点击上传")])],1)],1)])],1)])},n=[],r=(o("4160"),o("d81d"),o("b64b"),o("159b"),o("5657")),i=o("9b2a"),s={data:function(){var t=this;return{form:{name:"",description:"",isNeedSecurityDeposit:0,securityDeposit:"",tag:"",promotionType:1,promotionPlan:1,image:""},list:[{fullAmount:"",discountAmount:""}],date1:[],date2:[],type:!1,headers:{Authorization:""},action:"".concat("https://pos.admin.api.lotus-wallet.com","/file/upload"),dataObj:{folderId:1},pickerOptions:{disabledDate:function(e){var o=t.$route.query.info;return""!==t.date1[0]&&o&&2===o.status?e.getTime()<new Date(t.date1[0]).getTime():""}},pickerOptions1:{disabledDate:function(e){var o=t.$route.query.info;return""===t.date2[0]||!o||3!==o.status&&4!==o.status?"":e.getTime()<new Date(t.date2[0]).getTime()}}}},computed:{info:function(){return this.$route.query.info||{}},unStart:function(){var t=this.$route.query.info;return t&&!(1===t.status)},applyEnd:function(){var t=this.$route.query.info;return t&&(3===t.status||4===t.status)}},created:function(){this.headers.token="Bearer "+r["a"].get("TOKEN",""),this.headers.tenant="0000",this.setForm()},methods:{setForm:function(){var t=this,e=t.form;if(this.$route.meta.title=t.info.id?"修改活动":"新增活动",t.info.id){Object.keys(e).forEach((function(o){e[o]=t.info[o],"securityDeposit"===o&&(e[o]=t.info[o]/100)}));var o=t.info.promotionDetail;o.length&&(o.map((function(t){t.fullAmount/=100,t.discountAmount/=100})),t.list=o),this.date1=[t.info.activityStartTime,t.info.activityEndTime],this.date2=[t.info.applyStartTime,t.info.applyEndTime]}},selectDiscount:function(t){2===t&&(this.form.promotionPlan=2)},selectPreScheme:function(t){1===t&&(this.list=[{fullAmount:"",discountAmount:""}])},add:function(){2===this.form.promotionPlan&&this.list.push({fullAmount:"",discountAmount:""})},cancel:function(){this.$router.go(-1)},save:function(){var t=this,e=this,o=[];e.list.forEach((function(t){o.push({fullAmount:100*t.fullAmount,discountAmount:100*t.discountAmount})}));var a=Object.assign({},e.form,{activityStartTime:e.date1[0]||"",activityEndTime:e.date1[1]||"",applyStartTime:e.date2[0]||"",applyEndTime:e.date2[1]||"",promotionDetail:o,securityDeposit:100*e.form.securityDeposit});return e.info.id?i["a"].updatePromotion(Object.assign(a,{id:e.info.id})).then((function(o){var a=o.data;0===a.code&&(t.$message({message:"修改成功",type:"success"}),e.reset(),e.cancel())})):i["a"].addPromotion(a).then((function(o){var a=o.data;0===a.code&&(t.$message({message:"新增成功",type:"success"}),e.reset(),e.cancel())}))},handleAvatarSuccess:function(t){var e=t.data.url;this.form.image=e},reset:function(){this.form={name:"",description:"",isNeedSecurityDeposit:2,securityDeposit:"",tag:"",promotionType:1,promotionPlan:1,image:"",promotionDetail:"",activityStartTime:"",activityEndTime:"",applyStartTime:"",applyEndTime:""},this.list=[{fullAmount:"",discountAmount:""}],this.date1=[],this.date2=[]}}},c=s,u=(o("1214"),o("2877")),l=Object(u["a"])(c,a,n,!1,null,"1652741a",null);e["default"]=l.exports},9256:function(t,e,o){"use strict";o("99af"),o("4160"),o("caad"),o("4fad"),o("d3b7"),o("159b");var a=o("5530"),n=o("bc3a"),r=o.n(n),i=o("5c96"),s=o("5657");o("27ae");function c(t,e){"ECONNABORTED"===t.code?Object(i["Message"])({message:"请求超时"}):t.response&&t.response.data?Object(i["Message"])({message:t.response.data}):t.message&&Object(i["Message"])({message:t.message}),e(t)}function u(t,e){t.data.isError&&(4e4===t.data.code||40001===t.data.code||40002===t.data.code||40003===t.data.code||40005===t.data.code||40006===t.data.code||40008===t.data.code?i["MessageBox"].alert(t.data.msg,"提醒",{confirmButtonText:"确定",callback:function(){window.location.hash="/login"}}):i["Message"].error(t.data.msg)),e(t)}r.a.interceptors.request.use((function(t){var e=!1!==t.headers["X-isToken"]||t.headers["X-isToken"],o=s["a"].get("TOKEN","");o&&e&&(t.headers.token="Bearer "+o);var a="ceres_admin_web",n="ceres_admin_web";return t.headers["Authorization"]="Basic ".concat("".concat(a,":").concat(n)),t}),(function(t){return Promise.reject(t)})),r.a.interceptors.response.use((function(t){return t}),(function(t){return Promise.reject(t)}));var l=function(t){console.log(t,"opts");var e={ts:Date.now()},o=t.method.toUpperCase(),n={method:o,url:"".concat("https://pos.admin.api.lotus-wallet.com").concat(t.url),responseType:t.responseType||"",timeout:2e4},i=["PUT","POST","PATCH"];i.includes(o)?n.data=t.data||{}:n.params=Object(a["a"])(Object(a["a"])({},e),t.data||{}),t.formData&&(n.transformRequest=[function(t){var e=new FormData;return t&&Object.entries(t).forEach((function(t){e.append(t[0],t[1])})),e}]);var s=new Promise((function(t,e){r()(n).then((function(e){u(e,t)})).catch((function(t){c(t,e)}))}));return s};e["a"]=l},"9b2a":function(t,e,o){"use strict";o("99af");var a=o("9256"),n={addPromotion:"/promotion/addPromotion",getList:"/promotion/findAdminPromotionList",getDetails:"/promotion/query",delPromotion:"/promotion/delete",updatePromotion:"/promotion/updatePromotion",finishPromotion:"/promotion/end",applyShop:"/promotionApplyInfo/page",auditLog:"/promotionAuditLog/query",getGoodList:"/product/findAdminProductListByIds",auditPromotion:"/promotionApplyInfo/auditPromotion",closeApplyInfo:"/promotionApplyInfo/closeApplyInfo",getDetail:"/promotionStat/detail",findTenantStatDetail:"/promotionStat/findTenantStatDetail"};e["a"]={addPromotion:function(t){return Object(a["a"])({method:"POST",url:n.addPromotion,data:t})},getList:function(t){return Object(a["a"])({method:"POST",url:n.getList,data:t})},getDetails:function(t){return Object(a["a"])({method:"GET",url:"".concat(n.getDetails,"/").concat(t)})},delPromotion:function(t){return Object(a["a"])({method:"POST",url:n.delPromotion,data:t})},updatePromotion:function(t){return Object(a["a"])({method:"POST",url:n.updatePromotion,data:t})},finishPromotion:function(t){return Object(a["a"])({method:"POST",url:n.finishPromotion,data:t})},applyShop:function(t){return Object(a["a"])({method:"POST",url:n.applyShop,data:t})},auditLog:function(t){return Object(a["a"])({method:"POST",url:n.auditLog,data:t})},getGoodList:function(t){return Object(a["a"])({method:"POST",url:n.getGoodList,data:t})},auditPromotion:function(t){return Object(a["a"])({method:"POST",url:n.auditPromotion,data:t})},closeApplyInfo:function(t){return Object(a["a"])({method:"POST",url:n.closeApplyInfo,data:t})},getDetail:function(t){return Object(a["a"])({method:"GET",url:"".concat(n.getDetail,"/").concat(t)})},findTenantStatDetail:function(t){return Object(a["a"])({method:"GET",url:n.findTenantStatDetail,data:t})}}}}]); |