1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/mch/apply/apply"],{"1a808":function(t,e,a){"use strict";var i;a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return r})),a.d(e,"a",(function(){return i}));var n=function(){var t=this,e=t.$createElement;t._self._c},r=[]},"1aff":function(t,e,a){},"52c0":function(t,e,a){"use strict";a.r(e);var i=a("1a808"),n=a("83e0");for(var r in n)"default"!==r&&function(t){a.d(e,t,(function(){return n[t]}))}(r);a("6f47"),a("6472");var o,s=a("f0c5"),c=Object(s["a"])(n["default"],i["b"],i["c"],!1,null,"79e54787",null,!1,i["a"],o);e["default"]=c.exports},6472:function(t,e,a){"use strict";var i=a("d798"),n=a.n(i);n.a},"6f47":function(t,e,a){"use strict";var i=a("1aff"),n=a.n(i);n.a},"83e0":function(t,e,a){"use strict";a.r(e);var i=a("dbdc"),n=a.n(i);for(var r in i)"default"!==r&&function(t){a.d(e,t,(function(){return i[t]}))}(r);e["default"]=n.a},a2bb:function(t,e,a){"use strict";(function(t){a("2d0a");i(a("66fd"));var e=i(a("52c0"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,a("543d")["createPage"])},d798:function(t,e,a){},dbdc:function(t,e,a){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a("2f62");function n(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function r(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?n(Object(a),!0).forEach((function(e){o(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function o(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var s=function(){a.e("components/page-component/app-area-picker/app-area-picker").then(function(){return resolve(a("59f7"))}.bind(null,a)).catch(a.oe)},c=function(){a.e("components/page-component/app-diy-form/app-diy-form").then(function(){return resolve(a("df77"))}.bind(null,a)).catch(a.oe)},u={name:"apply",components:{appAreaPicker:s,appDiyForm:c},computed:r({},(0,i.mapState)({appImg:function(t){return t.mallConfig.plugin.mch.app_image}})),data:function(){return{mch_id:-1,category_list:[],express_list:null,form_data:null,form_status:!1,rulesStatus:!1,area:{province_id:0,city_id:0,district_id:0},setting:{},status:-2,form:{realname:"",mobile:"",wechat:"",username:"",password:"",checkPass:"",address:"",name:"",service_mobile:"",mch_common_cat_str:"",mch_common_cat_id:0},formStatus:{errors:[],hasError:!1},submit_status:!1,template_message_list:null}},onLoad:function(t){this.$commonLoad.onload(t),this.mch_id=t.mch_id,this.getCategory()},methods:{hangleForm:function(t){var e=t.data;this.form.form_data=e},navApplyRules:function(){t.navigateTo({url:"/pages/rules/index?url=".concat(encodeURIComponent(this.$api.mch.setting),"&keys=").concat(JSON.stringify(["setting","desc"]))})},navHome:function(){t.navigateTo({url:"/pages/index/index"})},loadData:function(){var t=this,e=this;e.$showLoading(),e.$request({url:e.$api.mch.mch_status}).then((function(a){e.$hideLoading(),0===a.code&&(e.mch=a.data.mch,e.status=e.mch?e.mch.review_status:-1,e.template_message_list=a.data.template_message_list,e.mch?(e.formInfo(e.mch.id),1==e.mch.status&&t.$storage.setStorageSync("MCH2019",a.data)):e.getSetting())})).catch((function(t){e.$hideLoading()}))},getCategory:function(){var t=this;t.$request({url:t.$api.mch.category,data:{id:t.mch_id}}).then((function(e){0===e.code&&(t.category_list=e.data.list,t.loadData())}))},getExpress:function(){var t=this;t.$request({url:t.$api.mch.express_list}).then((function(e){0===e.code&&(t.express_list=e.data.list)}))},getSetting:function(){var t=this;t.$request({url:t.$api.mch.setting}).then((function(e){t.$hideLoading(),0===e.code&&(t.setting=e.data.setting,t.form_data=e.data.setting.form_data)}))},formInfo:function(t){var e=this;e.getExpress(),e.$request({url:e.$api.mch.detail,data:{id:t,is_review_status:1}}).then((function(t){if(0===t.code){var a=t.data.detail,i="";if(e.category_list.forEach((function(t){t.id==a.mch_common_cat_id&&(i=t.name)})),2===e.status&&e.getSetting(),0===e.status||1===e.status){var n=[];a.form_data&&a.form_data.length&&a.form_data.map((function(t){var e=[];"checkbox"===t.key&&(t.value=t.value?t.value:[],t.value.map((function(t){e.push({label:t})}))),"radio"===t.key&&e.push({label:t.value}),n.push({key:t.key,name:t.key_name,default:t.value,is_required:t.required,img_type:t.img_type,list:e})})),e.form_data=n}e.form={mch_id:a.id,realname:a.realname,mobile:a.mobile,wechat:a.wechat,username:a.mchUser.username,password:"000000",checkPass:"000000",address:a.store.address,name:a.store.name,service_mobile:a.store.mobile,mch_common_cat_str:i,mch_common_cat_id:a.mch_common_cat_id},e.area={province_id:a.store.province_id,city_id:a.store.city_id,district_id:a.store.district_id}}}))},applyInput:function(t){var e=t.currentTarget.dataset.type;this.form[e]=t.detail.value},categoryChange:function(t){var e=this.category_list[t.detail.value];this.form.mch_common_cat_id=e.id,this.form.mch_common_cat_str=e.name},areaEvent:function(t){t&&(this.area.province_id=t.province.id,this.area.city_id=t.city.id,this.area.district_id=t.district.id)},validateForm:function(t){var e=t.result;this.formStatus=e},subscribe:function(t){this.$subscribe(this.template_message_list).then((function(){t()})).catch((function(){t()}))},formSubmit:function(){var e=this,a=e.form,i=e.area,n=e.rulesStatus,r=function(){return n?a.realname?a.mobile?a.username?a.password?a.mch_common_cat_id?a.password!==a.checkPass?"密码不一致":a.name?e.formStatus.hasError?e.formStatus.errors[0].msg:!!e.submit_status&&"提交中":"店铺名称不能为空":"类目不能为空":"密码不能为空":"账号不能为空":"联系电话不能为空":"联系人不能为空":"请同意入驻协议"}();r?t.showToast({title:r,icon:"none"}):e.subscribe((function(){e.$showLoading({text:"提交中"}),e.submit_status=!0,e.$request({url:e.$api.mch.apply,data:{id:a.mch_id?a.mch_id:0,realname:a.realname,mobile:a.mobile,wechat:a.wechat,username:a.username,password:a.password,name:a.name,province_id:i.province_id,city_id:i.city_id,district_id:i.district_id,mch_common_cat_id:a.mch_common_cat_id,address:a.address,service_mobile:a.service_mobile,form_data:a.form_data?JSON.stringify(a.form_data):JSON.stringify([]),is_update_apply:2===e.status?1:0},method:"POST"}).then((function(a){e.submit_status=!1,e.$hideLoading(),0===a.code?(e.loadData(),e.form_status=!1):t.showToast({title:a.msg,icon:"none"})})).catch((function(t){e.submit_status=!1}))}))},rulesTap:function(t){this.rulesStatus=t},closeForm:function(){this.form_status=!1},openForm:function(){this.form_status=!0}}};e.default=u}).call(this,a("543d")["default"])}},[["a2bb","common/runtime","common/vendor"]]]);
|