1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/share/add/add"],{"3e81":function(t,e,n){},"662a":function(t,e,n){"use strict";(function(t){n("2d0a");o(n("66fd"));var e=o(n("f894"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},"763a":function(t,e,n){"use strict";n.r(e);var o=n("88da"),r=n.n(o);for(var a in o)"default"!==a&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=r.a},"88da":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n("2f62");function r(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return u=t.done,t},e:function(t){s=!0,i=t},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw i}}}}function a(t,e){if(t){if("string"===typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l=function(){n.e("components/page-component/app-diy-form/app-diy-form").then(function(){return resolve(n("df77"))}.bind(null,n)).catch(n.oe)},f={data:function(){return{status:null,mallName:"",name:"",phone:"",parent_name:"",height:0,form:{},template_message:[],read:!1,protocol:!1}},computed:s({},(0,o.mapState)({mall:function(t){return t.mallConfig.mall},custom_setting:function(t){return t.mallConfig.share_setting_custom},share_setting:function(t){return t.mallConfig.share_setting}})),components:{AppDiyForm:l},methods:{handleFormInput:function(t){var e=t.data,n=[];for(var o in e)n[o]={key:e[o].key,label:e[o].name,value:e[o].value,required:e[o].is_required};this.form=n},toRead:function(){this.read=!this.read},imageLoad:function(t){var e=t.detail.width,n=t.detail.height;this.height=n*(702/e)},subscribe:function(){var e=this,n=this,o=0;if(this.form.length>0){var a,i=r(this.form);try{for(i.s();!(a=i.n()).done;){var u=a.value;if(1==u.required){if(!u.value)return t.showToast({title:"请填写"+u.label,icon:"none",duration:1e3}),!1;if("img_upload"==u.key&&Array.isArray(u.value)){var s,c=r(u.value);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(!l)return t.showToast({title:"请填写"+u.label,icon:"none",duration:1e3}),!1}}catch(f){c.e(f)}finally{c.f()}}}}}catch(f){i.e(f)}finally{i.f()}}1==this.read?(o=1,n.name?n.phone?/0?(1)[0-9]{10}/.test(n.phone)?this.$subscribe(this.template_message).then((function(t){e.submit(o)})).catch((function(t){e.submit(o)})):t.showToast({title:"请输入正确的手机号码",icon:"none",duration:1e3}):t.showToast({title:"请输入手机号码",icon:"none",duration:1e3}):t.showToast({title:"请输入真实姓名",icon:"none",duration:1e3})):t.showToast({title:"请先查看分销协议并同意",icon:"none",duration:1e3})},submit:function(e){var n=this;t.showLoading({title:"提交中..."});var o={name:n.name,mobile:n.phone,agree:e};1==n.share_setting.form_status&&(o.form=JSON.stringify(n.form)),n.$request({url:n.$api.share.apply,data:o,method:"post"}).then((function(e){n.$store.dispatch("mallConfig/actionResetConfig"),n.$hideLoading(),0==e.code?(t.showToast({title:e.msg,duration:1e3}),setTimeout((function(){t.navigateBack({delta:1})}),500)):0==n.share_setting.form_status&&"请填写表单"==e.msg?t.showToast({title:"申请条件有所变化,请重新填写",icon:"none",duration:1e3}):t.showToast({title:e.msg,icon:"none",duration:1e3})})).catch((function(e){n.$hideLoading(),t.showToast({title:response,icon:"none",duration:1e3})}))}},onLoad:function(e){var n=this;this.$commonLoad.onload(e);var o=this;this.$showLoading({type:"global",text:"加载中..."}),null!=e.template_message&&(o.template_message=JSON.parse(e.template_message)),t.setNavigationBarTitle({title:this.custom_setting.apply.share_apply.name?this.custom_setting.apply.share_apply.name:this.custom_setting.apply.share_apply.default}),this.$request({url:this.$api.user.user_info}).then((function(t){n.$hideLoading(),0===t.code&&(n.parent_name=t.data.identity.parent_name)}))},onShow:function(){this.$store.dispatch("mallConfig/actionResetConfig")}};e.default=f}).call(this,n("543d")["default"])},"9d77":function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var r=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.protocol=!0},t.e1=function(e){t.protocol=!1,t.read=!0})},a=[]},d908:function(t,e,n){"use strict";var o=n("3e81"),r=n.n(o);r.a},f894:function(t,e,n){"use strict";n.r(e);var o=n("9d77"),r=n("763a");for(var a in r)"default"!==a&&function(t){n.d(e,t,(function(){return r[t]}))}(a);n("d908");var i,u=n("f0c5"),s=Object(u["a"])(r["default"],o["b"],o["c"],!1,null,"270e1fe9",null,!1,o["a"],i);e["default"]=s.exports}},[["662a","common/runtime","common/vendor"]]]);
|