12345678910 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/gift/address/app-submit-address"],{"21d3":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i("2f62");function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function n(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var a=function(){Promise.all([i.e("common/vendor"),i.e("components/basic-component/app-iphone-x/app-iphone-x")]).then(function(){return resolve(i("bd7b"))}.bind(null,i)).catch(i.oe)},d={props:["theme","address","goods_id","user_order_id","store_list","store_index","send_type","goods","remark","mch","dis_send_type","diyForm","store","template_message_captain"],data:function(){return{delivery:"express",name:"",mobile:"",send_text:"",hasCity:!1}},methods:{jump:function(){t.navigateTo({url:"/pages/order-submit/map"})},navigateAddress:function(){var e="/pages/order-submit/address-pick";e+="?sign=gift&id="+this.user_order_id+"&hasCity="+this.hasCity,t.navigateTo({url:e})},setMethod:function(t){this.delivery=t,this.send_text=t,this.hasCity=!1,this.$emit("delivery",t),"offline"===this.delivery?this.$emit("setMethod"):"city"===this.delivery&&(this.hasCity=!0,this.$emit("city"))},submit:function(){var t=this;this.$subscribe(this.template_message_captain).then((function(){t.submission()})).catch((function(){t.submission()}))},submission:function(){var e=this;for(var i in this.goods){var o=this.goods[i];if(o.goods_form_validate_result&&o.goods_form_validate_result.hasError)return void t.showModal({title:"提示",content:o.goods_form_validate_result.errors[0].msg,showCancel:!1})}t.showLoading({title:"提交中"});for(var r={list:[{mch_id:0,goods_list:[],send_type:this.send_text,store_id:this.store.id,use_integral:0,user_coupon_id:0,remark:this.remark,order_form:this.diyForm}],address_id:this.address.id,address:{name:this.name,mobile:this.mobile}},n=0;n<this.goods.length;n++){for(var s={id:this.goods[n].goods_id,attr:[],num:this.goods[n].num,cat_id:0,goods_attr_id:this.goods[n].goods_attr_id,cart_id:0,user_order_id:this.user_order_id,form_data:this.goods[n].form_data},a=[],d=this.goods[n].goods_info,c=0;c<d.length;c++)a.push({attr_id:d[c].attr_id,attr_group_id:d[c].attr_group_id});s.attr=a,r.list[0].goods_list.push(s)}this.$request({url:this.$api.gift.convert,method:"post",data:{form_data:JSON.stringify(r)}}).then((function(i){0===i.code?e.pay_data(i.data):(t.hideLoading(),t.showModal({title:"提示",content:i.msg}))}))},route_go:function(){t.navigateTo({url:"/pages/order-submit/store-pick?plugin=gift"})},pay_data:function(e){var i=this;this.$request({url:this.$api.order.pay_data,method:"post",data:n({},e)}).then((function(o){if(0===o.code)if(o.data.hasOwnProperty("id")){var r=o.data.id;0==i.mch.express_price?i.$request({url:i.$api.payment.get_payments,method:"get",data:{id:r}}).then((function(e){0===e.code?(console.log(e.data),i.$request({url:i.$api.payment.pay_data,method:"get",data:{id:r,pay_type:"balance"}}).then((function(e){0===e.code?i.$request({url:i.$api.payment.pay_buy_balance,data:{id:r}}).then((function(e){0===e.code?(t.hideLoading(),t.redirectTo({url:"/plugins/gift/order/order"})):(t.hideLoading(),t.showModal({title:"提示",content:e.msg}))})):(t.hideLoading(),t.showModal({title:"提示",content:e.msg}))}))):(t.hideLoading(),t.showModal({title:"提示",content:e.msg}))})):i.$payment.pay(r).then((function(e){t.hideLoading(),t.redirectTo({url:"/plugins/gift/order/order"})})).catch((function(e){t.hideLoading(),t.redirectTo({url:"/plugins/gift/order/order"})}))}else setTimeout((function(){i.pay_data(e)}),1e3);else t.hideLoading(),t.showModal({title:"提示",content:o.msg})}))}},computed:n({},(0,o.mapState)({appImg:function(t){return t.mallConfig.__wxapp_img}})),watch:{send_type:{handler:function(t){if(0!==t.length)for(var e=0;e<t.length;e++)this.dis_send_type===t[0].value&&(this.delivery=t[0].value,this.send_text=t[0].value,"city"===t[0].value&&(this.hasCity=!0))},immediate:!0}},components:{"app-iphone-x":a}};e.default=d}).call(this,i("543d")["default"])},"4d7c":function(t,e,i){"use strict";i.r(e);var o=i("21d3"),r=i.n(o);for(var n in o)"default"!==n&&function(t){i.d(e,t,(function(){return o[t]}))}(n);e["default"]=r.a},"6cc5":function(t,e,i){"use strict";var o,r=function(){var t=this,e=t.$createElement,i=(t._self._c,Object.keys(t.store)),o=Object.keys(t.store);t.$mp.data=Object.assign({},{$root:{g0:i,g1:o}})},n=[];i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){return o}))},c2b8:function(t,e,i){},e6e6:function(t,e,i){"use strict";var o=i("c2b8"),r=i.n(o);r.a},f203:function(t,e,i){"use strict";i.r(e);var o=i("6cc5"),r=i("4d7c");for(var n in r)"default"!==n&&function(t){i.d(e,t,(function(){return r[t]}))}(n);i("e6e6");var s,a=i("f0c5"),d=Object(a["a"])(r["default"],o["b"],o["c"],!1,null,"74c9db5a",null,!1,o["a"],s);e["default"]=d.exports}}]);
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'plugins/gift/address/app-submit-address-create-component',
- {
- 'plugins/gift/address/app-submit-address-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('543d')['createComponent'](__webpack_require__("f203"))
- })
- },
- [['plugins/gift/address/app-submit-address-create-component']]
- ]);
|