1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["plugin-page-ticket-index"],{"0ae2c":function(t,e,i){"use strict";var n=i("7f1d"),a=i.n(n);a.a},"1c38":function(t,e,i){"use strict";i.r(e);var n=i("1f4b"),a=i("89cf");for(var c in a)["default"].indexOf(c)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(c);i("0ae2c");var o=i("828b"),s=Object(o["a"])(a["default"],n["b"],n["c"],!1,null,"428d8bf6",null,!1,n["a"],void 0);e["default"]=s.exports},"1f4b":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("custom-page",{attrs:{"custom-navbar":!0,"navbar-title":"代金劵"}},[i("v-uni-view",{staticClass:"top-operation-tabs",style:[{top:t.navBarInfo.height+"px"}]},[i("operation-tabs",{attrs:{tabs:["待领取","待使用","已使用","已过期"],numInfoArr:t.numInfoArr},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.handleTicketTypeChangeEvent.apply(void 0,arguments)}},model:{value:t.currentSelectTabIndex,callback:function(e){t.currentSelectTabIndex=e},expression:"currentSelectTabIndex"}})],1),i("v-uni-view",{staticClass:"ticket-wrapper"},[t.tickets.length>0?i("v-uni-view",{staticClass:"ticket-list"},t._l(t.tickets,(function(e,n){return i("v-uni-view",{key:n,staticClass:"ticket-item"},[i("redpacket-ticket",{attrs:{data:e},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.ticketClickEvent(n)},reload_data:function(e){arguments[0]=e=t.$handleEvent(e),t.reload_data.apply(void 0,arguments)}}})],1)})),1):i("empty",{attrs:{icon:"empty-coupon",tips:"暂无代金劵"}}),i("technical-support")],1)],1)},a=[]},"7cdf":function(t,e,i){var n=i("c86c");e=n(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 下方引入的为Tuniao UI的集成样式文件,为scss预处理器,其中包含了一些"tn-"开头的自定义变量\n * 使用的时候,请将下面的一行复制到您的uniapp项目根目录的uni.scss中即可\n * Tuniao UI自定义的css类名和scss变量,均以"tn-"开头,不会造成冲突,请放心使用 \n */\n/* 顶部操作栏 start */.top-operation-tabs[data-v-428d8bf6]{position:fixed;left:0;width:100%;z-index:99999}\n/* 顶部操作栏 end */.ticket-wrapper[data-v-428d8bf6]{position:relative;top:%?90?%}\n/* 红包列表 start */.ticket-list[data-v-428d8bf6]{width:100%;padding:%?30?%}.ticket-list .ticket-item[data-v-428d8bf6]{position:relative;width:100%}.ticket-list .ticket-item + .ticket-item[data-v-428d8bf6]{margin-top:%?30?%}\n/* 红包列表 end */',""]),t.exports=e},"7f1d":function(t,e,i){var n=i("7cdf");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("967d").default;a("ed98e880",n,!0,{sourceMap:!1,shadowMode:!1})},"89cf":function(t,e,i){"use strict";i.r(e);var n=i("c86c3"),a=i.n(n);for(var c in n)["default"].indexOf(c)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(c);e["default"]=a.a},"9d0a":function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.showToast=e.showModal=e.showLoading=e.closeLoading=void 0;e.showToast=function(t){var e=t.title,i=t.icon,n=t.mask,a=t.callback;uni.showToast({icon:i||"none",title:e,mask:n||!0}),setTimeout((function(){a&&a()}),1500)};e.showModal=function(t){var e=t.title,i=t.content,n=t.showCancel,a=t.cancelText,c=t.confirmText,o=t.callback;uni.showModal({title:e||"操作提示",content:i,showCancel:n||!1,cancelText:a||"取消",confirmText:c||"确认",success:function(t){t.confirm&&o&&o(!0),t.cancel&&o&&o(!1)}})};e.showLoading=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.title,i=void 0===e?"":e,n=t.mask,a=void 0!==n&&n;uni.showLoading({title:i,mask:a})};e.closeLoading=function(){uni.hideLoading()}},c86c3:function(t,e,i){"use strict";i("6a54");var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("64aa"),i("c223"),i("fd3c");var a=n(i("6fbe")),c=n(i("ebf3")),o=n(i("a71b")),s=n(i("b9c8")),d=n(i("644f")),r=i("9d0a"),u=i("419c"),l=i("b35a"),f={components:{Empty:o.default,TechnicalSupport:c.default,OperationTabs:s.default,RedpacketTicket:d.default},mixins:[a.default],data:function(){return{currentSelectTabIndex:0,tickets:[],currentPage:1,pageSize:20,isLoadAll:!1,sid:"",numInfoArr:[]}},onLoad:function(t){this.currentSelectTabIndex=Number((null===t||void 0===t?void 0:t.index)||"0"),this.sid=(null===t||void 0===t?void 0:t.sid)||"",this.initCustomNavBarInfo(),this.getTicketListData(),this.numInfo()},onReachBottom:function(){this.isLoadAll||(this.currentPage++,this.getTicketListData())},methods:{numInfo:function(){var t=this;(0,l.numInfoApi)().then((function(e){console.log("res",e),t.numInfoArr=[e.wait_receive_num,e.wait_use_num,e.has_use_num,e.has_expire_num]})).catch((function(t){console.error("[ticket]获取代金劵数量失败",t)}))},reload_data:function(){this.tickets=[],this.currentPage=1,this.isLoadAll=!1,this.getTicketListData()},getTicketListData:function(){0===this.currentSelectTabIndex?this.getBeCollectedListData():1===this.currentSelectTabIndex?this.getBeUsedListData(1):2===this.currentSelectTabIndex?this.getBeUsedListData(2):3===this.currentSelectTabIndex&&this.getBeUsedListData(3)},getBeCollectedListData:function(){var t=this;(0,l.getBeCollectedTicketListApi)({page:this.currentPage,psize:this.pageSize,sid:this.sid}).then((function(e){var i=(null===e||void 0===e?void 0:e.coupons)||[];t.tickets=t.tickets.concat(i.map((function(t){return{id:t.aid,sid:t.sid,title:t.title,image:t.logo||"",endtime:t.endtime||"",get:0,percent:t.percent,discount:t.discount,limit:t.couponInfo,type:t.type}}))),i.length<t.pageSize&&(t.isLoadAll=!0)})).catch((function(e){console.error("[ticket]获取代金劵数据失败",e),t.tickets=[]}))},getBeUsedListData:function(t){var e=this;(0,l.getBeUsedTicketListApi)({status:t,page:this.currentPage,psize:this.pageSize,sid:this.sid}).then((function(t){console.log("res~~",t);var i=(null===t||void 0===t?void 0:t.coupons)||[];e.tickets=e.tickets.concat(i.map((function(t){var e="仅限门店 ".concat(t.title," 使用");return e=t.is_multiple?"可在门店 ".concat(t.title," 多次使用"):"仅限门店 ".concat(t.title," 使用"),{id:t.aid,sid:t.sid,title:t.title,image:t.logo||"",endtime:0===t.endtime?0:""===t.endtim?"":t.endtim,get:1,discount:t.discount,condition:t.condition,limit:e,type:t.type,text:t.text,status:t.status,tuangouquan_order_id:t.tuangouquan_order_id,is_multiple:t.is_multiple||!1,encrypted_data:t.encrypted_data,is_show_use_now:t.is_show_use_now,is_show_refund:t.is_show_refund,is_show_offline:t.is_show_offline}}))),i.length<e.pageSize&&(e.isLoadAll=!0)})).catch((function(t){console.error("[ticket]获取代金劵数据失败",t),e.tickets=[]}))},ticketClickEvent:function(t){var e=this,i=this.tickets[t];if(0===this.currentSelectTabIndex){if(100===i.percent)return void(0,r.showToast)({title:"优惠卷已被抢完"});(0,l.collectedTicketApi)({sid:i.sid}).then((function(t){(0,r.showToast)({title:"领取优惠卷成功"}),e.handleTicketTypeChangeEvent()})).catch((function(t){console.error("[ticket]领取优惠卷失败"),(0,r.showToast)({title:"领取优惠卷失败, 请重试"})}))}else 1===this.currentSelectTabIndex&&(i.encrypted_data?(0,u.navPage)("/order-page/write-off/store?encrypted_data=".concat(i.encrypted_data)):(0,u.navPage)("/store-page/product-showcase/template-1?sid=".concat(i.sid)))},handleTicketTypeChangeEvent:function(){this.tickets=[],this.currentPage=1,this.isLoadAll=!1,this.getTicketListData()}}};e.default=f}}]);
|