12345678910 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/advance/components/detail-bottom-button"],{2996:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("4795"));function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n,a,i,o,r){try{var c=t[o](r),s=c.value}catch(u){return void n(u)}c.done?e(s):Promise.resolve(s).then(a,i)}function r(t){return function(){var e=this,n=arguments;return new Promise((function(a,i){var r=t.apply(e,n);function c(t){o(r,a,i,c,s,"next",t)}function s(t){o(r,a,i,c,s,"throw",t)}c(void 0)}))}}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={name:"detail-bottom-button",data:function(){return{request_time:!1,once_pay:!1}},props:{end_prepayment_at:String,active:Boolean,favorite:Boolean,goods_id:Number,detail:Object,num:Number},methods:{set_active:function(){this.$user.isLogin()&&!this.once_pay?this.$emit("close_attr",!1):this.$user.isLogin()||this.$user.getInfo().then((function(){})).catch((function(){}))},set_favorite:function(e){var n=this;e?this.$request({url:this.$api.user.favorite_remove,data:{goods_id:this.goods_id}}).then((function(e){0===e.code?n.$emit("favorite",!n.favorite):t.showModal({title:"提示",content:e.msg})})):this.$request({url:this.$api.user.favorite_add,data:{goods_id:this.goods_id}}).then((function(e){0===e.code?n.$emit("favorite",!n.favorite):t.showModal({title:"提示",content:e.msg})}))},route_jump:function(){t.navigateTo({url:"/pages/index/index"})},submit:function(){var e=this;this.once_pay=!0,t.showLoading({title:"生成订单中...",mask:!0}),this.$emit("close_attr",!0);for(var n={goods_id:this.detail.id,goods_attr_id:0,goods_num:"".concat(this.num),advance_goods_id:this.detail.advanceGoods.id},a="",i=this.detail.attr_groups,o=0;o<i.length;o++)for(var r=i[o],c=0;c<r.attr_list.length;c++)r.attr_list[c].active&&(a+=":".concat(r.attr_list[c].attr_id));for(var s=0;s<this.detail.attr.length;s++)this.detail.attr[s].sign_id===a.substring(1)&&(n.goods_attr_id=this.detail.attr[s].id);this.get_submit(n).then((function(t){e.get_token(t.data)}))},pay:function(){var t=this;this.$subscribe(this.detail.template_message).then((function(){t.submit()})).catch((function(){t.submit()}))},get_token:function(e){var n=this;this.$request({url:this.$api.advance.pay_data,method:"post",data:s({},e)}).then((function(a){0===a.code?a.data.hasOwnProperty("id")?(t.hideLoading(),n.$payment.pay(a.data.id).then((function(){n.once_pay=!1,t.navigateTo({url:"/plugins/advance/order/order"})})).catch((function(){n.once_pay=!1,t.navigateTo({url:"/plugins/advance/order/order"})}))):setTimeout((function(){n.get_token(e)}),1e3):(t.hideLoading(),t.showModal({title:"提示",content:a.msg}))}))},get_submit:function(e){var n=this;return r(a.default.mark((function i(){var o;return a.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,n.$request({url:n.$api.advance.order_submit,method:"post",data:s({},e)});case 2:if(o=a.sent,0!==o.code){a.next=7;break}return a.abrupt("return",o);case 7:1===o.code&&t.showModal({title:"提示",content:o.msg,success:function(e){e.cancel?this.$emit("request",this.goods_id):e.confirm&&t.navigateBack()}});case 8:case"end":return a.stop()}}),i)})))()},getDate:function(t){var e=new Date(t.replace(/-/g,"/"));e.setDate(e.getDate());var n=e.getMonth()+1,a=e.getDate(),i="'"+n+"'",o="'"+a+"'";3==i.length&&(n="0"+n),3==o.length&&(a="0"+a);var r=e.getHours(),c=e.getMinutes(),s=e.getSeconds();return s="".concat(s),c="".concat(c),r="".concat(r),1===r.length&&(r="0".concat(r)),1===c.length&&(c="0".concat(c)),1===s.length&&(s="0".concat(s)),e.getFullYear()+"."+n+"."+a+" "+r+":"+c+":"+s}}};e.default=d}).call(this,n("543d")["default"])},"504d":function(t,e,n){"use strict";n.r(e);var a=n("2996"),i=n.n(a);for(var o in a)"default"!==o&&function(t){n.d(e,t,(function(){return a[t]}))}(o);e["default"]=i.a},"8d12":function(t,e,n){"use strict";n.r(e);var a=n("a461"),i=n("504d");for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("abe0");var r,c=n("f0c5"),s=Object(c["a"])(i["default"],a["b"],a["c"],!1,null,"0311a3ec",null,!1,a["a"],r);e["default"]=s.exports},a461:function(t,e,n){"use strict";var a,i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.getDate(t.end_prepayment_at)),a=t.getDate(t.end_prepayment_at);t.$mp.data=Object.assign({},{$root:{m0:n,m1:a}})},o=[];n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a}))},abe0:function(t,e,n){"use strict";var a=n("b0c4"),i=n.n(a);i.a},b0c4:function(t,e,n){}}]);
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'plugins/advance/components/detail-bottom-button-create-component',
- {
- 'plugins/advance/components/detail-bottom-button-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('543d')['createComponent'](__webpack_require__("8d12"))
- })
- },
- [['plugins/advance/components/detail-bottom-button-create-component']]
- ]);
|