1477acb.js 2.8 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[53],{586:function(t,e,n){var content=n(666);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(17).default)("aec61efc",content,!0,{sourceMap:!1})},665:function(t,e,n){"use strict";n(586)},666:function(t,e,n){var o=n(16)(!1);o.push([t.i,".user-coupons{width:980px}.user-coupons .coupons-header{padding:20px 15px;border-bottom:1px solid #e5e5e5}.user-coupons .tabs{padding:15px 0}.user-coupons .tabs .button{width:104px;height:30px;line-height:0;display:inline-block;background:#fff;color:#666;border:1px solid #e5e5e5}.user-coupons .tabs .active{color:#fff;border:0;background:#ff2c3c}",""]),t.exports=o},720:function(t,e,n){"use strict";n.r(e);var o=n(9),c=(n(12),n(53),{head:function(){return{title:this.$store.getters.headTitle,link:[{rel:"icon",type:"image/x-icon",href:this.$store.getters.favicon}]}},layout:"user",components:{},data:function(){return{active:0,expand:{valid:0,used:0,expired:0},coupons:[{title:"可使用",type:"valid",list:[],hasData:!0},{title:"已使用",type:"used",list:[],hasData:!0},{title:"已过期",type:"expired",list:[],hasData:!0}]}},mounted:function(){this.getMyCoupons()},methods:{changeTabs:function(t){this.active=t,this.getMyCoupons()},getMyCoupons:function(){var t=this;return Object(o.a)(regeneratorRuntime.mark((function e(){var n,data,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$get("coupon/myCouponList",{params:{type:t.coupons[t.active].type+"",page_size:100}});case 2:if(n=e.sent,data=n.data,1==n.code){for(o in t.expand)t.$set(t.expand,o,data.expand[o]);t.changeData(data)}case 6:case"end":return e.stop()}}),e)})))()},changeData:function(data){var t=this;this.coupons.some((function(e,n){if(console.log(data,n),n==t.active)return Object.assign(e,{list:data.lists,hasData:data.lists.length}),!0}))}}}),r=(n(665),n(8)),component=Object(r.a)(c,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"user-coupons"},[e("div",{staticClass:"coupons-header lg"},[t._v("\n 我的优惠券\n ")]),t._v(" "),e("div",{staticClass:"tabs"},[t._l(t.expand,(function(n,o,c){return e("el-button",{key:o,staticClass:"button m-l-18",class:c==t.active?"active":"",attrs:{type:"primary"},on:{click:function(e){return t.changeTabs(c)}}},[t._v("\n "+t._s(t.coupons[c].title)+"("+t._s(n)+")")])})),t._v(" "),t._l(t.coupons,(function(o,c){return e("div",{key:c},[c==t.active?e("div",{staticClass:"m-t-20"},[o.hasData?e("coupons-list",{attrs:{list:o.list,type:t.active}}):e("null-data",{attrs:{img:n(564),text:"暂无优惠券~"}})],1):t._e()])}))],2)])}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{CouponsList:n(558).default,NullData:n(484).default})}}]);