require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/users/user_coupon/index"],{6982:function(t,o,n){"use strict";n.r(o);var e=n("9576"),i=n.n(e);for(var s in e)["default"].indexOf(s)<0&&function(t){n.d(o,t,(function(){return e[t]}))}(s);o["default"]=i.a},9576:function(t,o,n){"use strict";(function(t){var e=n("47a9");Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var i=n("a230"),s=n("7ba4"),a=n("8f59"),u=e(n("cef6")),c=n("bad7"),d={components:{emptyPage:function(){n.e("components/emptyPage").then(function(){return resolve(n("bc18"))}.bind(null,n)).catch(n.oe)}},mixins:[u.default],data:function(){return{couponsList:[],loading:!1,isAuto:!1,isShowAuth:!1,navOn:0,type:"",page:1,limit:15,finished:!1,imgHost:c.HTTP_REQUEST_URL,expired:0,not_used:0,used:0,shadeRight:!0,shadeLeft:!0}},computed:(0,a.mapGetters)(["isLogin"]),watch:{isLogin:{handler:function(t,o){},deep:!0}},onLoad:function(){this.isLogin?(this.getCouponsNum(),this.getUseCoupons()):(0,s.toLogin)()},onShow:function(){t.removeStorageSync("form_type_cart")},onReachBottom:function(){this.getUseCoupons()},methods:{getCouponsNum:function(){var t=this;(0,i.getCouponsNum)().then((function(o){t.used=o.data.used,t.not_used=o.data.not_used,t.expired=o.data.expired}))},onNav:function(t){this.navOn=t,this.onSubNav("")},onSubNav:function(t){this.type=t,this.couponsList=[],this.page=1,this.finished=!1,this.getUseCoupons()},useCoupon:function(o){var n="";if(0==o.category_id&&""==o.product_id&&0==o.brand_id&&(n="/pages/goods/goods_list/index?title=默认"),0!=o.category_id&&(n=1==o.category_type?"/pages/goods/goods_list/index?cid="+o.category_id+"&title="+o.category_name:"/pages/goods/goods_list/index?sid="+o.category_id+"&title="+o.category_name),""!=o.product_id){var e=o.product_id.split(","),i=e.length;n=1==i?"/pages/goods_details/index?id="+o.product_id:"/pages/goods/goods_list/index?productId="+o.product_id+"&title=默认"}0!=o.brand_id&&(n="/pages/goods/goods_list/index?brandId="+o.brand_id+"&title=默认"),t.navigateTo({url:n})},onLoadFun:function(){this.getUseCoupons(),this.isShowAuth=!1},authColse:function(t){this.isShowAuth=t},getUseCoupons:function(){var o=this;o.loading||o.finished||(o.loading=!0,t.showLoading({title:"正在加载…"}),(0,i.getUserCoupons)(this.navOn,{type:this.type,page:this.page,limit:this.limit}).then((function(n){o.loading=!1,t.hideLoading(),n.data.forEach((function(t){t.ruleShow=!1,t.rules=t.rule?t.rule.split("\n"):[]})),o.couponsList=o.couponsList.concat(n.data),o.finished=n.data.length