You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
4.1 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/coupon/coupon"],{"0c83":function(t,n,e){},"0cd8":function(t,n,e){"use strict";e.r(n);var o=e("5c64"),a=e.n(o);for(var i in o)"default"!==i&&function(t){e.d(n,t,(function(){return o[t]}))}(i);n["default"]=a.a},3722:function(t,n,e){"use strict";var o;e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){return o}));var a=function(){var t=this,n=t.$createElement;t._self._c},i=[]},"5c64":function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=a(e("a34a"));function a(t){return t&&t.__esModule?t:{default:t}}function i(t,n,e,o,a,i,u){try{var c=t[i](u),s=c.value}catch(r){return void e(r)}c.done?n(s):Promise.resolve(s).then(o,a)}function u(t){return function(){var n=this,e=arguments;return new Promise((function(o,a){var u=t.apply(n,e);function c(t){i(u,o,a,c,s,"next",t)}function s(t){i(u,o,a,c,s,"throw",t)}c(void 0)}))}}var c={data:function(){return{couponValidList:[],mycouponvalidList:[],headerTop:0,typeClass:"valid",subState:"",theIndex:null,oldIndex:null,isStop:!1,fromchoose:0,allmoney:0,yid:0}},onPageScroll:function(t){},onPullDownRefresh:function(){setTimeout((function(){t.stopPullDownRefresh()}),1e3)},onLoad:function(t){this.fromchoose=parseInt(t.fromchoose),this.allmoney=parseInt(t.allmoney),this.yid=getApp().globalData.yid,this.couponlist(),this.mycouponlist()},methods:{dogetcoupon:function(n){t.showLoading({title:"领取中..."}),this.getcoupon(n)},chooseit:function(n,e,o,a){1==a?(console.log(Number(parseFloat(100*this.allmoney)/100),"this.allmoney"),console.log(Number(parseFloat(100*e)/100),"jine"),Number(parseFloat(100*o)/100)>Number(parseFloat(100*this.allmoney)/100)?t.showToast({title:"订单金额不满"+o+"元,不可使用",icon:"none"}):(getApp().globalData.yid=n,getApp().globalData.yhqjine=e,getApp().globalData.useyhq=0,t.navigateBack({delta:1}))):(getApp().globalData.yid=0,getApp().globalData.yhqjine=0,getApp().globalData.useyhq=0,t.navigateBack({delta:1}))},couponlist:function(){var n=this;return u(o.default.mark((function e(){var a,i;return o.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=t.getStorageSync("userinfo"),e.next=3,n.$api.couponlist({action:"couponlist",uid:a.uid});case 3:i=e.sent,n.couponValidList=i.data;case 5:case"end":return e.stop()}}),e)})))()},mycouponlist:function(){var n=this;return u(o.default.mark((function e(){var a,i;return o.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=t.getStorageSync("userinfo"),e.next=3,n.$api.mycouponlist({action:"mycouponlist",uid:a.uid});case 3:i=e.sent,n.mycouponvalidList=i.data;case 5:case"end":return e.stop()}}),e)})))()},getcoupon:function(n){var e=this;return u(o.default.mark((function a(){var i,u;return o.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:return i=t.getStorageSync("userinfo"),o.next=3,e.$api.getcoupon({action:"getcoupon",uid:i.uid,id:n});case 3:u=o.sent,1==u.code?(t.hideLoading(),t.showToast({title:"领取成功",icon:"none",duration:2e3}),e.couponlist()):t.showToast({title:"领取失败",icon:"fail",duration:1500});case 5:case"end":return o.stop()}}),a)})))()},switchType:function(n){var e=this;this.couponlist(),this.mycouponlist(),this.typeClass!=n&&(t.pageScrollTo({scrollTop:0,duration:0}),this.typeClass=n,this.subState=""==this.typeClass?"":"show"+n,setTimeout((function(){e.oldIndex=null,e.theIndex=null,e.subState="valid"==e.typeClass?"":e.subState}),200))}}};n.default=c}).call(this,e("543d")["default"])},a031:function(t,n,e){"use strict";var o=e("0c83"),a=e.n(o);a.a},cfdc:function(t,n,e){"use strict";e.r(n);var o=e("3722"),a=e("0cd8");for(var i in a)"default"!==i&&function(t){e.d(n,t,(function(){return a[t]}))}(i);e("a031");var u,c=e("f0c5"),s=Object(c["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],u);n["default"]=s.exports},f6e5:function(t,n,e){"use strict";(function(t){e("8d0c");o(e("66fd"));var n=o(e("cfdc"));function o(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=e,t(n.default)}).call(this,e("543d")["createPage"])}},[["f6e5","common/runtime","common/vendor"]]]);