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
13 KiB
1 lines
13 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-71668ec2"],{1306:function(e,t,a){},"17bf":function(e,t,a){"use strict";var n=a("1306"),o=a.n(n);o.a},"27ae":function(e,t,a){(function(a){var n,o;(function(t,a){e.exports=a(t)})("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof a?a:this,(function(a){"use strict";a=a||{};var r,c=a.Base64,s="2.6.4",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=function(e){for(var t={},a=0,n=e.length;a<n;a++)t[e.charAt(a)]=a;return t}(i),u=String.fromCharCode,d=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?u(192|t>>>6)+u(128|63&t):u(224|t>>>12&15)+u(128|t>>>6&63)+u(128|63&t)}t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return u(240|t>>>18&7)+u(128|t>>>12&63)+u(128|t>>>6&63)+u(128|63&t)},f=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(e){return e.replace(f,d)},p=function(e){var t=[0,2,1][e.length%3],a=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0),n=[i.charAt(a>>>18),i.charAt(a>>>12&63),t>=2?"=":i.charAt(a>>>6&63),t>=1?"=":i.charAt(63&a)];return n.join("")},h=a.btoa&&"function"==typeof a.btoa?function(e){return a.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,p)},g=function(e){return h(m(String(e)))},b=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},v=function(e,t){return t?b(g(e)):g(e)},C=function(e){return v(e,!0)};a.Uint8Array&&(r=function(e,t){for(var a="",n=0,o=e.length;n<o;n+=3){var r=e[n],c=e[n+1],s=e[n+2],l=r<<16|c<<8|s;a+=i.charAt(l>>>18)+i.charAt(l>>>12&63)+("undefined"!=typeof c?i.charAt(l>>>6&63):"=")+("undefined"!=typeof s?i.charAt(63&l):"=")}return t?b(a):a});var T,x=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,y=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),a=t-65536;return u(55296+(a>>>10))+u(56320+(1023&a));case 3:return u((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return u((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},A=function(e){return e.replace(x,y)},k=function(e){var t=e.length,a=t%4,n=(t>0?l[e.charAt(0)]<<18:0)|(t>1?l[e.charAt(1)]<<12:0)|(t>2?l[e.charAt(2)]<<6:0)|(t>3?l[e.charAt(3)]:0),o=[u(n>>>16),u(n>>>8&255),u(255&n)];return o.length-=[0,0,2,1][a],o.join("")},B=a.atob&&"function"==typeof a.atob?function(e){return a.atob(e)}:function(e){return e.replace(/\S{1,4}/g,k)},w=function(e){return B(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(e){return A(B(e))},O=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},j=function(e){return _(O(e))};a.Uint8Array&&(T=function(e){return Uint8Array.from(w(O(e)),(function(e){return e.charCodeAt(0)}))});var F=function(){var e=a.Base64;return a.Base64=c,e};if(a.Base64={VERSION:s,atob:w,btoa:h,fromBase64:j,toBase64:v,utob:m,encode:v,encodeURI:C,btou:A,decode:j,noConflict:F,fromUint8Array:r,toUint8Array:T},"function"===typeof Object.defineProperty){var S=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};a.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",S((function(){return j(this)}))),Object.defineProperty(String.prototype,"toBase64",S((function(e){return v(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",S((function(){return v(this,!0)})))}}return a["Meteor"]&&(Base64=a.Base64),e.exports?e.exports.Base64=a.Base64:(n=[],o=function(){return a.Base64}.apply(t,n),void 0===o||(e.exports=o)),{Base64:a.Base64}}))}).call(this,a("c8ba"))},"4fad":function(e,t,a){var n=a("23e7"),o=a("6f53").entries;n({target:"Object",stat:!0},{entries:function(e){return o(e)}})},"6f53":function(e,t,a){var n=a("83ab"),o=a("df75"),r=a("fc6a"),c=a("d1e7").f,s=function(e){return function(t){var a,s=r(t),i=o(s),l=i.length,u=0,d=[];while(l>u)a=i[u++],n&&!c.call(s,a)||d.push(e?[a,s[a]]:s[a]);return d}};e.exports={entries:s(!0),values:s(!1)}},9256:function(e,t,a){"use strict";a("99af"),a("4160"),a("caad"),a("4fad"),a("d3b7"),a("159b");var n=a("5530"),o=a("bc3a"),r=a.n(o),c=a("5c96"),s=a("5657");a("27ae");function i(e,t){"ECONNABORTED"===e.code?Object(c["Message"])({message:"请求超时"}):e.response&&e.response.data?Object(c["Message"])({message:e.response.data}):e.message&&Object(c["Message"])({message:e.message}),t(e)}function l(e,t){e.data.isError&&(4e4===e.data.code||40001===e.data.code||40002===e.data.code||40003===e.data.code||40005===e.data.code||40006===e.data.code||40008===e.data.code?c["MessageBox"].alert(e.data.msg,"提醒",{confirmButtonText:"确定",callback:function(){window.location.hash="/login"}}):c["Message"].error(e.data.msg)),t(e)}r.a.interceptors.request.use((function(e){var t=!1!==e.headers["X-isToken"]||e.headers["X-isToken"],a=s["a"].get("TOKEN","");a&&t&&(e.headers.token="Bearer "+a);var n="ceres_admin_web",o="ceres_admin_web";return e.headers["Authorization"]="Basic ".concat("".concat(n,":").concat(o)),e}),(function(e){return Promise.reject(e)})),r.a.interceptors.response.use((function(e){return e}),(function(e){return Promise.reject(e)}));var u=function(e){console.log(e,"opts");var t={ts:Date.now()},a=e.method.toUpperCase(),o={method:a,url:"".concat("https://pos.admin.api.lotus-wallet.com").concat(e.url),responseType:e.responseType||"",timeout:2e4},c=["PUT","POST","PATCH"];c.includes(a)?o.data=e.data||{}:o.params=Object(n["a"])(Object(n["a"])({},t),e.data||{}),e.formData&&(o.transformRequest=[function(e){var t=new FormData;return e&&Object.entries(e).forEach((function(e){t.append(e[0],e[1])})),t}]);var s=new Promise((function(e,t){r()(o).then((function(t){l(t,e)})).catch((function(e){i(e,t)}))}));return s};t["a"]=u},"9afc":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"add_page"},[a("div",{staticClass:"header"},[e._v(" "+e._s(e.title)+" "),a("div",{staticClass:"btn_list"},[a("el-button",{on:{click:e.cancel}},[e._v("取消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])],1)]),a("div",{staticClass:"add_content"},[a("el-form",{attrs:{"label-width":"80px"}},[a("el-form-item",{attrs:{label:"标签名称"}},[a("el-input",{attrs:{placeholder:"最多输入32个字符"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"标签类型"}},[a("el-radio-group",{model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[a("el-radio",{attrs:{label:1}},[e._v("手动标签")]),a("el-radio",{attrs:{label:2}},[e._v("自动标签")])],1)],1),2===e.form.type?a("div",{staticClass:"auto_label"},[a("el-form-item",{attrs:{label:"满足条件"}},[a("el-radio-group",{model:{value:e.form.meetCondition,callback:function(t){e.$set(e.form,"meetCondition",t)},expression:"form.meetCondition"}},[a("el-radio",{attrs:{label:1}},[e._v("满足任意选中的条件即可")]),a("el-radio",{attrs:{label:2}},[e._v("必须满足所有选被中的条件")])],1)],1),a("el-form-item",{attrs:{label:"交易条件"}},[a("el-checkbox-group",{model:{value:e.checkBox,callback:function(t){e.checkBox=t},expression:"checkBox"}},[a("el-row",[a("el-checkbox",{attrs:{label:1,name:"config"}},[e._v("最后消费时间")]),a("el-row",[a("el-radio-group",{model:{value:e.form.config.lastConsumTime.type,callback:function(t){e.$set(e.form.config.lastConsumTime,"type",t)},expression:"form.config.lastConsumTime.type"}},[a("el-row",{staticClass:"indent"},[a("el-radio",{attrs:{label:1}},[e._v("最近")]),a("el-select",{staticStyle:{width:"70px"},attrs:{disabled:2===e.form.config.lastConsumTime.type||!e.checkBox.includes(1)},model:{value:e.form.config.lastConsumTime.value,callback:function(t){e.$set(e.form.config.lastConsumTime,"value",t)},expression:"form.config.lastConsumTime.value"}},e._l(e.dayList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.label}})})),1),a("span",{staticStyle:{"font-size":"16px","margin-left":"10px"}},[e._v("天")])],1),a("el-row",{staticClass:"indent"},[a("el-radio",{attrs:{label:2}},[e._v("自定义")]),a("el-date-picker",{attrs:{disabled:1===e.form.config.lastConsumTime.type||!e.checkBox.includes(1),type:"daterange","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"yyyy-MM-dd"},on:{change:e.handleChange},model:{value:e.date,callback:function(t){e.date=t},expression:"date"}})],1)],1)],1)],1),a("el-row",[a("el-checkbox",{attrs:{label:2,name:"config"}},[e._v("累计消费次数")]),a("el-row",{staticClass:"indent"},[a("el-col",{staticClass:"unit",attrs:{span:3}},[a("el-input",{attrs:{disabled:!e.checkBox.includes(2)},model:{value:e.totalConsumTimes.start,callback:function(t){e.$set(e.totalConsumTimes,"start",t)},expression:"totalConsumTimes.start"}}),a("span",[e._v("次")])],1),a("el-col",{staticStyle:{"font-size":"16px","text-align":"center"},attrs:{span:1}},[e._v(" ㅡ ")]),a("el-col",{staticClass:"unit",attrs:{span:3}},[a("el-input",{attrs:{disabled:!e.checkBox.includes(2)},model:{value:e.totalConsumTimes.end,callback:function(t){e.$set(e.totalConsumTimes,"end",t)},expression:"totalConsumTimes.end"}}),a("span",[e._v("次")])],1)],1)],1),a("el-row",[a("el-checkbox",{attrs:{label:3,name:"config"}},[e._v("累计消费金额")]),a("el-row",{staticClass:"indent"},[a("el-col",{staticClass:"unit",attrs:{span:3}},[a("el-input",{attrs:{disabled:!e.checkBox.includes(3)},model:{value:e.totalConsumAmount.start,callback:function(t){e.$set(e.totalConsumAmount,"start",t)},expression:"totalConsumAmount.start"}}),a("span",[e._v("元")])],1),a("el-col",{staticStyle:{"font-size":"16px","text-align":"center"},attrs:{span:1}},[e._v(" ㅡ ")]),a("el-col",{staticClass:"unit",attrs:{span:3}},[a("el-input",{attrs:{disabled:!e.checkBox.includes(3)},model:{value:e.totalConsumAmount.end,callback:function(t){e.$set(e.totalConsumAmount,"end",t)},expression:"totalConsumAmount.end"}}),a("span",[e._v("元")])],1)],1)],1)],1)],1)],1):e._e()],1)],1)])},o=[],r=(a("99af"),a("4160"),a("b64b"),a("ac1f"),a("1276"),a("159b"),a("96cf"),a("1da1")),c=a("ac44"),s={data:function(){return{form:{name:"",meetCondition:1,type:1,config:{totalConsumTimes:"",lastConsumTime:{type:1,value:3},totalConsumAmount:""}},checkBox:[],totalConsumTimes:{start:"",end:""},totalConsumAmount:{start:"",end:""},num:"",date:[],dayList:[{label:3},{label:7},{label:15},{label:30},{label:45},{label:60}]}},computed:{title:function(){var e={edit:"修改标签",add:"创建标签"};return e[this.$route.query.type]}},created:function(){this.$route.meta.title=this.title,this.getTagInfo()},methods:{getTagInfo:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var a,n,o,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a=e.$route.query,"add"!==a.type){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,c["a"].getTagInfo(a.id);case 5:n=t.sent,o=n.data,0===o.code&&(r=o.data,Object.keys(e.form).forEach((function(t){e.form[t]=r[t],"config"===t&&(e.totalConsumAmount=e.changeFields(r.config.totalConsumAmount,!0),e.totalConsumTimes=e.changeFields(r.config.totalConsumTimes,!1),e.form.config.lastConsumTime.value=e.changeTime(r.config.lastConsumTime))})));case 8:case"end":return t.stop()}}),t)})))()},handleChange:function(e){},getDate:function(e){var t=this.date;2===e.type&&(e.value="".concat(t&&t[0]||"").concat(t&&t[0]?"至":"").concat(t&&t[1]||""))},save:function(){var e=this,t=e.$route.query,a={edit:"editTag",add:"addLabel"};"edit"===t.type&&(e.form.id=t.id),e.form.config.totalConsumTimes=this.assemblyFields(e.totalConsumTimes.start,e.totalConsumTimes.end,!1),e.form.config.totalConsumAmount=this.assemblyFields(e.totalConsumAmount.start,e.totalConsumAmount.end,!0),e.getDate(e.form.config.lastConsumTime),c["a"][a[t.type]](this.form).then((function(t){0===t.data.code&&(e.$message.success("新增成功"),e.cancel())}))},cancel:function(){this.$router.push({path:"/customer-manage/label"})},assemblyFields:function(e,t,a){var n="";return(e||t)&&(n=a?"".concat(100*e,"-").concat(100*t):"".concat(e,"-").concat(t)),n},changeFields:function(e,t){var a={start:"",end:""};if(e){var n=e.split("-");a.start=t?n[0]/100:n[0],a.end=t?n[1]/100:n[1],t?this.checkBox.push(3):this.checkBox.push(2)}return a},changeTime:function(e){var t=3;return e&&(this.checkBox.push(1),2===e.type?this.date=e.value.split("至"):t=e.value),t}}},i=s,l=(a("17bf"),a("2877")),u=Object(l["a"])(i,n,o,!1,null,"dd26d274",null);t["default"]=u.exports},ac44:function(e,t,a){"use strict";a("99af");var n=a("9256"),o={getLabelList:"/memberTag/page",addLabel:"/memberTag",queryTag:"/memberTag/queryTag/",deleteTag:"/memberTag",editTag:"/memberTag",exportTag:"/memberTag/export",getTagInfo:"/memberTag/"};t["a"]={getLabelList:function(e){return Object(n["a"])({method:"POST",url:o.getLabelList,data:e})},addLabel:function(e){return Object(n["a"])({method:"POST",url:o.addLabel,data:e})},queryTag:function(e){return Object(n["a"])({method:"GET",url:"".concat(o.queryTag).concat(e)})},deleteTag:function(e){return Object(n["a"])({method:"DELETE",url:o.deleteTag,data:e})},editTag:function(e){return Object(n["a"])({method:"PUT",url:o.editTag,data:e})},exportTag:function(e){return Object(n["a"])({method:"POST",url:o.exportTag,data:e})},getTagInfo:function(e){return Object(n["a"])({method:"GET",url:"".concat(o.getTagInfo).concat(e)})}}}}]); |