address.js 5.7 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/gift/address/address"],{1431:function(t,e,s){"use strict";s.r(e);var i=s("5ce7"),a=s("939c");for(var d in a)"default"!==d&&function(t){s.d(e,t,(function(){return a[t]}))}(d);s("f288");var o,r=s("f0c5"),n=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,"b16a7e96",null,!1,i["a"],o);e["default"]=n.exports},"5ce7":function(t,e,s){"use strict";var i,a=function(){var t=this,e=t.$createElement,s=(t._self._c,Number(110));t.$mp.data=Object.assign({},{$root:{m0:s}})},d=[];s.d(e,"b",(function(){return a})),s.d(e,"c",(function(){return d})),s.d(e,"a",(function(){return i}))},"774a":function(t,e,s){},"939c":function(t,e,s){"use strict";s.r(e);var i=s("d75f"),a=s.n(i);for(var d in i)"default"!==d&&function(t){s.d(e,t,(function(){return i[t]}))}(d);e["default"]=a.a},bb5f:function(t,e,s){"use strict";(function(t){s("8748");i(s("66fd"));var e=i(s("1431"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,s("543d")["createPage"])},d75f:function(t,e,s){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=s("2f62");function a(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),s.push.apply(s,i)}return s}function d(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?a(Object(s),!0).forEach((function(e){o(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):a(Object(s)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}function o(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var r=function(){s.e("plugins/gift/address/app-submit-address").then(function(){return resolve(s("f203"))}.bind(null,s)).catch(s.oe)},n=function(){Promise.all([s.e("common/vendor"),s.e("components/basic-component/app-empty-bottom/app-empty-bottom")]).then(function(){return resolve(s("51dc"))}.bind(null,s)).catch(s.oe)},c=function(){s.e("components/page-component/app-diy-form/app-diy-form").then(function(){return resolve(s("d855"))}.bind(null,s)).catch(s.oe)},u={name:"address",data:function(){return{previewData:{hasCity:!1},address_id:"",address:{},goods_id:-1,user_order_id:0,goods:[],store_list:[],store_index:0,send_type:[],remark:"",store:{},mch:{},send_data:null,deli:"",loading:!1,dis_send_type:"",diyForm:[],template_message_captain:[]}},onLoad:function(e){var s=this;this.goods_id=e.goods_id,this.user_order_id=e.id;var i="";2==e.status?i=this.$api.gift.join_detail:1==e.status&&(i=this.$api.gift.win_detail),this.$request({url:i,data:{user_order_id:e.id}}).then((function(i){for(var a in i.data.detail.detail)i.data.detail.detail[a].form_data=null;s.template_message_captain=i.data.template_message_captain,console.log(s.template_message_captain),s.goods=i.data.detail.detail;for(var d={list:[{mch_id:0,goods_list:[],use_integral:0,user_coupon_id:0,distance:0,remark:"",order_form:[]}],address_id:0},o=0;o<s.goods.length;o++){for(var r={id:s.goods[o].goods_id,attr:[],num:s.goods[o].num,cat_id:0,goods_attr_id:s.goods[o].goods_attr_id,cart_id:0,user_order_id:e.id},n=[],c=s.goods[o].goods_info,u=0;u<c.length;u++)n.push({attr_id:c[u].attr_id,attr_group_id:c[u].attr_group_id});r.attr=n,d.list[0].goods_list.push(r)}s.send_data=d,s.$request({url:s.$api.gift.preview,method:"post",data:{form_data:JSON.stringify(d)}}).then((function(e){0===e.code?(s.send_type=e.data.mch_list[0].delivery.send_type_list,s.dis_send_type=e.data.mch_list[0].delivery.send_type,s.mch=e.data.mch_list[0],s.address=e.data.address,s.loading=!0):t.showModal({title:"提示",content:e.msg,success:function(){t.navigateBack()}})}))}))},onShow:function(){var e=this;if(this.$store.state.gift.address_id&&this.send_data){var s=this.send_data;s.list[0].send_type=this.deli,s.address_id=this.$store.state.gift.address_id,this.$request({url:this.$api.gift.preview,method:"post",data:{form_data:JSON.stringify(s)}}).then((function(s){0===s.code?(e.send_type=s.data.mch_list[0].delivery.send_type_list,e.mch=s.data.mch_list[0],e.address=s.data.address):t.showModal({title:"提示",content:s.msg,success:function(){t.navigateBack()}})}))}if(this.$store.state.gift.store_id)for(var i=0;i<this.store_list.length;i++)this.store_list[i].id===this.$store.state.gift.store_id&&(this.store=this.store_list[i])},methods:{delivery:function(t){this.deli=t},setMethod:function(){var e=this;t.getLocation({type:"wgs84",success:function(t){e.$request({url:e.$api.order.store_list,data:{latitude:t.latitude,longitude:t.longitude,goods_id:e.goods_id}}).then((function(t){e.store_list=t.data.list,e.store=t.data.list[0]}))}})},city:function(){var t=this,e=this.send_data;e.list[0].send_type="city",this.address&&(e.address_id=this.address.id),this.$request({url:this.$api.gift.preview,method:"post",data:{form_data:JSON.stringify(e)}}).then((function(e){t.send_type=e.data.mch_list[0].delivery.send_type_list,t.mch=e.data.mch_list[0],t.address=e.data.address}))},diyFormInput:function(t){this.diyForm=t},handleGoodsFormInput:function(t,e){var s=e.split(","),i=parseInt(s[1]),a=[];for(var d in t)a[d]={key:t[d].key,label:t[d].name,value:t[d].value,required:t[d].is_required};this.goods[i].form_data=a},handleGoodsFormValidate:function(t,e){var s=e.split(","),i=parseInt(s[1]);this.goods[i].goods_form_validate_result=t}},computed:d({},(0,i.mapState)("gift",{theme:function(t){return t.theme}})),components:{"app-submit-address":r,"app-empty-bottom":n,"app-diy-form":c}};e.default=u}).call(this,s("543d")["default"])},f288:function(t,e,s){"use strict";var i=s("774a"),a=s.n(i);a.a}},[["bb5f","common/runtime","common/vendor"]]]);