| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[32],{579:function(t,e,n){},580:function(t,e,n){},667:function(t,e,n){"use strict";n(579)},668:function(t,e,n){"use strict";n(580)},764:function(t,e,n){"use strict";n.r(e);n(25),n(24),n(23),n(8),n(29),n(17),n(30);var o=n(4),r=(n(73),n(56),n(205)),c=n(12);function l(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}var d={name:"my_coupon",layout:"member",components:{},data:function(){return{total:0,currentPage:1,pageSize:9,couponstatus:"1",couponList:[],type:"",state:1,text:"您还没有优惠券哦",loading:!0,yes:!0}},created:function(){var t=this;this.addonIsExit&&1!=this.addonIsExit.coupon?this.$message({message:"优惠券插件未安装",type:"warning",duration:2e3,onClose:function(){t.$route.push("/member")}}):this.getListData()},mounted:function(){var t=this;setTimeout((function(){t.yes=!1}),300)},computed:function(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}({},Object(c.b)(["addonIsExit"])),watch:{addonIsExit:function(){var t=this;1!=this.addonIsExit.coupon&&this.$message({message:"优惠券插件未安装",type:"warning",duration:2e3,onClose:function(){t.$route.push("/member")}})}},methods:{handleClickStatus:function(t,e){"1"==t.name?(this.state=1,this.text="您还没有优惠券哦"):"2"==t.name?(this.state=2,this.text="您还没有使用过优惠券哦"):(this.state=3,this.text="您还没有过期优惠券哦"),this.refresh()},handlePageSizeChange:function(t){this.pageSize=t,this.refresh()},handleCurrentPageChange:function(t){this.currentPage=t,this.refresh()},refresh:function(){this.loading=!0,this.getListData()},getListData:function(){var t=this;Object(r.f)({page:this.currentPage,page_size:this.pageSize,state:this.state,is_own:this.type}).then((function(e){e.code>=0&&(t.total=e.data.count,t.couponList=e.data.list),t.loading=!1})).catch((function(e){t.loading=!1,t.$message.error(e.message)}))},useCoupon:function(t){1==t.state&&(1!=t.use_scenario?this.$router.push({path:"/goods/list",query:{coupon:t.coupon_type_id}}):this.$router.push("/goods/list"))}}},h=d,f=(n(667),n(668),n(7)),component=Object(f.a)(h,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"box"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.yes,expression:"yes"}],staticClass:"null-page"}),t._v(" "),e("el-card",{staticClass:"box-card member-coupon"},[e("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("我的优惠券")])]),t._v(" "),e("div",[e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[e("el-tabs",{on:{"tab-click":t.handleClickStatus},model:{value:t.couponstatus,callback:function(e){t.couponstatus=e},expression:"couponstatus"}},[e("el-tab-pane",{attrs:{label:"未使用",name:"1"}}),t._v(" "),e("el-tab-pane",{attrs:{label:"已使用",name:"2"}}),t._v(" "),e("el-tab-pane",{attrs:{label:"已过期",name:"3"}})],1),t._v(" "),e("div",{staticClass:"coupon-wrap"},[t._l(t.couponList,(function(n,o){return e("div",{key:o,staticClass:"text item",class:"1"==t.state?"coupon-not-used":"2"==t.state?"coupon-used":"coupon-expire",on:{click:function(e){return t.useCoupon(n)}}},[["0.00"!=n.discount&&n.discount?e("p",{staticClass:"coupon-wrap-money"},[e("span",[t._v(t._s(n.discount))]),t._v("\n\t\t\t\t\t\t\t\t折\n\t\t\t\t\t\t\t")]):e("p",{staticClass:"coupon-wrap-money"},[t._v("\n\t\t\t\t\t\t\t\t¥\n\t\t\t\t\t\t\t\t"),e("span",[t._v(t._s(n.money))])])],t._v(" "),e("p",{staticClass:"coupon-wrap-name"},[t._v(t._s(n.platformcoupon_name))]),t._v(" "),[n.at_least>0?e("p",{staticClass:"coupon-wrap-least coupon-wrap-info"},[t._v("满"+t._s(n.at_least)+"元可用")]):e("p",{staticClass:"coupon-wrap-least coupon-wrap-info"},[t._v("无门槛优惠券")])],t._v(" "),[e("p",{staticClass:"coupon-wrap-time coupon-wrap-info"},[t._v(t._s(n.end_time>0?"有效期至"+t.$timeStampTurnTime(n.end_time):"长期有效"))])]],2)})),t._v(" "),0==t.couponList.length?e("div",{staticClass:"empty-text"},[t._v(t._s(t.text))]):t._e()],2),t._v(" "),e("div",{staticClass:"pager"},[e("el-pagination",{attrs:{background:"","pager-count":5,total:t.total,"prev-text":"上一页","next-text":"下一页","current-page":t.currentPage,"page-size":t.pageSize,"hide-on-single-page":""},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pageSize=e},"update:page-size":function(e){t.pageSize=e},"size-change":t.handlePageSizeChange,"current-change":t.handleCurrentPageChange}})],1)],1)])])],1)}),[],!1,null,"441ec269",null);e.default=component.exports}}]);
|