1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/card/index/index"],{1427:function(t,e,n){"use strict";n.r(e);var o=n("fbad"),i=n("9b29");for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("2ef7");var c,r=n("f0c5"),s=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,"1bff0aba",null,!1,o["a"],c);e["default"]=s.exports},"2ef7":function(t,e,n){"use strict";var o=n("7d39"),i=n.n(o);i.a},"7d39":function(t,e,n){},"8ea2":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n("2f62");function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var r=function(){n.e("components/basic-component/app-tab-nav/app-tab-nav").then(function(){return resolve(n("94b9"))}.bind(null,n)).catch(n.oe)},s=function(){n.e("components/page-component/app-no-goods/app-no-goods").then(function(){return resolve(n("0406"))}.bind(null,n)).catch(n.oe)},u={data:function(){return{tabList:[{id:1,name:"未使用"},{id:2,name:"已使用"},{id:3,name:"已过期"}],show:!1,img:"/images/share/img-share-order.png",activeTab:1,list:[],more:!1,page:2,title:"暂无课程~",type:1}},components:{"app-tab-nav":r,"app-no-goods":s},computed:a({},(0,o.mapState)({theme:function(t){return t.mallConfig.theme},userInfo:function(t){return t.user.info}})),methods:{saveImg:function(){var e=this;t.authorize({scope:"scope.writePhotosAlbum",success:function(n){"authorize:ok"==n.errMsg&&t.downloadFile({url:e.img,success:function(e){t.saveImageToPhotosAlbum({filePath:e.tempFilePath,success:function(){t.showToast({title:"保存成功",icon:"success",duration:1e3})},fail:function(){t.showToast({title:"保存失败",icon:"none",duration:1e3})}})}})},fail:function(e){t.showModal({title:"提示",content:"保存失败,需要授权保存到相册权限",showCancel:!1,confirmText:"打开授权",success:function(e){e.confirm&&t.openSetting({})}})}})},showModal:function(e){var n=this;e>0&&(t.showLoading({text:"生成中..."}),n.$request({url:n.$api.card.qrcode,data:{cardId:e},method:"get"}).then((function(e){t.hideLoading(),0===e.code?(n.show=!0,n.img=e.data.file_path):t.showToast({title:e.msg,icon:"none",duration:1e3})})).catch((function(e){t.hideLoading(),t.showToast({title:e,icon:"none",duration:1e3})})))},tabStatus:function(t){this.list=[];var e=t.currentTarget.dataset.id;(1===e||2===e||3===e)&&(2==this.type?this.title="暂无比赛~":this.title="暂无课程~"),this.page=2,this.activeTab=e,this.getList()},getList:function(){var e=this;e.$showLoading({text:"加载中..."}),e.$request({url:1==e.type?e.$api.card.index+"&type=1":2==e.type?e.$api.card.index+"&type=2":e.$api.card.index+"&type=3",data:{status:e.activeTab}}).then((function(n){e.$hideLoading(),0===n.code?e.list=n.data.list:t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(){e.$hideLoading(),e.$event.on(e.$const.EVENT_USER_LOGIN).then((function(){e.getList()}))}))},getMore:function(){var e=this;t.showLoading({title:"加载中..."}),e.$request({url:e.$api.card.index,data:{page:e.page,status:e.activeTab}}).then((function(n){t.hideLoading(),0===n.code?n.data.list.length>0&&(e.loading=null,e.list=e.list.concat(n.data.list),e.page++):t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(){e.$hideLoading()}))},toDetail:function(e){t.navigateTo({url:"/pages/card/details/details?id=".concat(e)})}},onLoad:function(t){console.log(t),this.type=t.type,this.getList()},onShow:function(){var e=this;setTimeout((function(){t.setNavigationBarTitle({title:1==e.type?"我的课程":2==e.type?"我的比赛":"我的培训"})}),1e3)},onReachBottom:function(){this.getMore()}};e.default=u}).call(this,n("543d")["default"])},"9b29":function(t,e,n){"use strict";n.r(e);var o=n("8ea2"),i=n.n(o);for(var a in o)"default"!==a&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=i.a},ea2d:function(t,e,n){"use strict";(function(t){n("ecb4");o(n("66fd"));var e=o(n("1427"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},fbad:function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.show=!1})},a=[]}},[["ea2d","common/runtime","common/vendor"]]]);
|