(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/shop-gift-exchange/shop-gift-exchange"],{5581:function(t,n,e){"use strict";e.r(n);var i=e("95dc"),o=e("fafb");for(var u in o)"default"!==u&&function(t){e.d(n,t,(function(){return o[t]}))}(u);e("6d0e");var c,a=e("f0c5"),f=Object(a["a"])(o["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],c);n["default"]=f.exports},"6d0e":function(t,n,e){"use strict";var i=e("818e"),o=e.n(i);o.a},"818e":function(t,n,e){},"95dc":function(t,n,e){"use strict";var i;e.d(n,"b",(function(){return o})),e.d(n,"c",(function(){return u})),e.d(n,"a",(function(){return i}));var o=function(){var t=this,n=t.$createElement;t._self._c;t._isMounted||(t.e0=function(n){t.num++},t.e1=function(n){t.hintShow=!1})},u=[]},be1b:function(t,n,e){"use strict";(function(t){e("fdf4");i(e("66fd"));var n=i(e("5581"));function i(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=e,t(n.default)}).call(this,e("543d")["createPage"])},da07:function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=e("057a"),o={data:function(){return{gift:"",num:0,hintCon:"",hintShow:!1}},onLoad:function(t){var n=t.gift;n&&(this.gift=JSON.parse(decodeURIComponent(n)))},computed:{integral:function(){return this.num>0?this.gift.integral*this.num:this.gift.integral}},methods:{down:function(){if(1==this.num)return t.showToast({title:"兑换数量至少为1",icon:"none"}),!1;this.num--},getVal:function(t){this.num=Number(t.detail.value)},exchange:function(){if(!this.num)return t.showModal({content:"至少选择一件兑换",showCancel:!1}),!1;this.hintShow=!0,this.hintCon="您确定使用".concat(this.integral,"积分兑换本商品吗？")},exGift:function(){var n=this;this.hintShow=!1,t.showLoading({title:"兑换中..."}),(0,i.exchangeGifts)({gift_id:this.gift.id,num:this.num}).then((function(e){200==e.code?t.showModal({content:"兑换成功",showCancel:!1,success:function(e){e.confirm&&t.redirectTo({url:"../shop-gift-suce/shop-gift-suce?integral="+n.integral})}}):t.showModal({content:e.data||"兑换失败",showCancel:!1}),t.hideLoading()})).catch((function(n){t.hideLoading()}))}}};n.default=o}).call(this,e("543d")["default"])},fafb:function(t,n,e){"use strict";e.r(n);var i=e("da07"),o=e.n(i);for(var u in i)"default"!==u&&function(t){e.d(n,t,(function(){return i[t]}))}(u);n["default"]=o.a}},[["be1b","common/runtime","common/vendor"]]]);