Commit 756967f5 by zhanghaozhe

跨域

parent 2eb91ebe
{
"coupons.css": "/static/css/coupons.9ece7350.chunk.css",
"coupons.js": "/static/js/coupons.74915af0.chunk.js",
"coupons.js.map": "/static/js/coupons.74915af0.chunk.js.map",
"main.css": "/static/css/main.d3ac9955.chunk.css",
"main.js": "/static/js/main.bbff2bc9.chunk.js",
"main.js.map": "/static/js/main.bbff2bc9.chunk.js.map",
"coupons.js": "/static/js/coupons.5f48a873.chunk.js",
"coupons.js.map": "/static/js/coupons.5f48a873.chunk.js.map",
"main.css": "/static/css/main.4a107531.chunk.css",
"main.js": "/static/js/main.b550e7ad.chunk.js",
"main.js.map": "/static/js/main.b550e7ad.chunk.js.map",
"myorders.css": "/static/css/myorders.3ab93c8e.chunk.css",
"myorders.js": "/static/js/myorders.64c84c4c.chunk.js",
"myorders.js.map": "/static/js/myorders.64c84c4c.chunk.js.map",
"myorders.js": "/static/js/myorders.5e3c8a18.chunk.js",
"myorders.js.map": "/static/js/myorders.5e3c8a18.chunk.js.map",
"purchased.css": "/static/css/purchased.72c55bd6.chunk.css",
"purchased.js": "/static/js/purchased.587ba463.chunk.js",
"purchased.js.map": "/static/js/purchased.587ba463.chunk.js.map",
"runtime~main.js": "/static/js/runtime~main.94d72f72.js",
"runtime~main.js.map": "/static/js/runtime~main.94d72f72.js.map",
"purchased.js": "/static/js/purchased.67f363d4.chunk.js",
"purchased.js.map": "/static/js/purchased.67f363d4.chunk.js.map",
"runtime~main.js": "/static/js/runtime~main.d373fbce.js",
"runtime~main.js.map": "/static/js/runtime~main.d373fbce.js.map",
"shareposter.css": "/static/css/shareposter.82081d02.chunk.css",
"shareposter.js": "/static/js/shareposter.03babfdf.chunk.js",
"shareposter.js.map": "/static/js/shareposter.03babfdf.chunk.js.map",
"shareposter.js": "/static/js/shareposter.ec4e8c9b.chunk.js",
"shareposter.js.map": "/static/js/shareposter.ec4e8c9b.chunk.js.map",
"study.css": "/static/css/study.50a142e7.chunk.css",
"study.js": "/static/js/study.fc72114b.chunk.js",
"study.js.map": "/static/js/study.fc72114b.chunk.js.map",
"study.js": "/static/js/study.cb74c887.chunk.js",
"study.js.map": "/static/js/study.cb74c887.chunk.js.map",
"togroup.css": "/static/css/togroup.49988cae.chunk.css",
"togroup.js": "/static/js/togroup.d6b233f8.chunk.js",
"togroup.js.map": "/static/js/togroup.d6b233f8.chunk.js.map",
"togroup.js": "/static/js/togroup.2ba99ab5.chunk.js",
"togroup.js.map": "/static/js/togroup.2ba99ab5.chunk.js.map",
"video.css": "/static/css/video.10e4a7e1.chunk.css",
"video.js": "/static/js/video.3d69c391.chunk.js",
"video.js.map": "/static/js/video.3d69c391.chunk.js.map",
"video.js": "/static/js/video.1cacaecc.chunk.js",
"video.js.map": "/static/js/video.1cacaecc.chunk.js.map",
"static/css/9.7c331155.chunk.css": "/static/css/9.7c331155.chunk.css",
"static/js/9.fac04f2b.chunk.js": "/static/js/9.fac04f2b.chunk.js",
"static/js/9.fac04f2b.chunk.js.map": "/static/js/9.fac04f2b.chunk.js.map",
"static/js/9.614e9c4c.chunk.js": "/static/js/9.614e9c4c.chunk.js",
"static/js/9.614e9c4c.chunk.js.map": "/static/js/9.614e9c4c.chunk.js.map",
"static/css/10.1597b3e9.chunk.css": "/static/css/10.1597b3e9.chunk.css",
"static/js/10.98079aa4.chunk.js": "/static/js/10.98079aa4.chunk.js",
"static/js/10.98079aa4.chunk.js.map": "/static/js/10.98079aa4.chunk.js.map",
"static/js/10.f8cb75f8.chunk.js": "/static/js/10.f8cb75f8.chunk.js",
"static/js/10.f8cb75f8.chunk.js.map": "/static/js/10.f8cb75f8.chunk.js.map",
"static/js/11.2e343155.chunk.js": "/static/js/11.2e343155.chunk.js",
"static/js/11.2e343155.chunk.js.map": "/static/js/11.2e343155.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.2608bbda91ce73266fc19bd1526709c0.js": "/precache-manifest.2608bbda91ce73266fc19bd1526709c0.js",
"precache-manifest.85331646b42ff69ece7efc5d951402ac.js": "/precache-manifest.85331646b42ff69ece7efc5d951402ac.js",
"service-worker.js": "/service-worker.js",
"static/css/10.1597b3e9.chunk.css.map": "/static/css/10.1597b3e9.chunk.css.map",
"static/css/9.7c331155.chunk.css.map": "/static/css/9.7c331155.chunk.css.map",
"static/css/coupons.9ece7350.chunk.css.map": "/static/css/coupons.9ece7350.chunk.css.map",
"static/css/main.d3ac9955.chunk.css.map": "/static/css/main.d3ac9955.chunk.css.map",
"static/css/main.4a107531.chunk.css.map": "/static/css/main.4a107531.chunk.css.map",
"static/css/myorders.3ab93c8e.chunk.css.map": "/static/css/myorders.3ab93c8e.chunk.css.map",
"static/css/purchased.72c55bd6.chunk.css.map": "/static/css/purchased.72c55bd6.chunk.css.map",
"static/css/shareposter.82081d02.chunk.css.map": "/static/css/shareposter.82081d02.chunk.css.map",
......
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>React App</title><link href="/static/css/9.7c331155.chunk.css" rel="stylesheet"><link href="/static/css/main.d3ac9955.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(i){function e(e){for(var t,r,n=e[0],o=e[1],a=e[2],u=0,c=[];u<n.length;u++)r=n[u],d[r]&&c.push(d[r][0]),d[r]=0;for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(i[t]=o[t]);for(h&&h(e);c.length;)c.shift()();return l.push.apply(l,a||[]),s()}function s(){for(var e,t=0;t<l.length;t++){for(var r=l[t],n=!0,o=1;o<r.length;o++){var a=r[o];0!==d[a]&&(n=!1)}n&&(l.splice(t--,1),e=p(p.s=r[0]))}return e}var r={},f={4:0},d={4:0},l=[];function p(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,p),t.l=!0,t.exports}p.e=function(l){var e=[];f[l]?e.push(f[l]):0!==f[l]&&{0:1,2:1,3:1,5:1,6:1,7:1,8:1,10:1}[l]&&e.push(f[l]=new Promise(function(e,n){for(var t="static/css/"+({0:"coupons",2:"myorders",3:"purchased",5:"shareposter",6:"study",7:"togroup",8:"video"}[l]||l)+"."+{0:"9ece7350",2:"3ab93c8e",3:"72c55bd6",5:"82081d02",6:"50a142e7",7:"49988cae",8:"10e4a7e1",10:"1597b3e9",11:"31d6cfe0"}[l]+".chunk.css",o=p.p+t,r=document.getElementsByTagName("link"),a=0;a<r.length;a++){var u=(i=r[a]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(u===t||u===o))return e()}var c=document.getElementsByTagName("style");for(a=0;a<c.length;a++){var i;if((u=(i=c[a]).getAttribute("data-href"))===t||u===o)return e()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=e,s.onerror=function(e){var t=e&&e.target&&e.target.src||o,r=new Error("Loading CSS chunk "+l+" failed.\n("+t+")");r.request=t,delete f[l],s.parentNode.removeChild(s),n(r)},s.href=o,document.getElementsByTagName("head")[0].appendChild(s)}).then(function(){f[l]=0}));var r=d[l];if(0!==r)if(r)e.push(r[2]);else{var t=new Promise(function(e,t){r=d[l]=[e,t]});e.push(r[2]=t);var n,a=document.createElement("script");a.charset="utf-8",a.timeout=120,p.nc&&a.setAttribute("nonce",p.nc),a.src=p.p+"static/js/"+({0:"coupons",2:"myorders",3:"purchased",5:"shareposter",6:"study",7:"togroup",8:"video"}[l]||l)+"."+{0:"74915af0",2:"64c84c4c",3:"587ba463",5:"03babfdf",6:"fc72114b",7:"d6b233f8",8:"3d69c391",10:"98079aa4",11:"2e343155"}[l]+".chunk.js",n=function(e){a.onerror=a.onload=null,clearTimeout(u);var t=d[l];if(0!==t){if(t){var r=e&&("load"===e.type?"missing":e.type),n=e&&e.target&&e.target.src,o=new Error("Loading chunk "+l+" failed.\n("+r+": "+n+")");o.type=r,o.request=n,t[1](o)}d[l]=void 0}};var u=setTimeout(function(){n({type:"timeout",target:a})},12e4);a.onerror=a.onload=n,document.head.appendChild(a)}return Promise.all(e)},p.m=i,p.c=r,p.d=function(e,t,r){p.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.t=function(t,e){if(1&e&&(t=p(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(p.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)p.d(r,n,function(e){return t[e]}.bind(null,n));return r},p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,"a",t),t},p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.p="/",p.oe=function(e){throw console.error(e),e};var t=window.webpackJsonp=window.webpackJsonp||[],n=t.push.bind(t);t.push=e,t=t.slice();for(var o=0;o<t.length;o++)e(t[o]);var h=n;s()}([])</script><script src="/static/js/9.fac04f2b.chunk.js"></script><script src="/static/js/main.bbff2bc9.chunk.js"></script></body></html>
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>React App</title><link href="/static/css/9.7c331155.chunk.css" rel="stylesheet"><link href="/static/css/main.4a107531.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(i){function e(e){for(var t,r,n=e[0],o=e[1],a=e[2],u=0,c=[];u<n.length;u++)r=n[u],d[r]&&c.push(d[r][0]),d[r]=0;for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(i[t]=o[t]);for(h&&h(e);c.length;)c.shift()();return l.push.apply(l,a||[]),s()}function s(){for(var e,t=0;t<l.length;t++){for(var r=l[t],n=!0,o=1;o<r.length;o++){var a=r[o];0!==d[a]&&(n=!1)}n&&(l.splice(t--,1),e=p(p.s=r[0]))}return e}var r={},f={4:0},d={4:0},l=[];function p(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,p),t.l=!0,t.exports}p.e=function(l){var e=[];f[l]?e.push(f[l]):0!==f[l]&&{0:1,2:1,3:1,5:1,6:1,7:1,8:1,10:1}[l]&&e.push(f[l]=new Promise(function(e,n){for(var t="static/css/"+({0:"coupons",2:"myorders",3:"purchased",5:"shareposter",6:"study",7:"togroup",8:"video"}[l]||l)+"."+{0:"9ece7350",2:"3ab93c8e",3:"72c55bd6",5:"82081d02",6:"50a142e7",7:"49988cae",8:"10e4a7e1",10:"1597b3e9",11:"31d6cfe0"}[l]+".chunk.css",o=p.p+t,r=document.getElementsByTagName("link"),a=0;a<r.length;a++){var u=(i=r[a]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(u===t||u===o))return e()}var c=document.getElementsByTagName("style");for(a=0;a<c.length;a++){var i;if((u=(i=c[a]).getAttribute("data-href"))===t||u===o)return e()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=e,s.onerror=function(e){var t=e&&e.target&&e.target.src||o,r=new Error("Loading CSS chunk "+l+" failed.\n("+t+")");r.request=t,delete f[l],s.parentNode.removeChild(s),n(r)},s.href=o,document.getElementsByTagName("head")[0].appendChild(s)}).then(function(){f[l]=0}));var r=d[l];if(0!==r)if(r)e.push(r[2]);else{var t=new Promise(function(e,t){r=d[l]=[e,t]});e.push(r[2]=t);var n,a=document.createElement("script");a.charset="utf-8",a.timeout=120,p.nc&&a.setAttribute("nonce",p.nc),a.src=p.p+"static/js/"+({0:"coupons",2:"myorders",3:"purchased",5:"shareposter",6:"study",7:"togroup",8:"video"}[l]||l)+"."+{0:"5f48a873",2:"5e3c8a18",3:"67f363d4",5:"ec4e8c9b",6:"cb74c887",7:"2ba99ab5",8:"1cacaecc",10:"f8cb75f8",11:"2e343155"}[l]+".chunk.js",n=function(e){a.onerror=a.onload=null,clearTimeout(u);var t=d[l];if(0!==t){if(t){var r=e&&("load"===e.type?"missing":e.type),n=e&&e.target&&e.target.src,o=new Error("Loading chunk "+l+" failed.\n("+r+": "+n+")");o.type=r,o.request=n,t[1](o)}d[l]=void 0}};var u=setTimeout(function(){n({type:"timeout",target:a})},12e4);a.onerror=a.onload=n,document.head.appendChild(a)}return Promise.all(e)},p.m=i,p.c=r,p.d=function(e,t,r){p.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.t=function(t,e){if(1&e&&(t=p(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(p.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)p.d(r,n,function(e){return t[e]}.bind(null,n));return r},p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,"a",t),t},p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.p="/",p.oe=function(e){throw console.error(e),e};var t=window.webpackJsonp=window.webpackJsonp||[],n=t.push.bind(t);t.push=e,t=t.slice();for(var o=0;o<t.length;o++)e(t[o]);var h=n;s()}([])</script><script src="/static/js/9.614e9c4c.chunk.js"></script><script src="/static/js/main.b550e7ad.chunk.js"></script></body></html>
\ No newline at end of file
self.__precacheManifest = [
{
"revision": "f1ad74439a14b6bafe5d",
"url": "/static/js/togroup.d6b233f8.chunk.js"
"revision": "669cb7adf56bb1fe58da",
"url": "/static/js/togroup.2ba99ab5.chunk.js"
},
{
"revision": "c6194015e9ea2c0fa0b5",
"revision": "e2fa1f20a808db803d9e",
"url": "/static/css/coupons.9ece7350.chunk.css"
},
{
"revision": "d8238a9df8081c2c78b1",
"url": "/static/css/main.d3ac9955.chunk.css"
"revision": "77d2bddff4b8dc1f55b4",
"url": "/static/css/main.4a107531.chunk.css"
},
{
"revision": "d8238a9df8081c2c78b1",
"url": "/static/js/main.bbff2bc9.chunk.js"
"revision": "77d2bddff4b8dc1f55b4",
"url": "/static/js/main.b550e7ad.chunk.js"
},
{
"revision": "b67d1ad8917eba1a96d5",
"revision": "6b25eb638ff8f76fe9af",
"url": "/static/css/myorders.3ab93c8e.chunk.css"
},
{
"revision": "b67d1ad8917eba1a96d5",
"url": "/static/js/myorders.64c84c4c.chunk.js"
"revision": "6b25eb638ff8f76fe9af",
"url": "/static/js/myorders.5e3c8a18.chunk.js"
},
{
"revision": "2180f0bff1355369e911",
"revision": "4c2d2a85294a9313d423",
"url": "/static/css/purchased.72c55bd6.chunk.css"
},
{
"revision": "2180f0bff1355369e911",
"url": "/static/js/purchased.587ba463.chunk.js"
"revision": "4c2d2a85294a9313d423",
"url": "/static/js/purchased.67f363d4.chunk.js"
},
{
"revision": "57a333cb0a8fa037b0b2",
"url": "/static/js/runtime~main.94d72f72.js"
"revision": "9b452edbee118be9f20f",
"url": "/static/js/runtime~main.d373fbce.js"
},
{
"revision": "5c9b1afb07310fd05c68",
"revision": "d8d272b8288d598a9317",
"url": "/static/css/shareposter.82081d02.chunk.css"
},
{
"revision": "5c9b1afb07310fd05c68",
"url": "/static/js/shareposter.03babfdf.chunk.js"
"revision": "d8d272b8288d598a9317",
"url": "/static/js/shareposter.ec4e8c9b.chunk.js"
},
{
"revision": "4f1bfef41cda243787f5",
"revision": "b6bf5bb10c981819a40b",
"url": "/static/css/study.50a142e7.chunk.css"
},
{
"revision": "4f1bfef41cda243787f5",
"url": "/static/js/study.fc72114b.chunk.js"
"revision": "b6bf5bb10c981819a40b",
"url": "/static/js/study.cb74c887.chunk.js"
},
{
"revision": "f1ad74439a14b6bafe5d",
"revision": "669cb7adf56bb1fe58da",
"url": "/static/css/togroup.49988cae.chunk.css"
},
{
"revision": "c6194015e9ea2c0fa0b5",
"url": "/static/js/coupons.74915af0.chunk.js"
"revision": "e2fa1f20a808db803d9e",
"url": "/static/js/coupons.5f48a873.chunk.js"
},
{
"revision": "4ef4e6967965fb185a92",
"revision": "e33ddc47e5298a7dbfd8",
"url": "/static/css/video.10e4a7e1.chunk.css"
},
{
"revision": "4ef4e6967965fb185a92",
"url": "/static/js/video.3d69c391.chunk.js"
"revision": "e33ddc47e5298a7dbfd8",
"url": "/static/js/video.1cacaecc.chunk.js"
},
{
"revision": "d46cd6ebd635706289b02b7defcfb46b",
"url": "/static/media/iconfont.d46cd6eb.svg"
},
{
"revision": "53fa5431e8d2252f1e54",
"url": "/static/js/9.fac04f2b.chunk.js"
"revision": "ffb3ca42c4df99731168",
"url": "/static/js/9.614e9c4c.chunk.js"
},
{
"revision": "68ab3b59f74192e13342be84b375b0d0",
"url": "/static/media/iconfont.68ab3b59.ttf"
},
{
"revision": "d29ed2193e2219228fae",
"url": "/static/js/10.98079aa4.chunk.js"
"revision": "7ac789ccc56a0baf536a",
"url": "/static/js/10.f8cb75f8.chunk.js"
},
{
"revision": "6ca9c42a2f5783095d20",
......@@ -100,15 +100,15 @@ self.__precacheManifest = [
"url": "/static/media/iconfont.258c8d5d.eot"
},
{
"revision": "53fa5431e8d2252f1e54",
"revision": "ffb3ca42c4df99731168",
"url": "/static/css/9.7c331155.chunk.css"
},
{
"revision": "d29ed2193e2219228fae",
"revision": "7ac789ccc56a0baf536a",
"url": "/static/css/10.1597b3e9.chunk.css"
},
{
"revision": "6c7604b3cc0d45b30852d88a84981154",
"revision": "01c790f84ffd93a0d4adacf72224d783",
"url": "/index.html"
}
];
\ No newline at end of file
......@@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts(
"/precache-manifest.2608bbda91ce73266fc19bd1526709c0.js"
"/precache-manifest.85331646b42ff69ece7efc5d951402ac.js"
);
workbox.clientsClaim();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{675:function(e,t,a){},676:function(e,t,a){},677:function(e,t,a){},678:function(e,t,a){},772:function(e,t,a){"use strict";a.r(t);var n=a(29),o=(a(26),a(2)),c=a.n(o),s=a(72),i=a(4),r=a(5),l=a(8),u=a(6),p=a(7),d=a(0),m=a.n(d),h=(a(675),a(676),a(677),a(16)),f=a.n(h),v=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return(a=Object(l.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(o)))).clearInput=function(){a.props.onChange("")},a}return Object(p.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props,t=e.type,a=e.placeholder;return m.a.createElement("div",{className:"custom-input-wrapper"},m.a.createElement("input",{type:t,className:f()("custom-input"),placeholder:a,onChange:this.props.onChange,value:this.props.value}),m.a.createElement("i",{className:f()("iconfont icondanseshixintubiao-3",{hide:0===this.props.value.length}),onClick:this.clearInput}))}}]),t}(d.Component);v.defaultProps={type:"text",placeholder:""};var C=v,g=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return(a=Object(l.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(o)))).state={},a}return Object(p.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props,t=e.onChange,a=e.redeemCode,n=e.exchange;return m.a.createElement("div",{className:"exchange-bar"},m.a.createElement(C,{placeholder:"\u8bf7\u8f93\u5165\u4f18\u60e0\u7801",onChange:t,value:a}),m.a.createElement("button",{className:f()({active:a&&a.length>0}),onClick:n},"\u5151\u6362"))}}]),t}(d.Component),b=(a(678),function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return(a=Object(l.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(o)))).pick=function(){var e=a.props,t=e.useCoupon;!e.invalid&&t&&t(a.props.id)},a.GoToUse=function(){a.props.useCoupon(a.props.id)},a}return Object(p.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props,t=e.ctype,a=e.amount,n=e.format_expire_time,o=e.limit_course,c=e.invalid,s=e.course_title,i=e.id,r=e.selectedCouponId,l=e.showUseButton;return m.a.createElement("li",{className:"coupon",onClick:this.pick},m.a.createElement("div",{className:f()("coupon-info",c?"invalid":"coupon-type".concat(t))},m.a.createElement("p",{className:"type"},1===t?"\u4ee3\u91d1\u5238":"\u8bfe\u7a0b\u5238"),1===t?m.a.createElement("p",{className:"denomination"},a," ",m.a.createElement("span",null,"\u5143")):m.a.createElement("p",{className:"course-title"},s),m.a.createElement("p",{className:"expire"},"\u6709\u6548\u671f\u81f3\uff1a",n),r===i&&m.a.createElement("i",{className:f()("iconfont icondanseshixintubiao-5",{check:!c})}),m.a.createElement("ul",null,new Array(19).fill("a").map(function(e,t){return m.a.createElement("li",{key:t})}))),m.a.createElement("div",{className:"coupon-des"},m.a.createElement("span",{className:"limit"},0===o?"\u53ef\u7528\u4e8e\u5927\u4e8e\u4ee3\u91d1\u5238\u91d1\u989d\u7684\u8bfe\u7a0b":"\u4ec5\u9002\u7528\u4e8e\u300a".concat(s,"\u300b")),l&&m.a.createElement("button",{className:"use",onClick:this.GoToUse},"\u7acb\u5373\u4f7f\u7528")))}}]),t}(d.PureComponent)),y=a(1),E=a(55),j=a(37),O=a(18),_=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(a=Object(l.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(o)))).state={selectedCouponId:0,redeemCode:"",couponList:[],valid_coupons:[],invalid_coupons:[],courseId:Object(y.c)("id"),showUseButton:!1},a.handleChange=function(e){var t=e?e.target.value:"";a.setState({redeemCode:t})},a.exchange=function(){""!==a.state.redeemCode?y.d.post("".concat(y.a.home,"/m/coupon/exchange"),{code:a.state.redeemCode}).then(function(e){var t=e.data;if(200===t.code){var n=t.data;if(a.state.showUseButton)a.setState({couponList:[].concat(Object(s.a)(state.couponList),[n]),redeemCode:""});else{var o=t.data;2==o.ctype&&o.limit_course!=a.state.courseId?a.setState({invalid_coupons:[].concat(Object(s.a)(a.state.invalid_coupons),[o]),showUseButton:null}):a.setState({valid_coupons:[].concat(Object(s.a)(a.state.valid_coupons),[o]),redeemCode:""})}c.a.info("\u5151\u6362\u6210\u529f")}else c.a.info(t.msg)}):c.a.info("\u8bf7\u8f93\u5165\u5151\u6362\u7801")},a.getMyCoupons=function(){y.d.get("".concat(y.a.home,"/m/coupon/all")).then(function(e){var t=e.data;200===t.code?a.setState({couponList:Object(j.isEmpty)(t.data)?[]:t.data}):c.a.info(t.msg)})},a.getAllCoupons=function(){y.d.post("".concat(y.a.home,"/m/coupon/select"),{course_id:a.state.courseId}).then(function(e){var t=e.data;if(200===t.code){var n=t.data.inuse_coupon;a.setState({valid_coupons:n?[].concat(Object(s.a)(n),Object(s.a)(t.data.valid_coupons)):t.data.valid_coupons,invalid_coupons:t.data.invalid_coupons,selectedCouponId:n.length?n[0].id:0})}else c.a.info(t.msg)})},a.useCoupon=function(e){var t=a.props.history,n=a.state.couponList.find(function(t){return t.id===e});if(e)if(a.state.showUseButton)1===n.ctype?t.push("/classify"):t.push("/detail?id=".concat(n.limit_course));else{var o=a.state,s=o.courseId;o.selectedCouponId===e?y.d.post("".concat(y.a.home,"/m/coupon/cancel"),{course_id:s}).then(function(e){var t=e.data;200===t.code?a.setState({selectedCouponId:0}):c.a.info(t.msg)}):y.d.post("".concat(y.a.home,"/m/coupon/use"),{course_id:a.state.courseId,coupon_id:e}).then(function(t){var n=t&&t.data;200===n.code?(a.setState({selectedCouponId:e}),a.props.history.goBack()):c.a.info(n.msg)})}else c.a.info("\u672a\u77e5\u9519\u8bef"),location.reload()},a}return Object(p.a)(t,e),Object(r.a)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.history,a=e.location,n=this.props.location.state;n&&n.from&&("/my"===n.from?(this.getMyCoupons(),this.setState({showUseButton:!0})):(this.state.courseId||(a.state&&a.state.from?t.replace(a.state.from):t.goBack()),this.getAllCoupons()))}},{key:"render",value:function(){var e=this.props.location.state,t=this.state,a=t.showUseButton,n=t.selectedCouponId;return m.a.createElement("div",{className:"use-coupon"},m.a.createElement(O.e,{title:"\u4f18\u60e0\u5238",arrow:!0}),m.a.createElement(g,{onChange:this.handleChange,exchange:this.exchange,redeemCode:this.state.redeemCode}),m.a.createElement("div",{className:"coupons-area"},m.a.createElement(w,{coupons:e&&e.from&&"/my"===e.from?this.state.couponList:this.state.valid_coupons,showUseButton:a,selectedCouponId:n,select:this.select,useCoupon:this.useCoupon}),this.state.invalid_coupons.length>0&&m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{className:"invalid-title"},"- \u4e0d\u53ef\u4f7f\u7528\u7684\u4f18\u60e0\u5238 -"),m.a.createElement(w,{coupons:this.state.invalid_coupons,selectedCouponId:n,select:this.select,purpose:"use",invalid:"invalid"}))))}}]),t}(d.PureComponent);function w(e){var t=e.coupons,a=Object(n.a)(e,["coupons"]);return 0===t.length?m.a.createElement("div",{className:"empty"},m.a.createElement("p",null,"\u6682\u65e0\u53ef\u4f7f\u7528\u7684\u4f18\u60e0\u5238")):m.a.createElement("ul",null,t.map(function(e){return m.a.createElement(b,Object.assign({key:e.id},e,{id:e.id},a))}))}t.default=Object(E.a)(_)}}]);
//# sourceMappingURL=coupons.74915af0.chunk.js.map
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{675:function(e,t,a){},676:function(e,t,a){},677:function(e,t,a){},678:function(e,t,a){},772:function(e,t,a){"use strict";a.r(t);var n=a(29),o=(a(26),a(2)),c=a.n(o),s=a(72),i=a(3),r=a(4),l=a(7),u=a(5),p=a(6),d=a(0),m=a.n(d),h=(a(675),a(676),a(677),a(16)),f=a.n(h),v=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return(a=Object(l.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(o)))).clearInput=function(){a.props.onChange("")},a}return Object(p.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props,t=e.type,a=e.placeholder;return m.a.createElement("div",{className:"custom-input-wrapper"},m.a.createElement("input",{type:t,className:f()("custom-input"),placeholder:a,onChange:this.props.onChange,value:this.props.value}),m.a.createElement("i",{className:f()("iconfont icondanseshixintubiao-3",{hide:0===this.props.value.length}),onClick:this.clearInput}))}}]),t}(d.Component);v.defaultProps={type:"text",placeholder:""};var C=v,g=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return(a=Object(l.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(o)))).state={},a}return Object(p.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props,t=e.onChange,a=e.redeemCode,n=e.exchange;return m.a.createElement("div",{className:"exchange-bar"},m.a.createElement(C,{placeholder:"\u8bf7\u8f93\u5165\u4f18\u60e0\u7801",onChange:t,value:a}),m.a.createElement("button",{className:f()({active:a&&a.length>0}),onClick:n},"\u5151\u6362"))}}]),t}(d.Component),b=(a(678),function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return(a=Object(l.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(o)))).pick=function(){var e=a.props,t=e.useCoupon;!e.invalid&&t&&t(a.props.id)},a.GoToUse=function(){a.props.useCoupon(a.props.id)},a}return Object(p.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props,t=e.ctype,a=e.amount,n=e.format_expire_time,o=e.limit_course,c=e.invalid,s=e.course_title,i=e.id,r=e.selectedCouponId,l=e.showUseButton;return m.a.createElement("li",{className:"coupon",onClick:this.pick},m.a.createElement("div",{className:f()("coupon-info",c?"invalid":"coupon-type".concat(t))},m.a.createElement("p",{className:"type"},1===t?"\u4ee3\u91d1\u5238":"\u8bfe\u7a0b\u5238"),1===t?m.a.createElement("p",{className:"denomination"},a," ",m.a.createElement("span",null,"\u5143")):m.a.createElement("p",{className:"course-title"},s),m.a.createElement("p",{className:"expire"},"\u6709\u6548\u671f\u81f3\uff1a",n),r===i&&m.a.createElement("i",{className:f()("iconfont icondanseshixintubiao-5",{check:!c})}),m.a.createElement("ul",null,new Array(19).fill("a").map(function(e,t){return m.a.createElement("li",{key:t})}))),m.a.createElement("div",{className:"coupon-des"},m.a.createElement("span",{className:"limit"},0===o?"\u53ef\u7528\u4e8e\u5927\u4e8e\u4ee3\u91d1\u5238\u91d1\u989d\u7684\u8bfe\u7a0b":"\u4ec5\u9002\u7528\u4e8e\u300a".concat(s,"\u300b")),l&&m.a.createElement("button",{className:"use",onClick:this.GoToUse},"\u7acb\u5373\u4f7f\u7528")))}}]),t}(d.PureComponent)),y=a(1),E=a(55),j=a(37),O=a(18),_=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(a=Object(l.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(o)))).state={selectedCouponId:0,redeemCode:"",couponList:[],valid_coupons:[],invalid_coupons:[],courseId:Object(y.c)("id"),showUseButton:!1},a.handleChange=function(e){var t=e?e.target.value:"";a.setState({redeemCode:t})},a.exchange=function(){""!==a.state.redeemCode?y.d.post("".concat(y.a.home,"/m/coupon/exchange"),{code:a.state.redeemCode}).then(function(e){var t=e.data;if(200===t.code){var n=t.data;if(a.state.showUseButton)a.setState({couponList:[].concat(Object(s.a)(state.couponList),[n]),redeemCode:""});else{var o=t.data;2==o.ctype&&o.limit_course!=a.state.courseId?a.setState({invalid_coupons:[].concat(Object(s.a)(a.state.invalid_coupons),[o]),showUseButton:null}):a.setState({valid_coupons:[].concat(Object(s.a)(a.state.valid_coupons),[o]),redeemCode:""})}c.a.info("\u5151\u6362\u6210\u529f")}else c.a.info(t.msg)}):c.a.info("\u8bf7\u8f93\u5165\u5151\u6362\u7801")},a.getMyCoupons=function(){y.d.get("".concat(y.a.home,"/m/coupon/all")).then(function(e){var t=e.data;200===t.code?a.setState({couponList:Object(j.isEmpty)(t.data)?[]:t.data}):c.a.info(t.msg)})},a.getAllCoupons=function(){y.d.post("".concat(y.a.home,"/m/coupon/select"),{course_id:a.state.courseId}).then(function(e){var t=e.data;if(200===t.code){var n=t.data.inuse_coupon;a.setState({valid_coupons:n?[].concat(Object(s.a)(n),Object(s.a)(t.data.valid_coupons)):t.data.valid_coupons,invalid_coupons:t.data.invalid_coupons,selectedCouponId:n.length?n[0].id:0})}else c.a.info(t.msg)})},a.useCoupon=function(e){var t=a.props.history,n=a.state.couponList.find(function(t){return t.id===e});if(e)if(a.state.showUseButton)1===n.ctype?t.push("/classify"):t.push("/detail?id=".concat(n.limit_course));else{var o=a.state,s=o.courseId;o.selectedCouponId===e?y.d.post("".concat(y.a.home,"/m/coupon/cancel"),{course_id:s}).then(function(e){var t=e.data;200===t.code?a.setState({selectedCouponId:0}):c.a.info(t.msg)}):y.d.post("".concat(y.a.home,"/m/coupon/use"),{course_id:a.state.courseId,coupon_id:e}).then(function(t){var n=t&&t.data;200===n.code?(a.setState({selectedCouponId:e}),a.props.history.goBack()):c.a.info(n.msg)})}else c.a.info("\u672a\u77e5\u9519\u8bef"),location.reload()},a}return Object(p.a)(t,e),Object(r.a)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.history,a=e.location,n=this.props.location.state;n&&n.from&&("/my"===n.from?(this.getMyCoupons(),this.setState({showUseButton:!0})):(this.state.courseId||(a.state&&a.state.from?t.replace(a.state.from):t.goBack()),this.getAllCoupons()))}},{key:"render",value:function(){var e=this.props.location.state,t=this.state,a=t.showUseButton,n=t.selectedCouponId;return m.a.createElement("div",{className:"use-coupon"},m.a.createElement(O.e,{title:"\u4f18\u60e0\u5238",arrow:!0}),m.a.createElement(g,{onChange:this.handleChange,exchange:this.exchange,redeemCode:this.state.redeemCode}),m.a.createElement("div",{className:"coupons-area"},m.a.createElement(w,{coupons:e&&e.from&&"/my"===e.from?this.state.couponList:this.state.valid_coupons,showUseButton:a,selectedCouponId:n,select:this.select,useCoupon:this.useCoupon}),this.state.invalid_coupons.length>0&&m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{className:"invalid-title"},"- \u4e0d\u53ef\u4f7f\u7528\u7684\u4f18\u60e0\u5238 -"),m.a.createElement(w,{coupons:this.state.invalid_coupons,selectedCouponId:n,select:this.select,purpose:"use",invalid:"invalid"}))))}}]),t}(d.PureComponent);function w(e){var t=e.coupons,a=Object(n.a)(e,["coupons"]);return 0===t.length?m.a.createElement("div",{className:"empty"},m.a.createElement("p",null,"\u6682\u65e0\u53ef\u4f7f\u7528\u7684\u4f18\u60e0\u5238")):m.a.createElement("ul",null,t.map(function(e){return m.a.createElement(b,Object.assign({key:e.id},e,{id:e.id},a))}))}t.default=Object(E.a)(_)}}]);
//# sourceMappingURL=coupons.5f48a873.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["components/coupons/Input/index.js","components/coupons/RedeemBar/index.js","components/coupons/Coupon/index.js","components/coupons/index.js"],"names":["Input","clearInput","_this","props","onChange","_this$props","this","type","placeholder","react_default","a","createElement","className","classnames","value","hide","length","onClick","Component","defaultProps","RedeemBar","state","redeemCode","exchange","coupons_Input","active","Coupon","pick","useCoupon","invalid","id","GoToUse","_this$props2","ctype","amount","format_expire_time","limit_course","course_title","selectedCouponId","showUseButton","concat","check","Array","fill","map","item","index","key","PureComponent","UseCoupon","couponList","valid_coupons","invalid_coupons","courseId","getParam","handleChange","e","target","setState","http","post","api","home","code","then","res","data","coupon","Object","toConsumableArray","toast_default","info","msg","getMyCoupons","get","isEmpty","getAllCoupons","course_id","inuse_coupon","val","history","find","push","_this$state","coupon_id","goBack","location","reload","from","replace","_this$state2","common","title","arrow","coupons_RedeemBar","Content","coupons","select","Fragment","purpose","_ref","rest","objectWithoutProperties","coupons_Coupon","assign","WithFullSize"],"mappings":"gUAKMA,6MACFC,WAAa,WACTC,EAAKC,MAAMC,SAAS,6EAGf,IAAAC,EACqBC,KAAKH,MAA1BI,EADAF,EACAE,KAAMC,EADNH,EACMG,YACX,OACIC,EAAAC,EAAAC,cAAA,OAAKC,UAAU,wBACXH,EAAAC,EAAAC,cAAA,SACIJ,KAAMA,EACNK,UAAWC,IAAW,gBACtBL,YAAaA,EACbJ,SAAUE,KAAKH,MAAMC,SACrBU,MAAOR,KAAKH,MAAMW,QAEtBL,EAAAC,EAAAC,cAAA,KACIC,UAAWC,IAAW,mCAAoC,CACtDE,KAAkC,IAA5BT,KAAKH,MAAMW,MAAME,SAE3BC,QAASX,KAAKL,qBApBdiB,aA4BpBlB,EAAMmB,aAAe,CAACZ,KAAM,OAAQC,YAAa,IAElCR,QCTAoB,6MApBXC,MAAQ,2EAEC,IAAAhB,EACoCC,KAAKH,MAAvCC,EADFC,EACED,SAAUkB,EADZjB,EACYiB,WAAYC,EADxBlB,EACwBkB,SAC7B,OACId,EAAAC,EAAAC,cAAA,OAAKC,UAAU,gBACXH,EAAAC,EAAAC,cAACa,EAAD,CACIhB,YAAa,uCACbJ,SAAUA,EACVU,MAAOQ,IAEXb,EAAAC,EAAAC,cAAA,UAAQC,UAAWC,IAAW,CAC1BY,OAAQH,GAAcA,EAAWN,OAAS,I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KACHlF,KAAKe,MAAM6B,WACX5C,KAAKe,MAAM8B,cAErBZ,cAAeA,EACfD,iBAAkBA,EAClB2D,OAAQ3F,KAAK2F,OACbrE,UAAWtB,KAAKsB,YAGhBtB,KAAKe,MAAM+B,gBAAgBpC,OAAS,GAEhCP,EAAAC,EAAAC,cAAAF,EAAAC,EAAAwF,SAAA,KACIzF,EAAAC,EAAAC,cAAA,OAAKC,UAAU,iBAAf,wDACAH,EAAAC,EAAAC,cAACoF,EAAD,CACIC,QAAS1F,KAAKe,MAAM+B,gBACpBd,iBAAkBA,EAClB2D,OAAQ3F,KAAK2F,OACbE,QAAS,MACTtE,QAAS,sBA/NrBmB,iBA0OxB,SAAS+C,EAATK,GAAqC,IAAnBJ,EAAmBI,EAAnBJ,QAAYK,EAAOjC,OAAAkC,EAAA,EAAAlC,CAAAgC,EAAA,aACjC,OAAuB,IAAnBJ,EAAQhF,OAEJP,EAAAC,EAAAC,cAAA,OAAKC,UAAU,SACXH,EAAAC,EAAAC,cAAA,oEAKRF,EAAAC,EAAAC,cAAA,UAEQqF,EAAQpD,IAAI,SAAAC,GACR,OACIpC,EAAAC,EAAAC,cAAC4F,EAADnC,OAAAoC,OAAA,CACIzD,IAAKF,EAAKf,IACNe,EAFR,CAGIf,GAAIe,EAAKf,IACLuE,OASjBI,sBAAaxD","file":"static/js/coupons.74915af0.chunk.js","sourcesContent":["import React, { Component } from 'react';\nimport './input.scss'\n\nimport classnames from 'classnames'\n\nclass Input extends Component {\n clearInput = () => {\n this.props.onChange('')\n }\n\n render() {\n let {type, placeholder} = this.props\n return (\n <div className='custom-input-wrapper'>\n <input\n type={type}\n className={classnames('custom-input')}\n placeholder={placeholder}\n onChange={this.props.onChange}\n value={this.props.value}\n />\n <i\n className={classnames('iconfont icondanseshixintubiao-3', {\n hide: this.props.value.length === 0\n })}\n onClick={this.clearInput}\n />\n </div>\n );\n }\n}\n\n\nInput.defaultProps = {type: 'text', placeholder: ''}\n\nexport default Input;","import React, { Component } from 'react';\nimport './exchange-bar.scss'\nimport Input from '../Input'\nimport classnames from 'classnames'\n\nclass RedeemBar extends Component {\n state = {}\n\n render() {\n const {onChange, redeemCode, exchange} = this.props\n return (\n <div className=\"exchange-bar\">\n <Input\n placeholder={'请输入优惠码'}\n onChange={onChange}\n value={redeemCode}\n />\n <button className={classnames({\n active: redeemCode && redeemCode.length > 0\n })} onClick={exchange}>兑换\n </button>\n </div>\n );\n }\n}\n\nexport default RedeemBar;","import React, { PureComponent } from 'react'\nimport './coupon.scss'\nimport classnames from 'classnames'\n\nclass Coupon extends PureComponent {\n\n pick = () => {\n let {useCoupon, invalid} = this.props\n !invalid && useCoupon && useCoupon(this.props.id)\n }\n\n GoToUse = () => {\n this.props.useCoupon(this.props.id)\n }\n\n render() {\n let {\n ctype,\n amount,\n format_expire_time,\n limit_course,\n invalid,\n course_title,\n id,\n selectedCouponId,\n showUseButton\n } = this.props\n\n return (\n <li className='coupon' onClick={this.pick}>\n <div className={classnames('coupon-info', invalid ? 'invalid' : `coupon-type${ctype}`)}>\n <p className='type'>{ctype === 1 ? '代金券' : '课程券'}</p>\n {\n ctype === 1 ? <p className='denomination'>{amount} <span>元</span></p>\n : <p className='course-title'>{course_title}</p>\n\n }\n <p className='expire'>有效期至:{format_expire_time}</p>\n {\n selectedCouponId === id &&\n <i className={classnames('iconfont icondanseshixintubiao-5', {\n check: !invalid\n })}\n />\n }\n <ul>\n {\n new Array(19).fill('a').map((item, index) => {\n return <li key={index}/>\n })\n }\n </ul>\n </div>\n <div className=\"coupon-des\">\n <span className='limit'>{\n limit_course === 0 ? '可用于大于代金券金额的课程' : `仅适用于《${course_title}》`\n }</span>\n {\n showUseButton &&\n <button\n className='use'\n onClick={this.GoToUse}\n >立即使用\n </button>\n }\n\n </div>\n </li>\n );\n }\n}\n\nexport default Coupon","import React, { PureComponent } from 'react';\nimport './coupons.scss'\n\nimport RedeemBar from \"./RedeemBar\";\nimport Coupon from './Coupon'\nimport { http, api, getParam } from '@/utils'\nimport { WithFullSize } from '@/HOCs'\nimport { Toast } from 'antd-mobile'\nimport { isEmpty } from 'lodash'\nimport { HeaderBar } from \"@/common\";\n\n\nclass UseCoupon extends PureComponent {\n\n state = {\n selectedCouponId: 0,\n redeemCode: '',\n couponList: [],\n valid_coupons: [],\n invalid_coupons: [],\n courseId: getParam('id'),\n showUseButton: false\n }\n\n componentDidMount() {\n\n const {history, location} = this.props\n\n const {state} = this.props.location\n\n\n if (state && state.from) {\n if (state.from === '/my') {\n this.getMyCoupons();\n this.setState({\n showUseButton: true\n })\n } else {\n if (!this.state.courseId) {\n location.state && location.state.from ? history.replace(location.state.from) : history.goBack()\n }\n this.getAllCoupons();\n }\n }\n }\n\n handleChange = e => {\n let value = e ? e.target.value : ''\n this.setState({redeemCode: value})\n }\n\n exchange = () => {\n if (this.state.redeemCode !== '') {\n http.post(`${api.home}/m/coupon/exchange`, {\n code: this.state.redeemCode\n })\n .then(res => {\n const data = res.data\n if (data.code === 200) {\n\n const coupon = data.data\n\n if (this.state.showUseButton) {\n this.setState({\n couponList: [...state.couponList, coupon],\n redeemCode: ''\n })\n } else {\n\n const coupon = data.data\n\n if (coupon['ctype'] == 2\n && coupon['limit_course'] != this.state.courseId) {\n this.setState({\n invalid_coupons: [...this.state.invalid_coupons, coupon],\n showUseButton: null\n });\n } else {\n this.setState({\n valid_coupons: [...this.state.valid_coupons, coupon],\n redeemCode: ''\n })\n }\n\n\n }\n\n Toast.info('兑换成功')\n } else {\n Toast.info(data.msg)\n }\n })\n } else {\n Toast.info('请输入兑换码')\n }\n }\n\n getMyCoupons = () => {\n http.get(`${api.home}/m/coupon/all`)\n .then(res => {\n const data = res.data\n if (data.code === 200) {\n this.setState({\n couponList: isEmpty(data.data) ? [] : data.data\n })\n } else {\n Toast.info(data.msg)\n }\n })\n }\n\n getAllCoupons = () => {\n http.post(`${api.home}/m/coupon/select`, {course_id: this.state.courseId})\n .then(res => {\n const data = res.data\n if (data.code === 200) {\n\n const inuse_coupon = data.data['inuse_coupon'];\n\n\n this.setState({\n valid_coupons: inuse_coupon\n ? [...inuse_coupon, ...data.data.valid_coupons]\n : data.data.valid_coupons,\n invalid_coupons: data.data.invalid_coupons,\n selectedCouponId: inuse_coupon.length ? inuse_coupon[0].id : 0\n })\n\n } else {\n Toast.info(data.msg)\n }\n })\n }\n\n useCoupon = val => {\n const {history} = this.props\n const coupon = this.state.couponList.find(item => item.id === val)\n\n if (val) {\n if (this.state.showUseButton) {\n\n if (coupon['ctype'] === 1) {\n history.push(`/classify`)\n } else {\n history.push(`/detail?id=${coupon['limit_course']}`)\n }\n\n } else {\n\n const {courseId, selectedCouponId} = this.state\n\n if (selectedCouponId === val) {\n\n\n http.post(`${api.home}/m/coupon/cancel`, {\n course_id: courseId\n }).then(res => {\n const data = res.data\n if (data.code === 200) {\n\n\n this.setState({\n selectedCouponId: 0\n })\n\n\n } else {\n Toast.info(data.msg)\n }\n })\n\n\n } else {\n http.post(`${api.home}/m/coupon/use`, {\n course_id: this.state.courseId,\n coupon_id: val\n })\n .then(res => {\n const data = res && res.data\n if (data.code === 200) {\n\n this.setState({selectedCouponId: val})\n this.props.history.goBack()\n\n\n } else {\n Toast.info(data.msg)\n }\n })\n\n }\n\n\n }\n\n } else {\n Toast.info('未知错误')\n location.reload()\n }\n\n }\n\n render() {\n const {state} = this.props.location\n const {showUseButton, selectedCouponId} = this.state\n return (\n <div className='use-coupon'>\n <HeaderBar title='优惠券' arrow={true}/>\n <RedeemBar onChange={this.handleChange}\n exchange={this.exchange}\n redeemCode={this.state.redeemCode}/>\n <div className=\"coupons-area\">\n <Content\n coupons={\n state\n && state.from\n && state.from === '/my'\n ? this.state.couponList\n : this.state.valid_coupons\n }\n showUseButton={showUseButton}\n selectedCouponId={selectedCouponId}\n select={this.select}\n useCoupon={this.useCoupon}\n />\n {\n this.state.invalid_coupons.length > 0 &&\n (\n <>\n <div className='invalid-title'>- 不可使用的优惠券 -</div>\n <Content\n coupons={this.state.invalid_coupons}\n selectedCouponId={selectedCouponId}\n select={this.select}\n purpose={'use'}\n invalid={'invalid'}\n />\n </>\n )\n }\n </div>\n </div>\n );\n }\n}\n\nfunction Content({coupons, ...rest}) {\n if (coupons.length === 0) {\n return (\n <div className='empty'>\n <p>暂无可使用的优惠券</p>\n </div>\n )\n }\n return (\n <ul>\n {\n coupons.map(item => {\n return (\n <Coupon\n key={item.id}\n {...item}\n id={item.id}\n {...rest}\n />\n )\n })\n }\n </ul>\n )\n}\n\nexport default WithFullSize(UseCoupon);"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["components/coupons/Input/index.js","components/coupons/RedeemBar/index.js","components/coupons/Coupon/index.js","components/coupons/index.js"],"names":["Input","clearInput","_this","props","onChange","_this$props","this","type","placeholder","react_default","a","createElement","className","classnames","value","hide","length","onClick","Component","defaultProps","RedeemBar","state","redeemCode","exchange","coupons_Input","active","Coupon","pick","useCoupon","invalid","id","GoToUse","_this$props2","ctype","amount","format_expire_time","limit_course","course_title","selectedCouponId","showUseButton","concat","check","Array","fill","map","item","index","key","PureComponent","UseCoupon","couponList","valid_coupons","invalid_coupons","courseId","getParam","handleChange","e","target","setState","http","post","api","home","code","then","res","data","coupon","Object","toConsumableArray","toast_default","info","msg","getMyCoupons","get","isEmpty","getAllCoupons","course_id","inuse_coupon","val","history","find","push","_this$state","coupon_id","goBack","location","reload","from","replace","_this$state2","common","title","arrow","coupons_RedeemBar","Content","coupons","select","Fragment","purpose","_ref","rest","objectWithoutProperties","coupons_Coupon","assign","WithFullSize"],"mappings":"gUAKMA,6MACFC,WAAa,WACTC,EAAKC,MAAMC,SAAS,6EAGf,IAAAC,EACqBC,KAAKH,MAA1BI,EADAF,EACAE,KAAMC,EADNH,EACMG,YACX,OACIC,EAAAC,EAAAC,cAAA,OAAKC,UAAU,wBACXH,EAAAC,EAAAC,cAAA,SACIJ,KAAMA,EACNK,UAAWC,IAAW,gBACtBL,YAAaA,EACbJ,SAAUE,KAAKH,MAAMC,SACrBU,MAAOR,KAAKH,MAAM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,cAAC4F,EAADnC,OAAAoC,OAAA,CACIzD,IAAKF,EAAKf,IACNe,EAFR,CAGIf,GAAIe,EAAKf,IACLuE,OASjBI,sBAAaxD","file":"static/js/coupons.5f48a873.chunk.js","sourcesContent":["import React, { Component } from 'react';\nimport './input.scss'\n\nimport classnames from 'classnames'\n\nclass Input extends Component {\n clearInput = () => {\n this.props.onChange('')\n }\n\n render() {\n let {type, placeholder} = this.props\n return (\n <div className='custom-input-wrapper'>\n <input\n type={type}\n className={classnames('custom-input')}\n placeholder={placeholder}\n onChange={this.props.onChange}\n value={this.props.value}\n />\n <i\n className={classnames('iconfont icondanseshixintubiao-3', {\n hide: this.props.value.length === 0\n })}\n onClick={this.clearInput}\n />\n </div>\n );\n }\n}\n\n\nInput.defaultProps = {type: 'text', placeholder: ''}\n\nexport default Input;","import React, { Component } from 'react';\nimport './exchange-bar.scss'\nimport Input from '../Input'\nimport classnames from 'classnames'\n\nclass RedeemBar extends Component {\n state = {}\n\n render() {\n const {onChange, redeemCode, exchange} = this.props\n return (\n <div className=\"exchange-bar\">\n <Input\n placeholder={'请输入优惠码'}\n onChange={onChange}\n value={redeemCode}\n />\n <button className={classnames({\n active: redeemCode && redeemCode.length > 0\n })} onClick={exchange}>兑换\n </button>\n </div>\n );\n }\n}\n\nexport default RedeemBar;","import React, { PureComponent } from 'react'\nimport './coupon.scss'\nimport classnames from 'classnames'\n\nclass Coupon extends PureComponent {\n\n pick = () => {\n let {useCoupon, invalid} = this.props\n !invalid && useCoupon && useCoupon(this.props.id)\n }\n\n GoToUse = () => {\n this.props.useCoupon(this.props.id)\n }\n\n render() {\n let {\n ctype,\n amount,\n format_expire_time,\n limit_course,\n invalid,\n course_title,\n id,\n selectedCouponId,\n showUseButton\n } = this.props\n\n return (\n <li className='coupon' onClick={this.pick}>\n <div className={classnames('coupon-info', invalid ? 'invalid' : `coupon-type${ctype}`)}>\n <p className='type'>{ctype === 1 ? '代金券' : '课程券'}</p>\n {\n ctype === 1 ? <p className='denomination'>{amount} <span>元</span></p>\n : <p className='course-title'>{course_title}</p>\n\n }\n <p className='expire'>有效期至:{format_expire_time}</p>\n {\n selectedCouponId === id &&\n <i className={classnames('iconfont icondanseshixintubiao-5', {\n check: !invalid\n })}\n />\n }\n <ul>\n {\n new Array(19).fill('a').map((item, index) => {\n return <li key={index}/>\n })\n }\n </ul>\n </div>\n <div className=\"coupon-des\">\n <span className='limit'>{\n limit_course === 0 ? '可用于大于代金券金额的课程' : `仅适用于《${course_title}》`\n }</span>\n {\n showUseButton &&\n <button\n className='use'\n onClick={this.GoToUse}\n >立即使用\n </button>\n }\n\n </div>\n </li>\n );\n }\n}\n\nexport default Coupon","import React, { PureComponent } from 'react';\nimport './coupons.scss'\n\nimport RedeemBar from \"./RedeemBar\";\nimport Coupon from './Coupon'\nimport { http, api, getParam } from '@/utils'\nimport { WithFullSize } from '@/HOCs'\nimport { Toast } from 'antd-mobile'\nimport { isEmpty } from 'lodash'\nimport { HeaderBar } from \"@/common\";\n\n\nclass UseCoupon extends PureComponent {\n\n state = {\n selectedCouponId: 0,\n redeemCode: '',\n couponList: [],\n valid_coupons: [],\n invalid_coupons: [],\n courseId: getParam('id'),\n showUseButton: false\n }\n\n componentDidMount() {\n\n const {history, location} = this.props\n\n const {state} = this.props.location\n\n\n if (state && state.from) {\n if (state.from === '/my') {\n this.getMyCoupons();\n this.setState({\n showUseButton: true\n })\n } else {\n if (!this.state.courseId) {\n location.state && location.state.from ? history.replace(location.state.from) : history.goBack()\n }\n this.getAllCoupons();\n }\n }\n }\n\n handleChange = e => {\n let value = e ? e.target.value : ''\n this.setState({redeemCode: value})\n }\n\n exchange = () => {\n if (this.state.redeemCode !== '') {\n http.post(`${api.home}/m/coupon/exchange`, {\n code: this.state.redeemCode\n })\n .then(res => {\n const data = res.data\n if (data.code === 200) {\n\n const coupon = data.data\n\n if (this.state.showUseButton) {\n this.setState({\n couponList: [...state.couponList, coupon],\n redeemCode: ''\n })\n } else {\n\n const coupon = data.data\n\n if (coupon['ctype'] == 2\n && coupon['limit_course'] != this.state.courseId) {\n this.setState({\n invalid_coupons: [...this.state.invalid_coupons, coupon],\n showUseButton: null\n });\n } else {\n this.setState({\n valid_coupons: [...this.state.valid_coupons, coupon],\n redeemCode: ''\n })\n }\n\n\n }\n\n Toast.info('兑换成功')\n } else {\n Toast.info(data.msg)\n }\n })\n } else {\n Toast.info('请输入兑换码')\n }\n }\n\n getMyCoupons = () => {\n http.get(`${api.home}/m/coupon/all`)\n .then(res => {\n const data = res.data\n if (data.code === 200) {\n this.setState({\n couponList: isEmpty(data.data) ? [] : data.data\n })\n } else {\n Toast.info(data.msg)\n }\n })\n }\n\n getAllCoupons = () => {\n http.post(`${api.home}/m/coupon/select`, {course_id: this.state.courseId})\n .then(res => {\n const data = res.data\n if (data.code === 200) {\n\n const inuse_coupon = data.data['inuse_coupon'];\n\n\n this.setState({\n valid_coupons: inuse_coupon\n ? [...inuse_coupon, ...data.data.valid_coupons]\n : data.data.valid_coupons,\n invalid_coupons: data.data.invalid_coupons,\n selectedCouponId: inuse_coupon.length ? inuse_coupon[0].id : 0\n })\n\n } else {\n Toast.info(data.msg)\n }\n })\n }\n\n useCoupon = val => {\n const {history} = this.props\n const coupon = this.state.couponList.find(item => item.id === val)\n\n if (val) {\n if (this.state.showUseButton) {\n\n if (coupon['ctype'] === 1) {\n history.push(`/classify`)\n } else {\n history.push(`/detail?id=${coupon['limit_course']}`)\n }\n\n } else {\n\n const {courseId, selectedCouponId} = this.state\n\n if (selectedCouponId === val) {\n\n\n http.post(`${api.home}/m/coupon/cancel`, {\n course_id: courseId\n }).then(res => {\n const data = res.data\n if (data.code === 200) {\n\n\n this.setState({\n selectedCouponId: 0\n })\n\n\n } else {\n Toast.info(data.msg)\n }\n })\n\n\n } else {\n http.post(`${api.home}/m/coupon/use`, {\n course_id: this.state.courseId,\n coupon_id: val\n })\n .then(res => {\n const data = res && res.data\n if (data.code === 200) {\n\n this.setState({selectedCouponId: val})\n this.props.history.goBack()\n\n\n } else {\n Toast.info(data.msg)\n }\n })\n\n }\n\n\n }\n\n } else {\n Toast.info('未知错误')\n location.reload()\n }\n\n }\n\n render() {\n const {state} = this.props.location\n const {showUseButton, selectedCouponId} = this.state\n return (\n <div className='use-coupon'>\n <HeaderBar title='优惠券' arrow={true}/>\n <RedeemBar onChange={this.handleChange}\n exchange={this.exchange}\n redeemCode={this.state.redeemCode}/>\n <div className=\"coupons-area\">\n <Content\n coupons={\n state\n && state.from\n && state.from === '/my'\n ? this.state.couponList\n : this.state.valid_coupons\n }\n showUseButton={showUseButton}\n selectedCouponId={selectedCouponId}\n select={this.select}\n useCoupon={this.useCoupon}\n />\n {\n this.state.invalid_coupons.length > 0 &&\n (\n <>\n <div className='invalid-title'>- 不可使用的优惠券 -</div>\n <Content\n coupons={this.state.invalid_coupons}\n selectedCouponId={selectedCouponId}\n select={this.select}\n purpose={'use'}\n invalid={'invalid'}\n />\n </>\n )\n }\n </div>\n </div>\n );\n }\n}\n\nfunction Content({coupons, ...rest}) {\n if (coupons.length === 0) {\n return (\n <div className='empty'>\n <p>暂无可使用的优惠券</p>\n </div>\n )\n }\n return (\n <ul>\n {\n coupons.map(item => {\n return (\n <Coupon\n key={item.id}\n {...item}\n id={item.id}\n {...rest}\n />\n )\n })\n }\n </ul>\n )\n}\n\nexport default WithFullSize(UseCoupon);"],"sourceRoot":""}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{762:function(e,a,t){},768:function(e,a,t){"use strict";t.r(a);t(26);var n=t(2),c=t.n(n),r=t(4),s=t(5),m=t(8),i=t(6),o=t(7),l=(t(166),t(84)),d=t.n(l),u=t(0),p=t.n(u),E=(t(762),t(18)),f=t(105),N=t(1),b=t(13),v=d.a.alert,_=function(e){function a(e){var t;return Object(r.a)(this,a),(t=Object(m.a)(this,Object(i.a)(a).call(this,e))).getList=function(){N.d.get("".concat(N.a.home,"/m/my/orders/1/1")).then(function(e){200===e.data.code?t.setState({data:e.data.data}):c.a.info(e.data.msg,2)})},t.cancel=function(e){v("\u786e\u8ba4\u53d6\u6d88\u8ba2\u5355\uff1f","\u8ba2\u5355\u53d6\u6d88\u540e\uff0c\u4f18\u60e0\u5238\u548c\u62b5\u6263\u7684\u4f59\u989d\u4f1a\u8fd4\u56de\u5230\u60a8\u7684\u8d26\u6237\u3002",[{text:"\u53d6\u6d88",onPress:function(){return console.log("cancel")}},{text:"\u786e\u8ba4",onPress:function(){var a={order_id:e};N.d.post("".concat(N.a.home,"/m/cancel_order"),a).then(function(e){200===e.data.code?t.getList():c.a.info(e.data.msg,2)})}}])},t.state={data:[]},t}return Object(o.a)(a,e),Object(s.a)(a,[{key:"componentDidMount",value:function(){this.getList()}},{key:"render",value:function(){var e=this;return p.a.createElement("div",{className:"myorders-box"},p.a.createElement(E.e,{title:"\u6211\u7684\u8ba2\u5355",arrow:!0,cart:!1}),this.state.data&&this.state.data.length>0?this.state.data.map(function(a,t){return p.a.createElement("div",{className:"order-body",key:t},p.a.createElement(h,{item:a}),a.course&&a.course.length>0&&a.course.map(function(e,a){var t=p.a.createElement("div",{className:"order-info"},p.a.createElement("p",{className:"order-title text-overflow-one"},p.a.createElement(b.b,{to:"/detail?id=".concat(e.course_id)},e.course_title)),p.a.createElement("p",{className:"order-content text-overflow-2"},e.description),p.a.createElement("p",{className:"order-des"},p.a.createElement("span",{className:"order-newprice"},"\xa5",e.pay_amount),p.a.createElement("span",{className:"order-price"},"\xa5",e.price0)));return p.a.createElement("div",{className:"order-wrap",key:a},p.a.createElement(f.a,{info:t,src:e.image_name,id:e.course_id}))}),p.a.createElement(g,{item:a,cancel:e.cancel}))}):p.a.createElement("div",{className:"cart-tip"},p.a.createElement("p",{className:"cart-mess"},"\u60a8\u8fd8\u6ca1\u6709\u8ba2\u5355\u54e6\uff0c\u5feb\u53bb\u901b\u901b\u5427~"),p.a.createElement(b.b,{to:"/classify"},"\u53bb\u901b\u901b")))}}]),a}(u.Component);function h(e){var a;return a="0"===e.item.pay_time&&0===e.item.member_num?p.a.createElement("span",{className:"oid-status"},"\u7b49\u5f85\u652f\u4ed8"):e.item.member_num===e.item.pdd_info.length&&0!==e.item.member_num?p.a.createElement("span",{className:"oid-success"},"\u62fc\u56e2\u6210\u529f"):p.a.createElement("span",{className:"oid-success"},"\u652f\u4ed8\u6210\u529f"),p.a.createElement("div",{className:"order-head"},p.a.createElement("span",{className:"oid-num"},"\u8ba2\u5355\u53f7\uff1a",e.item.oid),a)}function g(e){return p.a.createElement("div",{className:"order-btm"},p.a.createElement("div",{className:"price-info"},p.a.createElement("p",null,p.a.createElement("span",{className:"payable"},"\u5e94\u4ed8\uff1a"),p.a.createElement("span",{className:"price"},"\xa5",e.item.pay_amount)),p.a.createElement("p",null,p.a.createElement("span",{className:"payable"},"\u5df2\u4f18\u60e0\uff1a"),p.a.createElement("span",{className:"price"},"\xa5",e.item.coupon_amount))),"0"===e.item.pay_time&&0===e.item.member_num&&p.a.createElement("div",{className:"btm-right"},p.a.createElement("button",{className:"cancel",onClick:function(a){return e.cancel(e.item.oid)}},"\u53d6\u6d88\u8ba2\u5355"),p.a.createElement(b.b,{to:"/payorder?oid=".concat(e.item.oid)},"\u53bb\u652f\u4ed8")),0!==e.item.member_num&&p.a.createElement("div",{className:"btm-right"},p.a.createElement("div",{className:"group"},e.item.pdd_info&&e.item.pdd_info.length>0&&e.item.pdd_info.map(function(e,a){return p.a.createElement("img",{src:""===e.user_avatar?"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/tinypng-spreadtrain8/ellipsis.png":e.user_avatar,key:a,alt:""})}))))}a.default=_}}]);
//# sourceMappingURL=myorders.64c84c4c.chunk.js.map
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{762:function(e,a,t){},768:function(e,a,t){"use strict";t.r(a);t(26);var n=t(2),c=t.n(n),r=t(3),s=t(4),m=t(7),i=t(5),o=t(6),l=(t(166),t(85)),d=t.n(l),u=t(0),p=t.n(u),E=(t(762),t(18)),f=t(105),N=t(1),b=t(11),v=d.a.alert,_=function(e){function a(e){var t;return Object(r.a)(this,a),(t=Object(m.a)(this,Object(i.a)(a).call(this,e))).getList=function(){N.d.get("".concat(N.a.home,"/m/my/orders/1/1")).then(function(e){200===e.data.code?t.setState({data:e.data.data}):c.a.info(e.data.msg,2)})},t.cancel=function(e){v("\u786e\u8ba4\u53d6\u6d88\u8ba2\u5355\uff1f","\u8ba2\u5355\u53d6\u6d88\u540e\uff0c\u4f18\u60e0\u5238\u548c\u62b5\u6263\u7684\u4f59\u989d\u4f1a\u8fd4\u56de\u5230\u60a8\u7684\u8d26\u6237\u3002",[{text:"\u53d6\u6d88",onPress:function(){return console.log("cancel")}},{text:"\u786e\u8ba4",onPress:function(){var a={order_id:e};N.d.post("".concat(N.a.home,"/m/cancel_order"),a).then(function(e){200===e.data.code?t.getList():c.a.info(e.data.msg,2)})}}])},t.state={data:[]},t}return Object(o.a)(a,e),Object(s.a)(a,[{key:"componentDidMount",value:function(){this.getList()}},{key:"render",value:function(){var e=this;return p.a.createElement("div",{className:"myorders-box"},p.a.createElement(E.e,{title:"\u6211\u7684\u8ba2\u5355",arrow:!0,cart:!1}),this.state.data&&this.state.data.length>0?this.state.data.map(function(a,t){return p.a.createElement("div",{className:"order-body",key:t},p.a.createElement(h,{item:a}),a.course&&a.course.length>0&&a.course.map(function(e,a){var t=p.a.createElement("div",{className:"order-info"},p.a.createElement("p",{className:"order-title text-overflow-one"},p.a.createElement(b.b,{to:"/detail?id=".concat(e.course_id)},e.course_title)),p.a.createElement("p",{className:"order-content text-overflow-2"},e.description),p.a.createElement("p",{className:"order-des"},p.a.createElement("span",{className:"order-newprice"},"\xa5",e.pay_amount),p.a.createElement("span",{className:"order-price"},"\xa5",e.price0)));return p.a.createElement("div",{className:"order-wrap",key:a},p.a.createElement(f.a,{info:t,src:e.image_name,id:e.course_id}))}),p.a.createElement(g,{item:a,cancel:e.cancel}))}):p.a.createElement("div",{className:"cart-tip"},p.a.createElement("p",{className:"cart-mess"},"\u60a8\u8fd8\u6ca1\u6709\u8ba2\u5355\u54e6\uff0c\u5feb\u53bb\u901b\u901b\u5427~"),p.a.createElement(b.b,{to:"/classify"},"\u53bb\u901b\u901b")))}}]),a}(u.Component);function h(e){var a;return a="0"===e.item.pay_time&&0===e.item.member_num?p.a.createElement("span",{className:"oid-status"},"\u7b49\u5f85\u652f\u4ed8"):e.item.member_num===e.item.pdd_info.length&&0!==e.item.member_num?p.a.createElement("span",{className:"oid-success"},"\u62fc\u56e2\u6210\u529f"):p.a.createElement("span",{className:"oid-success"},"\u652f\u4ed8\u6210\u529f"),p.a.createElement("div",{className:"order-head"},p.a.createElement("span",{className:"oid-num"},"\u8ba2\u5355\u53f7\uff1a",e.item.oid),a)}function g(e){return p.a.createElement("div",{className:"order-btm"},p.a.createElement("div",{className:"price-info"},p.a.createElement("p",null,p.a.createElement("span",{className:"payable"},"\u5e94\u4ed8\uff1a"),p.a.createElement("span",{className:"price"},"\xa5",e.item.pay_amount)),p.a.createElement("p",null,p.a.createElement("span",{className:"payable"},"\u5df2\u4f18\u60e0\uff1a"),p.a.createElement("span",{className:"price"},"\xa5",e.item.coupon_amount))),"0"===e.item.pay_time&&0===e.item.member_num&&p.a.createElement("div",{className:"btm-right"},p.a.createElement("button",{className:"cancel",onClick:function(a){return e.cancel(e.item.oid)}},"\u53d6\u6d88\u8ba2\u5355"),p.a.createElement(b.b,{to:"/payorder?oid=".concat(e.item.oid)},"\u53bb\u652f\u4ed8")),0!==e.item.member_num&&p.a.createElement("div",{className:"btm-right"},p.a.createElement("div",{className:"group"},e.item.pdd_info&&e.item.pdd_info.length>0&&e.item.pdd_info.map(function(e,a){return p.a.createElement("img",{src:""===e.user_avatar?"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/tinypng-spreadtrain8/ellipsis.png":e.user_avatar,key:a,alt:""})}))))}a.default=_}}]);
//# sourceMappingURL=myorders.5e3c8a18.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["components/myOrders/index.js"],"names":["alert","antd_mobile_lib_modal__WEBPACK_IMPORTED_MODULE_8___default","a","MyOrders","props","_this","Object","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__","this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__","call","getList","http","get","concat","api","home","then","res","data","code","setState","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_1___default","info","msg","cancel","oid","text","onPress","console","log","order_id","post","state","_this2","react__WEBPACK_IMPORTED_MODULE_9___default","createElement","className","_common__WEBPACK_IMPORTED_MODULE_11__","title","arrow","cart","length","map","item","index","key","OrderInfo","course","Info","react_router_dom__WEBPACK_IMPORTED_MODULE_14__","to","course_id","course_title","description","pay_amount","price0","_common_OrderList__WEBPACK_IMPORTED_MODULE_12__","src","image_name","id","PayInfo","Component","btn","pay_time","member_num","pdd_info","coupon_amount","onClick","event","user_avatar","alt"],"mappings":"uQAQMA,EAAQC,EAAAC,EAAMF,MAGdG,cACF,SAAAA,EAAYC,GAAO,IAAAC,EAAA,OAAAC,OAAAC,EAAA,EAAAD,CAAAE,KAAAL,IACfE,EAAAC,OAAAG,EAAA,EAAAH,CAAAE,KAAAF,OAAAI,EAAA,EAAAJ,CAAAH,GAAAQ,KAAAH,KAAMJ,KAWVQ,QAAU,WACNC,IAAKC,IAAL,GAAAC,OAAYC,IAAIC,KAAhB,qBAAyCC,KAAK,SAACC,GACrB,MAAlBA,EAAIC,KAAKC,KACThB,EAAKiB,SAAS,CACVF,KAAMD,EAAIC,KAAKA,OAGn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AAlC,EAAAmC,cAAA,QAAMC,UAAU,SAAhB,OAA0BlC,EAAMyC,KAAKW,aAEzCpB,EAAAlC,EAAAmC,cAAA,SACID,EAAAlC,EAAAmC,cAAA,QAAMC,UAAU,WAAhB,4BACAF,EAAAlC,EAAAmC,cAAA,QAAMC,UAAU,SAAhB,OAA0BlC,EAAMyC,KAAKuB,iBAKjB,MAAxBhE,EAAMyC,KAAKoB,UAA8C,IAA1B7D,EAAMyC,KAAKqB,YAC1C9B,EAAAlC,EAAAmC,cAAA,OAAKC,UAAU,aACXF,EAAAlC,EAAAmC,cAAA,UAAQC,UAAU,SAAS+B,QAAS,SAAAC,GAAK,OAAIlE,EAAMsB,OAAOtB,EAAMyC,KAAKlB,OAArE,4BACAS,EAAAlC,EAAAmC,cAACc,EAAA,EAAD,CAAMC,GAAE,iBAAArC,OAAmBX,EAAMyC,KAAKlB,MAAtC,uBAKsB,IAA1BvB,EAAMyC,KAAKqB,YACX9B,EAAAlC,EAAAmC,cAAA,OAAKC,UAAU,aACXF,EAAAlC,EAAAmC,cAAA,OAAKC,UAAU,SAEPlC,EAAMyC,KAAKsB,UAAY/D,EAAMyC,KAAKsB,SAASxB,OAAS,GAAKvC,EAAMyC,KAAKsB,SAASvB,IAAI,SAACC,EAAMC,GACpF,OACIV,EAAAlC,EAAAmC,cAAA,OACIsB,IAA0B,KAArBd,EAAK0B,YAAqB,oFAAsF1B,EAAK0B,YAC1HxB,IAAKD,EAAO0B,IAAI,UAWzCrE","file":"static/js/myorders.64c84c4c.chunk.js","sourcesContent":["import React, {Component} from 'react'\nimport './index.scss'\nimport {HeaderBar} from '../../common'\nimport OrderList from '@/common/OrderList'\nimport {http, api} from \"@/utils\"\nimport {Link} from 'react-router-dom'\nimport {Modal, Toast} from 'antd-mobile'\n\nconst alert = Modal.alert;\n\n\nclass MyOrders extends Component {\n constructor(props) {\n super(props)\n this.state = {\n data: []\n }\n }\n\n componentDidMount() {\n this.getList()\n }\n\n // 获取订单\n getList = () => {\n http.get(`${api.home}/m/my/orders/1/1`,).then((res) => {\n if (res.data.code === 200) {\n this.setState({\n data: res.data.data\n })\n } else {\n Toast.info(res.data.msg, 2);\n }\n })\n }\n\n // 取消订单\n cancel = (oid) => {\n alert('确认取消订单?', '订单取消后,优惠券和抵扣的余额会返回到您的账户。', [\n {text: '取消', onPress: () => console.log('cancel')},\n {\n text: '确认',\n onPress: () => {\n let data = {\n order_id: oid\n }\n http.post(`${api.home}/m/cancel_order`, data).then((res) => {\n if (res.data.code === 200) {\n this.getList()\n } else {\n Toast.info(res.data.msg, 2);\n }\n })\n }\n }\n ])\n }\n\n\n render() {\n\n return (\n <div className='myorders-box'>\n <HeaderBar title='我的订单' arrow={true} cart={false}></HeaderBar>\n {\n this.state.data && this.state.data.length > 0 ?\n this.state.data.map((item, index) => {\n return (\n <div className=\"order-body\" key={index}>\n <OrderInfo item={item}/>\n {\n item.course && item.course.length > 0 && item.course.map((item, index) => {\n const Info = (\n <div className=\"order-info\">\n <p className='order-title text-overflow-one'>\n <Link\n to={`/detail?id=${item.course_id}`}>{item.course_title}</Link>\n </p>\n <p className='order-content text-overflow-2'>{item.description}</p>\n <p className='order-des'>\n <span className='order-newprice'>¥{item.pay_amount}</span>\n <span className='order-price'>¥{item.price0}</span>\n </p>\n </div>\n )\n return (\n <div className=\"order-wrap\" key={index}>\n <OrderList info={Info} src={item.image_name}\n id={item.course_id}></OrderList>\n </div>\n )\n })\n }\n\n <PayInfo item={item} cancel={this.cancel}/>\n </div>\n )\n }) : <div className=\"cart-tip\">\n <p className='cart-mess'>您还没有订单哦,快去逛逛吧~</p>\n <Link to='/classify'>去逛逛</Link>\n </div>\n }\n\n </div>\n )\n }\n}\n\n\nfunction OrderInfo(props) {\n let btn\n if (props.item.pay_time === '0' && props.item.member_num === 0) {\n btn = <span className='oid-status'>等待支付</span>\n } else if ((props.item.member_num === props.item.pdd_info.length) && props.item.member_num !== 0) {\n btn = <span className='oid-success'>拼团成功</span>\n } else {\n btn = <span className='oid-success'>支付成功</span>\n }\n return (\n <div className='order-head'>\n <span className='oid-num'>订单号:{props.item.oid}</span>\n {btn}\n </div>\n )\n}\n\nfunction PayInfo(props) {\n return (\n <div className='order-btm'>\n <div className='price-info'>\n <p>\n <span className='payable'>应付:</span>\n <span className='price'>¥{props.item.pay_amount}</span>\n </p>\n <p>\n <span className='payable'>已优惠:</span>\n <span className='price'>¥{props.item.coupon_amount}</span>\n </p>\n </div>\n\n {\n props.item.pay_time === '0' && props.item.member_num === 0 &&\n <div className='btm-right'>\n <button className='cancel' onClick={event => props.cancel(props.item.oid)}>取消订单</button>\n <Link to={`/payorder?oid=${props.item.oid}`}>去支付</Link>\n </div>\n }\n\n {\n props.item.member_num !== 0 &&\n <div className='btm-right'>\n <div className=\"group\">\n {\n props.item.pdd_info && props.item.pdd_info.length > 0 && props.item.pdd_info.map((item, index) => {\n return (\n <img\n src={item.user_avatar === '' ? 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/tinypng-spreadtrain8/ellipsis.png' : item.user_avatar}\n key={index} alt=\"\"/>\n )\n })\n }\n </div>\n </div>\n }\n </div>\n )\n}\n\nexport default MyOrders\n"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["components/myOrders/index.js"],"names":["alert","antd_mobile_lib_modal__WEBPACK_IMPORTED_MODULE_8___default","a","MyOrders","props","_this","Object","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__","this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__","call","getList","http","get","concat","api","home","then","res","data","code","setState","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_1___default","info","msg","cancel","oid","text","onPress","console","log","order_id","post","state","_this2","react__WEBPACK_IMPORTED_MODULE_9___default","createElement","className","_common__WEBPACK_IMPORTED_MODULE_11__","title","arrow","cart","length","map","item","index","key","OrderInfo","course","Info","react_router_dom__WEBPACK_IMPORTED_MODULE_14__","to","course_id","course_title","description","pay_amount","price0","_common_OrderList__WEBPACK_IMPORTED_MODULE_12__","src","image_name","id","PayInfo","Component","btn","pay_time","member_num","pdd_info","coupon_amount","onClick","event","user_avatar","alt"],"mappings":"uQAQMA,EAAQC,EAAAC,EAAMF,MAGdG,cACF,SAAAA,EAAYC,GAAO,IAAAC,EAAA,OAAAC,OAAAC,EAAA,EAAAD,CAAAE,KAAAL,IACfE,EAAAC,OAAAG,EAAA,EAAAH,CAAAE,KAAAF,OAAAI,EAAA,EAAAJ,CAAAH,GAAAQ,KAAAH,KAAMJ,KAWVQ,QAAU,WACNC,IAAKC,IAAL,GAAAC,OAAYC,IAAIC,KAAhB,qBAAyCC,KAAK,SAACC,GACrB,MAAlBA,EAAIC,KAAKC,KACThB,EAAKiB,SAAS,CACVF,KAAMD,EAAIC,KAAKA,OAGnBG,EAAArB,EAAMsB,KAAKL,EAAIC,KAAKK,IAAK,MAnBlBpB,EAyBnBqB,OAAS,SAACC,GACN3B,EAAM,6CAAW,mJAA4B,CACzC,CAAC4B,KAAM,eAAMC,QAAS,kBAAMC,QAAQC,IAAI,YACxC,CACIH,KAAM,eACNC,QAAS,WACL,IAAIT,EAAO,CACPY,SAAUL,GAEdd,IAAKoB,KAAL,GAAAlB,OAAaC,IAAIC,KAAjB,mBAAwCG,GAAMF,KAAK,SAACC,GAC1B,MAAlBA,EAAIC,KAAKC,KACThB,EAAKO,UAELW,EAAArB,EAAMsB,KAAKL,EAAIC,KAAKK,IAAK,UApC7CpB,EAAK6B,MAAQ,CACTd,KAAM,IAHKf,mFAQfG,KAAKI,2CAuCA,IAAAuB,EAAA3B,KAEL,OACI4B,EAAAlC,EAAAmC,cAAA,OAAKC,UAAU,gBACXF,EAAAlC,EAAAmC,cAACE,EAAA,EAAD,CAA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AAKqB,YACX9B,EAAAlC,EAAAmC,cAAA,OAAKC,UAAU,aACXF,EAAAlC,EAAAmC,cAAA,OAAKC,UAAU,SAEPlC,EAAMyC,KAAKsB,UAAY/D,EAAMyC,KAAKsB,SAASxB,OAAS,GAAKvC,EAAMyC,KAAKsB,SAASvB,IAAI,SAACC,EAAMC,GACpF,OACIV,EAAAlC,EAAAmC,cAAA,OACIsB,IAA0B,KAArBd,EAAK0B,YAAqB,oFAAsF1B,EAAK0B,YAC1HxB,IAAKD,EAAO0B,IAAI,UAWzCrE","file":"static/js/myorders.5e3c8a18.chunk.js","sourcesContent":["import React, {Component} from 'react'\nimport './index.scss'\nimport {HeaderBar} from '../../common'\nimport OrderList from '@/common/OrderList'\nimport {http, api} from \"@/utils\"\nimport {Link} from 'react-router-dom'\nimport {Modal, Toast} from 'antd-mobile'\n\nconst alert = Modal.alert;\n\n\nclass MyOrders extends Component {\n constructor(props) {\n super(props)\n this.state = {\n data: []\n }\n }\n\n componentDidMount() {\n this.getList()\n }\n\n // 获取订单\n getList = () => {\n http.get(`${api.home}/m/my/orders/1/1`,).then((res) => {\n if (res.data.code === 200) {\n this.setState({\n data: res.data.data\n })\n } else {\n Toast.info(res.data.msg, 2);\n }\n })\n }\n\n // 取消订单\n cancel = (oid) => {\n alert('确认取消订单?', '订单取消后,优惠券和抵扣的余额会返回到您的账户。', [\n {text: '取消', onPress: () => console.log('cancel')},\n {\n text: '确认',\n onPress: () => {\n let data = {\n order_id: oid\n }\n http.post(`${api.home}/m/cancel_order`, data).then((res) => {\n if (res.data.code === 200) {\n this.getList()\n } else {\n Toast.info(res.data.msg, 2);\n }\n })\n }\n }\n ])\n }\n\n\n render() {\n\n return (\n <div className='myorders-box'>\n <HeaderBar title='我的订单' arrow={true} cart={false}></HeaderBar>\n {\n this.state.data && this.state.data.length > 0 ?\n this.state.data.map((item, index) => {\n return (\n <div className=\"order-body\" key={index}>\n <OrderInfo item={item}/>\n {\n item.course && item.course.length > 0 && item.course.map((item, index) => {\n const Info = (\n <div className=\"order-info\">\n <p className='order-title text-overflow-one'>\n <Link\n to={`/detail?id=${item.course_id}`}>{item.course_title}</Link>\n </p>\n <p className='order-content text-overflow-2'>{item.description}</p>\n <p className='order-des'>\n <span className='order-newprice'>¥{item.pay_amount}</span>\n <span className='order-price'>¥{item.price0}</span>\n </p>\n </div>\n )\n return (\n <div className=\"order-wrap\" key={index}>\n <OrderList info={Info} src={item.image_name}\n id={item.course_id}></OrderList>\n </div>\n )\n })\n }\n\n <PayInfo item={item} cancel={this.cancel}/>\n </div>\n )\n }) : <div className=\"cart-tip\">\n <p className='cart-mess'>您还没有订单哦,快去逛逛吧~</p>\n <Link to='/classify'>去逛逛</Link>\n </div>\n }\n\n </div>\n )\n }\n}\n\n\nfunction OrderInfo(props) {\n let btn\n if (props.item.pay_time === '0' && props.item.member_num === 0) {\n btn = <span className='oid-status'>等待支付</span>\n } else if ((props.item.member_num === props.item.pdd_info.length) && props.item.member_num !== 0) {\n btn = <span className='oid-success'>拼团成功</span>\n } else {\n btn = <span className='oid-success'>支付成功</span>\n }\n return (\n <div className='order-head'>\n <span className='oid-num'>订单号:{props.item.oid}</span>\n {btn}\n </div>\n )\n}\n\nfunction PayInfo(props) {\n return (\n <div className='order-btm'>\n <div className='price-info'>\n <p>\n <span className='payable'>应付:</span>\n <span className='price'>¥{props.item.pay_amount}</span>\n </p>\n <p>\n <span className='payable'>已优惠:</span>\n <span className='price'>¥{props.item.coupon_amount}</span>\n </p>\n </div>\n\n {\n props.item.pay_time === '0' && props.item.member_num === 0 &&\n <div className='btm-right'>\n <button className='cancel' onClick={event => props.cancel(props.item.oid)}>取消订单</button>\n <Link to={`/payorder?oid=${props.item.oid}`}>去支付</Link>\n </div>\n }\n\n {\n props.item.member_num !== 0 &&\n <div className='btm-right'>\n <div className=\"group\">\n {\n props.item.pdd_info && props.item.pdd_info.length > 0 && props.item.pdd_info.map((item, index) => {\n return (\n <img\n src={item.user_avatar === '' ? 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/tinypng-spreadtrain8/ellipsis.png' : item.user_avatar}\n key={index} alt=\"\"/>\n )\n })\n }\n </div>\n </div>\n }\n </div>\n )\n}\n\nexport default MyOrders\n"],"sourceRoot":""}
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{763:function(e,t,a){},769:function(e,t,a){"use strict";a.r(t);a(26);var c=a(2),n=a.n(c),s=a(4),i=a(5),r=a(8),o=a(6),l=a(7),d=a(0),m=a.n(d),u=(a(763),a(18)),p=a(1),f=a(13),h=a(20),b=function(e){function t(e){var a;return Object(s.a)(this,t),(a=Object(r.a)(this,Object(o.a)(t).call(this,e))).getList=function(){p.d.get("".concat(p.a.home,"/m/my/courses")).then(function(e){200===e.data.code?a.setState({data:e.data.data}):n.a.info(e.data.msg,2)})},a.state={data:[]},a}return Object(l.a)(t,e),Object(i.a)(t,[{key:"componentDidMount",value:function(){this.getList()}},{key:"render",value:function(){var e=this.props.user,t=e&&e.data&&e.data.uid;return m.a.createElement("div",{className:"purchased-box"},m.a.createElement(u.e,{title:"\u5df2\u8d2d\u8bfe\u7a0b",arrow:!0,cart:!1}),this.state.data&&this.state.data.length>0?m.a.createElement("div",{className:"purchased-body"},m.a.createElement("div",{className:"tip"},"\u52a0\u7fa4\u8bf7\u5907\u6ce8\u60a8\u7684\u5b66\u53f7\uff1a",t),this.state.data.map(function(e,t){var a=m.a.createElement("div",{className:"info"},m.a.createElement("p",{className:"title"},m.a.createElement(f.b,{to:"/detail?id=".concat(e.course_id)},e.course_title)),m.a.createElement("p",{className:"contact text-overflow-2"},e.simpledescription),m.a.createElement("div",{className:"des"},"QQ\u7fa4\uff1a",e.course_qq));return m.a.createElement(u.i,{key:t,img:e.image_name,id:e.course_id,info:a})})):m.a.createElement("div",{className:"cart-tip"},m.a.createElement("p",{className:"cart-mess"},"\u60a8\u8fd8\u6ca1\u6709\u8bfe\u7a0b\u54e6\uff0c\u5feb\u53bb\u901b\u901b\u5427~"),m.a.createElement(f.b,{to:"/classify"},"\u53bb\u901b\u901b")))}}]),t}(d.Component);t.default=Object(h.b)(function(e){return{user:e.user}},null)(b)}}]);
//# sourceMappingURL=purchased.587ba463.chunk.js.map
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{763:function(e,t,a){},769:function(e,t,a){"use strict";a.r(t);a(26);var c=a(2),n=a.n(c),s=a(3),i=a(4),r=a(7),o=a(5),l=a(6),d=a(0),m=a.n(d),u=(a(763),a(18)),p=a(1),f=a(11),h=a(19),b=function(e){function t(e){var a;return Object(s.a)(this,t),(a=Object(r.a)(this,Object(o.a)(t).call(this,e))).getList=function(){p.d.get("".concat(p.a.home,"/m/my/courses")).then(function(e){200===e.data.code?a.setState({data:e.data.data}):n.a.info(e.data.msg,2)})},a.state={data:[]},a}return Object(l.a)(t,e),Object(i.a)(t,[{key:"componentDidMount",value:function(){this.getList()}},{key:"render",value:function(){var e=this.props.user,t=e&&e.data&&e.data.uid;return m.a.createElement("div",{className:"purchased-box"},m.a.createElement(u.e,{title:"\u5df2\u8d2d\u8bfe\u7a0b",arrow:!0,cart:!1}),this.state.data&&this.state.data.length>0?m.a.createElement("div",{className:"purchased-body"},m.a.createElement("div",{className:"tip"},"\u52a0\u7fa4\u8bf7\u5907\u6ce8\u60a8\u7684\u5b66\u53f7\uff1a",t),this.state.data.map(function(e,t){var a=m.a.createElement("div",{className:"info"},m.a.createElement("p",{className:"title"},m.a.createElement(f.b,{to:"/detail?id=".concat(e.course_id)},e.course_title)),m.a.createElement("p",{className:"contact text-overflow-2"},e.simpledescription),m.a.createElement("div",{className:"des"},"QQ\u7fa4\uff1a",e.course_qq));return m.a.createElement(u.i,{key:t,img:e.image_name,id:e.course_id,info:a})})):m.a.createElement("div",{className:"cart-tip"},m.a.createElement("p",{className:"cart-mess"},"\u60a8\u8fd8\u6ca1\u6709\u8bfe\u7a0b\u54e6\uff0c\u5feb\u53bb\u901b\u901b\u5427~"),m.a.createElement(f.b,{to:"/classify"},"\u53bb\u901b\u901b")))}}]),t}(d.Component);t.default=Object(h.b)(function(e){return{user:e.user}},null)(b)}}]);
//# sourceMappingURL=purchased.67f363d4.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["components/purchased/index.js"],"names":["Purchased","props","_this","Object","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__","this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__","call","getList","http","get","concat","api","home","then","res","data","code","setState","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_1___default","a","info","msg","state","user","uid","react__WEBPACK_IMPORTED_MODULE_7___default","createElement","className","_common__WEBPACK_IMPORTED_MODULE_9__","title","arrow","cart","length","map","item","index","Info","react_router_dom__WEBPACK_IMPORTED_MODULE_11__","to","course_id","course_title","simpledescription","course_qq","key","img","image_name","id","Component","connect"],"mappings":"4OASMA,cACF,SAAAA,EAAYC,GAAO,IAAAC,EAAA,OAAAC,OAAAC,EAAA,EAAAD,CAAAE,KAAAL,IACfE,EAAAC,OAAAG,EAAA,EAAAH,CAAAE,KAAAF,OAAAI,EAAA,EAAAJ,CAAAH,GAAAQ,KAAAH,KAAMJ,KAWVQ,QAAU,WACNC,IAAKC,IAAL,GAAAC,OAAYC,IAAIC,KAAhB,kBAAsCC,KAAK,SAACC,GAClB,MAAlBA,EAAIC,KAAKC,KACThB,EAAKiB,SAAS,CACVF,KAAMD,EAAIC,KAAKA,OAGnBG,EAAAC,EAAMC,KAAKN,EAAIC,KAAKM,IAAK,MAjBjCrB,EAAKsB,MAAQ,CACTP,KAAM,IAHKf,mFAQfG,KAAKI,2CAiBA,IACEgB,EAAQpB,KAAKJ,MAAbwB,KACDC,EAAMD,GAAQA,EAAKR,MAAQQ,EAAKR,KAAKS,IAC3C,OACIC,EAAAN,EAAAO,cAAA,OAAKC,UAAU,iBACXF,EAAAN,EAAAO,cAACE,EAAA,EAAD,CAAWC,MAAM,2BAAOC,OAAO,EAAMC,MAAM,IAEvC5B,KAAKmB,MAAMP,MAAQZ,KAAKmB,MAAMP,KAAKiB,OAAS,EACxCP,EAAAN,EAAAO,cAAA,OAAKC,UAAU,kBACXF,EAAAN,EAAAO,cAAA,OAAKC,UAAU,OAAf,+DAAgCH,GAE5BrB,KAAKmB,MAAMP,KAAKkB,IAAI,SAACC,EAAMC,GACvB,IAAMC,EACFX,EAAAN,EAAAO,cAAA,OAAKC,UAAU,QACXF,EAAAN,EAAAO,cAAA,KAAGC,UAAU,SACTF,EAAAN,EAAAO,cAACW,EAAA,EAAD,CAAMC,GAAE,cAAA5B,OAAgBwB,EAAKK,YACxBL,EAAKM,eAGdf,EAAAN,EAAAO,cAAA,KAAGC,UAAU,2BAA2BO,EAAKO,mBAC7ChB,EAAAN,EAAAO,cAAA,OAAKC,UAAU,OAAf,iBACSO,EAAKQ,YAItB,OACIjB,EAAAN,EAAAO,cAACE,EAAA,EAAD,CAAOe,IAAKR,EAAOS,IAAKV,EAAKW,WACtBC,GAAIZ,EAAKK,UACTnB,KAAMgB,OAK3BX,EAAAN,EAAAO,cAAA,OAAKC,UAAU,YACbF,EAAAN,EAAAO,cAAA,KAAGC,UAAU,aAAb,mFACAF,EAAAN,EAAAO,cAACW,EAAA,EAAD,CAAMC,GAAG,aAAT,+BA7DJS,aAsETC,sBACX,SAAA1B,GAAK,MAAK,CAACC,KAAMD,EAAMC,OACvB,KAFWyB,CAGblD","file":"static/js/purchased.587ba463.chunk.js","sourcesContent":["import React, {Component} from 'react';\nimport './index.scss';\nimport {HeaderBar} from '../../common'\nimport {VList} from '../../common'\nimport {http, api} from \"@/utils\";\nimport {Link} from 'react-router-dom'\nimport {Toast} from 'antd-mobile'\nimport {connect} from \"react-redux\"\n\nclass Purchased extends Component {\n constructor(props) {\n super(props)\n this.state = {\n data: []\n }\n }\n\n componentDidMount() {\n this.getList()\n }\n\n // 获取订单\n getList = () => {\n http.get(`${api.home}/m/my/courses`,).then((res) => {\n if (res.data.code === 200) {\n this.setState({\n data: res.data.data\n })\n } else {\n Toast.info(res.data.msg, 2);\n }\n })\n }\n\n\n render() {\n const {user} = this.props\n const uid = user && user.data && user.data.uid\n return (\n <div className='purchased-box'>\n <HeaderBar title='已购课程' arrow={true} cart={false}></HeaderBar>\n {\n this.state.data && this.state.data.length > 0 ?\n <div className=\"purchased-body\">\n <div className='tip'>加群请备注您的学号:{uid}</div>\n {\n this.state.data.map((item, index) => {\n const Info = (\n <div className=\"info\">\n <p className='title'>\n <Link to={`/detail?id=${item.course_id}`}>\n {item.course_title}\n </Link>\n </p>\n <p className='contact text-overflow-2'>{item.simpledescription}</p>\n <div className='des'>\n QQ群:{item.course_qq}\n </div>\n </div>\n )\n return (\n <VList key={index} img={item.image_name}\n id={item.course_id}\n info={Info}></VList>\n )\n })\n }\n </div>\n : <div className=\"cart-tip\">\n <p className='cart-mess'>您还没有课程哦,快去逛逛吧~</p>\n <Link to='/classify'>去逛逛</Link>\n </div>\n }\n\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({user: state.user}),\n null\n)(Purchased)\n"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["components/purchased/index.js"],"names":["Purchased","props","_this","Object","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__","this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__","call","getList","http","get","concat","api","home","then","res","data","code","setState","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_1___default","a","info","msg","state","user","uid","react__WEBPACK_IMPORTED_MODULE_7___default","createElement","className","_common__WEBPACK_IMPORTED_MODULE_9__","title","arrow","cart","length","map","item","index","Info","react_router_dom__WEBPACK_IMPORTED_MODULE_11__","to","course_id","course_title","simpledescription","course_qq","key","img","image_name","id","Component","connect"],"mappings":"4OASMA,cACF,SAAAA,EAAYC,GAAO,IAAAC,EAAA,OAAAC,OAAAC,EAAA,EAAAD,CAAAE,KAAAL,IACfE,EAAAC,OAAAG,EAAA,EAAAH,CAAAE,KAAAF,OAAAI,EAAA,EAAAJ,CAAAH,GAAAQ,KAAAH,KAAMJ,KAWVQ,QAAU,WACNC,IAAKC,IAAL,GAAAC,OAAYC,IAAIC,KAAhB,kBAAsCC,KAAK,SAACC,GAClB,MAAlBA,EAAIC,KAAKC,KACThB,EAAKiB,SAAS,CACVF,KAAMD,EAAIC,KAAKA,OAGnBG,EAAAC,EAAMC,KAAKN,EAAIC,KAAKM,IAAK,MAjBjCrB,EAAKsB,MAAQ,CACTP,KAAM,IAHKf,mFAQfG,KAAKI,2CAiBA,IACEgB,EAAQpB,KAAKJ,MAAbwB,KACDC,EAAMD,GAAQA,EAAKR,MAAQQ,EAAKR,KAAKS,IAC3C,OACIC,EAAAN,EAAAO,cAAA,OAAKC,UAAU,iBACXF,EAAAN,EAAAO,cAACE,EAAA,EAAD,CAAWC,MAAM,2BAAOC,OAAO,EAAMC,MAAM,IAEvC5B,KAAKmB,MAAMP,MAAQZ,KAAKmB,MAAMP,KAAKiB,OAAS,EACxCP,EAAAN,EAAAO,cAAA,OAAKC,UAAU,kBACXF,EAAAN,EAAAO,cAAA,OAAKC,UAAU,OAAf,+DAAgCH,GAE5BrB,KAAKmB,MAAMP,KAAKkB,IAAI,SAACC,EAAMC,GACvB,IAAMC,EACFX,EAAAN,EAAAO,cAAA,OAAKC,UAAU,QACXF,EAAAN,EAAAO,cAAA,KAAGC,UAAU,SACTF,EAAAN,EAAAO,cAACW,EAAA,EAAD,CAAMC,GAAE,cAAA5B,OAAgBwB,EAAKK,YACxBL,EAAKM,eAGdf,EAAAN,EAAAO,cAAA,KAAGC,UAAU,2BAA2BO,EAAKO,mBAC7ChB,EAAAN,EAAAO,cAAA,OAAKC,UAAU,OAAf,iBACSO,EAAKQ,YAItB,OACIjB,EAAAN,EAAAO,cAACE,EAAA,EAAD,CAAOe,IAAKR,EAAOS,IAAKV,EAAKW,WACtBC,GAAIZ,EAAKK,UACTnB,KAAMgB,OAK3BX,EAAAN,EAAAO,cAAA,OAAKC,UAAU,YACbF,EAAAN,EAAAO,cAAA,KAAGC,UAAU,aAAb,mFACAF,EAAAN,EAAAO,cAACW,EAAA,EAAD,CAAMC,GAAG,aAAT,+BA7DJS,aAsETC,sBACX,SAAA1B,GAAK,MAAK,CAACC,KAAMD,EAAMC,OACvB,KAFWyB,CAGblD","file":"static/js/purchased.67f363d4.chunk.js","sourcesContent":["import React, {Component} from 'react';\nimport './index.scss';\nimport {HeaderBar} from '../../common'\nimport {VList} from '../../common'\nimport {http, api} from \"@/utils\";\nimport {Link} from 'react-router-dom'\nimport {Toast} from 'antd-mobile'\nimport {connect} from \"react-redux\"\n\nclass Purchased extends Component {\n constructor(props) {\n super(props)\n this.state = {\n data: []\n }\n }\n\n componentDidMount() {\n this.getList()\n }\n\n // 获取订单\n getList = () => {\n http.get(`${api.home}/m/my/courses`,).then((res) => {\n if (res.data.code === 200) {\n this.setState({\n data: res.data.data\n })\n } else {\n Toast.info(res.data.msg, 2);\n }\n })\n }\n\n\n render() {\n const {user} = this.props\n const uid = user && user.data && user.data.uid\n return (\n <div className='purchased-box'>\n <HeaderBar title='已购课程' arrow={true} cart={false}></HeaderBar>\n {\n this.state.data && this.state.data.length > 0 ?\n <div className=\"purchased-body\">\n <div className='tip'>加群请备注您的学号:{uid}</div>\n {\n this.state.data.map((item, index) => {\n const Info = (\n <div className=\"info\">\n <p className='title'>\n <Link to={`/detail?id=${item.course_id}`}>\n {item.course_title}\n </Link>\n </p>\n <p className='contact text-overflow-2'>{item.simpledescription}</p>\n <div className='des'>\n QQ群:{item.course_qq}\n </div>\n </div>\n )\n return (\n <VList key={index} img={item.image_name}\n id={item.course_id}\n info={Info}></VList>\n )\n })\n }\n </div>\n : <div className=\"cart-tip\">\n <p className='cart-mess'>您还没有课程哦,快去逛逛吧~</p>\n <Link to='/classify'>去逛逛</Link>\n </div>\n }\n\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({user: state.user}),\n null\n)(Purchased)\n"],"sourceRoot":""}
\ No newline at end of file
!function(e){function t(t){for(var n,o,c=t[0],i=t[1],s=t[2],l=0,d=[];l<c.length;l++)o=c[l],a[o]&&d.push(a[o][0]),a[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(f&&f(t);d.length;)d.shift()();return u.push.apply(u,s||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(u.splice(t--,1),e=c(c.s=r[0]))}return e}var n={},o={4:0},a={4:0},u=[];function c(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{0:1,2:1,3:1,5:1,6:1,7:1,8:1,10:1}[e]&&t.push(o[e]=new Promise(function(t,r){for(var n="static/css/"+({0:"coupons",2:"myorders",3:"purchased",5:"shareposter",6:"study",7:"togroup",8:"video"}[e]||e)+"."+{0:"9ece7350",2:"3ab93c8e",3:"72c55bd6",5:"82081d02",6:"50a142e7",7:"49988cae",8:"10e4a7e1",10:"1597b3e9",11:"31d6cfe0"}[e]+".chunk.css",a=c.p+n,u=document.getElementsByTagName("link"),i=0;i<u.length;i++){var s=(f=u[i]).getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(s===n||s===a))return t()}var l=document.getElementsByTagName("style");for(i=0;i<l.length;i++){var f;if((s=(f=l[i]).getAttribute("data-href"))===n||s===a)return t()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onload=t,d.onerror=function(t){var n=t&&t.target&&t.target.src||a,u=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");u.request=n,delete o[e],d.parentNode.removeChild(d),r(u)},d.href=a,document.getElementsByTagName("head")[0].appendChild(d)}).then(function(){o[e]=0}));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=a[e]=[t,n]});t.push(r[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,c.nc&&i.setAttribute("nonce",c.nc),i.src=function(e){return c.p+"static/js/"+({0:"coupons",2:"myorders",3:"purchased",5:"shareposter",6:"study",7:"togroup",8:"video"}[e]||e)+"."+{0:"74915af0",2:"64c84c4c",3:"587ba463",5:"03babfdf",6:"fc72114b",7:"d6b233f8",8:"3d69c391",10:"98079aa4",11:"2e343155"}[e]+".chunk.js"}(e),u=function(t){i.onerror=i.onload=null,clearTimeout(s);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src,u=new Error("Loading chunk "+e+" failed.\n("+n+": "+o+")");u.type=n,u.request=o,r[1](u)}a[e]=void 0}};var s=setTimeout(function(){u({type:"timeout",target:i})},12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(t)},c.m=e,c.c=n,c.d=function(e,t,r){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(c.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(r,n,function(t){return e[t]}.bind(null,n));return r},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/",c.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var f=s;r()}([]);
//# sourceMappingURL=runtime~main.94d72f72.js.map
\ No newline at end of file
!function(e){function t(t){for(var n,o,c=t[0],i=t[1],s=t[2],l=0,d=[];l<c.length;l++)o=c[l],a[o]&&d.push(a[o][0]),a[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(f&&f(t);d.length;)d.shift()();return u.push.apply(u,s||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(u.splice(t--,1),e=c(c.s=r[0]))}return e}var n={},o={4:0},a={4:0},u=[];function c(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{0:1,2:1,3:1,5:1,6:1,7:1,8:1,10:1}[e]&&t.push(o[e]=new Promise(function(t,r){for(var n="static/css/"+({0:"coupons",2:"myorders",3:"purchased",5:"shareposter",6:"study",7:"togroup",8:"video"}[e]||e)+"."+{0:"9ece7350",2:"3ab93c8e",3:"72c55bd6",5:"82081d02",6:"50a142e7",7:"49988cae",8:"10e4a7e1",10:"1597b3e9",11:"31d6cfe0"}[e]+".chunk.css",a=c.p+n,u=document.getElementsByTagName("link"),i=0;i<u.length;i++){var s=(f=u[i]).getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(s===n||s===a))return t()}var l=document.getElementsByTagName("style");for(i=0;i<l.length;i++){var f;if((s=(f=l[i]).getAttribute("data-href"))===n||s===a)return t()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onload=t,d.onerror=function(t){var n=t&&t.target&&t.target.src||a,u=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");u.request=n,delete o[e],d.parentNode.removeChild(d),r(u)},d.href=a,document.getElementsByTagName("head")[0].appendChild(d)}).then(function(){o[e]=0}));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=a[e]=[t,n]});t.push(r[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,c.nc&&i.setAttribute("nonce",c.nc),i.src=function(e){return c.p+"static/js/"+({0:"coupons",2:"myorders",3:"purchased",5:"shareposter",6:"study",7:"togroup",8:"video"}[e]||e)+"."+{0:"5f48a873",2:"5e3c8a18",3:"67f363d4",5:"ec4e8c9b",6:"cb74c887",7:"2ba99ab5",8:"1cacaecc",10:"f8cb75f8",11:"2e343155"}[e]+".chunk.js"}(e),u=function(t){i.onerror=i.onload=null,clearTimeout(s);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src,u=new Error("Loading chunk "+e+" failed.\n("+n+": "+o+")");u.type=n,u.request=o,r[1](u)}a[e]=void 0}};var s=setTimeout(function(){u({type:"timeout",target:i})},12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(t)},c.m=e,c.c=n,c.d=function(e,t,r){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(c.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(r,n,function(t){return e[t]}.bind(null,n));return r},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/",c.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var f=s;r()}([]);
//# sourceMappingURL=runtime~main.d373fbce.js.map
\ No newline at end of file
{"version":3,"sources":["../webpack/bootstrap"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","installedCssChunks","4","exports","module","l","e","promises","0","2","3","5","6","7","8","10","Promise","resolve","reject","href","11","fullhref","p","existingLinkTags","document","getElementsByTagName","dataHref","tag","getAttribute","rel","existingStyleTags","linkTag","createElement","type","onload","onerror","event","request","target","src","err","Error","parentNode","removeChild","appendChild","then","installedChunkData","promise","onScriptComplete","script","charset","timeout","nc","setAttribute","jsonpScriptSrc","clearTimeout","chunk","errorType","realSrc","error","undefined","setTimeout","head","all","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","console","jsonpArray","window","oldJsonpFunction","slice"],"mappings":"aACA,SAAAA,EAAAC,GAQA,IAPA,IAMAC,EAAAC,EANAC,EAAAH,EAAA,GACAI,EAAAJ,EAAA,GACAK,EAAAL,EAAA,GAIAM,EAAA,EAAAC,EAAA,GACQD,EAAAH,EAAAK,OAAoBF,IAC5BJ,EAAAC,EAAAG,GACAG,EAAAP,IACAK,EAAAG,KAAAD,EAAAP,GAAA,IAEAO,EAAAP,GAAA,EAEA,IAAAD,KAAAG,EACAO,OAAAC,UAAAC,eAAAC,KAAAV,EAAAH,KACAc,EAAAd,GAAAG,EAAAH,IAKA,IAFAe,KAAAhB,GAEAO,EAAAC,QACAD,EAAAU,OAAAV,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A,WAExD9F,OAAAwF,eAAAnE,EAAA,cAAiDyE,OAAA,KAQjD9E,EAAA+E,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAA9E,EAAA8E,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,kBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAlG,OAAAmG,OAAA,MAGA,GAFAnF,EAAA2E,EAAAO,GACAlG,OAAAwF,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAA9E,EAAAoE,EAAAc,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAlF,EAAAsF,EAAA,SAAAhF,GACA,IAAAgE,EAAAhE,KAAA2E,WACA,WAA2B,OAAA3E,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAN,EAAAoE,EAAAE,EAAA,IAAAA,GACAA,GAIAtE,EAAAuE,EAAA,SAAAgB,EAAAC,GAAsD,OAAAxG,OAAAC,UAAAC,eAAAC,KAAAoG,EAAAC,IAGtDxF,EAAAwB,EAAA,IAGAxB,EAAAyF,GAAA,SAAA/C,GAA8D,MAApBgD,QAAA7B,MAAAnB,GAAoBA,GAE9D,IAAAiD,EAAAC,OAAA,aAAAA,OAAA,iBACAC,EAAAF,EAAA5G,KAAAsG,KAAAM,GACAA,EAAA5G,KAAAX,EACAuH,IAAAG,QACA,QAAAnH,EAAA,EAAgBA,EAAAgH,EAAA9G,OAAuBF,IAAAP,EAAAuH,EAAAhH,IACvC,IAAAU,EAAAwG,EAIApG","file":"static/js/runtime~main.94d72f72.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded CSS chunks\n \tvar installedCssChunks = {\n \t\t4: 0\n \t}\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t4: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"static/js/\" + ({\"0\":\"coupons\",\"2\":\"myorders\",\"3\":\"purchased\",\"5\":\"shareposter\",\"6\":\"study\",\"7\":\"togroup\",\"8\":\"video\"}[chunkId]||chunkId) + \".\" + {\"0\":\"74915af0\",\"2\":\"64c84c4c\",\"3\":\"587ba463\",\"5\":\"03babfdf\",\"6\":\"fc72114b\",\"7\":\"d6b233f8\",\"8\":\"3d69c391\",\"10\":\"98079aa4\",\"11\":\"2e343155\"}[chunkId] + \".chunk.js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// mini-css-extract-plugin CSS loading\n \t\tvar cssChunks = {\"0\":1,\"2\":1,\"3\":1,\"5\":1,\"6\":1,\"7\":1,\"8\":1,\"10\":1};\n \t\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n \t\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n \t\t\tpromises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {\n \t\t\t\tvar href = \"static/css/\" + ({\"0\":\"coupons\",\"2\":\"myorders\",\"3\":\"purchased\",\"5\":\"shareposter\",\"6\":\"study\",\"7\":\"togroup\",\"8\":\"video\"}[chunkId]||chunkId) + \".\" + {\"0\":\"9ece7350\",\"2\":\"3ab93c8e\",\"3\":\"72c55bd6\",\"5\":\"82081d02\",\"6\":\"50a142e7\",\"7\":\"49988cae\",\"8\":\"10e4a7e1\",\"10\":\"1597b3e9\",\"11\":\"31d6cfe0\"}[chunkId] + \".chunk.css\";\n \t\t\t\tvar fullhref = __webpack_require__.p + href;\n \t\t\t\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n \t\t\t\tfor(var i = 0; i < existingLinkTags.length; i++) {\n \t\t\t\t\tvar tag = existingLinkTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n \t\t\t\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return resolve();\n \t\t\t\t}\n \t\t\t\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n \t\t\t\tfor(var i = 0; i < existingStyleTags.length; i++) {\n \t\t\t\t\tvar tag = existingStyleTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\");\n \t\t\t\t\tif(dataHref === href || dataHref === fullhref) return resolve();\n \t\t\t\t}\n \t\t\t\tvar linkTag = document.createElement(\"link\");\n \t\t\t\tlinkTag.rel = \"stylesheet\";\n \t\t\t\tlinkTag.type = \"text/css\";\n \t\t\t\tlinkTag.onload = resolve;\n \t\t\t\tlinkTag.onerror = function(event) {\n \t\t\t\t\tvar request = event && event.target && event.target.src || fullhref;\n \t\t\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + request + \")\");\n \t\t\t\t\terr.request = request;\n \t\t\t\t\tdelete installedCssChunks[chunkId]\n \t\t\t\t\tlinkTag.parentNode.removeChild(linkTag)\n \t\t\t\t\treject(err);\n \t\t\t\t};\n \t\t\t\tlinkTag.href = fullhref;\n\n \t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n \t\t\t\thead.appendChild(linkTag);\n \t\t\t}).then(function() {\n \t\t\t\tinstalledCssChunks[chunkId] = 0;\n \t\t\t}));\n \t\t}\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\tvar error = new Error('Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')');\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["../webpack/bootstrap"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","installedCssChunks","4","exports","module","l","e","promises","0","2","3","5","6","7","8","10","Promise","resolve","reject","href","11","fullhref","p","existingLinkTags","document","getElementsByTagName","dataHref","tag","getAttribute","rel","existingStyleTags","linkTag","createElement","type","onload","onerror","event","request","target","src","err","Error","parentNode","removeChild","appendChild","then","installedChunkData","promise","onScriptComplete","script","charset","timeout","nc","setAttribute","jsonpScriptSrc","clearTimeout","chunk","errorType","realSrc","error","undefined","setTimeout","head","all","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","console","jsonpArray","window","oldJsonpFunction","slice"],"mappings":"aACA,SAAAA,EAAAC,GAQA,IAPA,IAMAC,EAAAC,EANAC,EAAAH,EAAA,GACAI,EAAAJ,EAAA,GACAK,EAAAL,EAAA,GAIAM,EAAA,EAAAC,EAAA,GACQD,EAAAH,EAAAK,OAAoBF,IAC5BJ,EAAAC,EAAAG,GACAG,EAAAP,IACAK,EAAAG,KAAAD,EAAAP,GAAA,IAEAO,EAAAP,GAAA,EAEA,IA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\tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded CSS chunks\n \tvar installedCssChunks = {\n \t\t4: 0\n \t}\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t4: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"static/js/\" + ({\"0\":\"coupons\",\"2\":\"myorders\",\"3\":\"purchased\",\"5\":\"shareposter\",\"6\":\"study\",\"7\":\"togroup\",\"8\":\"video\"}[chunkId]||chunkId) + \".\" + {\"0\":\"5f48a873\",\"2\":\"5e3c8a18\",\"3\":\"67f363d4\",\"5\":\"ec4e8c9b\",\"6\":\"cb74c887\",\"7\":\"2ba99ab5\",\"8\":\"1cacaecc\",\"10\":\"f8cb75f8\",\"11\":\"2e343155\"}[chunkId] + \".chunk.js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// mini-css-extract-plugin CSS loading\n \t\tvar cssChunks = {\"0\":1,\"2\":1,\"3\":1,\"5\":1,\"6\":1,\"7\":1,\"8\":1,\"10\":1};\n \t\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n \t\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n \t\t\tpromises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {\n \t\t\t\tvar href = \"static/css/\" + ({\"0\":\"coupons\",\"2\":\"myorders\",\"3\":\"purchased\",\"5\":\"shareposter\",\"6\":\"study\",\"7\":\"togroup\",\"8\":\"video\"}[chunkId]||chunkId) + \".\" + {\"0\":\"9ece7350\",\"2\":\"3ab93c8e\",\"3\":\"72c55bd6\",\"5\":\"82081d02\",\"6\":\"50a142e7\",\"7\":\"49988cae\",\"8\":\"10e4a7e1\",\"10\":\"1597b3e9\",\"11\":\"31d6cfe0\"}[chunkId] + \".chunk.css\";\n \t\t\t\tvar fullhref = __webpack_require__.p + href;\n \t\t\t\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n \t\t\t\tfor(var i = 0; i < existingLinkTags.length; i++) {\n \t\t\t\t\tvar tag = existingLinkTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n \t\t\t\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return resolve();\n \t\t\t\t}\n \t\t\t\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n \t\t\t\tfor(var i = 0; i < existingStyleTags.length; i++) {\n \t\t\t\t\tvar tag = existingStyleTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\");\n \t\t\t\t\tif(dataHref === href || dataHref === fullhref) return resolve();\n \t\t\t\t}\n \t\t\t\tvar linkTag = document.createElement(\"link\");\n \t\t\t\tlinkTag.rel = \"stylesheet\";\n \t\t\t\tlinkTag.type = \"text/css\";\n \t\t\t\tlinkTag.onload = resolve;\n \t\t\t\tlinkTag.onerror = function(event) {\n \t\t\t\t\tvar request = event && event.target && event.target.src || fullhref;\n \t\t\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + request + \")\");\n \t\t\t\t\terr.request = request;\n \t\t\t\t\tdelete installedCssChunks[chunkId]\n \t\t\t\t\tlinkTag.parentNode.removeChild(linkTag)\n \t\t\t\t\treject(err);\n \t\t\t\t};\n \t\t\t\tlinkTag.href = fullhref;\n\n \t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n \t\t\t\thead.appendChild(linkTag);\n \t\t\t}).then(function() {\n \t\t\t\tinstalledCssChunks[chunkId] = 0;\n \t\t\t}));\n \t\t}\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\tvar error = new Error('Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')');\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""}
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{740:function(e,t,a){},767:function(e,t,a){"use strict";a.r(t);a(26);var n=a(2),i=a.n(n),s=a(4),r=a(5),c=a(8),o=a(6),l=a(7),d=a(92),m=a(0),g=a.n(m),u=(a(740),a(18)),h=a(1),v=a(741),f=a.n(v),p=function(e){function t(e){var a;return Object(s.a)(this,t),(a=Object(c.a)(this,Object(o.a)(t).call(this,e))).initCanvas=function(e,t){var n=Object(d.a)(Object(d.a)(a)),i=e[t].poster,s=450*e[t].header_position_x,r=800*e[t].header_position_y,c=(e[t].qr_code_x,e[t].qr_code_y,e[t].qr_code_width,e[t].qr_code_height,"/detail/".concat(Object(h.c)("courseId"),"/").concat(Object(h.c)("dist_code")),document.getElementById("canvas")),o=c.getContext("2d");n.getBase64(i).then(function(a){var i=new Image;i.src=a;var c=document.getElementById("qrcode"),l=navigator.userAgent.toLowerCase();l.indexOf("Android")>-1||l.indexOf("Adr"),l.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?c=document.getElementById("qrcode"):/(Android)/i.test(navigator.userAgent)&&(c=document.getElementById("qrcode")),i.setAttribute("crossOrigin","anonymous"),i.onload=function(){o.drawImage(i,0,0,450,800),o.drawImage(c,320,685,100,100),o.fillStyle=e[t].username_color,o.font="16px serif",o.fillText("@"+n.name,s+50+20,r+25),o.font="14px serif",o.fillText("\u6b63\u5728\u5b66\u4e60\u8be5\u8bfe\u7a0b",s+50+20,r+25+20),o.restore()}}).then(function(){n.getBase64(n.state.imgUrl).then(function(e){var t=new Image;t.src=e,t.setAttribute("crossOrigin","anonymous"),t.setAttribute("border-Radius","50%"),t.onload=function(){n.imgPosition(o,t,s,r,24),o.drawImage(t,s,r,48,48),o.restore(),n.setState({billSrc:n.convertCanvasToImage(c)})}})})},a.children=function(e,t){var a=e.childNodes,n=[];if(/MSIE(6|7|8)/.test(navigator.userAgent))for(var i=0;i<a.length;i++){var s=a[i];1===s.nodeType&&(n[n.length]=s)}else n=Array.prototype.slice.call(e.children);if("string"===typeof t)for(var r=0;r<n.length;r++)(e=n[r]).nodeName.toLowerCase()!==t.toLowerCase()&&(n.splice(r,1),r--);return n},a.imgPosition=function(e,t,a,n,i){e.save();var s=a+i,r=n+i;e.beginPath(),e.arc(s,r,i,0,2*Math.PI),e.clip()},a.getBase64Image=function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0,e.width,e.height);var a=e.src.substring(e.src.lastIndexOf(".")+1).toLowerCase();return t.toDataURL("image/"+a)},a.convertCanvasToImage=function(e){var t=new Image;return t.src=e.toDataURL("image/png"),t},a.squareClick=function(e){a.setState({smallactive:e}),a.initCanvas(a.state.bgImage,e)},a.state={codeSrc:"",billSrc:"",imgUrl:"",smallListImg:[],smallactive:0,distPrice:"",name:"",bgImage:[]},a}return Object(l.a)(t,e),Object(r.a)(t,[{key:"componentDidMount",value:function(){var e=this;this.getCodeWe(),h.d.get("".concat(h.a.home,"/m/dist/posters/").concat(Object(h.c)("courseId"),"/").concat(Object(h.c)("uid"))).then(function(t){200===t.data.code?(e.setState({imgUrl:t.data.data.avatar,smallListImg:t.data.data.list,distPrice:t.data.data.dist_course,bgImage:t.data.data.list,name:t.data.data.username}),e.initCanvas(e.state.bgImage,0)):i.a.info(t.data.msg,2)})}},{key:"getCodeWe",value:function(){var e=this,t="/detail/".concat(Object(h.c)("courseId"),"/").concat(Object(h.c)("dist_code"));return new Promise(function(a){f.a.toDataURL(t,{},function(t,a){e.setState({codeSrc:a})}),a()})}},{key:"getBase64",value:function(e){var t=this;return new Promise(function(a){var n=null,i=new Image,s=+new Date;i.setAttribute("crossOrigin","anonymous"),i.src=e+"?"+s,i.onload=function(){n=t.getBase64Image(i),a(n)},i.onerror=function(){var a=+new Date;t.getBase64(e+"?"+a)}})}},{key:"render",value:function(){var e=this;return g.a.createElement("div",{className:"share-poster"},g.a.createElement(u.e,{title:"\u751f\u6210\u4e13\u5c5e\u6d77\u62a5",arrow:!0,cart:!1}),g.a.createElement("div",{className:"total-container"},g.a.createElement("div",{className:"placard-img-container",id:"imgWrapper"},g.a.createElement("img",{src:this.state.billSrc.src,alt:""})),g.a.createElement("img",{src:this.state.codeSrc,alt:"",id:"qrcode",className:"placard-code"}),g.a.createElement("canvas",{id:"canvas",width:"450",height:"800",className:""===this.state.billSrc?"":"hide"})),g.a.createElement("div",{className:"placard-desc"},g.a.createElement("span",{className:"placard-sharetxt"},"\u957f\u6309\u4fdd\u5b58\u6d77\u62a5\u5206\u4eab\u7ed9\u597d\u53cb\uff0c\u6bcf\u6709\u4e00\u4eba\u901a\u8fc7\u60a8\u7684\u5206\u4eab\u8d2d\u4e70\u8be5\u8bfe\u7a0b\uff0c\u60a8\u53ef\u4ee5",0===this.state.distPrice.count_type&&g.a.createElement("span",{className:"placard-price"},"\u83b7\u5f97",this.state.distPrice.first_level_tip,"\u5143\u7684\u4f63\u91d1\u5956\u52b1\u3002"),1===this.state.distPrice.count_type&&g.a.createElement("span",{className:"placard-price"},"\u83b7\u5f97\u6210\u4ea4\u91d1\u989d\u7684",this.state.distPrice.first_level_scale,"%\u4f5c\u4e3a\u4f63\u91d1\u5956\u52b1\u3002"))),g.a.createElement("div",{className:"placard-swiper"},g.a.createElement("ul",{className:"placard-list"},this.state.smallListImg&&this.state.smallListImg.length>0&&this.state.smallListImg.map(function(t,a){return g.a.createElement("li",{onClick:e.squareClick.bind(e,a),key:a,className:e.state.smallactive===a?"active":""},g.a.createElement("img",{src:t.square,alt:""}))}))))}}]),t}(m.Component);t.default=p}}]);
//# sourceMappingURL=shareposter.03babfdf.chunk.js.map
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{740:function(e,t,a){},767:function(e,t,a){"use strict";a.r(t);a(26);var n=a(2),i=a.n(n),s=a(3),r=a(4),c=a(7),o=a(5),l=a(6),d=a(92),m=a(0),g=a.n(m),u=(a(740),a(18)),h=a(1),v=a(741),f=a.n(v),p=function(e){function t(e){var a;return Object(s.a)(this,t),(a=Object(c.a)(this,Object(o.a)(t).call(this,e))).initCanvas=function(e,t){var n=Object(d.a)(Object(d.a)(a)),i=e[t].poster,s=450*e[t].header_position_x,r=800*e[t].header_position_y,c=(e[t].qr_code_x,e[t].qr_code_y,e[t].qr_code_width,e[t].qr_code_height,"/detail/".concat(Object(h.c)("courseId"),"/").concat(Object(h.c)("dist_code")),document.getElementById("canvas")),o=c.getContext("2d");n.getBase64(i).then(function(a){var i=new Image;i.src=a;var c=document.getElementById("qrcode"),l=navigator.userAgent.toLowerCase();l.indexOf("Android")>-1||l.indexOf("Adr"),l.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?c=document.getElementById("qrcode"):/(Android)/i.test(navigator.userAgent)&&(c=document.getElementById("qrcode")),i.setAttribute("crossOrigin","anonymous"),i.onload=function(){o.drawImage(i,0,0,450,800),o.drawImage(c,320,685,100,100),o.fillStyle=e[t].username_color,o.font="16px serif",o.fillText("@"+n.name,s+50+20,r+25),o.font="14px serif",o.fillText("\u6b63\u5728\u5b66\u4e60\u8be5\u8bfe\u7a0b",s+50+20,r+25+20),o.restore()}}).then(function(){n.getBase64(n.state.imgUrl).then(function(e){var t=new Image;t.src=e,t.setAttribute("crossOrigin","anonymous"),t.setAttribute("border-Radius","50%"),t.onload=function(){n.imgPosition(o,t,s,r,24),o.drawImage(t,s,r,48,48),o.restore(),n.setState({billSrc:n.convertCanvasToImage(c)})}})})},a.children=function(e,t){var a=e.childNodes,n=[];if(/MSIE(6|7|8)/.test(navigator.userAgent))for(var i=0;i<a.length;i++){var s=a[i];1===s.nodeType&&(n[n.length]=s)}else n=Array.prototype.slice.call(e.children);if("string"===typeof t)for(var r=0;r<n.length;r++)(e=n[r]).nodeName.toLowerCase()!==t.toLowerCase()&&(n.splice(r,1),r--);return n},a.imgPosition=function(e,t,a,n,i){e.save();var s=a+i,r=n+i;e.beginPath(),e.arc(s,r,i,0,2*Math.PI),e.clip()},a.getBase64Image=function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0,e.width,e.height);var a=e.src.substring(e.src.lastIndexOf(".")+1).toLowerCase();return t.toDataURL("image/"+a)},a.convertCanvasToImage=function(e){var t=new Image;return t.src=e.toDataURL("image/png"),t},a.squareClick=function(e){a.setState({smallactive:e}),a.initCanvas(a.state.bgImage,e)},a.state={codeSrc:"",billSrc:"",imgUrl:"",smallListImg:[],smallactive:0,distPrice:"",name:"",bgImage:[]},a}return Object(l.a)(t,e),Object(r.a)(t,[{key:"componentDidMount",value:function(){var e=this;this.getCodeWe(),h.d.get("".concat(h.a.home,"/m/dist/posters/").concat(Object(h.c)("courseId"),"/").concat(Object(h.c)("uid"))).then(function(t){200===t.data.code?(e.setState({imgUrl:t.data.data.avatar,smallListImg:t.data.data.list,distPrice:t.data.data.dist_course,bgImage:t.data.data.list,name:t.data.data.username}),e.initCanvas(e.state.bgImage,0)):i.a.info(t.data.msg,2)})}},{key:"getCodeWe",value:function(){var e=this,t="/detail/".concat(Object(h.c)("courseId"),"/").concat(Object(h.c)("dist_code"));return new Promise(function(a){f.a.toDataURL(t,{},function(t,a){e.setState({codeSrc:a})}),a()})}},{key:"getBase64",value:function(e){var t=this;return new Promise(function(a){var n=null,i=new Image,s=+new Date;i.setAttribute("crossOrigin","anonymous"),i.src=e+"?"+s,i.onload=function(){n=t.getBase64Image(i),a(n)},i.onerror=function(){var a=+new Date;t.getBase64(e+"?"+a)}})}},{key:"render",value:function(){var e=this;return g.a.createElement("div",{className:"share-poster"},g.a.createElement(u.e,{title:"\u751f\u6210\u4e13\u5c5e\u6d77\u62a5",arrow:!0,cart:!1}),g.a.createElement("div",{className:"total-container"},g.a.createElement("div",{className:"placard-img-container",id:"imgWrapper"},g.a.createElement("img",{src:this.state.billSrc.src,alt:""})),g.a.createElement("img",{src:this.state.codeSrc,alt:"",id:"qrcode",className:"placard-code"}),g.a.createElement("canvas",{id:"canvas",width:"450",height:"800",className:""===this.state.billSrc?"":"hide"})),g.a.createElement("div",{className:"placard-desc"},g.a.createElement("span",{className:"placard-sharetxt"},"\u957f\u6309\u4fdd\u5b58\u6d77\u62a5\u5206\u4eab\u7ed9\u597d\u53cb\uff0c\u6bcf\u6709\u4e00\u4eba\u901a\u8fc7\u60a8\u7684\u5206\u4eab\u8d2d\u4e70\u8be5\u8bfe\u7a0b\uff0c\u60a8\u53ef\u4ee5",0===this.state.distPrice.count_type&&g.a.createElement("span",{className:"placard-price"},"\u83b7\u5f97",this.state.distPrice.first_level_tip,"\u5143\u7684\u4f63\u91d1\u5956\u52b1\u3002"),1===this.state.distPrice.count_type&&g.a.createElement("span",{className:"placard-price"},"\u83b7\u5f97\u6210\u4ea4\u91d1\u989d\u7684",this.state.distPrice.first_level_scale,"%\u4f5c\u4e3a\u4f63\u91d1\u5956\u52b1\u3002"))),g.a.createElement("div",{className:"placard-swiper"},g.a.createElement("ul",{className:"placard-list"},this.state.smallListImg&&this.state.smallListImg.length>0&&this.state.smallListImg.map(function(t,a){return g.a.createElement("li",{onClick:e.squareClick.bind(e,a),key:a,className:e.state.smallactive===a?"active":""},g.a.createElement("img",{src:t.square,alt:""}))}))))}}]),t}(m.Component);t.default=p}}]);
//# sourceMappingURL=shareposter.ec4e8c9b.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["components/sharePoster/index.js"],"names":["SharePoster","props","_this2","Object","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__","this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__","call","initCanvas","imgList","index","_this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__","imgSrc1","poster","avatarPositionX","header_position_x","avatarPositionY","header_position_y","canvas","qr_code_x","qr_code_y","qr_code_width","qr_code_height","concat","getParam","document","getElementById","context","getContext","getBase64","then","img","bgImage","Image","src","qrCodeImg","ua","navigator","userAgent","toLowerCase","indexOf","match","test","setAttribute","onload","drawImage","fillStyle","username_color","font","fillText","name","avatarHeight","restore","state","imgUrl","imgPosition","setState","billSrc","convertCanvasToImage","children","curEle","tagName","nodeList","childNodes","ary","i","length","curNode","nodeType","Array","prototype","slice","k","nodeName","splice","ctx","x","y","r","save","cx","cy","beginPath","arc","Math","PI","clip","getBase64Image","createElement","width","height","ext","substring","lastIndexOf","toDataURL","image","squareClick","smallactive","codeSrc","smallListImg","distPrice","_this3","getCodeWe","http","get","api","home","res","data","code","avatar","list","dist_course","username","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_1___default","a","info","msg","qrCodeLink","Promise","resolve","QRCode","err","url","base64","timeStamp","Date","onerror","_this4","react__WEBPACK_IMPORTED_MODULE_8___default","className","_common__WEBPACK_IMPORTED_MODULE_10__","title","arrow","cart","id","alt","count_type","first_level_tip","first_level_scale","map","item","onClick","bind","key","square","Component"],"mappings":"sPASMA,cACF,SAAAA,EAAYC,GAAO,IAAAC,EAAA,OAAAC,OAAAC,EAAA,EAAAD,CAAAE,KAAAL,IACfE,EAAAC,OAAAG,EAAA,EAAAH,CAAAE,KAAAF,OAAAI,EAAA,EAAAJ,CAAAH,GAAAQ,KAAAH,KAAMJ,KAgCVQ,WAAa,SAACC,EAASC,GACnB,IAAIC,EAAKT,OAAAU,EAAA,EAAAV,QAAAU,EAAA,EAAAV,CAAAD,IACLY,EAAUJ,EAAQC,GAAOI,OAKzBC,EAJS,IAIUN,EAAQC,GAAOM,kBAClCC,EAJU,IAISR,EAAQC,GAAOQ,kBASlCC,GAPkBV,EAAQC,GAAOU,UACfX,EAAQC,GAAOW,UAClBZ,EAAQC,GAAOY,cACdb,EAAQC,GAAOa,eAErB,WAAAC,OAAcC,YAAS,YAAvB,KAAAD,OAAsCC,YAAS,cAEhDC,SAASC,eAAe,WACjCC,EAAUT,EAAOU,WAAW,MAEhClB,EAAMmB,UAAUjB,GAEXkB,KAAK,SAACC,GACH,IAAIC,EAAU,IAAIC,MAClBD,EAAQE,IAAMH,EACd,IAAII,EAAYV,SAASC,eAAe,UACpCU,EAAKC,UAAUC,UAAUC,cAEbH,EAAGI,QAAQ,YAAc,GAAKJ,EAAGI,QAAQ,OAE3CJ,EAAGK,MAAM,iCACnB,0BAA0BC,KAAKL,UAAUC,WACzCH,EAAYV,SAASC,eAAe,UAC7B,aAAagB,KAAKL,UAAUC,aAEnCH,EAAYV,SAASC,eAAe,WAIxCM,EAAQW,aAAa,cAAe,aACpCX,EAAQY,OAAS,WACbjB,EAAQkB,UAAUb,EAAS,EAAG,EAAG,IAAK,KACtCL,EAAQkB,UAAUV,EAAW,IAAK,IAAK,IAAK,KAC5CR,EAAQmB,UAAYtC,EAAQC,GAAOsC,eACnCpB,EAAQqB,KAAO,aACfrB,EAAQsB,SAAS,IAAMvC,EAAMwC,KAAOp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ApC/H,KAAKkD,MAAM+C,UAAUqC,YACrBR,EAAAd,EAAA3B,cAAA,QAAM0C,UAAU,iBAAhB,eAAmC/H,KAAKkD,MAAM+C,UAAUsC,gBAAxD,8CAGoC,IAApCvI,KAAKkD,MAAM+C,UAAUqC,YACrBR,EAAAd,EAAA3B,cAAA,QACI0C,UAAU,iBADd,6CACsC/H,KAAKkD,MAAM+C,UAAUuC,kBAD3D,iDAMZV,EAAAd,EAAA3B,cAAA,OAAK0C,UAAU,kBACXD,EAAAd,EAAA3B,cAAA,MAAI0C,UAAU,gBAEN/H,KAAKkD,MAAM8C,cAAgBhG,KAAKkD,MAAM8C,aAAajC,OAAS,GAAK/D,KAAKkD,MAAM8C,aAAayC,IAAI,SAACC,EAAMpI,GAChG,OACIwH,EAAAd,EAAA3B,cAAA,MAAIsD,QAASd,EAAKhC,YAAY+C,KAAKf,EAAMvH,GAAQuI,IAAKvI,EAClDyH,UAAWF,EAAK3E,MAAM4C,cAAgBxF,EAAQ,SAAW,IACzDwH,EAAAd,EAAA3B,cAAA,OAAKtD,IAAK2G,EAAKI,OAAQT,IAAI,kBA7PzCU,aA0QXpJ","file":"static/js/shareposter.03babfdf.chunk.js","sourcesContent":["import React, {Component} from 'react'\nimport './index.scss'\nimport {HeaderBar} from '../../common'\nimport {http, api, getParam} from '@/utils'\nimport QRCode from 'qrcode'\nimport { Toast} from 'antd-mobile'\n\n\n\nclass SharePoster extends Component {\n constructor(props) {\n super(props)\n this.state = {\n codeSrc: '',\n billSrc: '', // 图片链接\n imgUrl: '',\n smallListImg: [], // 小图片地址\n smallactive: 0, // 小图选中标记\n distPrice: '', // 分销价格\n name: '', // 用户姓名\n bgImage: [] // 背景图\n }\n }\n\n componentDidMount() {\n this.getCodeWe()\n http.get(`${api.home}/m/dist/posters/${getParam('courseId')}/${getParam('uid')}`).then((res) => {\n if (res.data.code === 200) {\n this.setState({\n imgUrl: res.data.data.avatar,\n smallListImg: res.data.data.list,\n distPrice: res.data.data.dist_course,\n bgImage: res.data.data.list,\n name: res.data.data.username\n })\n this.initCanvas(this.state.bgImage, 0)\n } else {\n Toast.info(res.data.msg, 2)\n }\n })\n }\n\n // 初始化海报\n initCanvas = (imgList, index) => {\n let _this = this;\n let imgSrc1 = imgList[index].poster;\n let $width = 450;\n let $height = 800;\n let avatarWidth = 50 // imgList[index].poster_width // 头像宽度\n let avatarHeight = 50 // imgList[index].poster_height // 头像高度\n let avatarPositionX = (imgList[index].header_position_x * $width) // 头像x轴位置\n let avatarPositionY = (imgList[index].header_position_y * $height) // 头像Y轴位置\n\n let qrCodePositionX = imgList[index].qr_code_x * $width // 二维码x轴位置\n let qrCodePositionY = imgList[index].qr_code_y * $height // 二维码y轴位置\n let qrCodeWidth = (imgList[index].qr_code_width * $width) // 二维码宽度\n let qrCodeHeight = (imgList[index].qr_code_height * $height) - avatarHeight / 2 // 二维码高度\n\n let qrCodeLink = `/detail/${getParam('courseId')}/${getParam('dist_code')}`\n\n var canvas = document.getElementById(\"canvas\"),\n context = canvas.getContext(\"2d\");\n\n _this.getBase64(imgSrc1)\n // 背景图片合成\n .then((img) => {\n let bgImage = new Image();\n bgImage.src = img;\n let qrCodeImg = document.getElementById('qrcode');\n let ua = navigator.userAgent.toLowerCase();\n // Android终端\n let isAndroid = ua.indexOf('Android') > -1 || ua.indexOf('Adr') > -1;\n // Ios终端\n let isiOS = !!ua.match(/\\(i[^;]+;( U;)? CPU.+Mac OS X/);\n if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {\n qrCodeImg = document.getElementById('qrcode');\n } else if (/(Android)/i.test(navigator.userAgent)) {\n //Android终端\n qrCodeImg = document.getElementById('qrcode');\n\n }\n\n bgImage.setAttribute('crossOrigin', 'anonymous');\n bgImage.onload = function () {\n context.drawImage(bgImage, 0, 0, 450, 800);\n context.drawImage(qrCodeImg, 320, 685, 100, 100);\n context.fillStyle = imgList[index].username_color;\n context.font = \"16px serif\";\n context.fillText('@' + _this.name, (avatarPositionX + avatarWidth) + 20, (avatarPositionY + avatarHeight / 2));\n context.font = \"14px serif\";\n context.fillText('正在学习该课程', (avatarPositionX + avatarWidth) + 20, (avatarPositionY + avatarHeight / 2) + 20);\n context.restore();\n }\n\n })\n // 头像生成\n .then(() => {\n _this.getBase64(_this.state.imgUrl)\n .then((img) => {\n let bgImage = new Image();\n bgImage.src = img;\n bgImage.setAttribute('crossOrigin', 'anonymous');\n bgImage.setAttribute('border-Radius', '50%');\n bgImage.onload = function () {\n _this.imgPosition(context, bgImage, avatarPositionX, avatarPositionY, 24);\n context.drawImage(bgImage, avatarPositionX, avatarPositionY, 48, 48);\n context.restore();\n _this.setState({\n billSrc: _this.convertCanvasToImage(canvas)\n })\n\n }\n })\n\n })\n }\n children = (curEle, tagName) => {\n var nodeList = curEle.childNodes;\n var ary = [];\n if (/MSIE(6|7|8)/.test(navigator.userAgent)) {\n for (var i = 0; i < nodeList.length; i++) {\n var curNode = nodeList[i];\n if (curNode.nodeType === 1) {\n ary[ary.length] = curNode;\n }\n }\n } else {\n ary = Array.prototype.slice.call(curEle.children);\n }\n\n // 获取指定子元素\n if (typeof tagName === \"string\") {\n for (var k = 0; k < ary.length; k++) {\n curEle = ary[k];\n if (curEle.nodeName.toLowerCase() !== tagName.toLowerCase()) {\n ary.splice(k, 1);\n k--;\n }\n }\n }\n\n return ary;\n }\n\n // 合成图片位置\n imgPosition = (ctx, img, x, y, r) => {\n ctx.save();\n var d = 2 * r;\n var cx = x + r;\n var cy = y + r;\n ctx.beginPath();\n ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.clip();\n }\n\n // 获取二维码\n getCodeWe() {\n let _this = this\n let qrCodeLink = `/detail/${getParam('courseId')}/${getParam('dist_code')}`\n return new Promise(resolve => {\n QRCode.toDataURL(qrCodeLink, {}, function (err, url) {\n _this.setState({\n codeSrc: url\n })\n })\n /*\n let qrcode = new QRCode(document.getElementById('qrcode'), {\n text: qrCodeLink,\n width: 160,\n height: 160,\n colorDark: \"#000000\", // 生成的二维码的深色部分\n colorLight: \"#ffffff\", //生成二维码的浅色部分\n })\n */\n resolve()\n })\n }\n\n // 图片路径转成base64\n getBase64(img) {\n let _this = this;\n return new Promise(resolve => {\n let base64 = null;\n let image = new Image();\n let timeStamp = +new Date();\n image.setAttribute('crossOrigin', 'anonymous');\n image.src = img + '?' + timeStamp;\n image.onload = () => {\n base64 = _this.getBase64Image(image)\n resolve(base64)\n }\n image.onerror = function () {\n let timeStamp = +new Date();\n _this.getBase64(img + '?' + timeStamp);\n }\n })\n\n }\n\n // 图片路径放入canvas转成base64\n getBase64Image = (img) => {\n let canvas = document.createElement(\"canvas\");\n canvas.width = img.width;\n canvas.height = img.height;\n\n let ctx = canvas.getContext(\"2d\");\n ctx.drawImage(img, 0, 0, img.width, img.height);\n let ext = img.src.substring(img.src.lastIndexOf(\".\") + 1).toLowerCase();\n let dataURL = canvas.toDataURL(\"image/\" + ext);\n return dataURL;\n }\n\n // canvas转换成img图片\n convertCanvasToImage = (canvas) => {\n let image = new Image();\n image.src = canvas.toDataURL(\"image/png\");\n return image;\n }\n\n // 小图切换\n squareClick = (index) => {\n this.setState({\n smallactive: index\n })\n this.initCanvas(this.state.bgImage, index);\n\n }\n\n render() {\n return (\n <div className='share-poster'>\n <HeaderBar title='生成专属海报' arrow={true} cart={false}></HeaderBar>\n <div className=\"total-container\">\n <div className='placard-img-container' id='imgWrapper'>\n <img src={this.state.billSrc.src} alt=\"\"/>\n </div>\n <img src={this.state.codeSrc} alt=\"\" id='qrcode' className='placard-code'/>\n <canvas id='canvas' width='450' height='800'\n className={this.state.billSrc === '' ? '' : 'hide'}></canvas>\n </div>\n <div className='placard-desc'>\n <span className='placard-sharetxt'>\n 长按保存海报分享给好友,每有一人通过您的分享购买该课程,您可以\n {\n this.state.distPrice.count_type === 0 &&\n <span className='placard-price'>获得{this.state.distPrice.first_level_tip}元的佣金奖励。</span>\n }\n {\n this.state.distPrice.count_type === 1 &&\n <span\n className='placard-price'>获得成交金额的{this.state.distPrice.first_level_scale}%作为佣金奖励。</span>\n }\n </span>\n </div>\n\n <div className='placard-swiper'>\n <ul className='placard-list'>\n {\n this.state.smallListImg && this.state.smallListImg.length > 0 && this.state.smallListImg.map((item, index) => {\n return (\n <li onClick={this.squareClick.bind(this, index)} key={index}\n className={this.state.smallactive === index ? 'active' : ''}>\n <img src={item.square} alt=\"\"/>\n </li>\n )\n })\n }\n </ul>\n </div>\n\n </div>\n )\n }\n}\n\nexport default SharePoster\n"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["components/sharePoster/index.js"],"names":["SharePoster","props","_this2","Object","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__","this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__","call","initCanvas","imgList","index","_this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__","imgSrc1","poster","avatarPositionX","header_position_x","avatarPositionY","header_position_y","canvas","qr_code_x","qr_code_y","qr_code_width","qr_code_height","concat","getParam","document","getElementById","context","getContext","getBase64","then","img","bgImage","Image","src","qrCodeImg","ua","navigator","userAgent","toLowerCase","indexOf","match","test","setAttribute","onload","drawImage","fillStyle","username_color","font","fillText","name","avatarHeight","restore","state","imgUrl","imgPosition","setState","billSrc","convertCanvasToImage","children","curEle","tagName","nodeList","childNodes","ary","i","length","curNode","nodeType","Array","prototype","slice","k","nodeName","splice","ctx","x","y","r","save","cx","cy","beginPath","arc","Math","PI","clip","getBase64Image","createElement","width","height","ext","substring","lastIndexOf","toDataURL","image","squareClick","smallactive","codeSrc","smallListImg","distPrice","_this3","getCodeWe","http","get","api","home","res","data","code","avatar","list","dist_course","username","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_1___default","a","info","msg","qrCodeLink","Promise","resolve","QRCode","err","url","base64","timeStamp","Date","onerror","_this4","react__WEBPACK_IMPORTED_MODULE_8___default","className","_common__WEBPACK_IMPORTED_MODULE_10__","title","arrow","cart","id","alt","count_type","first_level_tip","first_level_scale","map","item","onClick","bind","key","square","Component"],"mappings":"sPASMA,cACF,SAAAA,EAAYC,GAAO,IAAAC,EAAA,OAAAC,OAAAC,EAAA,EAAAD,CAAAE,KAAAL,IACfE,EAAAC,OAAAG,EAAA,EAAAH,CAAAE,KAAAF,OAAAI,EAAA,EAAAJ,CAAAH,GAAAQ,KAAAH,KAAMJ,KAgCVQ,WAAa,SAACC,EAASC,GACnB,IAAIC,EAAKT,OAAAU,EAAA,EAAAV,QAAAU,EAAA,EAAAV,CAAAD,IACLY,EAAUJ,EAAQC,GAAOI,OAKzBC,EAJS,IAIUN,EAAQC,GAAOM,kBAClCC,EAJU,IAISR,EAAQC,GAAOQ,kBASlCC,GAPkBV,EAAQC,GAAOU,UACfX,EAAQC,GAAOW,UAClBZ,EAAQC,GAAOY,cACdb,EAAQC,GAAOa,eAErB,WAAAC,OAAcC,YAAS,YAAvB,KAAAD,OAAsCC,YAAS,cAEhDC,SAASC,eAAe,WACjCC,EAAUT,EAAOU,WAAW,MAEhClB,EAAMmB,UAAUjB,GAEXkB,KAAK,SAACC,GACH,IAAIC,EAAU,IAAIC,MAClBD,EAAQE,IAAMH,EACd,IAAII,EAAYV,SAASC,eAAe,UACpCU,EAAKC,UAAUC,UAAUC,cAEbH,EAAGI,QAAQ,YAAc,GAAKJ,EAAGI,QAAQ,OAE3CJ,EAAGK,MAAM,iCACnB,0BAA0BC,KAAKL,UAAUC,WACzCH,EAAYV,SAASC,eAAe,UAC7B,aAAagB,KAAKL,UAAUC,aAEnCH,EAAYV,SAASC,eAAe,WAIxCM,EAAQW,aAAa,cAAe,aACpCX,EAAQY,OAAS,WACbjB,EAAQkB,U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9C,MAAM,MAAMC,OAAO,MAC/BwC,UAAkC,KAAvB/H,KAAKkD,MAAMI,QAAiB,GAAK,UAExDwE,EAAAd,EAAA3B,cAAA,OAAK0C,UAAU,gBACXD,EAAAd,EAAA3B,cAAA,QAAM0C,UAAU,oBAAhB,6LAG4C,IAApC/H,KAAKkD,MAAM+C,UAAUqC,YACrBR,EAAAd,EAAA3B,cAAA,QAAM0C,UAAU,iBAAhB,eAAmC/H,KAAKkD,MAAM+C,UAAUsC,gBAAxD,8CAGoC,IAApCvI,KAAKkD,MAAM+C,UAAUqC,YACrBR,EAAAd,EAAA3B,cAAA,QACI0C,UAAU,iBADd,6CACsC/H,KAAKkD,MAAM+C,UAAUuC,kBAD3D,iDAMZV,EAAAd,EAAA3B,cAAA,OAAK0C,UAAU,kBACXD,EAAAd,EAAA3B,cAAA,MAAI0C,UAAU,gBAEN/H,KAAKkD,MAAM8C,cAAgBhG,KAAKkD,MAAM8C,aAAajC,OAAS,GAAK/D,KAAKkD,MAAM8C,aAAayC,IAAI,SAACC,EAAMpI,GAChG,OACIwH,EAAAd,EAAA3B,cAAA,MAAIsD,QAASd,EAAKhC,YAAY+C,KAAKf,EAAMvH,GAAQuI,IAAKvI,EAClDyH,UAAWF,EAAK3E,MAAM4C,cAAgBxF,EAAQ,SAAW,IACzDwH,EAAAd,EAAA3B,cAAA,OAAKtD,IAAK2G,EAAKI,OAAQT,IAAI,kBA7PzCU,aA0QXpJ","file":"static/js/shareposter.ec4e8c9b.chunk.js","sourcesContent":["import React, {Component} from 'react'\nimport './index.scss'\nimport {HeaderBar} from '../../common'\nimport {http, api, getParam} from '@/utils'\nimport QRCode from 'qrcode'\nimport { Toast} from 'antd-mobile'\n\n\n\nclass SharePoster extends Component {\n constructor(props) {\n super(props)\n this.state = {\n codeSrc: '',\n billSrc: '', // 图片链接\n imgUrl: '',\n smallListImg: [], // 小图片地址\n smallactive: 0, // 小图选中标记\n distPrice: '', // 分销价格\n name: '', // 用户姓名\n bgImage: [] // 背景图\n }\n }\n\n componentDidMount() {\n this.getCodeWe()\n http.get(`${api.home}/m/dist/posters/${getParam('courseId')}/${getParam('uid')}`).then((res) => {\n if (res.data.code === 200) {\n this.setState({\n imgUrl: res.data.data.avatar,\n smallListImg: res.data.data.list,\n distPrice: res.data.data.dist_course,\n bgImage: res.data.data.list,\n name: res.data.data.username\n })\n this.initCanvas(this.state.bgImage, 0)\n } else {\n Toast.info(res.data.msg, 2)\n }\n })\n }\n\n // 初始化海报\n initCanvas = (imgList, index) => {\n let _this = this;\n let imgSrc1 = imgList[index].poster;\n let $width = 450;\n let $height = 800;\n let avatarWidth = 50 // imgList[index].poster_width // 头像宽度\n let avatarHeight = 50 // imgList[index].poster_height // 头像高度\n let avatarPositionX = (imgList[index].header_position_x * $width) // 头像x轴位置\n let avatarPositionY = (imgList[index].header_position_y * $height) // 头像Y轴位置\n\n let qrCodePositionX = imgList[index].qr_code_x * $width // 二维码x轴位置\n let qrCodePositionY = imgList[index].qr_code_y * $height // 二维码y轴位置\n let qrCodeWidth = (imgList[index].qr_code_width * $width) // 二维码宽度\n let qrCodeHeight = (imgList[index].qr_code_height * $height) - avatarHeight / 2 // 二维码高度\n\n let qrCodeLink = `/detail/${getParam('courseId')}/${getParam('dist_code')}`\n\n var canvas = document.getElementById(\"canvas\"),\n context = canvas.getContext(\"2d\");\n\n _this.getBase64(imgSrc1)\n // 背景图片合成\n .then((img) => {\n let bgImage = new Image();\n bgImage.src = img;\n let qrCodeImg = document.getElementById('qrcode');\n let ua = navigator.userAgent.toLowerCase();\n // Android终端\n let isAndroid = ua.indexOf('Android') > -1 || ua.indexOf('Adr') > -1;\n // Ios终端\n let isiOS = !!ua.match(/\\(i[^;]+;( U;)? CPU.+Mac OS X/);\n if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {\n qrCodeImg = document.getElementById('qrcode');\n } else if (/(Android)/i.test(navigator.userAgent)) {\n //Android终端\n qrCodeImg = document.getElementById('qrcode');\n\n }\n\n bgImage.setAttribute('crossOrigin', 'anonymous');\n bgImage.onload = function () {\n context.drawImage(bgImage, 0, 0, 450, 800);\n context.drawImage(qrCodeImg, 320, 685, 100, 100);\n context.fillStyle = imgList[index].username_color;\n context.font = \"16px serif\";\n context.fillText('@' + _this.name, (avatarPositionX + avatarWidth) + 20, (avatarPositionY + avatarHeight / 2));\n context.font = \"14px serif\";\n context.fillText('正在学习该课程', (avatarPositionX + avatarWidth) + 20, (avatarPositionY + avatarHeight / 2) + 20);\n context.restore();\n }\n\n })\n // 头像生成\n .then(() => {\n _this.getBase64(_this.state.imgUrl)\n .then((img) => {\n let bgImage = new Image();\n bgImage.src = img;\n bgImage.setAttribute('crossOrigin', 'anonymous');\n bgImage.setAttribute('border-Radius', '50%');\n bgImage.onload = function () {\n _this.imgPosition(context, bgImage, avatarPositionX, avatarPositionY, 24);\n context.drawImage(bgImage, avatarPositionX, avatarPositionY, 48, 48);\n context.restore();\n _this.setState({\n billSrc: _this.convertCanvasToImage(canvas)\n })\n\n }\n })\n\n })\n }\n children = (curEle, tagName) => {\n var nodeList = curEle.childNodes;\n var ary = [];\n if (/MSIE(6|7|8)/.test(navigator.userAgent)) {\n for (var i = 0; i < nodeList.length; i++) {\n var curNode = nodeList[i];\n if (curNode.nodeType === 1) {\n ary[ary.length] = curNode;\n }\n }\n } else {\n ary = Array.prototype.slice.call(curEle.children);\n }\n\n // 获取指定子元素\n if (typeof tagName === \"string\") {\n for (var k = 0; k < ary.length; k++) {\n curEle = ary[k];\n if (curEle.nodeName.toLowerCase() !== tagName.toLowerCase()) {\n ary.splice(k, 1);\n k--;\n }\n }\n }\n\n return ary;\n }\n\n // 合成图片位置\n imgPosition = (ctx, img, x, y, r) => {\n ctx.save();\n var d = 2 * r;\n var cx = x + r;\n var cy = y + r;\n ctx.beginPath();\n ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.clip();\n }\n\n // 获取二维码\n getCodeWe() {\n let _this = this\n let qrCodeLink = `/detail/${getParam('courseId')}/${getParam('dist_code')}`\n return new Promise(resolve => {\n QRCode.toDataURL(qrCodeLink, {}, function (err, url) {\n _this.setState({\n codeSrc: url\n })\n })\n /*\n let qrcode = new QRCode(document.getElementById('qrcode'), {\n text: qrCodeLink,\n width: 160,\n height: 160,\n colorDark: \"#000000\", // 生成的二维码的深色部分\n colorLight: \"#ffffff\", //生成二维码的浅色部分\n })\n */\n resolve()\n })\n }\n\n // 图片路径转成base64\n getBase64(img) {\n let _this = this;\n return new Promise(resolve => {\n let base64 = null;\n let image = new Image();\n let timeStamp = +new Date();\n image.setAttribute('crossOrigin', 'anonymous');\n image.src = img + '?' + timeStamp;\n image.onload = () => {\n base64 = _this.getBase64Image(image)\n resolve(base64)\n }\n image.onerror = function () {\n let timeStamp = +new Date();\n _this.getBase64(img + '?' + timeStamp);\n }\n })\n\n }\n\n // 图片路径放入canvas转成base64\n getBase64Image = (img) => {\n let canvas = document.createElement(\"canvas\");\n canvas.width = img.width;\n canvas.height = img.height;\n\n let ctx = canvas.getContext(\"2d\");\n ctx.drawImage(img, 0, 0, img.width, img.height);\n let ext = img.src.substring(img.src.lastIndexOf(\".\") + 1).toLowerCase();\n let dataURL = canvas.toDataURL(\"image/\" + ext);\n return dataURL;\n }\n\n // canvas转换成img图片\n convertCanvasToImage = (canvas) => {\n let image = new Image();\n image.src = canvas.toDataURL(\"image/png\");\n return image;\n }\n\n // 小图切换\n squareClick = (index) => {\n this.setState({\n smallactive: index\n })\n this.initCanvas(this.state.bgImage, index);\n\n }\n\n render() {\n return (\n <div className='share-poster'>\n <HeaderBar title='生成专属海报' arrow={true} cart={false}></HeaderBar>\n <div className=\"total-container\">\n <div className='placard-img-container' id='imgWrapper'>\n <img src={this.state.billSrc.src} alt=\"\"/>\n </div>\n <img src={this.state.codeSrc} alt=\"\" id='qrcode' className='placard-code'/>\n <canvas id='canvas' width='450' height='800'\n className={this.state.billSrc === '' ? '' : 'hide'}></canvas>\n </div>\n <div className='placard-desc'>\n <span className='placard-sharetxt'>\n 长按保存海报分享给好友,每有一人通过您的分享购买该课程,您可以\n {\n this.state.distPrice.count_type === 0 &&\n <span className='placard-price'>获得{this.state.distPrice.first_level_tip}元的佣金奖励。</span>\n }\n {\n this.state.distPrice.count_type === 1 &&\n <span\n className='placard-price'>获得成交金额的{this.state.distPrice.first_level_scale}%作为佣金奖励。</span>\n }\n </span>\n </div>\n\n <div className='placard-swiper'>\n <ul className='placard-list'>\n {\n this.state.smallListImg && this.state.smallListImg.length > 0 && this.state.smallListImg.map((item, index) => {\n return (\n <li onClick={this.squareClick.bind(this, index)} key={index}\n className={this.state.smallactive === index ? 'active' : ''}>\n <img src={item.square} alt=\"\"/>\n </li>\n )\n })\n }\n </ul>\n </div>\n\n </div>\n )\n }\n}\n\nexport default SharePoster\n"],"sourceRoot":""}
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{653:function(e,t,a){"use strict";var n=a(0),o=a.n(n);a(654);t.a=function(e){return o.a.createElement("li",{className:"v-list-base-item",onClick:e.handleClick.bind(void 0,e.id)},o.a.createElement("div",{className:"content"},o.a.createElement("div",{className:"cover"},e.status,o.a.createElement("img",{src:e.img,alt:""})),e.info),e.tab)}},654:function(e,t,a){},679:function(e,t,a){},680:function(e,t,a){},681:function(e,t,a){e.exports=a(682)},682:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),o=a(0),r=i(o),s=i(a(3));function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.scrollListener=a.scrollListener.bind(a),a.eventListenerOptions=a.eventListenerOptions.bind(a),a.mousewheelListener=a.mousewheelListener.bind(a),a}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.Component),n(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(a){}return e}},{key:"eventListenerOptions",value:function(){var e=this.props.useCapture;return this.isPassiveSupported()&&(e={useCapture:this.props.useCapture,passive:!0}),e}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,a=this.getParentElement(e),n=void 0;if(this.props.useWindow){var o=document.documentElement||document.body.parentNode||document.body,r=void 0!==t.pageYOffset?t.pageYOffset:o.scrollTop;n=this.props.isReverse?r:this.calculateOffset(e,r)}else n=this.props.isReverse?a.scrollTop:e.scrollHeight-a.scrollTop-a.clientHeight;n<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=a.scrollHeight,this.beforeScrollTop=a.scrollTop,"function"===typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),a=t.children,n=t.element,o=t.hasMore,s=(t.initialLoad,t.isReverse),i=t.loader,l=(t.loadMore,t.pageStart,t.ref),c=(t.threshold,t.useCapture,t.useWindow,t.getScrollParent,function(e,t){var a={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));c.ref=function(t){e.scrollComponent=t,l&&l(t)};var u=[a];return o&&(i?s?u.unshift(i):u.push(i):this.defaultLoader&&(s?u.unshift(this.defaultLoader):u.push(this.defaultLoader))),r.default.createElement(n,c,u)}}]),t}();l.propTypes={children:s.default.node.isRequired,element:s.default.node,hasMore:s.default.bool,initialLoad:s.default.bool,isReverse:s.default.bool,loader:s.default.node,loadMore:s.default.func.isRequired,pageStart:s.default.number,ref:s.default.func,getScrollParent:s.default.func,threshold:s.default.number,useCapture:s.default.bool,useWindow:s.default.bool},l.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=l,e.exports=t.default},683:function(e,t,a){},684:function(e,t,a){},771:function(e,t,a){"use strict";a.r(t);var n=a(4),o=a(5),r=a(8),s=a(6),i=a(7),l=a(0),c=a.n(l),u=(a(679),a(13)),p=a(59),d=a(653),h=(a(680),a(50)),m=a(20),f=a(117),v=a(681),b=a.n(v),y=a(37);var g=c.a.memo(function(e){var t=e.addCourseClick;return c.a.createElement("div",{className:"add-course"},c.a.createElement("button",{className:"add",onClick:t},"\u6dfb\u52a0\u8bfe\u7a0b+"))});function E(e){var t=e.record,a=t.seconds,n=t.lesson_name,o="";if(n){var r=/\u7b2c[\s\S]+?\u8bfe/.exec(n);o+=r&&r[0]?r[0]:""}if(a){var s=function(e){return{hour:Math.floor(e/3600),min:Math.floor(e/60)%60,sec:e%60}}(a);o+=(s.hour?String(s.hour).padStart(2,"0")+":":"")+(s.min?String(s.min).padStart(2,"0")+":":"")+(s.sec?String(s.sec).padStart(2,"0"):"")}return c.a.createElement("span",{className:"record"},o.length?"\u5b66\u4e60\u5230".concat(o):null)}var w=c.a.memo(function(e){var t=e.item;if(t.ago||t.seconds){var a=new Date(1e3*t.ago),n=Object(h.isToday)(a)?Object(h.format)(a,"HH\u65f6mm\u5206"):Object(h.format)(a,"MM\u6708DD\u65e5");return c.a.createElement("div",{className:"des"},c.a.createElement("span",{className:"time"},n),c.a.createElement(E,{record:t}))}return c.a.createElement("button",{className:"start-learn"},"\u5f00\u59cb\u5b66\u4e60")}),L=function(e){function t(){var e,a;Object(n.a)(this,t);for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return(a=Object(r.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(i)))).handleClick=function(e){a.props.history.push("/play/video?id=".concat(e))},a.addCourseClick=function(){a.props.history.push("/classify")},a.loadFunc=Object(y.debounce)(function(){a.props.courseList.length%10===0&&a.props.fetchCoursesListIfNeeded()},200),a}return Object(i.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){this.props.switchTab(!1),this.props.fetchCoursesListIfNeeded()}},{key:"componentWillUnmount",value:function(){this.props.switchTab(!0)}},{key:"render",value:function(){var e=this,t=this.props.courseList;return t&&0!==t.length?c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"my-course-uid"},"\u52a0\u7fa4\u8bf7\u5907\u6ce8\u60a8\u7684\u5b66\u53f7\uff1a".concat(this.props.user.data.uid)),c.a.createElement(b.a,{pageStart:0,hasMore:!0,loadMore:this.loadFunc,useWindow:!1},c.a.createElement("ul",{ref:function(t){return e.list=t}},t.map(function(t,a){var n=c.a.createElement("div",{className:"info"},c.a.createElement("p",{className:"title"},t.course_title),c.a.createElement("p",{className:"contact"},"QQ\u7fa4\uff1a",t.course_qq),c.a.createElement(w,{item:t}));return c.a.createElement(d.a,Object.assign({img:t.image_name,handleClick:e.handleClick},t,{key:a,info:n,id:t.course_id}))}))),t.length%10!==0?c.a.createElement(g,{addCourseClick:this.addCourseClick}):null):c.a.createElement("div",{className:"empty"},c.a.createElement("p",null,c.a.createElement("i",{className:"iconfont iconfish"})),c.a.createElement("p",{className:"empty-prompt"},"\u8fd8\u662f\u54b8\u9c7c\u4e00\u6761\uff0c\u5feb\u53bb\u7ffb\u8eab~"),c.a.createElement("p",null,c.a.createElement(u.b,{className:"select-course",to:"/classify"},"\u53bb\u9009\u8bfe")))}}]),t}(l.PureComponent),C=Object(m.b)(function(e){return{courseList:e.myCourses.courseList,user:e.user}},{fetchCoursesListIfNeeded:f.d,switchTab:f.e})(L),k=(a(26),a(2)),N=a.n(k),O=a(18),S=(a(683),function(e){return c.a.createElement("li",{className:"course-base-item ".concat(e.className),onClick:e.handleClick.bind(void 0,e.id)},e.top,c.a.createElement("img",{src:e.img,alt:""}),c.a.createElement("p",{className:"course-title"},e.title),e.bottom)}),_=a(1),j=a(16),P=a.n(j),M=(a(684),function(e){return c.a.createElement("div",{className:"bottom"},c.a.createElement(O.h,{className:e.className},e.text),c.a.createElement("span",null,e.audience,"\u4eba\u89c2\u770b"))}),T=function(e){function t(){var e,a;Object(n.a)(this,t);for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return(a=Object(r.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(i)))).state={courses:[],live:[],page:1,num:10},a.handleClick=function(e){a.props.history.push("/play?id=".concat(e))},a.getFreeCourses=function(){return _.d.get("".concat(_.a.home,"/m/free_course/").concat(a.state.page,"/").concat(a.state.num))},a.getFreeLive=function(){return _.d.get("".concat(_.a.home,"/m/live/free_list"))},a.toLive=function(e){var t=e.room_id;e.live_status?window.location.assign("http://www-test.julyedu.com/live/m_room/".concat(t)):N.a.info("\u76f4\u64ad\u5373\u5c06\u5f00\u59cb\uff0c\u656c\u8bf7\u671f\u5f85",2,null,!1)},a}return Object(i.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){var e=this;this.getFreeCourses().then(function(t){var a=t.data;200==a.code?e.setState({courses:a.data}):N.a.info(a.msg)}),this.getFreeLive().then(function(t){var a=t.data;200==a.code?e.setState({live:Object(y.isEmpty)(a.data)?[]:a.data}):N.a.info(a.msg,2,null,!1)})}},{key:"render",value:function(){var e=this;return c.a.createElement("ul",{className:"free-courses"},this.state.live.map(function(t,a){var n=c.a.createElement("div",{className:"bottom"},c.a.createElement("div",{className:"animation-box"},new Array(4).fill("a").map(function(e,t){return c.a.createElement("i",{key:t,className:P()("column","column-".concat(t+1))})})),c.a.createElement("div",{className:"time"},"".concat(t.live_start_time))),o=t.live_status?c.a.createElement(O.h,{className:"tag-soon top"},"\u5373\u5c06\u5f00\u59cb"):c.a.createElement(O.h,{className:"tag-playing top"},"\u6b63\u5728\u76f4\u64ad");return c.a.createElement(S,{img:t.live_cover,title:t.live_title,top:o,bottom:n,key:t.live_id,className:"live",handleClick:e.toLive.bind(e,t),id:a})}),this.state.courses.map(function(t,a){return c.a.createElement(S,{img:t.logo,title:t.video_course_name,handleClick:e.handleClick,bottom:c.a.createElement(M,{audience:t.play_times,className:"tag-category",text:t.category}),id:t.v_course_id,key:a,className:"course-item"})}))}}]),t}(l.PureComponent),W=a(169),H=a(168),R=a(23),x=(a(251),function(e){function t(){var e,a;Object(n.a)(this,t);for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return(a=Object(r.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(i)))).state={position:{}},a}return Object(i.a)(t,e),Object(o.a)(t,[{key:"storeScrollPosition",value:function(e){}},{key:"render",value:function(){var e=this,t=this.props.match;return c.a.createElement("section",{id:"study"},c.a.createElement("div",{className:"tab"},c.a.createElement("div",null,c.a.createElement(u.c,{to:"".concat(t.url,"/my-course"),replace:!0,activeClassName:"active"},"\u6211\u7684\u8bfe\u7a0b")),c.a.createElement("div",null,c.a.createElement(u.c,{to:"".concat(t.url,"/free-course"),replace:!0,activeClassName:"active"},"\u514d\u8d39\u8bfe\u7a0b"))),c.a.createElement("div",{className:"study-container",ref:function(t){return e.list=t}},c.a.createElement(p.d,null,c.a.createElement(p.a,{exact:!0,from:"/study",to:"study/my-course"}),c.a.createElement(p.b,{path:"".concat(this.props.match.path,"/my-course"),component:C}),c.a.createElement(p.b,{path:"".concat(this.props.match.path,"/free-course"),component:T}))))}}]),t}(l.Component));t.default=Object(R.d)(H.a,W.a)(x)}}]);
//# sourceMappingURL=study.fc72114b.chunk.js.map
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{653:function(e,t,a){"use strict";var n=a(0),o=a.n(n);a(654);t.a=function(e){return o.a.createElement("li",{className:"v-list-base-item",onClick:e.handleClick.bind(void 0,e.id)},o.a.createElement("div",{className:"content"},o.a.createElement("div",{className:"cover"},e.status,o.a.createElement("img",{src:e.img,alt:""})),e.info),e.tab)}},654:function(e,t,a){},679:function(e,t,a){},680:function(e,t,a){},681:function(e,t,a){e.exports=a(682)},682:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),o=a(0),r=i(o),s=i(a(8));function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.scrollListener=a.scrollListener.bind(a),a.eventListenerOptions=a.eventListenerOptions.bind(a),a.mousewheelListener=a.mousewheelListener.bind(a),a}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.Component),n(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(a){}return e}},{key:"eventListenerOptions",value:function(){var e=this.props.useCapture;return this.isPassiveSupported()&&(e={useCapture:this.props.useCapture,passive:!0}),e}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,a=this.getParentElement(e),n=void 0;if(this.props.useWindow){var o=document.documentElement||document.body.parentNode||document.body,r=void 0!==t.pageYOffset?t.pageYOffset:o.scrollTop;n=this.props.isReverse?r:this.calculateOffset(e,r)}else n=this.props.isReverse?a.scrollTop:e.scrollHeight-a.scrollTop-a.clientHeight;n<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=a.scrollHeight,this.beforeScrollTop=a.scrollTop,"function"===typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),a=t.children,n=t.element,o=t.hasMore,s=(t.initialLoad,t.isReverse),i=t.loader,l=(t.loadMore,t.pageStart,t.ref),c=(t.threshold,t.useCapture,t.useWindow,t.getScrollParent,function(e,t){var a={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));c.ref=function(t){e.scrollComponent=t,l&&l(t)};var u=[a];return o&&(i?s?u.unshift(i):u.push(i):this.defaultLoader&&(s?u.unshift(this.defaultLoader):u.push(this.defaultLoader))),r.default.createElement(n,c,u)}}]),t}();l.propTypes={children:s.default.node.isRequired,element:s.default.node,hasMore:s.default.bool,initialLoad:s.default.bool,isReverse:s.default.bool,loader:s.default.node,loadMore:s.default.func.isRequired,pageStart:s.default.number,ref:s.default.func,getScrollParent:s.default.func,threshold:s.default.number,useCapture:s.default.bool,useWindow:s.default.bool},l.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=l,e.exports=t.default},683:function(e,t,a){},684:function(e,t,a){},771:function(e,t,a){"use strict";a.r(t);var n=a(3),o=a(4),r=a(7),s=a(5),i=a(6),l=a(0),c=a.n(l),u=(a(679),a(11)),p=a(59),d=a(653),h=(a(680),a(40)),m=a(19),f=a(116),v=a(681),b=a.n(v),y=a(37);var g=c.a.memo(function(e){var t=e.addCourseClick;return c.a.createElement("div",{className:"add-course"},c.a.createElement("button",{className:"add",onClick:t},"\u6dfb\u52a0\u8bfe\u7a0b+"))});function E(e){var t=e.record,a=t.seconds,n=t.lesson_name,o="";if(n){var r=/\u7b2c[\s\S]+?\u8bfe/.exec(n);o+=r&&r[0]?r[0]:""}if(a){var s=function(e){return{hour:Math.floor(e/3600),min:Math.floor(e/60)%60,sec:e%60}}(a);o+=(s.hour?String(s.hour).padStart(2,"0")+":":"")+(s.min?String(s.min).padStart(2,"0")+":":"")+(s.sec?String(s.sec).padStart(2,"0"):"")}return c.a.createElement("span",{className:"record"},o.length?"\u5b66\u4e60\u5230".concat(o):null)}var w=c.a.memo(function(e){var t=e.item;if(t.ago||t.seconds){var a=new Date(1e3*t.ago),n=Object(h.isToday)(a)?Object(h.format)(a,"HH\u65f6mm\u5206"):Object(h.format)(a,"MM\u6708DD\u65e5");return c.a.createElement("div",{className:"des"},c.a.createElement("span",{className:"time"},n),c.a.createElement(E,{record:t}))}return c.a.createElement("button",{className:"start-learn"},"\u5f00\u59cb\u5b66\u4e60")}),L=function(e){function t(){var e,a;Object(n.a)(this,t);for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return(a=Object(r.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(i)))).handleClick=function(e){a.props.history.push("/play/video?id=".concat(e))},a.addCourseClick=function(){a.props.history.push("/classify")},a.loadFunc=Object(y.debounce)(function(){a.props.courseList.length%10===0&&a.props.fetchCoursesListIfNeeded()},200),a}return Object(i.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){this.props.switchTab(!1),this.props.fetchCoursesListIfNeeded()}},{key:"componentWillUnmount",value:function(){this.props.switchTab(!0)}},{key:"render",value:function(){var e=this,t=this.props.courseList;return t&&0!==t.length?c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"my-course-uid"},"\u52a0\u7fa4\u8bf7\u5907\u6ce8\u60a8\u7684\u5b66\u53f7\uff1a".concat(this.props.user.data.uid)),c.a.createElement(b.a,{pageStart:0,hasMore:!0,loadMore:this.loadFunc,useWindow:!1},c.a.createElement("ul",{ref:function(t){return e.list=t}},t.map(function(t,a){var n=c.a.createElement("div",{className:"info"},c.a.createElement("p",{className:"title"},t.course_title),c.a.createElement("p",{className:"contact"},"QQ\u7fa4\uff1a",t.course_qq),c.a.createElement(w,{item:t}));return c.a.createElement(d.a,Object.assign({img:t.image_name,handleClick:e.handleClick},t,{key:a,info:n,id:t.course_id}))}))),t.length%10!==0?c.a.createElement(g,{addCourseClick:this.addCourseClick}):null):c.a.createElement("div",{className:"empty"},c.a.createElement("p",null,c.a.createElement("i",{className:"iconfont iconfish"})),c.a.createElement("p",{className:"empty-prompt"},"\u8fd8\u662f\u54b8\u9c7c\u4e00\u6761\uff0c\u5feb\u53bb\u7ffb\u8eab~"),c.a.createElement("p",null,c.a.createElement(u.b,{className:"select-course",to:"/classify"},"\u53bb\u9009\u8bfe")))}}]),t}(l.PureComponent),C=Object(m.b)(function(e){return{courseList:e.myCourses.courseList,user:e.user}},{fetchCoursesListIfNeeded:f.d,switchTab:f.e})(L),k=(a(26),a(2)),N=a.n(k),O=a(18),S=(a(683),function(e){return c.a.createElement("li",{className:"course-base-item ".concat(e.className),onClick:e.handleClick.bind(void 0,e.id)},e.top,c.a.createElement("img",{src:e.img,alt:""}),c.a.createElement("p",{className:"course-title"},e.title),e.bottom)}),_=a(1),j=a(16),P=a.n(j),M=(a(684),function(e){return c.a.createElement("div",{className:"bottom"},c.a.createElement(O.h,{className:e.className},e.text),c.a.createElement("span",null,e.audience,"\u4eba\u89c2\u770b"))}),T=function(e){function t(){var e,a;Object(n.a)(this,t);for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return(a=Object(r.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(i)))).state={courses:[],live:[],page:1,num:10},a.handleClick=function(e){a.props.history.push("/play?id=".concat(e))},a.getFreeCourses=function(){return _.d.get("".concat(_.a.home,"/m/free_course/").concat(a.state.page,"/").concat(a.state.num))},a.getFreeLive=function(){return _.d.get("".concat(_.a.home,"/m/live/free_list"))},a.toLive=function(e){var t=e.room_id;e.live_status?window.location.assign("http://www-test.julyedu.com/live/m_room/".concat(t)):N.a.info("\u76f4\u64ad\u5373\u5c06\u5f00\u59cb\uff0c\u656c\u8bf7\u671f\u5f85",2,null,!1)},a}return Object(i.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){var e=this;this.getFreeCourses().then(function(t){var a=t.data;200==a.code?e.setState({courses:a.data}):N.a.info(a.msg)}),this.getFreeLive().then(function(t){var a=t.data;200==a.code?e.setState({live:Object(y.isEmpty)(a.data)?[]:a.data}):N.a.info(a.msg,2,null,!1)})}},{key:"render",value:function(){var e=this;return c.a.createElement("ul",{className:"free-courses"},this.state.live.map(function(t,a){var n=c.a.createElement("div",{className:"bottom"},c.a.createElement("div",{className:"animation-box"},new Array(4).fill("a").map(function(e,t){return c.a.createElement("i",{key:t,className:P()("column","column-".concat(t+1))})})),c.a.createElement("div",{className:"time"},"".concat(t.live_start_time))),o=t.live_status?c.a.createElement(O.h,{className:"tag-soon top"},"\u5373\u5c06\u5f00\u59cb"):c.a.createElement(O.h,{className:"tag-playing top"},"\u6b63\u5728\u76f4\u64ad");return c.a.createElement(S,{img:t.live_cover,title:t.live_title,top:o,bottom:n,key:t.live_id,className:"live",handleClick:e.toLive.bind(e,t),id:a})}),this.state.courses.map(function(t,a){return c.a.createElement(S,{img:t.logo,title:t.video_course_name,handleClick:e.handleClick,bottom:c.a.createElement(M,{audience:t.play_times,className:"tag-category",text:t.category}),id:t.v_course_id,key:a,className:"course-item"})}))}}]),t}(l.PureComponent),W=a(169),H=a(168),R=a(23),x=(a(250),function(e){function t(){var e,a;Object(n.a)(this,t);for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return(a=Object(r.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(i)))).state={position:{}},a}return Object(i.a)(t,e),Object(o.a)(t,[{key:"storeScrollPosition",value:function(e){}},{key:"render",value:function(){var e=this,t=this.props.match;return c.a.createElement("section",{id:"study"},c.a.createElement("div",{className:"tab"},c.a.createElement("div",null,c.a.createElement(u.c,{to:"".concat(t.url,"/my-course"),replace:!0,activeClassName:"active"},"\u6211\u7684\u8bfe\u7a0b")),c.a.createElement("div",null,c.a.createElement(u.c,{to:"".concat(t.url,"/free-course"),replace:!0,activeClassName:"active"},"\u514d\u8d39\u8bfe\u7a0b"))),c.a.createElement("div",{className:"study-container",ref:function(t){return e.list=t}},c.a.createElement(p.d,null,c.a.createElement(p.a,{exact:!0,from:"/study",to:"study/my-course"}),c.a.createElement(p.b,{path:"".concat(this.props.match.path,"/my-course"),component:C}),c.a.createElement(p.b,{path:"".concat(this.props.match.path,"/free-course"),component:T}))))}}]),t}(l.Component));t.default=Object(R.d)(H.a,W.a)(x)}}]);
//# sourceMappingURL=study.cb74c887.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["common/v-list-base/index.js","../node_modules/react-infinite-scroller/index.js","../node_modules/react-infinite-scroller/dist/InfiniteScroll.js","components/study/myCourses/index.js","common/course-base/index.js","components/study/freeCourses/index.js","components/study/index.js"],"names":["VList","props","react__WEBPACK_IMPORTED_MODULE_0___default","a","createElement","className","onClick","handleClick","bind","id","status","src","img","alt","info","tab","module","exports","__webpack_require__","Object","defineProperty","value","_createClass","defineProperties","target","i","length","descriptor","enumerable","configurable","writable","key","Constructor","protoProps","staticProps","prototype","_react","_react2","_interopRequireDefault","_propTypes2","obj","__esModule","default","InfiniteScroll","_Component","instance","TypeError","_classCallCheck","this","_this","self","call","ReferenceError","_possibleConstructorReturn","__proto__","getPrototypeOf","scrollListener","eventListenerOptions","mousewheelListener","subClass","superClass","create","constructor","setPrototypeOf","_inherits","Component","pageLoaded","pageStart","options","attachScrollListener","isReverse","loadMore","parentElement","getParentElement","scrollComponent","scrollTop","scrollHeight","beforeScrollHeight","beforeScrollTop","detachScrollListener","detachMousewheelListener","passive","testOptions","document","addEventListener","removeEventListener","e","useCapture","isPassiveSupported","loader","defaultLoader","scrollEl","window","useWindow","parentNode","el","scrollParent","getScrollParent","hasMore","initialLoad","deltaY","preventDefault","offset","doc","documentElement","body","undefined","pageYOffset","calculateOffset","clientHeight","Number","threshold","offsetParent","calculateTopPosition","offsetHeight","innerHeight","offsetTop","_this2","renderProps","filterProps","children","element","ref","keys","indexOf","hasOwnProperty","_objectWithoutProperties","node","childrenArray","unshift","push","propTypes","isRequired","bool","func","number","defaultProps","AddCourse","React","memo","_ref","addCourseClick","react_default","Record","_ref2","_ref2$record","record","seconds","lesson_name","result","matchResult","exec","studyTime","hour","Math","floor","min","sec","getStudyTime","String","padStart","concat","Bottom","_ref3","item","ago","date","Date","time","isToday","format","MyCourses","history","loadFunc","debounce","courseList","fetchCoursesListIfNeeded","switchTab","list","Fragment","user","data","uid","react_infinite_scroller_default","map","index","Info","course_title","course_qq","myCourses_Bottom","v_list_base","assign","image_name","react_router_dom","to","PureComponent","connect","state","myCourses","Course","top","title","bottom","common","text","audience","FreeCourse","courses","live","page","num","getFreeCourses","http","get","api","home","getFreeLive","toLive","room_id","live_status","location","toast_default","then","res","code","setState","msg","isEmpty","_this3","Array","fill","classnames","LiveStatus","common_course_base","logo","freeCourses_Bottom","category","Study","position","match","url","replace","activeClassName","react_router","exact","from","path","component","FreeCourses","compose","WithFullSize","WithTab"],"mappings":"qHAkBeA,IAfD,SAACC,GACX,OACIC,EAAAC,EAAAC,cAAA,MAAIC,UAAU,mBAAmBC,QAASL,EAAMM,YAAYC,YAAWP,EAAMQ,KACzEP,EAAAC,EAAAC,cAAA,OAAKC,UAAU,WACXH,EAAAC,EAAAC,cAAA,OAAKC,UAAU,SACVJ,EAAMS,OACPR,EAAAC,EAAAC,cAAA,OAAKO,IAAKV,EAAMW,IAAKC,IAAI,MAE5BZ,EAAMa,MAEVb,EAAMc,6FCbnBC,EAAAC,QAAiBC,EAAQ,uCCEzBC,OAAAC,eAAAH,EAAA,cACAI,OAAA,IAGA,IAAAC,EAAA,WACA,SAAAC,EAAAC,EAAAvB,GACA,QAAAwB,EAAA,EAAm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AK,SAASnD,GAAG,oBACjCpD,EAAA3I,EAAAC,cAAC+O,EAAA,EAAD,CAAOG,KAAI,GAAArF,OAAKjH,KAAK/C,MAAM8O,MAAMO,KAAtB,cAAwCC,UAAW5E,IAE9D7B,EAAA3I,EAAAC,cAAC+O,EAAA,EAAD,CAAOG,KAAI,GAAArF,OAAKjH,KAAK/C,MAAM8O,MAAMO,KAAtB,gBAA0CC,UAAWC,cArCpEvL,cAiDLwL,sBACXC,IACAC,IAFWF,CAGbZ","file":"static/js/study.fc72114b.chunk.js","sourcesContent":["import React from 'react';\nimport './index.scss'\n\nconst VList = (props) => {\n return (\n <li className='v-list-base-item' onClick={props.handleClick.bind(this, props.id)}>\n <div className=\"content\">\n <div className=\"cover\">\n {props.status}\n <img src={props.img} alt=\"\"/>\n </div>\n {props.info}\n </div>\n {props.tab}\n </li>\n );\n};\n\nexport default VList;","module.exports = require('./dist/InfiniteScroll');","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar InfiniteScroll = function (_Component) {\n _inherits(InfiniteScroll, _Component);\n\n function InfiniteScroll(props) {\n _classCallCheck(this, InfiniteScroll);\n\n var _this = _possibleConstructorReturn(this, (InfiniteScroll.__proto__ || Object.getPrototypeOf(InfiniteScroll)).call(this, props));\n\n _this.scrollListener = _this.scrollListener.bind(_this);\n _this.eventListenerOptions = _this.eventListenerOptions.bind(_this);\n _this.mousewheelListener = _this.mousewheelListener.bind(_this);\n return _this;\n }\n\n _createClass(InfiniteScroll, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.pageLoaded = this.props.pageStart;\n this.options = this.eventListenerOptions();\n this.attachScrollListener();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n if (this.props.isReverse && this.loadMore) {\n var parentElement = this.getParentElement(this.scrollComponent);\n parentElement.scrollTop = parentElement.scrollHeight - this.beforeScrollHeight + this.beforeScrollTop;\n this.loadMore = false;\n }\n\n this.attachScrollListener();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.detachScrollListener();\n this.detachMousewheelListener();\n }\n }, {\n key: 'isPassiveSupported',\n value: function isPassiveSupported() {\n var passive = false;\n var testOptions = {\n get passive() {\n passive = true;\n }\n\n };\n\n try {\n document.addEventListener('test', null, testOptions);\n document.removeEventListener('test', null, testOptions);\n } catch (e) {// ignore\n }\n\n return passive;\n }\n }, {\n key: 'eventListenerOptions',\n value: function eventListenerOptions() {\n var options = this.props.useCapture;\n\n if (this.isPassiveSupported()) {\n options = {\n useCapture: this.props.useCapture,\n passive: true\n };\n }\n\n return options;\n } // Set a defaut loader for all your `InfiniteScroll` components\n\n }, {\n key: 'setDefaultLoader',\n value: function setDefaultLoader(loader) {\n this.defaultLoader = loader;\n }\n }, {\n key: 'detachMousewheelListener',\n value: function detachMousewheelListener() {\n var scrollEl = window;\n\n if (this.props.useWindow === false) {\n scrollEl = this.scrollComponent.parentNode;\n }\n\n scrollEl.removeEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);\n }\n }, {\n key: 'detachScrollListener',\n value: function detachScrollListener() {\n var scrollEl = window;\n\n if (this.props.useWindow === false) {\n scrollEl = this.getParentElement(this.scrollComponent);\n }\n\n scrollEl.removeEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);\n scrollEl.removeEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);\n }\n }, {\n key: 'getParentElement',\n value: function getParentElement(el) {\n var scrollParent = this.props.getScrollParent && this.props.getScrollParent();\n\n if (scrollParent != null) {\n return scrollParent;\n }\n\n return el && el.parentNode;\n }\n }, {\n key: 'filterProps',\n value: function filterProps(props) {\n return props;\n }\n }, {\n key: 'attachScrollListener',\n value: function attachScrollListener() {\n var parentElement = this.getParentElement(this.scrollComponent);\n\n if (!this.props.hasMore || !parentElement) {\n return;\n }\n\n var scrollEl = window;\n\n if (this.props.useWindow === false) {\n scrollEl = parentElement;\n }\n\n scrollEl.addEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);\n scrollEl.addEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);\n scrollEl.addEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);\n\n if (this.props.initialLoad) {\n this.scrollListener();\n }\n }\n }, {\n key: 'mousewheelListener',\n value: function mousewheelListener(e) {\n // Prevents Chrome hangups\n // See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257\n if (e.deltaY === 1 && !this.isPassiveSupported()) {\n e.preventDefault();\n }\n }\n }, {\n key: 'scrollListener',\n value: function scrollListener() {\n var el = this.scrollComponent;\n var scrollEl = window;\n var parentNode = this.getParentElement(el);\n var offset = void 0;\n\n if (this.props.useWindow) {\n var doc = document.documentElement || document.body.parentNode || document.body;\n var scrollTop = scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : doc.scrollTop;\n\n if (this.props.isReverse) {\n offset = scrollTop;\n } else {\n offset = this.calculateOffset(el, scrollTop);\n }\n } else if (this.props.isReverse) {\n offset = parentNode.scrollTop;\n } else {\n offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight;\n } // Here we make sure the element is visible as well as checking the offset\n\n\n if (offset < Number(this.props.threshold) && el && el.offsetParent !== null) {\n this.detachScrollListener();\n this.beforeScrollHeight = parentNode.scrollHeight;\n this.beforeScrollTop = parentNode.scrollTop; // Call loadMore after detachScrollListener to allow for non-async loadMore functions\n\n if (typeof this.props.loadMore === 'function') {\n this.props.loadMore(this.pageLoaded += 1);\n this.loadMore = true;\n }\n }\n }\n }, {\n key: 'calculateOffset',\n value: function calculateOffset(el, scrollTop) {\n if (!el) {\n return 0;\n }\n\n return this.calculateTopPosition(el) + (el.offsetHeight - scrollTop - window.innerHeight);\n }\n }, {\n key: 'calculateTopPosition',\n value: function calculateTopPosition(el) {\n if (!el) {\n return 0;\n }\n\n return el.offsetTop + this.calculateTopPosition(el.offsetParent);\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var renderProps = this.filterProps(this.props);\n\n var children = renderProps.children,\n element = renderProps.element,\n hasMore = renderProps.hasMore,\n initialLoad = renderProps.initialLoad,\n isReverse = renderProps.isReverse,\n loader = renderProps.loader,\n loadMore = renderProps.loadMore,\n pageStart = renderProps.pageStart,\n ref = renderProps.ref,\n threshold = renderProps.threshold,\n useCapture = renderProps.useCapture,\n useWindow = renderProps.useWindow,\n getScrollParent = renderProps.getScrollParent,\n props = _objectWithoutProperties(renderProps, ['children', 'element', 'hasMore', 'initialLoad', 'isReverse', 'loader', 'loadMore', 'pageStart', 'ref', 'threshold', 'useCapture', 'useWindow', 'getScrollParent']);\n\n props.ref = function (node) {\n _this2.scrollComponent = node;\n\n if (ref) {\n ref(node);\n }\n };\n\n var childrenArray = [children];\n\n if (hasMore) {\n if (loader) {\n isReverse ? childrenArray.unshift(loader) : childrenArray.push(loader);\n } else if (this.defaultLoader) {\n isReverse ? childrenArray.unshift(this.defaultLoader) : childrenArray.push(this.defaultLoader);\n }\n }\n\n return _react2.default.createElement(element, props, childrenArray);\n }\n }]);\n\n return InfiniteScroll;\n}(_react.Component);\n\nInfiniteScroll.propTypes = {\n children: _propTypes2.default.node.isRequired,\n element: _propTypes2.default.node,\n hasMore: _propTypes2.default.bool,\n initialLoad: _propTypes2.default.bool,\n isReverse: _propTypes2.default.bool,\n loader: _propTypes2.default.node,\n loadMore: _propTypes2.default.func.isRequired,\n pageStart: _propTypes2.default.number,\n ref: _propTypes2.default.func,\n getScrollParent: _propTypes2.default.func,\n threshold: _propTypes2.default.number,\n useCapture: _propTypes2.default.bool,\n useWindow: _propTypes2.default.bool\n};\nInfiniteScroll.defaultProps = {\n element: 'div',\n hasMore: false,\n initialLoad: true,\n pageStart: 0,\n ref: null,\n threshold: 250,\n useWindow: true,\n isReverse: false,\n useCapture: false,\n loader: null,\n getScrollParent: null\n};\nexports.default = InfiniteScroll;\nmodule.exports = exports['default'];","import React, { PureComponent } from \"react\"\nimport VList from '@/common/v-list-base'\nimport './my-courses.scss'\nimport { isToday, format } from \"date-fns\"\nimport { connect } from \"react-redux\"\nimport { fetchCoursesListIfNeeded, switchTab } from \"./actions\"\nimport InfiniteScroll from 'react-infinite-scroller'\nimport { debounce } from 'lodash'\nimport { Link } from 'react-router-dom'\n\n\nfunction getStudyTime(seconds) {\n return {\n hour: Math.floor(seconds / (60 * 60)),\n min: Math.floor(seconds / 60) % 60,\n sec: seconds % 60\n }\n}\n\nconst AddCourse = React.memo(({addCourseClick}) => (\n <div className='add-course'>\n <button className='add' onClick={addCourseClick}>添加课程+</button>\n </div>\n))\n\nfunction Record({record: {seconds, lesson_name}}) {\n let re = /第[\\s\\S]+?课/,\n result = ''\n\n if (lesson_name) {\n let matchResult = re.exec(lesson_name)\n result += (matchResult && matchResult[0]) ? matchResult[0] : ''\n }\n\n if (seconds) {\n let studyTime = getStudyTime(seconds)\n let hour = studyTime.hour ? String(studyTime.hour).padStart(2, '0') + ':' : '',\n min = studyTime.min ? String(studyTime.min).padStart(2, '0') + ':' : '',\n sec = studyTime.sec ? String(studyTime.sec).padStart(2, '0') : ''\n\n result += hour + min + sec\n }\n\n return (\n <span className={'record'}>\n {\n result.length ? `学习到${result}` : null\n }\n </span>\n )\n}\n\n\nconst Bottom = React.memo(({item}) => {\n if (item.ago || item.seconds) {\n let date = new Date(item.ago * 1000)\n let time = isToday(date) ? format(date, 'HH时mm分') : format(date, 'MM月DD日')\n return (\n <div className=\"des\">\n <span className='time'>{time}</span>\n <Record record={item}/>\n </div>\n )\n }\n return (\n <button className='start-learn'>开始学习</button>\n )\n})\n\nclass MyCourses extends PureComponent {\n\n list;\n\n handleClick = id => {\n this.props.history.push(`/play/video?id=${id}`)\n }\n addCourseClick = () => {\n this.props.history.push('/classify')\n }\n\n componentDidMount() {\n this.props.switchTab(false)\n this.props.fetchCoursesListIfNeeded();\n }\n\n componentWillUnmount() {\n this.props.switchTab(true);\n }\n\n loadFunc = debounce(() => {\n if (this.props.courseList.length % 10 === 0) {\n this.props.fetchCoursesListIfNeeded();\n }\n }, 200)\n\n render() {\n let list = this.props.courseList\n if (list && list.length !== 0) {\n return (\n <>\n <div className=\"my-course-uid\">\n {`加群请备注您的学号:${this.props.user.data.uid}`}\n </div>\n <InfiniteScroll\n pageStart={0}\n hasMore={true}\n loadMore={this.loadFunc}\n useWindow={false}\n >\n <ul ref={el => this.list = el}>\n {\n list.map((item, index) => {\n\n const Info = (\n <div className=\"info\">\n <p className='title'>{item.course_title}</p>\n <p className='contact'>QQ群:{item.course_qq}</p>\n <Bottom item={item}/>\n </div>\n )\n return (\n <VList img={item.image_name}\n handleClick={this.handleClick}\n {...item}\n key={index}\n info={Info}\n id={item['course_id']}\n />\n )\n })\n }\n </ul>\n </InfiniteScroll>\n {\n list.length % 10 !== 0 ?\n <AddCourse addCourseClick={this.addCourseClick}/>\n : null\n }\n </>\n )\n } else {\n return (\n <div className=\"empty\">\n <p><i className='iconfont iconfish'/></p>\n <p className='empty-prompt'>还是咸鱼一条,快去翻身~</p>\n <p>\n <Link className='select-course' to='/classify'>去选课</Link>\n </p>\n </div>\n )\n }\n\n }\n}\n\nexport default connect(\n state => ({\n courseList: state.myCourses.courseList,\n user: state.user\n }),\n {\n fetchCoursesListIfNeeded,\n switchTab\n })(MyCourses)","import React from 'react'\nimport './course-base.scss'\n\nconst Course = (props) => {\n return (\n <li className={`course-base-item ${props.className}`} onClick={props.handleClick.bind(this, props.id)}>\n {props.top}\n <img src={props.img} alt=\"\"/>\n <p className=\"course-title\">{props.title}</p>\n {props.bottom}\n </li>\n );\n};\n\nexport default Course;\n\n","import React, { PureComponent } from 'react'\nimport { Tag } from '../../../common'\nimport Course from '@/common/course-base'\nimport { http, api } from '@/utils'\nimport { Toast } from \"antd-mobile\";\nimport classnames from 'classnames'\nimport { isEmpty } from 'lodash'\n\n\nimport './free-courses.scss'\n\nconst Bottom = (props) => (\n <div className='bottom'>\n <Tag className={props.className}>{props.text}</Tag>\n <span>{props.audience}人观看</span>\n </div>\n)\n\nclass FreeCourse extends PureComponent {\n state = {\n courses: [],\n live: [],\n page: 1,\n num: 10\n }\n\n componentDidMount() {\n this.getFreeCourses()\n .then(res => {\n let data = res.data\n if (data.code == 200) {\n this.setState({\n courses: data.data,\n })\n } else {\n Toast.info(data.msg)\n }\n })\n this.getFreeLive()\n .then(res => {\n let data = res.data\n if (data.code == 200) {\n this.setState({\n live: isEmpty(data.data) ? [] : data.data\n })\n } else {\n Toast.info(data.msg, 2, null, false)\n }\n })\n }\n\n handleClick = id => {\n this.props.history.push(`/play?id=${id}`)\n }\n\n getFreeCourses = () => {\n return http.get(`${api.home}/m/free_course/${this.state.page}/${this.state.num}`)\n }\n\n getFreeLive = () => {\n return http.get(`${api.home}/m/live/free_list`)\n }\n\n toLive = live => {\n const {room_id, live_status} = live\n if (live_status) {\n window.location.assign(`http://www-test.julyedu.com/live/m_room/${room_id}`)\n } else {\n Toast.info('直播即将开始,敬请期待', 2, null, false)\n }\n }\n\n render() {\n return (\n <ul className='free-courses'>\n {\n this.state.live.map((item, index) => {\n const Bottom = (\n <div className=\"bottom\">\n <div className=\"animation-box\">\n {new Array(4).fill('a').map((item, index) => {\n return <i key={index} className={classnames('column', `column-${index + 1}`)}/>\n })}\n </div>\n <div className=\"time\">{`${item['live_start_time']}`}</div>\n </div>\n )\n\n const LiveStatus = (\n item['live_status'] ? <Tag className={'tag-soon top'}>即将开始</Tag> :\n <Tag className={'tag-playing top'}>正在直播</Tag>\n )\n return (\n <Course\n img={item['live_cover']}\n title={item['live_title']}\n top={LiveStatus}\n bottom={Bottom}\n key={item['live_id']}\n className={'live'}\n handleClick={this.toLive.bind(this, item)}\n id={index}\n />\n )\n })\n }\n {\n this.state.courses.map((item, index) => (\n <Course\n img={item.logo}\n title={item['video_course_name']}\n handleClick={this.handleClick}\n bottom={\n <Bottom audience={item['play_times']} className={'tag-category'} text={item.category}/>\n }\n id={item['v_course_id']}\n key={index}\n className={'course-item'}\n />\n ))\n }\n </ul>\n )\n }\n}\n\n\nexport default FreeCourse","import React, { Component } from 'react'\nimport './study.scss'\n\nimport { NavLink, Route, Switch, Redirect } from \"react-router-dom\"\nimport MyCourses from \"./myCourses\"\nimport FreeCourses from './freeCourses'\nimport WithTab from '@/HOCs/WithTab'\nimport WithFullSize from '@/HOCs/WithFullSize'\nimport { compose } from 'redux'\nimport PrivateRoute from '@/router/privateRoute'\n\n\nclass Study extends Component {\n\n state = {\n position: {\n\n }\n }\n\n list;\n\n storeScrollPosition(tab){\n\n }\n\n render() {\n const {match} = this.props;\n return (\n <section id='study'>\n <div className='tab'>\n <div>\n <NavLink to={`${match.url}/my-course`}\n replace\n activeClassName='active'\n >我的课程</NavLink>\n </div>\n <div>\n <NavLink to={`${match.url}/free-course`}\n replace\n activeClassName='active'\n >免费课程</NavLink>\n </div>\n </div>\n <div className=\"study-container\" ref={el => this.list = el}>\n <Switch>\n <Redirect exact from='/study' to='study/my-course'/>\n <Route path={`${this.props.match.path}/my-course`} component={MyCourses}/>\n {/*<PrivateRoute path={`${this.props.match.path}/my-course`} component={MyCourses}/>*/}\n <Route path={`${this.props.match.path}/free-course`} component={FreeCourses}/>\n {/*<Route path={`${this.props.match.path}/my-course`} render={props => {\n <MyCourses storeScrollPosition={this.storeScrollPosition}/>\n }}/>*/}\n </Switch>\n </div>\n </section>\n )\n }\n\n}\n\nexport default compose(\n WithFullSize,\n WithTab\n)(Study)"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["common/v-list-base/index.js","../node_modules/react-infinite-scroller/index.js","../node_modules/react-infinite-scroller/dist/InfiniteScroll.js","components/study/myCourses/index.js","common/course-base/index.js","components/study/freeCourses/index.js","components/study/index.js"],"names":["VList","props","react__WEBPACK_IMPORTED_MODULE_0___default","a","createElement","className","onClick","handleClick","bind","id","status","src","img","alt","info","tab","module","exports","__webpack_require__","Object","defineProperty","value","_createClass","defineProperties","target","i","length","descriptor","enumerable","configurable","writable","key","Constructor","protoProps","staticProps","prototype","_react","_react2","_interopRequireDefault","_propTypes2","obj","__esModule","default","InfiniteScroll","_Component","instance","TypeError","_classCallCheck","this","_this","self","call","ReferenceError","_possibleConstructorReturn","__proto__","getPrototypeOf","scrollListener","eventListenerOptions","mousewheelListener","subClass","superClass","create","constructor","setPrototypeOf","_inherits","Component","pageLoaded","pageStart","options","attachScrollListener","isReverse","loadMore","parentElement","getParentElement","scrollComponent","scrollTop","scrollHeight","beforeScrollHeight","beforeScrollTop","detachScrollListener","detachMousewheelListener","passive","testOptions","document","addEventListener","removeEventListener","e","useCapture","isPassiveSupported","loader","defaultLoader","scrollEl","window","useWindow","parentNode","el","scrollParent","getScrollParent","hasMore","initialLoad","deltaY","preventDefault","offset","doc","documentElement","body","undefined","pageYOffset","calculateOffset","clientHeight","Number","threshold","offsetParent","calculateTopPosition","offsetHeight","innerHeight","offsetTop","_this2","renderProps","filterProps","children","element","ref","keys","indexOf","hasOwnProperty","_objectWithoutProperties","node","childrenArray","unshift","push","propTypes","isRequired","bool","func","number","defaultProps","AddCourse","React","memo","_ref","addCourseClick","react_default","Record","_ref2","_ref2$record","record","seconds","lesson_name","result","matchResult","exec","studyTime","hour","Math","floor","min","sec","getStudyTime","String","padStart","concat","Bottom","_ref3","item","ago","date","Date","time","isToday","format","MyCourses","history","loadFunc","debounce","courseList","fetchCoursesListIfNeeded","switchTab","list","Fragment","user","data","uid","react_infinite_scroller_default","map","index","Info","course_title","course_qq","myCourses_Bottom","v_list_base","assign","image_name","react_router_dom","to","PureComponent","connect","state","myCourses","Course","top","title","bottom","common","text","audience","FreeCourse","courses","live","page","num","getFreeCourses","http","get","api","home","getFreeLive","toLive","room_id","live_status","location","toast_default","then","res","code","setState","msg","isEmpty","_this3","Array","fill","classnames","LiveStatus","common_course_base","logo","freeCourses_Bottom","category","Study","position","match","url","replace","activeClassName","react_router","exact","from","path","component","FreeCourses","compose","WithFullSize","WithTab"],"mappings":"qHAkBeA,IAfD,SAACC,GACX,OACIC,EAAAC,EAAAC,cAAA,MAAIC,UAAU,mBAAmBC,QAASL,EAAMM,YAAYC,YAAWP,EAAMQ,KACzEP,EAAAC,EAAAC,cAAA,OAAKC,UAAU,WACXH,EAAAC,EAAAC,cAAA,OAAKC,UAAU,SACVJ,EAAMS,OACPR,EAAAC,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BAAgB,UAFzB,8BAMRpG,EAAA3I,EAAAC,cAAA,OAAKC,UAAU,kBAAkBqH,IAAK,SAAA3B,GAAE,OAAIsB,EAAK6D,KAAOnF,IACpD+C,EAAA3I,EAAAC,cAAC+O,EAAA,EAAD,KACIrG,EAAA3I,EAAAC,cAAC+O,EAAA,EAAD,CAAUC,OAAK,EAACC,KAAK,SAASnD,GAAG,oBACjCpD,EAAA3I,EAAAC,cAAC+O,EAAA,EAAD,CAAOG,KAAI,GAAArF,OAAKjH,KAAK/C,MAAM8O,MAAMO,KAAtB,cAAwCC,UAAW5E,IAE9D7B,EAAA3I,EAAAC,cAAC+O,EAAA,EAAD,CAAOG,KAAI,GAAArF,OAAKjH,KAAK/C,MAAM8O,MAAMO,KAAtB,gBAA0CC,UAAWC,cArCpEvL,cAiDLwL,sBACXC,IACAC,IAFWF,CAGbZ","file":"static/js/study.cb74c887.chunk.js","sourcesContent":["import React from 'react';\nimport './index.scss'\n\nconst VList = (props) => {\n return (\n <li className='v-list-base-item' onClick={props.handleClick.bind(this, props.id)}>\n <div className=\"content\">\n <div className=\"cover\">\n {props.status}\n <img src={props.img} alt=\"\"/>\n </div>\n {props.info}\n </div>\n {props.tab}\n </li>\n );\n};\n\nexport default VList;","module.exports = require('./dist/InfiniteScroll');","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar InfiniteScroll = function (_Component) {\n _inherits(InfiniteScroll, _Component);\n\n function InfiniteScroll(props) {\n _classCallCheck(this, InfiniteScroll);\n\n var _this = _possibleConstructorReturn(this, (InfiniteScroll.__proto__ || Object.getPrototypeOf(InfiniteScroll)).call(this, props));\n\n _this.scrollListener = _this.scrollListener.bind(_this);\n _this.eventListenerOptions = _this.eventListenerOptions.bind(_this);\n _this.mousewheelListener = _this.mousewheelListener.bind(_this);\n return _this;\n }\n\n _createClass(InfiniteScroll, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.pageLoaded = this.props.pageStart;\n this.options = this.eventListenerOptions();\n this.attachScrollListener();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n if (this.props.isReverse && this.loadMore) {\n var parentElement = this.getParentElement(this.scrollComponent);\n parentElement.scrollTop = parentElement.scrollHeight - this.beforeScrollHeight + this.beforeScrollTop;\n this.loadMore = false;\n }\n\n this.attachScrollListener();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.detachScrollListener();\n this.detachMousewheelListener();\n }\n }, {\n key: 'isPassiveSupported',\n value: function isPassiveSupported() {\n var passive = false;\n var testOptions = {\n get passive() {\n passive = true;\n }\n\n };\n\n try {\n document.addEventListener('test', null, testOptions);\n document.removeEventListener('test', null, testOptions);\n } catch (e) {// ignore\n }\n\n return passive;\n }\n }, {\n key: 'eventListenerOptions',\n value: function eventListenerOptions() {\n var options = this.props.useCapture;\n\n if (this.isPassiveSupported()) {\n options = {\n useCapture: this.props.useCapture,\n passive: true\n };\n }\n\n return options;\n } // Set a defaut loader for all your `InfiniteScroll` components\n\n }, {\n key: 'setDefaultLoader',\n value: function setDefaultLoader(loader) {\n this.defaultLoader = loader;\n }\n }, {\n key: 'detachMousewheelListener',\n value: function detachMousewheelListener() {\n var scrollEl = window;\n\n if (this.props.useWindow === false) {\n scrollEl = this.scrollComponent.parentNode;\n }\n\n scrollEl.removeEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);\n }\n }, {\n key: 'detachScrollListener',\n value: function detachScrollListener() {\n var scrollEl = window;\n\n if (this.props.useWindow === false) {\n scrollEl = this.getParentElement(this.scrollComponent);\n }\n\n scrollEl.removeEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);\n scrollEl.removeEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);\n }\n }, {\n key: 'getParentElement',\n value: function getParentElement(el) {\n var scrollParent = this.props.getScrollParent && this.props.getScrollParent();\n\n if (scrollParent != null) {\n return scrollParent;\n }\n\n return el && el.parentNode;\n }\n }, {\n key: 'filterProps',\n value: function filterProps(props) {\n return props;\n }\n }, {\n key: 'attachScrollListener',\n value: function attachScrollListener() {\n var parentElement = this.getParentElement(this.scrollComponent);\n\n if (!this.props.hasMore || !parentElement) {\n return;\n }\n\n var scrollEl = window;\n\n if (this.props.useWindow === false) {\n scrollEl = parentElement;\n }\n\n scrollEl.addEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);\n scrollEl.addEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);\n scrollEl.addEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);\n\n if (this.props.initialLoad) {\n this.scrollListener();\n }\n }\n }, {\n key: 'mousewheelListener',\n value: function mousewheelListener(e) {\n // Prevents Chrome hangups\n // See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257\n if (e.deltaY === 1 && !this.isPassiveSupported()) {\n e.preventDefault();\n }\n }\n }, {\n key: 'scrollListener',\n value: function scrollListener() {\n var el = this.scrollComponent;\n var scrollEl = window;\n var parentNode = this.getParentElement(el);\n var offset = void 0;\n\n if (this.props.useWindow) {\n var doc = document.documentElement || document.body.parentNode || document.body;\n var scrollTop = scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : doc.scrollTop;\n\n if (this.props.isReverse) {\n offset = scrollTop;\n } else {\n offset = this.calculateOffset(el, scrollTop);\n }\n } else if (this.props.isReverse) {\n offset = parentNode.scrollTop;\n } else {\n offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight;\n } // Here we make sure the element is visible as well as checking the offset\n\n\n if (offset < Number(this.props.threshold) && el && el.offsetParent !== null) {\n this.detachScrollListener();\n this.beforeScrollHeight = parentNode.scrollHeight;\n this.beforeScrollTop = parentNode.scrollTop; // Call loadMore after detachScrollListener to allow for non-async loadMore functions\n\n if (typeof this.props.loadMore === 'function') {\n this.props.loadMore(this.pageLoaded += 1);\n this.loadMore = true;\n }\n }\n }\n }, {\n key: 'calculateOffset',\n value: function calculateOffset(el, scrollTop) {\n if (!el) {\n return 0;\n }\n\n return this.calculateTopPosition(el) + (el.offsetHeight - scrollTop - window.innerHeight);\n }\n }, {\n key: 'calculateTopPosition',\n value: function calculateTopPosition(el) {\n if (!el) {\n return 0;\n }\n\n return el.offsetTop + this.calculateTopPosition(el.offsetParent);\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var renderProps = this.filterProps(this.props);\n\n var children = renderProps.children,\n element = renderProps.element,\n hasMore = renderProps.hasMore,\n initialLoad = renderProps.initialLoad,\n isReverse = renderProps.isReverse,\n loader = renderProps.loader,\n loadMore = renderProps.loadMore,\n pageStart = renderProps.pageStart,\n ref = renderProps.ref,\n threshold = renderProps.threshold,\n useCapture = renderProps.useCapture,\n useWindow = renderProps.useWindow,\n getScrollParent = renderProps.getScrollParent,\n props = _objectWithoutProperties(renderProps, ['children', 'element', 'hasMore', 'initialLoad', 'isReverse', 'loader', 'loadMore', 'pageStart', 'ref', 'threshold', 'useCapture', 'useWindow', 'getScrollParent']);\n\n props.ref = function (node) {\n _this2.scrollComponent = node;\n\n if (ref) {\n ref(node);\n }\n };\n\n var childrenArray = [children];\n\n if (hasMore) {\n if (loader) {\n isReverse ? childrenArray.unshift(loader) : childrenArray.push(loader);\n } else if (this.defaultLoader) {\n isReverse ? childrenArray.unshift(this.defaultLoader) : childrenArray.push(this.defaultLoader);\n }\n }\n\n return _react2.default.createElement(element, props, childrenArray);\n }\n }]);\n\n return InfiniteScroll;\n}(_react.Component);\n\nInfiniteScroll.propTypes = {\n children: _propTypes2.default.node.isRequired,\n element: _propTypes2.default.node,\n hasMore: _propTypes2.default.bool,\n initialLoad: _propTypes2.default.bool,\n isReverse: _propTypes2.default.bool,\n loader: _propTypes2.default.node,\n loadMore: _propTypes2.default.func.isRequired,\n pageStart: _propTypes2.default.number,\n ref: _propTypes2.default.func,\n getScrollParent: _propTypes2.default.func,\n threshold: _propTypes2.default.number,\n useCapture: _propTypes2.default.bool,\n useWindow: _propTypes2.default.bool\n};\nInfiniteScroll.defaultProps = {\n element: 'div',\n hasMore: false,\n initialLoad: true,\n pageStart: 0,\n ref: null,\n threshold: 250,\n useWindow: true,\n isReverse: false,\n useCapture: false,\n loader: null,\n getScrollParent: null\n};\nexports.default = InfiniteScroll;\nmodule.exports = exports['default'];","import React, { PureComponent } from \"react\"\nimport VList from '@/common/v-list-base'\nimport './my-courses.scss'\nimport { isToday, format } from \"date-fns\"\nimport { connect } from \"react-redux\"\nimport { fetchCoursesListIfNeeded, switchTab } from \"./actions\"\nimport InfiniteScroll from 'react-infinite-scroller'\nimport { debounce } from 'lodash'\nimport { Link } from 'react-router-dom'\n\n\nfunction getStudyTime(seconds) {\n return {\n hour: Math.floor(seconds / (60 * 60)),\n min: Math.floor(seconds / 60) % 60,\n sec: seconds % 60\n }\n}\n\nconst AddCourse = React.memo(({addCourseClick}) => (\n <div className='add-course'>\n <button className='add' onClick={addCourseClick}>添加课程+</button>\n </div>\n))\n\nfunction Record({record: {seconds, lesson_name}}) {\n let re = /第[\\s\\S]+?课/,\n result = ''\n\n if (lesson_name) {\n let matchResult = re.exec(lesson_name)\n result += (matchResult && matchResult[0]) ? matchResult[0] : ''\n }\n\n if (seconds) {\n let studyTime = getStudyTime(seconds)\n let hour = studyTime.hour ? String(studyTime.hour).padStart(2, '0') + ':' : '',\n min = studyTime.min ? String(studyTime.min).padStart(2, '0') + ':' : '',\n sec = studyTime.sec ? String(studyTime.sec).padStart(2, '0') : ''\n\n result += hour + min + sec\n }\n\n return (\n <span className={'record'}>\n {\n result.length ? `学习到${result}` : null\n }\n </span>\n )\n}\n\n\nconst Bottom = React.memo(({item}) => {\n if (item.ago || item.seconds) {\n let date = new Date(item.ago * 1000)\n let time = isToday(date) ? format(date, 'HH时mm分') : format(date, 'MM月DD日')\n return (\n <div className=\"des\">\n <span className='time'>{time}</span>\n <Record record={item}/>\n </div>\n )\n }\n return (\n <button className='start-learn'>开始学习</button>\n )\n})\n\nclass MyCourses extends PureComponent {\n\n list;\n\n handleClick = id => {\n this.props.history.push(`/play/video?id=${id}`)\n }\n addCourseClick = () => {\n this.props.history.push('/classify')\n }\n\n componentDidMount() {\n this.props.switchTab(false)\n this.props.fetchCoursesListIfNeeded();\n }\n\n componentWillUnmount() {\n this.props.switchTab(true);\n }\n\n loadFunc = debounce(() => {\n if (this.props.courseList.length % 10 === 0) {\n this.props.fetchCoursesListIfNeeded();\n }\n }, 200)\n\n render() {\n let list = this.props.courseList\n if (list && list.length !== 0) {\n return (\n <>\n <div className=\"my-course-uid\">\n {`加群请备注您的学号:${this.props.user.data.uid}`}\n </div>\n <InfiniteScroll\n pageStart={0}\n hasMore={true}\n loadMore={this.loadFunc}\n useWindow={false}\n >\n <ul ref={el => this.list = el}>\n {\n list.map((item, index) => {\n\n const Info = (\n <div className=\"info\">\n <p className='title'>{item.course_title}</p>\n <p className='contact'>QQ群:{item.course_qq}</p>\n <Bottom item={item}/>\n </div>\n )\n return (\n <VList img={item.image_name}\n handleClick={this.handleClick}\n {...item}\n key={index}\n info={Info}\n id={item['course_id']}\n />\n )\n })\n }\n </ul>\n </InfiniteScroll>\n {\n list.length % 10 !== 0 ?\n <AddCourse addCourseClick={this.addCourseClick}/>\n : null\n }\n </>\n )\n } else {\n return (\n <div className=\"empty\">\n <p><i className='iconfont iconfish'/></p>\n <p className='empty-prompt'>还是咸鱼一条,快去翻身~</p>\n <p>\n <Link className='select-course' to='/classify'>去选课</Link>\n </p>\n </div>\n )\n }\n\n }\n}\n\nexport default connect(\n state => ({\n courseList: state.myCourses.courseList,\n user: state.user\n }),\n {\n fetchCoursesListIfNeeded,\n switchTab\n })(MyCourses)","import React from 'react'\nimport './course-base.scss'\n\nconst Course = (props) => {\n return (\n <li className={`course-base-item ${props.className}`} onClick={props.handleClick.bind(this, props.id)}>\n {props.top}\n <img src={props.img} alt=\"\"/>\n <p className=\"course-title\">{props.title}</p>\n {props.bottom}\n </li>\n );\n};\n\nexport default Course;\n\n","import React, { PureComponent } from 'react'\nimport { Tag } from '../../../common'\nimport Course from '@/common/course-base'\nimport { http, api } from '@/utils'\nimport { Toast } from \"antd-mobile\";\nimport classnames from 'classnames'\nimport { isEmpty } from 'lodash'\n\n\nimport './free-courses.scss'\n\nconst Bottom = (props) => (\n <div className='bottom'>\n <Tag className={props.className}>{props.text}</Tag>\n <span>{props.audience}人观看</span>\n </div>\n)\n\nclass FreeCourse extends PureComponent {\n state = {\n courses: [],\n live: [],\n page: 1,\n num: 10\n }\n\n componentDidMount() {\n this.getFreeCourses()\n .then(res => {\n let data = res.data\n if (data.code == 200) {\n this.setState({\n courses: data.data,\n })\n } else {\n Toast.info(data.msg)\n }\n })\n this.getFreeLive()\n .then(res => {\n let data = res.data\n if (data.code == 200) {\n this.setState({\n live: isEmpty(data.data) ? [] : data.data\n })\n } else {\n Toast.info(data.msg, 2, null, false)\n }\n })\n }\n\n handleClick = id => {\n this.props.history.push(`/play?id=${id}`)\n }\n\n getFreeCourses = () => {\n return http.get(`${api.home}/m/free_course/${this.state.page}/${this.state.num}`)\n }\n\n getFreeLive = () => {\n return http.get(`${api.home}/m/live/free_list`)\n }\n\n toLive = live => {\n const {room_id, live_status} = live\n if (live_status) {\n window.location.assign(`http://www-test.julyedu.com/live/m_room/${room_id}`)\n } else {\n Toast.info('直播即将开始,敬请期待', 2, null, false)\n }\n }\n\n render() {\n return (\n <ul className='free-courses'>\n {\n this.state.live.map((item, index) => {\n const Bottom = (\n <div className=\"bottom\">\n <div className=\"animation-box\">\n {new Array(4).fill('a').map((item, index) => {\n return <i key={index} className={classnames('column', `column-${index + 1}`)}/>\n })}\n </div>\n <div className=\"time\">{`${item['live_start_time']}`}</div>\n </div>\n )\n\n const LiveStatus = (\n item['live_status'] ? <Tag className={'tag-soon top'}>即将开始</Tag> :\n <Tag className={'tag-playing top'}>正在直播</Tag>\n )\n return (\n <Course\n img={item['live_cover']}\n title={item['live_title']}\n top={LiveStatus}\n bottom={Bottom}\n key={item['live_id']}\n className={'live'}\n handleClick={this.toLive.bind(this, item)}\n id={index}\n />\n )\n })\n }\n {\n this.state.courses.map((item, index) => (\n <Course\n img={item.logo}\n title={item['video_course_name']}\n handleClick={this.handleClick}\n bottom={\n <Bottom audience={item['play_times']} className={'tag-category'} text={item.category}/>\n }\n id={item['v_course_id']}\n key={index}\n className={'course-item'}\n />\n ))\n }\n </ul>\n )\n }\n}\n\n\nexport default FreeCourse","import React, { Component } from 'react'\nimport './study.scss'\n\nimport { NavLink, Route, Switch, Redirect } from \"react-router-dom\"\nimport MyCourses from \"./myCourses\"\nimport FreeCourses from './freeCourses'\nimport WithTab from '@/HOCs/WithTab'\nimport WithFullSize from '@/HOCs/WithFullSize'\nimport { compose } from 'redux'\nimport PrivateRoute from '@/router/privateRoute'\n\n\nclass Study extends Component {\n\n state = {\n position: {\n\n }\n }\n\n list;\n\n storeScrollPosition(tab){\n\n }\n\n render() {\n const {match} = this.props;\n return (\n <section id='study'>\n <div className='tab'>\n <div>\n <NavLink to={`${match.url}/my-course`}\n replace\n activeClassName='active'\n >我的课程</NavLink>\n </div>\n <div>\n <NavLink to={`${match.url}/free-course`}\n replace\n activeClassName='active'\n >免费课程</NavLink>\n </div>\n </div>\n <div className=\"study-container\" ref={el => this.list = el}>\n <Switch>\n <Redirect exact from='/study' to='study/my-course'/>\n <Route path={`${this.props.match.path}/my-course`} component={MyCourses}/>\n {/*<PrivateRoute path={`${this.props.match.path}/my-course`} component={MyCourses}/>*/}\n <Route path={`${this.props.match.path}/free-course`} component={FreeCourses}/>\n {/*<Route path={`${this.props.match.path}/my-course`} render={props => {\n <MyCourses storeScrollPosition={this.storeScrollPosition}/>\n }}/>*/}\n </Switch>\n </div>\n </section>\n )\n }\n\n}\n\nexport default compose(\n WithFullSize,\n WithTab\n)(Study)"],"sourceRoot":""}
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{764:function(e,a,t){},770:function(e,a,t){"use strict";t.r(a);t(62);var n=t(33),c=t.n(n),s=(t(49),t(17)),r=t.n(s),i=(t(61),t(21)),o=t.n(i),l=(t(26),t(2)),m=t.n(l),d=t(20),u=t(3),p=t(4),E=t(7),_=t(5),g=t(6),f=t(0),N=t.n(f),v=(t(764),t(18)),h=t(1),b=(t(19),t(11)),w=function(e){function a(e){var t;return Object(u.a)(this,a),(t=Object(E.a)(this,Object(_.a)(a).call(this,e))).invitedFriends=function(){var e=t.state,a=e.pdd_price,n=e.number,c=e.data;if(h.b.isWeixin){var s=t.state.share;t.setState({share:!s});var r={title:"\u3010\u4ec5\u5269".concat(n,"\u4e2a\u540d\u989d\u3011\u6211").concat(a,"\u5143\u62fc\u4e86\u300a").concat(c.course_title,"\u300b"),desc:c.course_title,link:location.origin+"/detail??id=".concat(c.course_id),imgUrl:c.image_name};h.d.post("".concat(h.a["pay-api"],"/m/sale/signature")).then(function(e){var a=e.data,t=a.nonce_str,n=a.signature,c=a.timestamp;wx.config({debug:!1,appId:"wx23dac6775ac82877",timestamp:c,nonceStr:t,signature:n,jsApiList:["hideMenuItems","showMenuItems","updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareAppMessage"]})}),wx.ready(function(){wx.hideAllNonBaseMenuItem(),wx.showMenuItems({menuList:["menuItem:share:appMessage","menuItem:share:timeline"]}),wx.updateAppMessageShareData(Object(d.a)({},r,{success:function(){}})),wx.updateTimelineShareData(Object(d.a)({},r,{success:function(){}}))})}else m.a.info("\u8bf7\u5728\u5fae\u4fe1\u4e2d\u4f7f\u7528\u5206\u4eab\u529f\u80fd\uff01",2)},t.state={data:{},share:!1,pdd_price:0,groupon_member:[],person_num:0,is_success:!1,userInfo:{},number:0},t}return Object(g.a)(a,e),Object(p.a)(a,[{key:"componentDidMount",value:function(){var e=this;Promise.all([h.d.get("".concat(h.a["pay-api"],"/pdd/goupon_pay_page/").concat(Object(h.c)("id"))),h.d.get("".concat(h.a.home,"/m/user_info"))]).then(function(a){console.log(a);var t=a[0],n=a[1];if(e.setState({data:t.data.data.course_info,pdd_price:t.data.data.pdd_price,groupon_member:t.data.data.groupon_member,is_success:t.data.data.is_success,person_num:t.data.data.person_num,course_list:t.data.data.course_list,userInfo:n,number:t.data.data.number,countdown:""}),0===t.data.data.is_success){var c=1e3*t.data.data.end_time,s=0,r=0,i=0;setInterval(function(){c-=1e3,s="".concat(parseInt(c/36e5)).padStart(2,0),r="".concat(parseInt((c-36e5*s)/6e4)).padStart(2,0),i="".concat(parseInt((c-36e5*s-6e4*r)/1e3)).padStart(2,0),e.setState({countdown:"".concat(s,":").concat(r,":").concat(i)})},1e3)}})}},{key:"render",value:function(){var e=this.state,a=e.data,t=a.course_id,n=a.course_title,c=a.simpledescription,s=a.price0,r=a.price1,i=(e.pdd_price,e.is_success),l=(e.person_num,e.groupon_member,e.course_list),m=N.a.createElement("div",{className:"info"},N.a.createElement("p",{className:"title"},N.a.createElement(b.b,{to:"/detail?id=".concat(t)},n)),N.a.createElement("p",{className:"contact text-overflow-2"},c),N.a.createElement("div",{className:"des"},N.a.createElement("p",{className:"course-price"},N.a.createElement("span",{className:"new"},"\xa5",r),N.a.createElement("span",{className:"old"},"\xa5",s))));return N.a.createElement("div",{className:"to-group-box"},N.a.createElement(v.e,{title:"\u62fc\u56e2",arrow:!0,cart:!1}),!i&&N.a.createElement(v.i,{img:this.state.data.image_name,id:this.state.data.course_id,info:m}),N.a.createElement(y,{data:this.state,invitedFriends:this.invitedFriends}),N.a.createElement(o.a,null),N.a.createElement("div",{className:"group-course"},N.a.createElement("div",{className:"top-title"},N.a.createElement("span",null,"\u672c\u5468\u7279\u60e0"),N.a.createElement(b.b,{to:"/preferential",className:"more"},"\u66f4\u591a",N.a.createElement("i",{className:"iconfont iconiconfront-70"}))),l&&l.length>0&&l[0].course&&l[0].course.length>0&&l[0].course.slice(0,4).map(function(e){var a=N.a.createElement("div",{className:"info"},N.a.createElement("p",{className:"title"},N.a.createElement(b.b,{to:"/detail?id=".concat(e.course_id)},e.course_title)),N.a.createElement("p",{className:"contact text-overflow-2"},e.simpledescription),N.a.createElement("div",{className:"des"},N.a.createElement("p",{className:"course-price"},N.a.createElement("span",{className:"new"},"\xa5",e.price1),N.a.createElement("span",{className:"old"},"\xa5",e.price0))));return N.a.createElement(v.i,{img:e.image_name,key:e.uid,id:e.course_id,info:a})})))}}]),a}(f.Component);function y(e){for(var a,t,n,s,i=e.data,o=i.pdd_price,l=i.data,m=i.groupon_member,d=i.is_success,u=i.person_num,p=i.userInfo,E=i.share,_=i.number,g=i.countdown,f=[],v=_;0!=v;)f.push(v),v--;if(s=N.a.createElement("div",{className:"group-user-list"},N.a.createElement(r.a,{justify:"center",className:"imgList"},m.map(function(e){return N.a.createElement("div",{className:"imgContainer",key:Math.random()},N.a.createElement("img",{className:"imgname",src:e.avatar,alt:""}),1===e.user_type?N.a.createElement("div",{className:"leaderFlag"},N.a.createElement("span",null,"\u56e2\u957f")):null)}),f.map(function(e){return N.a.createElement("div",{className:"imgContainer",key:Math.random()},N.a.createElement("div",{className:"imgname"},N.a.createElement("i",{className:"iconfont iconwode-xianxing no-body"})))}))),m&&m.length>0){var h="";m.map(function(e){1===e.user_type&&(h="".concat(e.uid))}),h===p.data.data.uid?(a=N.a.createElement("p",{className:"tip"},"\u62fc\u56e2\u7701\uffe5".concat(o,"\u5143")),t=N.a.createElement("span",{className:"group-btn",onClick:e.invitedFriends},"\u9080\u8bf7\u597d\u53cb\u53c2\u56e2 ",g," \u540e\u7ed3\u675f"),n=N.a.createElement("p",{className:"dec"},"\u5206\u4eab\u52303\u4e2a\u7fa4\u540e\uff0c\u6210\u56e2\u7387\u9ad8\u8fbe98%")):(a=N.a.createElement("p",{className:"tip"},"\u62fc\u56e2\u7701\uffe5".concat(o,"\u5143")),t=N.a.createElement(b.b,{to:"/order?id=".concat(l.course_id),className:"group-btn"},"\u4e00\u952e\u53c2\u56e2"))}return 1===d&&(a=N.a.createElement("p",{className:"success"},"\u62fc\u56e2\u6210\u529f"),t=N.a.createElement(b.b,{to:"/play",className:"tostudy"},"\u53bb\u5b66\u4e60")),N.a.createElement("div",{className:"gorup-content"},E?N.a.createElement("div",{className:"groupSuccessMbc",onClick:e.invitedFriends},N.a.createElement("div",{className:"tipContent"},"\u8fd8\u5dee".concat(_,"\u4eba\uff0c\u5206\u4eab\u52303\u4e2a\u7fa4\uff0c\u6210\u56e2\u7387\u9ad8\u8fbe98%")),N.a.createElement("div",{className:"tipArrow"},N.a.createElement("i",{className:"iconfont iconyindao"}))):null,a,N.a.createElement(c.a,null,s),N.a.createElement(c.a,null,t),n,!d&&N.a.createElement("div",{className:"group-dec"},N.a.createElement("span",null,N.a.createElement("i",{className:"iconfont iconiconfront-1"}),"\xb7\u597d\u53cb\u53c2\u56e2 \xb7\u4eba\u6ee1\u6210\u4ea4 \xb7\u4eba\u4e0d\u6ee1\u9000\u6b3e"),N.a.createElement("span",{className:"allNum"},"\u7d2f\u8ba1".concat(u,"\u4eba\u6210\u56e2"))))}a.default=w}}]);
//# sourceMappingURL=togroup.2ba99ab5.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["components/detail/group/togroup.js"],"names":["ToGroup","props","_this","Object","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_9__","this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_11__","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_12__","call","invitedFriends","_this$state","state","pdd_price","number","data","browser","isWeixin","share","setState","shareData","title","concat","course_title","desc","link","location","origin","course_id","imgUrl","image_name","http","post","api","then","res","_res$data","nonce_str","signature","timestamp","wx","config","debug","appId","nonceStr","jsApiList","ready","hideAllNonBaseMenuItem","showMenuItems","menuList","updateAppMessageShareData","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_8__","success","updateTimelineShareData","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_7___default","a","info","groupon_member","person_num","is_success","userInfo","_this2","Promise","all","get","getParam","home","resultList","console","log","course_info","course_list","countdown","date","end_time","hours","minutes","seconds","setInterval","parseInt","padStart","_this$state2","_this$state2$data","simpledescription","price0","price1","Info","react__WEBPACK_IMPORTED_MODULE_14___default","createElement","className","react_router_dom__WEBPACK_IMPORTED_MODULE_19__","to","_common__WEBPACK_IMPORTED_MODULE_16__","arrow","cart","img","id","GorupContent","antd_mobile_lib_white_space__WEBPACK_IMPORTED_MODULE_5___default","length","course","slice","map","item","weekInfo","key","uid","Component","tip","btn","dec","groupTip","_props$data","ary","num","push","antd_mobile_lib_flex__WEBPACK_IMPORTED_MODULE_3___default","justify","Math","random","src","avatar","alt","user_type","onClick","antd_mobile_lib_wing_blank__WEBPACK_IMPORTED_MODULE_1___default"],"mappings":"+TAUMA,cACF,SAAAA,EAAYC,GAAO,IAAAC,EAAA,OAAAC,OAAAC,EAAA,EAAAD,CAAAE,KAAAL,IACfE,EAAAC,OAAAG,EAAA,EAAAH,CAAAE,KAAAF,OAAAI,EAAA,EAAAJ,CAAAH,GAAAQ,KAAAH,KAAMJ,KAaVQ,eAAiB,WAAM,IAAAC,EACeR,EAAKS,MAAhCC,EADYF,EACZE,UAAWC,EADCH,EACDG,OAAQC,EADPJ,EACOI,KAC1B,GAAGC,IAAQC,SAAU,CACjB,IAAIC,EAAQf,EAAKS,MAAMM,MACvBf,EAAKgB,SAAS,CACVD,OAAQA,IAEZ,IAAIE,EAAY,CACZC,MAAK,qBAAAC,OAAQR,EAAR,kCAAAQ,OAAsBT,EAAtB,4BAAAS,OAAsCP,EAAKQ,aAA3C,UACLC,KAAMT,EAAKQ,aACXE,KAAMC,SAASC,OAAT,eAAAL,OAAiCP,EAAKa,WAC5CC,OAAQd,EAAKe,YAEjBC,IAAKC,KAAL,GAAAV,OAAaW,IAAI,WAAjB,sBAAgDC,KAAK,SAAAC,GAAO,IAAAC,EACdD,EAAIpB,KAAvCsB,EADiDD,EACjDC,UAAWC,EADsCF,EACtCE,UAAWC,EAD2BH,EAC3BG,UAC7BC,GAAGC,OAAO,CACNC,OAAS,EACTC,MAAS,qBACTJ,UAAaA,EACbK,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BAOLzD","file":"static/js/togroup.2ba99ab5.chunk.js","sourcesContent":["import React, { Component } from 'react'\nimport './togroup.scss'\nimport { HeaderBar, VList } from '../../../common'\n\nimport { api, getParam, http, browser} from \"@/utils\";\nimport { connect } from \"react-redux\"\nimport { Link } from \"react-router-dom\"\nimport { WingBlank, WhiteSpace, Flex, Toast } from 'antd-mobile'\n\n\nclass ToGroup extends Component {\n constructor(props) {\n super(props)\n this.state = {\n data: {},\n share: false,\n pdd_price: 0,\n groupon_member: [],\n person_num: 0, // 共多少人成团\n is_success: false, // 是否拼团成功\n userInfo: {},\n number: 0, // 差几人成团\n }\n }\n\n invitedFriends = () => {\n const {pdd_price, number, data} = this.state;\n if(browser.isWeixin) {\n let share = this.state.share;\n this.setState({\n share: !share,\n });\n let shareData = {\n title: `【仅剩${number}个名额】我${pdd_price}元拼了《${data.course_title}》`,\n desc: data.course_title, // 分享描述\n link: location.origin + `/detail??id=${data.course_id}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致\n imgUrl: data.image_name, // 分享图标\n };\n http.post(`${api['pay-api']}/m/sale/signature`).then(res => {\n const {nonce_str, signature, timestamp} = res.data;\n wx.config({\n \"debug\": false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。\n \"appId\": 'wx23dac6775ac82877', // 必填,公众号的唯一标识\n \"timestamp\": timestamp, // 必填,生成签名的时间戳\n \"nonceStr\": nonce_str, // 必填,生成签名的随机串\n \"signature\": signature, // 必填,签名\n jsApiList: [\n 'hideMenuItems',\n 'showMenuItems',\n 'updateAppMessageShareData',\n 'updateTimelineShareData',\n 'onMenuShareWeibo',\n 'onMenuShareAppMessage',\n ], // 必填,需要使用的JS接口列表\n });\n });\n wx.ready(function () { //需在用户可能点击分享按钮前就先调用\n wx.hideAllNonBaseMenuItem();\n wx.showMenuItems({\n menuList: ['menuItem:share:appMessage' , 'menuItem:share:timeline'] // 要显示的菜单项,所有menu项见附录3\n });\n wx.updateAppMessageShareData({ \n ...shareData,\n success: function () {\n // 设置成功\n }\n })\n wx.updateTimelineShareData({\n ...shareData,\n success: function () {\n // 设置成功\n }\n })\n });\n }else{\n Toast.info('请在微信中使用分享功能!', 2);\n }\n }\n\n componentDidMount() {\n Promise.all([http.get(`${api['pay-api']}/pdd/goupon_pay_page/${getParam('id')}`), http.get(`${api.home}/m/user_info`)]).then(resultList => {\n console.log(resultList);\n let res = resultList[0],\n userInfo = resultList[1];\n\n this.setState({\n data: res.data.data.course_info,\n pdd_price: res.data.data.pdd_price,\n groupon_member: res.data.data.groupon_member,\n is_success: res.data.data.is_success,\n person_num: res.data.data.person_num,\n course_list: res.data.data.course_list,\n userInfo,\n number: res.data.data.number,\n countdown: '',\n });\n\n if(res.data.data.is_success === 0) {\n let date = res.data.data.end_time * 1000,\n hours = 0,\n minutes = 0,\n seconds = 0;\n setInterval(() => {\n date -= 1000\n hours = `${parseInt(date / (60 * 60 * 1000))}`.padStart(2, 0);\n minutes = `${parseInt((date - hours * 3600000) / 60000)}`.padStart(2, 0);\n seconds = `${parseInt((date - hours * 3600000 - minutes * 60000 ) / 1000)}`.padStart(2, 0);\n this.setState({\n countdown: `${hours}:${minutes}:${seconds}`\n });\n }, 1000)\n }\n });\n }\n\n render() {\n const { data: { course_id, course_title, simpledescription, price0, price1 }, pdd_price, is_success, person_num, groupon_member, course_list } = this.state;\n const Info = (\n <div className=\"info\">\n <p className='title'>\n <Link to={`/detail?id=${course_id}`}>\n {course_title}\n </Link>\n </p>\n <p className='contact text-overflow-2'>{simpledescription}</p>\n <div className='des'>\n <p className=\"course-price\">\n <span className=\"new\">¥{price1}</span>\n <span className=\"old\">¥{price0}</span>\n </p>\n </div>\n </div>\n )\n return (\n <div className='to-group-box'>\n <HeaderBar title='拼团' arrow={true} cart={false}></HeaderBar>\n {\n !is_success && <VList img={this.state.data.image_name} id={this.state.data.course_id} info={Info}></VList>\n }\n\n <GorupContent data={this.state} invitedFriends={this.invitedFriends} />\n\n <WhiteSpace></WhiteSpace>\n <div className=\"group-course\">\n <div className=\"top-title\">\n <span>本周特惠</span>\n <Link to={`/preferential`} className='more'>更多<i className='iconfont iconiconfront-70'></i></Link>\n </div>\n {\n (course_list && course_list.length > 0) && (course_list[0].course && course_list[0].course.length > 0) && course_list[0].course.slice(0, 4).map(item => {\n\n let weekInfo = <div className=\"info\">\n <p className='title'>\n <Link to={`/detail?id=${item.course_id}`}>\n {item.course_title}\n </Link>\n </p>\n <p className='contact text-overflow-2'>{item.simpledescription}</p>\n <div className='des'>\n <p className=\"course-price\">\n <span className=\"new\">¥{item.price1}</span>\n <span className=\"old\">¥{item.price0}</span>\n </p>\n </div>\n </div>\n return (<VList img={item.image_name} key={item.uid} id={item.course_id} info={weekInfo}></VList>)\n })\n }\n\n </div>\n </div>\n )\n }\n}\n\nfunction GorupContent(props) {\n let tip, btn, dec, groupTip, shareTip, groupSuccessMbc;\n const { pdd_price, data, groupon_member, is_success, person_num, userInfo, share, number, countdown } = props.data;\n let ary=[],num = number;\n while(num != 0) {\n ary.push(num);\n num--;\n }\n groupTip = (<div className='group-user-list'>\n <Flex justify='center' className='imgList'>\n {\n groupon_member.map(item => {\n return (\n <div className='imgContainer' key={Math.random()}>\n <img className='imgname' src={item.avatar} alt='' />\n {\n item.user_type === 1 ? (\n <div className='leaderFlag'>\n <span>团长</span>\n </div>\n ) : null\n }\n </div>);\n })\n }\n {\n ary.map(item => {\n return (<div className='imgContainer' key={Math.random()}>\n <div className='imgname'>\n <i className='iconfont iconwode-xianxing no-body'></i>\n </div>\n </div>)\n })\n }\n </Flex>\n </div>);\n\n if (groupon_member && groupon_member.length > 0) {\n let uid = '';\n groupon_member.map(item=>{\n if(item.user_type === 1) {\n uid = `${item.uid}`;\n }\n })\n\n if(uid === userInfo.data.data.uid) {\n tip = <p className='tip'>{`拼团省¥${pdd_price}元`}</p>\n btn = <span className='group-btn' onClick={props.invitedFriends}>邀请好友参团 {countdown} 后结束</span>\n dec = <p className='dec'>分享到3个群后,成团率高达98%</p>\n } else {\n tip = <p className='tip'>{`拼团省¥${pdd_price}元`}</p>\n btn = <Link to={`/order?id=${data.course_id}`} className='group-btn'>一键参团</Link>\n }\n }\n\n if (is_success === 1) {\n tip = <p className='success'>拼团成功</p>\n btn = <Link to={`/play`} className='tostudy'>去学习</Link>\n }\n return (\n <div className='gorup-content'>\n {\n share ? (\n <div className='groupSuccessMbc' onClick={props.invitedFriends}>\n <div className='tipContent'>\n \n {`还差${number}人,分享到3个群,成团率高达98%`}\n </div>\n <div className='tipArrow'>\n <i className='iconfont iconyindao'></i>\n </div>\n </div>\n ) : null\n }\n\n {tip}\n <WingBlank>\n {groupTip}\n </WingBlank>\n <WingBlank>\n {btn}\n </WingBlank>\n {dec}\n {\n !is_success &&\n <div className=\"group-dec\">\n <span>\n <i className='iconfont iconiconfront-1'></i>\n ·好友参团 ·人满成交 ·人不满退款\n </span>\n <span className='allNum'>{`累计${person_num}人成团`}</span>\n </div>\n }\n </div>\n )\n}\n\nexport default ToGroup\n"],"sourceRoot":""}
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{764:function(e,a,t){},770:function(e,a,t){"use strict";t.r(a);t(62);var n=t(33),c=t.n(n),s=(t(47),t(17)),r=t.n(s),i=(t(61),t(21)),o=t.n(i),l=(t(26),t(2)),m=t.n(l),u=t(19),d=t(4),p=t(5),E=t(8),g=t(6),N=t(7),_=t(0),f=t.n(_),v=(t(764),t(18)),h=t(1),b=(t(20),t(13)),w=function(e){function a(e){var t;return Object(d.a)(this,a),(t=Object(E.a)(this,Object(g.a)(a).call(this,e))).invitedFriends=function(){var e=t.state,a=e.pdd_price,n=e.number,c=e.data;if(h.b.isWeixin){var s=t.state.share;t.setState({share:!s});var r={title:"\u3010\u4ec5\u5269".concat(n,"\u4e2a\u540d\u989d\u3011\u6211").concat(a,"\u5143\u62fc\u4e86\u300a").concat(c.course_title,"\u300b"),desc:c.course_title,link:location.origin+"/detail??id=".concat(c.course_id),imgUrl:c.image_name};h.d.post("".concat(h.a["pay-api"],"/m/sale/signature")).then(function(e){var a=e.data,t=a.nonce_str,n=a.signature,c=a.timestamp;wx.config({debug:!1,appId:"wx23dac6775ac82877",timestamp:c,nonceStr:t,signature:n,jsApiList:["hideMenuItems","showMenuItems","updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareAppMessage"]})}),wx.ready(function(){wx.hideAllNonBaseMenuItem(),wx.showMenuItems({menuList:["menuItem:share:appMessage","menuItem:share:timeline"]}),wx.updateAppMessageShareData(Object(u.a)({},r,{success:function(){}})),wx.updateTimelineShareData(Object(u.a)({},r,{success:function(){}}))})}else m.a.info("\u8bf7\u5728\u5fae\u4fe1\u4e2d\u4f7f\u7528\u5206\u4eab\u529f\u80fd\uff01",2)},t.state={data:{},share:!1,pdd_price:0,groupon_member:[],person_num:0,is_success:!1,userInfo:{},number:0},t}return Object(N.a)(a,e),Object(p.a)(a,[{key:"componentDidMount",value:function(){var e=this;Promise.all([h.d.get("".concat(h.a["pay-api"],"/pdd/goupon_pay_page/15610158875449306780")),h.d.get("".concat(h.a.home,"/m/user_info"))]).then(function(a){console.log(a);var t=a[0],n=a[1];e.setState({data:t.data.data.course_info,pdd_price:t.data.data.pdd_price,groupon_member:t.data.data.groupon_member,is_success:t.data.data.is_success,person_num:t.data.data.person_num,course_list:t.data.data.course_list,userInfo:n,number:t.data.data.number})}),h.d.post("".concat(h.a["pay-api"],"/m/sale/signature")).then(function(e){console.log(e)})}},{key:"render",value:function(){var e=this.state,a=e.data,t=a.course_id,n=a.course_title,c=a.simpledescription,s=a.price0,r=a.price1,i=(e.pdd_price,e.is_success),l=(e.person_num,e.groupon_member,e.course_list),m=f.a.createElement("div",{className:"info"},f.a.createElement("p",{className:"title"},f.a.createElement(b.b,{to:"/detail?id=".concat(t)},n)),f.a.createElement("p",{className:"contact text-overflow-2"},c),f.a.createElement("div",{className:"des"},f.a.createElement("p",{className:"course-price"},f.a.createElement("span",{className:"new"},"\xa5",r),f.a.createElement("span",{className:"old"},"\xa5",s))));return f.a.createElement("div",{className:"to-group-box"},f.a.createElement(v.e,{title:"\u62fc\u56e2",arrow:!0,cart:!1}),!i&&f.a.createElement(v.i,{img:this.state.data.image_name,id:this.state.data.course_id,info:m}),f.a.createElement(y,{data:this.state,invitedFriends:this.invitedFriends}),f.a.createElement(o.a,null),f.a.createElement("div",{className:"group-course"},f.a.createElement("div",{className:"top-title"},f.a.createElement("span",null,"\u672c\u5468\u7279\u60e0"),f.a.createElement(b.b,{to:"/preferential",className:"more"},"\u66f4\u591a",f.a.createElement("i",{className:"iconfont iconiconfront-70"}))),l&&l.length>0&&l[0].course&&l[0].course.length>0&&l[0].course.slice(0,4).map(function(e){var a=f.a.createElement("div",{className:"info"},f.a.createElement("p",{className:"title"},f.a.createElement(b.b,{to:"/detail?id=".concat(e.course_id)},e.course_title)),f.a.createElement("p",{className:"contact text-overflow-2"},e.simpledescription),f.a.createElement("div",{className:"des"},f.a.createElement("p",{className:"course-price"},f.a.createElement("span",{className:"new"},"\xa5",e.price1),f.a.createElement("span",{className:"old"},"\xa5",e.price0))));return f.a.createElement(v.i,{img:e.image_name,key:e.uid,id:e.course_id,info:a})})))}}]),a}(_.Component);function y(e){for(var a,t,n,s,i=e.data,o=i.pdd_price,l=i.data,m=i.groupon_member,u=i.is_success,d=i.person_num,p=i.userInfo,E=i.share,g=i.number,N=[],_=g;0!=_;)N.push(_),_--;if(s=f.a.createElement("div",{className:"group-user-list"},f.a.createElement(r.a,{justify:"center",className:"imgList"},m.map(function(e){return f.a.createElement("div",{className:"imgContainer",key:Math.random()},f.a.createElement("img",{className:"imgname",src:e.avatar,alt:""}),1===e.user_type?f.a.createElement("div",{className:"leaderFlag"},f.a.createElement("span",null,"\u56e2\u957f")):null)}),N.map(function(e){return f.a.createElement("div",{className:"imgContainer",key:Math.random()},f.a.createElement("div",{className:"imgname"},f.a.createElement("i",{className:"iconfont iconwode-xianxing no-body"})))}))),m&&m.length>0){var v="";m.map(function(e){1===e.user_type&&(v="".concat(e.uid))}),v===p.data.data.uid?(a=f.a.createElement("p",{className:"tip"},"\u62fc\u56e2\u7701\uffe5".concat(o,"\u5143")),t=f.a.createElement("span",{className:"group-btn",onClick:e.invitedFriends},"\u9080\u8bf7\u597d\u53cb\u53c2\u56e2 23\uff1a23\uff1a23 \u540e\u7ed3\u675f"),n=f.a.createElement("p",{className:"dec"},"\u5206\u4eab\u52303\u4e2a\u7fa4\u540e\uff0c\u6210\u56e2\u7387\u9ad8\u8fbe98%")):(a=f.a.createElement("p",{className:"tip"},"\u62fc\u56e2\u7701\uffe5".concat(o,"\u5143")),t=f.a.createElement(b.b,{to:"/order?id=".concat(l.course_id),className:"group-btn"},"\u4e00\u952e\u53c2\u56e2"))}return 1===u&&(a=f.a.createElement("p",{className:"success"},"\u62fc\u56e2\u6210\u529f"),t=f.a.createElement(b.b,{to:"/play",className:"tostudy"},"\u53bb\u5b66\u4e60")),f.a.createElement("div",{className:"gorup-content"},E?f.a.createElement("div",{className:"groupSuccessMbc",onClick:e.invitedFriends},f.a.createElement("div",{className:"tipContent"},"\u8fd8\u5dee".concat(g,"\u4eba\uff0c\u5206\u4eab\u52303\u4e2a\u7fa4\uff0c\u6210\u56e2\u7387\u9ad8\u8fbe98%")),f.a.createElement("div",{className:"tipArrow"},f.a.createElement("i",{className:"iconfont iconyindao"}))):null,a,f.a.createElement(c.a,null,s),f.a.createElement(c.a,null,t),n,!u&&f.a.createElement("div",{className:"group-dec"},f.a.createElement("span",null,f.a.createElement("i",{className:"iconfont iconiconfront-1"}),"\xb7\u597d\u53cb\u53c2\u56e2 \xb7\u4eba\u6ee1\u6210\u4ea4 \xb7\u4eba\u4e0d\u6ee1\u9000\u6b3e"),f.a.createElement("span",{className:"allNum"},"\u7d2f\u8ba1".concat(d,"\u4eba\u6210\u56e2"))))}a.default=w}}]);
//# sourceMappingURL=togroup.d6b233f8.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["components/detail/group/togroup.js"],"names":["ToGroup","props","_this","Object","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_9__","this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_11__","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_12__","call","invitedFriends","_this$state","state","pdd_price","number","data","browser","isWeixin","share","setState","shareData","title","concat","course_title","desc","link","location","origin","course_id","imgUrl","image_name","http","post","api","then","res","_res$data","nonce_str","signature","timestamp","wx","config","debug","appId","nonceStr","jsApiList","ready","hideAllNonBaseMenuItem","showMenuItems","menuList","updateAppMessageShareData","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_8__","success","updateTimelineShareData","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_7___default","a","info","groupon_member","person_num","is_success","userInfo","_this2","Promise","all","get","home","resultList","console","log","course_info","course_list","_this$state2","_this$state2$data","simpledescription","price0","price1","Info","react__WEBPACK_IMPORTED_MODULE_14___default","createElement","className","react_router_dom__WEBPACK_IMPORTED_MODULE_19__","to","_common__WEBPACK_IMPORTED_MODULE_16__","arrow","cart","img","id","GorupContent","antd_mobile_lib_white_space__WEBPACK_IMPORTED_MODULE_5___default","length","course","slice","map","item","weekInfo","key","uid","Component","tip","btn","dec","groupTip","_props$data","ary","num","push","antd_mobile_lib_flex__WEBPACK_IMPORTED_MODULE_3___default","justify","Math","random","src","avatar","alt","user_type","onClick","antd_mobile_lib_wing_blank__WEBPACK_IMPORTED_MODULE_1___default"],"mappings":"+TAUMA,cACF,SAAAA,EAAYC,GAAO,IAAAC,EAAA,OAAAC,OAAAC,EAAA,EAAAD,CAAAE,KAAAL,IACfE,EAAAC,OAAAG,EAAA,EAAAH,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,GAEJC,GAEIzC,GACDkB,EAAAtB,EAAAuB,cAAA,OAAKC,UAAU,aACXF,EAAAtB,EAAAuB,cAAA,YACID,EAAAtB,EAAAuB,cAAA,KAAGC,UAAU,6BADjB,kGAIAF,EAAAtB,EAAAuB,cAAA,QAAMC,UAAU,UAAhB,eAAAzD,OAA+BoC,EAA/B,yBAOLzD","file":"static/js/togroup.d6b233f8.chunk.js","sourcesContent":["import React, { Component } from 'react'\nimport './togroup.scss'\nimport { HeaderBar, VList } from '../../../common'\n\nimport { api, getParam, http, browser} from \"@/utils\";\nimport { connect } from \"react-redux\"\nimport { Link } from \"react-router-dom\"\nimport { WingBlank, WhiteSpace, Flex, Toast } from 'antd-mobile'\n\n\nclass ToGroup extends Component {\n constructor(props) {\n super(props)\n this.state = {\n data: {},\n share: false,\n pdd_price: 0,\n groupon_member: [],\n person_num: 0, // 共多少人成团\n is_success: false, // 是否拼团成功\n userInfo: {},\n number: 0, // 差几人成团\n }\n }\n\n invitedFriends = () => {\n const {pdd_price, number, data} = this.state;\n if(browser.isWeixin) {\n let share = this.state.share;\n this.setState({\n share: !share,\n });\n let shareData = {\n title: `【仅剩${number}个名额】我${pdd_price}元拼了《${data.course_title}》`,\n desc: data.course_title, // 分享描述\n link: location.origin + `/detail??id=${data.course_id}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致\n imgUrl: data.image_name, // 分享图标\n };\n http.post(`${api['pay-api']}/m/sale/signature`).then(res => {\n const {nonce_str, signature, timestamp} = res.data;\n wx.config({\n \"debug\": false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。\n \"appId\": 'wx23dac6775ac82877', // 必填,公众号的唯一标识\n \"timestamp\": timestamp, // 必填,生成签名的时间戳\n \"nonceStr\": nonce_str, // 必填,生成签名的随机串\n \"signature\": signature, // 必填,签名\n jsApiList: [\n 'hideMenuItems',\n 'showMenuItems',\n 'updateAppMessageShareData',\n 'updateTimelineShareData',\n 'onMenuShareWeibo',\n 'onMenuShareAppMessage',\n ], // 必填,需要使用的JS接口列表\n });\n });\n wx.ready(function () { //需在用户可能点击分享按钮前就先调用\n wx.hideAllNonBaseMenuItem();\n wx.showMenuItems({\n menuList: ['menuItem:share:appMessage' , 'menuItem:share:timeline'] // 要显示的菜单项,所有menu项见附录3\n });\n wx.updateAppMessageShareData({ \n ...shareData,\n success: function () {\n // 设置成功\n }\n })\n wx.updateTimelineShareData({\n ...shareData,\n success: function () {\n // 设置成功\n }\n })\n });\n }else{\n Toast.info('请在微信中使用分享功能!', 2);\n }\n }\n\n componentDidMount() {\n Promise.all([http.get(`${api['pay-api']}/pdd/goupon_pay_page/15610158875449306780`), http.get(`${api.home}/m/user_info`)]).then(resultList => {\n console.log(resultList);\n let res = resultList[0],\n userInfo = resultList[1];\n\n this.setState({\n data: res.data.data.course_info,\n pdd_price: res.data.data.pdd_price,\n groupon_member: res.data.data.groupon_member,\n is_success: res.data.data.is_success,\n person_num: res.data.data.person_num,\n course_list: res.data.data.course_list,\n userInfo,\n number: res.data.data.number,\n });\n });\n\n http.post(`${api['pay-api']}/m/sale/signature`).then(res => {\n console.log(res);\n });\n }\n\n render() {\n const { data: { course_id, course_title, simpledescription, price0, price1 }, pdd_price, is_success, person_num, groupon_member, course_list } = this.state;\n const Info = (\n <div className=\"info\">\n <p className='title'>\n <Link to={`/detail?id=${course_id}`}>\n {course_title}\n </Link>\n </p>\n <p className='contact text-overflow-2'>{simpledescription}</p>\n <div className='des'>\n <p className=\"course-price\">\n <span className=\"new\">¥{price1}</span>\n <span className=\"old\">¥{price0}</span>\n </p>\n </div>\n </div>\n )\n return (\n <div className='to-group-box'>\n <HeaderBar title='拼团' arrow={true} cart={false}></HeaderBar>\n {\n !is_success && <VList img={this.state.data.image_name} id={this.state.data.course_id} info={Info}></VList>\n }\n\n <GorupContent data={this.state} invitedFriends={this.invitedFriends} />\n\n <WhiteSpace></WhiteSpace>\n <div className=\"group-course\">\n <div className=\"top-title\">\n <span>本周特惠</span>\n <Link to={`/preferential`} className='more'>更多<i className='iconfont iconiconfront-70'></i></Link>\n </div>\n {\n (course_list && course_list.length > 0) && (course_list[0].course && course_list[0].course.length > 0) && course_list[0].course.slice(0, 4).map(item => {\n\n let weekInfo = <div className=\"info\">\n <p className='title'>\n <Link to={`/detail?id=${item.course_id}`}>\n {item.course_title}\n </Link>\n </p>\n <p className='contact text-overflow-2'>{item.simpledescription}</p>\n <div className='des'>\n <p className=\"course-price\">\n <span className=\"new\">¥{item.price1}</span>\n <span className=\"old\">¥{item.price0}</span>\n </p>\n </div>\n </div>\n return (<VList img={item.image_name} key={item.uid} id={item.course_id} info={weekInfo}></VList>)\n })\n }\n\n </div>\n </div>\n )\n }\n}\n\nfunction GorupContent(props) {\n let tip, btn, dec, groupTip, shareTip, groupSuccessMbc;\n const { pdd_price, data, groupon_member, is_success, person_num, userInfo, share, number } = props.data;\n let ary=[],num = number;\n while(num != 0) {\n ary.push(num);\n num--;\n }\n groupTip = (<div className='group-user-list'>\n <Flex justify='center' className='imgList'>\n {\n groupon_member.map(item => {\n return (\n <div className='imgContainer' key={Math.random()}>\n <img className='imgname' src={item.avatar} alt='' />\n {\n item.user_type === 1 ? (\n <div className='leaderFlag'>\n <span>团长</span>\n </div>\n ) : null\n }\n </div>);\n })\n }\n {\n ary.map(item => {\n return (<div className='imgContainer' key={Math.random()}>\n <div className='imgname'>\n <i className='iconfont iconwode-xianxing no-body'></i>\n </div>\n </div>)\n })\n }\n </Flex>\n </div>);\n\n if (groupon_member && groupon_member.length > 0) {\n let uid = '';\n groupon_member.map(item=>{\n if(item.user_type === 1) {\n uid = `${item.uid}`;\n }\n })\n\n if(uid === userInfo.data.data.uid) {\n tip = <p className='tip'>{`拼团省¥${pdd_price}元`}</p>\n btn = <span className='group-btn' onClick={props.invitedFriends}>邀请好友参团 23:23:23 后结束</span>\n dec = <p className='dec'>分享到3个群后,成团率高达98%</p>\n } else {\n tip = <p className='tip'>{`拼团省¥${pdd_price}元`}</p>\n btn = <Link to={`/order?id=${data.course_id}`} className='group-btn'>一键参团</Link>\n }\n }\n\n if (is_success === 1) {\n tip = <p className='success'>拼团成功</p>\n btn = <Link to={`/play`} className='tostudy'>去学习</Link>\n }\n return (\n <div className='gorup-content'>\n {\n share ? (\n <div className='groupSuccessMbc' onClick={props.invitedFriends}>\n <div className='tipContent'>\n \n {`还差${number}人,分享到3个群,成团率高达98%`}\n </div>\n <div className='tipArrow'>\n <i className='iconfont iconyindao'></i>\n </div>\n </div>\n ) : null\n }\n\n {tip}\n <WingBlank>\n {groupTip}\n </WingBlank>\n <WingBlank>\n {btn}\n </WingBlank>\n {dec}\n {\n !is_success &&\n <div className=\"group-dec\">\n <span>\n <i className='iconfont iconiconfront-1'></i>\n ·好友参团 ·人满成交 ·人不满退款\n </span>\n <span className='allNum'>{`累计${person_num}人成团`}</span>\n </div>\n }\n </div>\n )\n}\n\nexport default ToGroup\n"],"sourceRoot":""}
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{653:function(e,t,a){"use strict";var n=a(0),c=a.n(n);a(654);t.a=function(e){return c.a.createElement("li",{className:"v-list-base-item",onClick:e.handleClick.bind(void 0,e.id)},c.a.createElement("div",{className:"content"},c.a.createElement("div",{className:"cover"},e.status,c.a.createElement("img",{src:e.img,alt:""})),e.info),e.tab)}},654:function(e,t,a){},685:function(e,t,a){},686:function(e,t,a){},687:function(e,t,a){},692:function(e,t,a){},694:function(e,t){},773:function(e,t,a){"use strict";a.r(t);a(26);var n=a(2),c=a.n(n),i=a(4),r=a(5),o=a(8),s=a(6),l=a(7),u=(a(166),a(84)),d=a.n(u),m=a(0),p=a.n(m),v=a(167),h=(a(685),a(13)),f=a(59),y=a(1),E=(a(686),a(653)),g=function(e){var t=e.item;return p.a.createElement("div",{className:"bottom"},p.a.createElement("span",{className:"price"},"\xa5",t.price1),p.a.createElement("span",{className:"stale-price"},"\xa5",t.price0))},b=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return(a=Object(o.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(r)))).state={num:10,list:[],courseId:null},a.getRecommendation=function(){y.d.get("".concat(y.a.home,"/m/play/recommend_course/").concat(a.props.vCourseId,"?num=").concat(a.state.num)).then(function(e){var t=e.data;200===t.code?a.setState({list:t.data}):c.a.info(t.msg)})},a.handleClick=function(e){a.props.history.push("/detail?id=".concat(e))},a}return Object(l.a)(t,e),Object(r.a)(t,[{key:"componentDidMount",value:function(){this.getRecommendation()}},{key:"render",value:function(){var e=this;return p.a.createElement("div",{className:"recommendation"},p.a.createElement("div",{className:"title"},"\u76f8\u5173\u63a8\u8350"),p.a.createElement("ul",null,this.state.list.map(function(t){var a=p.a.createElement("div",{className:"info"},p.a.createElement("p",{className:"title"},t.course_title),p.a.createElement("p",{className:"des"},t.simpledescription),p.a.createElement(g,{item:t}));return p.a.createElement(E.a,{key:t.course_id,img:t.image_name,handleClick:e.handleClick,info:a,id:t.course_id})})))}}]),t}(m.PureComponent),_=(a(687),a(16)),C=a.n(_),N=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,c=new Array(n),r=0;r<n;r++)c[r]=arguments[r];return(a=Object(o.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(c)))).handleClick=function(e){a.props.handleClick(e)},a}return Object(l.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this;return p.a.createElement("div",{className:"video-catalog"},p.a.createElement("ul",null,this.props.videoCatalog.map(function(t,a){return p.a.createElement("li",{key:t.id,className:C()({active:e.props.activeIndex===a}),onClick:e.handleClick.bind(e,a)},p.a.createElement("span",{className:"title"},t.name),p.a.createElement("span",{className:"duration"},t.duration),p.a.createElement("i",{className:C()("iconfont",[0===t.video_auth?"iconiconfront-74":"iconiconfront-35"])}))})))}}]),t}(m.Component),I=(a(688),a(691)),k=a.n(I),O=(a(692),function(e){function t(){return Object(i.a)(this,t),Object(o.a)(this,Object(s.a)(t).apply(this,arguments))}return Object(l.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props.datum;return p.a.createElement("div",{className:"datum-catalog"},p.a.createElement("p",{className:"prompt"},"\u8bfe\u7a0b\u8d44\u6599\u8bf7\u5230PC\u7aef\u64ad\u653e\u9875\u4e0b\u8f7d"),p.a.createElement(k.a,null,e&&e.length&&e.map(function(e,t){return p.a.createElement(k.a.Panel,{header:e.dir_name,key:t},e.files.map(function(e){return p.a.createElement("div",{key:e.file_id,className:"file-name"},e.file_name)}))})))}}]),t}(m.Component));O.defaultProps={datum:[{dir_name:"",files:[{file_name:"",file_id:0}]}]};var j=O,P=a(766),A=(a(739),a(18)),x=d.a.alert,S=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return(a=Object(o.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(r)))).state={title:"",courseId:null,video_catalog:[],datum:[],currentVideoSrc:"",activeIndex:0,isAuth:!0,course:null,salePrice:null,vCourseId:null,isLoading:!0},a.initializePlayer=function(){window.HELP_IMPROVE_VIDEOJS=!1,a.player=Object(P.a)(a.video,{controls:!0,preload:"auto",bigPlayButton:!0,textTrackDisplay:!1,posterImage:!1,errorDisplay:!1}),a.player.enableTouchActivity()},a.handleClick=function(e){a.hasAuth()&&(a.setPlayerSrc(a.state.video_catalog[e].play_url),a.playVideo()),a.setState({activeIndex:e})},a.getVideoCatalog=function(){y.d.get("".concat(y.a.home,"/m/course/play/").concat(a.courseID)).then(function(e){var t=e.data;200===t.code?a.setState(function(e){return{video_catalog:t.data.lessons,currentVideoSrc:t.data.lessons[e.activeIndex].play_url,course:t.data.course,courseId:t.data.course.course_id,vCourseId:t.data.course.v_course_id,title:t.data.course.course_title,isLoading:!1}},function(){a.lessonAvailable()?a.hasAuth(a.state.activeIndex)?Promise.resolve().then(function(){a.initializePlayer(),a.playWithAuth()}):a.getCoursePrice():x("\u6682\u65e0\u89c6\u9891","",[{text:"OK",onPress:function(){a.props.history.push("/")}}])}):c.a.info(t.msg)})},a.setPlayerSrc=function(e){a.player.src({src:e,type:"application/x-mpegURL"})},a.playVideo=function(){a.player.play()},a.lessonAvailable=function(){var e=a.state;return 0!==e.video_catalog[e.activeIndex].video_size},a.getCoursePrice=function(){y.d.get("".concat(y.a.home,"/sys/course/price/").concat(a.state.courseId)).then(function(e){var t=e.data;200===t.code&&a.setState({salePrice:t.data.sale_price})})},a.playWithAuth=function(){var e=a.state,t=e.video_catalog,n=e.activeIndex;a.hasAuth()&&a.setPlayerSrc(t[n].play_url)},a.hasAuth=function(e){var t=a.state,n=t.course,c=t.video_catalog[t.activeIndex];return c.is_free?(a.setState({isAuth:!0}),!0):n.is_audition?(a.setState({isAuth:!0}),!0):c.video_auth?(a.setState({isAuth:!0}),!0):(a.setState({isAuth:!1}),!1)},a}return Object(l.a)(t,e),Object(r.a)(t,[{key:"componentDidMount",value:function(){this.courseID=Object(y.c)("id"),this.setState({courseId:this.courseID}),this.getVideoCatalog(),this.getDatumCatalog()}},{key:"componentDidUpdate",value:function(e,t){console.log(this.video)}},{key:"componentWillUnmount",value:function(){this.player&&this.player.dispose()}},{key:"getDatumCatalog",value:function(){var e=this;y.d.get("".concat(y.a.home,"/m/course/data/").concat(this.courseID)).then(function(t){var a=t.data;200===a.code?e.setState({datum:a.data}):c.a.info(a.msg)})}},{key:"render",value:function(){var e=this,t=this.props,a=t.match,n=t.location,c=this.state,i=c.video_catalog,r=c.activeIndex,o=c.isAuth,s=c.salePrice;return p.a.createElement("div",{className:"play"},p.a.createElement(v.a,{title:this.state.title,arrow:!0}),p.a.createElement(A.f,{isLoading:this.state.isLoading},p.a.createElement("div",{className:"video"},p.a.createElement("video",{className:"video-js",ref:function(t){return e.video=t}},p.a.createElement("source",{src:"/",type:"application/x-mpegURL"})),!o&&p.a.createElement("div",{className:"purchase-box"},p.a.createElement("div",{className:"hint"},"\u60a8\u5c1a\u672a\u8d2d\u4e70\u8be5\u8bfe\u65f6\uff0c\u8bf7\u8d2d\u4e70\u540e\u5b66\u4e60\u3002"),p.a.createElement("div",{className:"btns"},p.a.createElement("button",{type:"button",className:"purchase-class"},"\xa5",s," \u8d2d\u4e70\u8bfe\u7a0b"),p.a.createElement("button",{type:"button",className:"purchase-episode"},"\xa5",i.length&&i[r].class_price," \u8d2d\u4e70\u5355\u96c6")))),p.a.createElement("div",{className:"tab"},p.a.createElement("div",null,p.a.createElement(h.c,{to:"".concat(a.url,"/video"),replace:!0,activeClassName:"active"},"\u89c6\u9891")),p.a.createElement("div",null,p.a.createElement(h.c,{to:"".concat(a.url,"/datum"),replace:!0,activeClassName:"active"},"\u8d44\u6599")))),p.a.createElement(f.d,null,p.a.createElement(f.a,{exact:!0,from:"/play",to:{pathname:"/play/video",search:n.search}}),p.a.createElement(f.b,{path:"".concat(a.path,"/video"),render:function(t){return p.a.createElement(N,Object.assign({activeIndex:e.state.activeIndex,handleClick:e.handleClick,videoCatalog:e.state.video_catalog},t))}}),p.a.createElement(f.b,{path:"".concat(a.path,"/datum"),render:function(t){return p.a.createElement(j,Object.assign({},t,{datum:e.state.datum}))}})),p.a.createElement(f.b,{render:function(t){return e.state.vCourseId?p.a.createElement(b,Object.assign({},t,{vCourseId:e.state.vCourseId})):null}}))}}]),t}(m.Component);t.default=S}}]);
//# sourceMappingURL=video.3d69c391.chunk.js.map
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{653:function(e,t,a){"use strict";var n=a(0),c=a.n(n);a(654);t.a=function(e){return c.a.createElement("li",{className:"v-list-base-item",onClick:e.handleClick.bind(void 0,e.id)},c.a.createElement("div",{className:"content"},c.a.createElement("div",{className:"cover"},e.status,c.a.createElement("img",{src:e.img,alt:""})),e.info),e.tab)}},654:function(e,t,a){},685:function(e,t,a){},686:function(e,t,a){},687:function(e,t,a){},692:function(e,t,a){},694:function(e,t){},773:function(e,t,a){"use strict";a.r(t);a(26);var n=a(2),c=a.n(n),i=a(3),r=a(4),o=a(7),s=a(5),l=a(6),u=(a(166),a(85)),d=a.n(u),m=a(0),p=a.n(m),v=a(167),h=(a(685),a(11)),f=a(59),y=a(1),E=(a(686),a(653)),g=function(e){var t=e.item;return p.a.createElement("div",{className:"bottom"},p.a.createElement("span",{className:"price"},"\xa5",t.price1),p.a.createElement("span",{className:"stale-price"},"\xa5",t.price0))},b=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return(a=Object(o.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(r)))).state={num:10,list:[],courseId:null},a.getRecommendation=function(){y.d.get("".concat(y.a.home,"/m/play/recommend_course/").concat(a.props.vCourseId,"?num=").concat(a.state.num)).then(function(e){var t=e.data;200===t.code?a.setState({list:t.data}):c.a.info(t.msg)})},a.handleClick=function(e){a.props.history.push("/detail?id=".concat(e))},a}return Object(l.a)(t,e),Object(r.a)(t,[{key:"componentDidMount",value:function(){this.getRecommendation()}},{key:"render",value:function(){var e=this;return p.a.createElement("div",{className:"recommendation"},p.a.createElement("div",{className:"title"},"\u76f8\u5173\u63a8\u8350"),p.a.createElement("ul",null,this.state.list.map(function(t){var a=p.a.createElement("div",{className:"info"},p.a.createElement("p",{className:"title"},t.course_title),p.a.createElement("p",{className:"des"},t.simpledescription),p.a.createElement(g,{item:t}));return p.a.createElement(E.a,{key:t.course_id,img:t.image_name,handleClick:e.handleClick,info:a,id:t.course_id})})))}}]),t}(m.PureComponent),_=(a(687),a(16)),C=a.n(_),N=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,c=new Array(n),r=0;r<n;r++)c[r]=arguments[r];return(a=Object(o.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(c)))).handleClick=function(e){a.props.handleClick(e)},a}return Object(l.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this;return p.a.createElement("div",{className:"video-catalog"},p.a.createElement("ul",null,this.props.videoCatalog.map(function(t,a){return p.a.createElement("li",{key:t.id,className:C()({active:e.props.activeIndex===a}),onClick:e.handleClick.bind(e,a)},p.a.createElement("span",{className:"title"},t.name),p.a.createElement("span",{className:"duration"},t.duration),p.a.createElement("i",{className:C()("iconfont",[0===t.video_auth?"iconiconfront-74":"iconiconfront-35"])}))})))}}]),t}(m.Component),I=(a(688),a(691)),k=a.n(I),O=(a(692),function(e){function t(){return Object(i.a)(this,t),Object(o.a)(this,Object(s.a)(t).apply(this,arguments))}return Object(l.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props.datum;return p.a.createElement("div",{className:"datum-catalog"},p.a.createElement("p",{className:"prompt"},"\u8bfe\u7a0b\u8d44\u6599\u8bf7\u5230PC\u7aef\u64ad\u653e\u9875\u4e0b\u8f7d"),p.a.createElement(k.a,null,e&&e.length&&e.map(function(e,t){return p.a.createElement(k.a.Panel,{header:e.dir_name,key:t},e.files.map(function(e){return p.a.createElement("div",{key:e.file_id,className:"file-name"},e.file_name)}))})))}}]),t}(m.Component));O.defaultProps={datum:[{dir_name:"",files:[{file_name:"",file_id:0}]}]};var j=O,P=a(766),A=(a(739),a(18)),x=d.a.alert,S=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return(a=Object(o.a)(this,(e=Object(s.a)(t)).call.apply(e,[this].concat(r)))).state={title:"",courseId:null,video_catalog:[],datum:[],currentVideoSrc:"",activeIndex:0,isAuth:!0,course:null,salePrice:null,vCourseId:null,isLoading:!0},a.initializePlayer=function(){window.HELP_IMPROVE_VIDEOJS=!1,a.player=Object(P.a)(a.video,{controls:!0,preload:"auto",bigPlayButton:!0,textTrackDisplay:!1,posterImage:!1,errorDisplay:!1}),a.player.enableTouchActivity()},a.handleClick=function(e){a.hasAuth()&&(a.setPlayerSrc(a.state.video_catalog[e].play_url),a.playVideo()),a.setState({activeIndex:e})},a.getVideoCatalog=function(){y.d.get("".concat(y.a.home,"/m/course/play/").concat(a.courseID)).then(function(e){var t=e.data;200===t.code?a.setState(function(e){return{video_catalog:t.data.lessons,currentVideoSrc:t.data.lessons[e.activeIndex].play_url,course:t.data.course,courseId:t.data.course.course_id,vCourseId:t.data.course.v_course_id,title:t.data.course.course_title,isLoading:!1}},function(){a.lessonAvailable()?a.hasAuth(a.state.activeIndex)?Promise.resolve().then(function(){a.initializePlayer(),a.playWithAuth()}):a.getCoursePrice():x("\u6682\u65e0\u89c6\u9891","",[{text:"OK",onPress:function(){a.props.history.push("/")}}])}):c.a.info(t.msg)})},a.setPlayerSrc=function(e){a.player.src({src:e,type:"application/x-mpegURL"})},a.playVideo=function(){a.player.play()},a.lessonAvailable=function(){var e=a.state;return 0!==e.video_catalog[e.activeIndex].video_size},a.getCoursePrice=function(){y.d.get("".concat(y.a.home,"/sys/course/price/").concat(a.state.courseId)).then(function(e){var t=e.data;200===t.code&&a.setState({salePrice:t.data.sale_price})})},a.playWithAuth=function(){var e=a.state,t=e.video_catalog,n=e.activeIndex;a.hasAuth()&&a.setPlayerSrc(t[n].play_url)},a.hasAuth=function(e){var t=a.state,n=t.course,c=t.video_catalog[t.activeIndex];return c.is_free?(a.setState({isAuth:!0}),!0):n.is_audition?(a.setState({isAuth:!0}),!0):c.video_auth?(a.setState({isAuth:!0}),!0):(a.setState({isAuth:!1}),!1)},a}return Object(l.a)(t,e),Object(r.a)(t,[{key:"componentDidMount",value:function(){this.courseID=Object(y.c)("id"),this.setState({courseId:this.courseID}),this.getVideoCatalog(),this.getDatumCatalog()}},{key:"componentDidUpdate",value:function(e,t){console.log(this.video)}},{key:"componentWillUnmount",value:function(){this.player&&this.player.dispose()}},{key:"getDatumCatalog",value:function(){var e=this;y.d.get("".concat(y.a.home,"/m/course/data/").concat(this.courseID)).then(function(t){var a=t.data;200===a.code?e.setState({datum:a.data}):c.a.info(a.msg)})}},{key:"render",value:function(){var e=this,t=this.props,a=t.match,n=t.location,c=this.state,i=c.video_catalog,r=c.activeIndex,o=c.isAuth,s=c.salePrice;return p.a.createElement("div",{className:"play"},p.a.createElement(v.a,{title:this.state.title,arrow:!0}),p.a.createElement(A.f,{isLoading:this.state.isLoading},p.a.createElement("div",{className:"video"},p.a.createElement("video",{className:"video-js",ref:function(t){return e.video=t}},p.a.createElement("source",{src:"/",type:"application/x-mpegURL"})),!o&&p.a.createElement("div",{className:"purchase-box"},p.a.createElement("div",{className:"hint"},"\u60a8\u5c1a\u672a\u8d2d\u4e70\u8be5\u8bfe\u65f6\uff0c\u8bf7\u8d2d\u4e70\u540e\u5b66\u4e60\u3002"),p.a.createElement("div",{className:"btns"},p.a.createElement("button",{type:"button",className:"purchase-class"},"\xa5",s," \u8d2d\u4e70\u8bfe\u7a0b"),p.a.createElement("button",{type:"button",className:"purchase-episode"},"\xa5",i.length&&i[r].class_price," \u8d2d\u4e70\u5355\u96c6")))),p.a.createElement("div",{className:"tab"},p.a.createElement("div",null,p.a.createElement(h.c,{to:"".concat(a.url,"/video"),replace:!0,activeClassName:"active"},"\u89c6\u9891")),p.a.createElement("div",null,p.a.createElement(h.c,{to:"".concat(a.url,"/datum"),replace:!0,activeClassName:"active"},"\u8d44\u6599")))),p.a.createElement(f.d,null,p.a.createElement(f.a,{exact:!0,from:"/play",to:{pathname:"/play/video",search:n.search}}),p.a.createElement(f.b,{path:"".concat(a.path,"/video"),render:function(t){return p.a.createElement(N,Object.assign({activeIndex:e.state.activeIndex,handleClick:e.handleClick,videoCatalog:e.state.video_catalog},t))}}),p.a.createElement(f.b,{path:"".concat(a.path,"/datum"),render:function(t){return p.a.createElement(j,Object.assign({},t,{datum:e.state.datum}))}})),p.a.createElement(f.b,{render:function(t){return e.state.vCourseId?p.a.createElement(b,Object.assign({},t,{vCourseId:e.state.vCourseId})):null}}))}}]),t}(m.Component);t.default=S}}]);
//# sourceMappingURL=video.1cacaecc.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["common/v-list-base/index.js","components/video/recommendation/index.js","components/video/video-catalog/index.js","components/video/datum-catalog/index.js","components/video/index.js"],"names":["VList","props","react__WEBPACK_IMPORTED_MODULE_0___default","a","createElement","className","onClick","handleClick","bind","id","status","src","img","alt","info","tab","Bottom","_ref","item","react_default","price1","price0","Recommendation","state","num","list","courseId","getRecommendation","http","get","concat","api","home","_this","vCourseId","then","res","data","code","setState","toast_default","msg","history","push","this","_this2","map","Info","course_title","simpledescription","recommendation_Bottom","v_list_base","key","course_id","image_name","PureComponent","VideoCatalog","i","videoCatalog","index","classnames","active","activeIndex","name","duration","video_auth","Component","DatumCatalog","datum","accordion_default","length","Panel","header","dir_name","files","file_id","file_name","defaultProps","alert","modal_default","Video","title","video_catalog","currentVideoSrc","isAuth","course","salePrice","isLoading","initializePlayer","window","HELP_IMPROVE_VIDEOJS","player","videojs","video","controls","preload","bigPlayButton","textTrackDisplay","posterImage","errorDisplay","enableTouchActivity","hasAuth","setPlayerSrc","playVideo","getVideoCatalog","courseID","lessonAvailable","Promise","resolve","playWithAuth","getCoursePrice","text","onPress","type","play","_this$state","_this$state2","_this$state3","lesson","getParam","getDatumCatalog","prevProps","prevState","console","log","dispose","_this3","_this$props","match","location","_this$state4","HeaderBar","arrow","common","ref","el","react_router_dom","to","url","replace","activeClassName","react_router","exact","from","pathname","search","path","render","video_video_catalog","Object","assign","video_datum_catalog","video_recommendation"],"mappings":"qHAkBeA,IAfD,SAACC,GACX,OACIC,EAAAC,EAAAC,cAAA,MAAIC,UAAU,mBAAmBC,QAASL,EAAMM,YAAYC,YAAWP,EAAMQ,KACzEP,EAAAC,EAAAC,cAAA,OAAKC,UAAU,WACXH,EAAAC,EAAAC,cAAA,OAAKC,UAAU,SACVJ,EAAMS,OACPR,EAAAC,EAAAC,cAAA,OAAKO,IAAKV,EAAMW,IAAKC,IAAI,MAE5BZ,EAAMa,MAEVb,EAAMc,mVCLbC,EAAS,SAAAC,GAAY,IAAVC,EAAUD,EAAVC,KACb,OACIC,EAAAhB,EAAAC,cAAA,OAAKC,UAAU,U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e,EAAAhB,EAAAC,cAACoI,EAAA,EAAD,CAASC,GAAE,GAAA3G,OAAKkG,EAAMU,IAAX,UACFC,SAAO,EACPC,gBAAgB,UAFzB,mBAOZzH,EAAAhB,EAAAC,cAACyI,EAAA,EAAD,KACI1H,EAAAhB,EAAAC,cAACyI,EAAA,EAAD,CAAUC,OAAK,EAACC,KAAM,QAASN,GAAI,CAC/BO,SAAU,cACVC,OAAQhB,EAASgB,UAErB9H,EAAAhB,EAAAC,cAACyI,EAAA,EAAD,CAAOK,KAAI,GAAApH,OAAKkG,EAAMkB,KAAX,UAAyBC,OAAQ,SAAAlJ,GACxC,OAAOkB,EAAAhB,EAAAC,cAACgJ,EAADC,OAAAC,OAAA,CACHxF,YAAagE,EAAKvG,MAAMuC,YACxBvD,YAAauH,EAAKvH,YAClBmD,aAAcoE,EAAKvG,MAAM2D,eACrBjF,OAEZkB,EAAAhB,EAAAC,cAACyI,EAAA,EAAD,CAAOK,KAAI,GAAApH,OAAKkG,EAAMkB,KAAX,UAAyBC,OAAQ,SAAAlJ,GACxC,OAAOkB,EAAAhB,EAAAC,cAACmJ,EAADF,OAAAC,OAAA,GAAkBrJ,EAAlB,CAAyBmE,MAAO0D,EAAKvG,MAAM6C,aAG1DjD,EAAAhB,EAAAC,cAACyI,EAAA,EAAD,CAAOM,OAAQ,SAAAlJ,GACX,OAAO6H,EAAKvG,MAAMW,UAAYf,EAAAhB,EAAAC,cAACoJ,EAADH,OAAAC,OAAA,GAAoBrJ,EAApB,CAA2BiC,UAAW4F,EAAKvG,MAAMW,aACzE,gBA3PNgC,aAmQLc","file":"static/js/video.3d69c391.chunk.js","sourcesContent":["import React from 'react';\nimport './index.scss'\n\nconst VList = (props) => {\n return (\n <li className='v-list-base-item' onClick={props.handleClick.bind(this, props.id)}>\n <div className=\"content\">\n <div className=\"cover\">\n {props.status}\n <img src={props.img} alt=\"\"/>\n </div>\n {props.info}\n </div>\n {props.tab}\n </li>\n );\n};\n\nexport default VList;","import React, { PureComponent } from 'react';\nimport './recommendation.scss'\nimport { http, api } from '@/utils'\nimport { Toast } from \"antd-mobile\";\nimport VList from '@/common/v-list-base';\n\n\n\nconst Bottom = ({item}) => {\n return (\n <div className='bottom'>\n <span className='price'>¥{item.price1}</span>\n <span className='stale-price'>¥{item.price0}</span>\n </div>\n )\n}\n\n\n\nclass Recommendation extends PureComponent {\n state = {\n num: 10,\n list: [],\n courseId: null\n }\n\n\n componentDidMount() {\n this.getRecommendation()\n }\n\n getRecommendation = () => {\n http.get(`${api.home}/m/play/recommend_course/${this.props.vCourseId}?num=${this.state.num}`)\n .then(res => {\n const data = res.data\n if(data.code === 200){\n\n this.setState({\n list: data.data\n })\n\n }else {\n Toast.info(data.msg)\n }\n })\n }\n\n\n handleClick = id => {\n this.props.history.push(`/detail?id=${id}`)\n }\n\n render() {\n return (\n <div className='recommendation'>\n <div className={'title'}>相关推荐</div>\n <ul>\n {\n this.state.list.map(item => {\n const Info = (\n <div className=\"info\">\n <p className='title'>{item.course_title}</p>\n <p className='des'>{item.simpledescription}</p>\n <Bottom\n item={item}\n />\n </div>\n )\n\n return (\n <VList\n key={item.course_id}\n img={item.image_name}\n handleClick={this.handleClick}\n info={Info}\n id={item.course_id}\n />\n )\n })\n }\n </ul>\n </div>\n );\n }\n}\n\nexport default Recommendation;","import React, { Component } from 'react';\nimport './video-catalog.scss'\nimport classnames from 'classnames'\n\n\nclass VideoCatalog extends Component {\n\n handleClick = (i) => {\n this.props.handleClick(i)\n }\n\n render() {\n return (\n <div className='video-catalog'>\n <ul>\n {\n this.props.videoCatalog.map((item, index) => {\n return (\n <li key={item.id}\n className={classnames({active: this.props.activeIndex === index})}\n onClick={this.handleClick.bind(this, index)}\n >\n <span className=\"title\">{item.name}</span>\n <span className='duration'>{item.duration}</span>\n <i className={classnames(`iconfont`,\n [item.video_auth === 0\n ? 'iconiconfront-74'\n : 'iconiconfront-35'],\n )}/>\n </li>\n )\n })\n }\n </ul>\n </div>\n );\n }\n}\n\nexport default VideoCatalog;","import React, { Component } from 'react';\nimport './datum-catalog.scss'\nimport { Accordion } from \"antd-mobile\";\n\n\nclass DatumCatalog extends Component {\n\n static defaultProps = {\n datum: [{\n dir_name: '',\n files: [{\n file_name: '',\n file_id: 0\n }]\n }]\n }\n\n render() {\n const {datum} = this.props\n return (\n <div className='datum-catalog'>\n <p className='prompt'>课程资料请到PC端播放页下载</p>\n <Accordion>\n {\n datum && datum.length && datum.map((item, index) => {\n return (\n <Accordion.Panel header={item.dir_name} key={index}>\n {\n item.files.map(item => {\n return (\n <div key={item.file_id} className='file-name'>\n {item.file_name}\n </div>\n )\n })\n }\n </Accordion.Panel>\n )\n })\n }\n </Accordion>\n </div>\n );\n }\n}\n\nexport default DatumCatalog;","import React, { Component } from 'react';\nimport HeaderBar from '@/common/HeaderBar'\nimport './video.scss'\nimport { NavLink, Route, Redirect, Switch } from 'react-router-dom';\nimport { http, api, getParam } from '@/utils'\nimport Recommendation from './recommendation'\nimport VideoCatalog from './video-catalog'\nimport DatumCatalog from './datum-catalog'\nimport { Toast } from 'antd-mobile';\nimport videojs from 'video.js'\nimport 'video.js/dist/video-js.min.css'\nimport { Modal } from \"antd-mobile\";\nimport { Loading } from '@/common'\n\nlet alert = Modal.alert\n\n\nclass Video extends Component {\n\n video\n player\n courseID\n\n\n state = {\n title: '',\n courseId: null,\n video_catalog: [],\n datum: [],\n currentVideoSrc: '',\n activeIndex: 0,\n isAuth: true,\n course: null,\n salePrice: null,\n vCourseId: null,\n isLoading: true\n }\n\n\n componentDidMount() {\n this.courseID = getParam('id')\n this.setState({\n courseId: this.courseID\n })\n this.getVideoCatalog()\n this.getDatumCatalog()\n }\n\n initializePlayer = () => {\n window.HELP_IMPROVE_VIDEOJS = false;\n this.player = videojs(this.video, {\n controls: true,\n preload: 'auto',\n bigPlayButton: true,\n textTrackDisplay: false,\n posterImage: false,\n errorDisplay: false\n })\n this.player.enableTouchActivity()\n\n }\n\n componentDidUpdate(prevProps, prevState) {\n console.log(this.video);\n }\n\n\n componentWillUnmount() {\n if (this.player) {\n\n this.player.dispose()\n }\n }\n\n handleClick = index => {\n if (this.hasAuth()) {\n this.setPlayerSrc(this.state.video_catalog[index]['play_url'])\n this.playVideo()\n }\n this.setState({\n activeIndex: index\n })\n }\n\n\n getVideoCatalog = () => {\n http.get(`${api.home}/m/course/play/${this.courseID}`)\n .then(res => {\n const data = res.data\n if (data.code === 200) {\n\n this.setState(\n state => ({\n video_catalog: data.data['lessons'],\n currentVideoSrc: data.data['lessons'][state.activeIndex]['play_url'],\n course: data.data.course,\n courseId: data.data.course['course_id'],\n vCourseId: data.data.course['v_course_id'],\n title: data.data.course['course_title'],\n isLoading: false\n }),\n () => {\n if (this.lessonAvailable()) {\n if (this.hasAuth(this.state.activeIndex)) {\n Promise.resolve().then(() => {\n this.initializePlayer()\n this.playWithAuth()\n })\n } else {\n this.getCoursePrice();\n }\n } else {\n alert('暂无视频', '', [{\n text: 'OK',\n onPress: () => {\n this.props.history.push('/')\n }\n }])\n }\n }\n )\n } else {\n Toast.info(data.msg)\n }\n })\n }\n\n setPlayerSrc = src => {\n this.player.src({\n src,\n type: 'application/x-mpegURL'\n })\n }\n\n playVideo = () => {\n this.player.play()\n }\n\n\n getDatumCatalog() {\n http.get(`${api.home}/m/course/data/${this.courseID}`)\n .then(res => {\n const data = res.data\n if (data.code === 200) {\n\n this.setState({\n datum: data.data\n })\n\n } else {\n Toast.info(data.msg)\n }\n })\n }\n\n lessonAvailable = () => {\n const {video_catalog, activeIndex} = this.state\n return video_catalog[activeIndex]['video_size'] !== 0\n }\n\n getCoursePrice = () => {\n http.get(`${api.home}/sys/course/price/${this.state.courseId}`)\n .then(res => {\n const {data} = res\n if (data.code === 200) {\n this.setState({\n salePrice: data.data['sale_price']\n })\n }\n })\n }\n\n playWithAuth = () => {\n const {video_catalog, activeIndex} = this.state\n\n if (this.hasAuth()) {\n this.setPlayerSrc(video_catalog[activeIndex]['play_url'])\n }\n }\n\n hasAuth = (index) => {\n const {course, video_catalog, activeIndex} = this.state\n let lesson = video_catalog[activeIndex]\n if (!lesson['is_free']) {\n if (course['is_audition']) {\n this.setState({\n isAuth: true\n })\n return true\n } else {\n if (lesson['video_auth']) {\n this.setState({\n isAuth: true\n })\n return true\n }\n this.setState({\n isAuth: false\n })\n return false\n }\n\n }\n this.setState({\n isAuth: true\n })\n return true\n }\n\n\n render() {\n let {match, location} = this.props\n const {video_catalog, activeIndex, isAuth, salePrice} = this.state\n return (\n <div className='play'>\n <HeaderBar title={this.state.title} arrow={true}/>\n <Loading isLoading={this.state.isLoading}>\n <div className=\"video\">\n <video className={'video-js'} ref={el => this.video = el}>\n <source src={'/'} type='application/x-mpegURL'/>\n </video>\n {\n !isAuth && (\n <div className=\"purchase-box\">\n <div className='hint'>您尚未购买该课时,请购买后学习。</div>\n <div className='btns'>\n <button type='button' className='purchase-class'>¥{salePrice} 购买课程</button>\n <button type='button'\n className='purchase-episode'>¥{video_catalog.length && video_catalog[activeIndex]['class_price']} 购买单集\n </button>\n </div>\n </div>\n )\n }\n </div>\n <div className='tab'>\n <div>\n <NavLink to={`${match.url}/video`}\n replace\n activeClassName='active'\n >视频</NavLink>\n </div>\n <div>\n <NavLink to={`${match.url}/datum`}\n replace\n activeClassName='active'\n >资料</NavLink>\n </div>\n </div>\n </Loading>\n <Switch>\n <Redirect exact from={'/play'} to={{\n pathname: '/play/video',\n search: location.search\n }}/>\n <Route path={`${match.path}/video`} render={props => {\n return <VideoCatalog\n activeIndex={this.state.activeIndex}\n handleClick={this.handleClick}\n videoCatalog={this.state.video_catalog}\n {...props}/>\n }}/>\n <Route path={`${match.path}/datum`} render={props => {\n return <DatumCatalog {...props} datum={this.state.datum}/>\n }}/>\n </Switch>\n <Route render={props => {\n return this.state.vCourseId ? <Recommendation {...props} vCourseId={this.state.vCourseId}/>\n : null\n }}/>\n </div>\n );\n }\n}\n\n\nexport default Video;"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["common/v-list-base/index.js","components/video/recommendation/index.js","components/video/video-catalog/index.js","components/video/datum-catalog/index.js","components/video/index.js"],"names":["VList","props","react__WEBPACK_IMPORTED_MODULE_0___default","a","createElement","className","onClick","handleClick","bind","id","status","src","img","alt","info","tab","Bottom","_ref","item","react_default","price1","price0","Recommendation","state","num","list","courseId","getRecommendation","http","get","concat","api","home","_this","vCourseId","then","res","data","code","setState","toast_default","msg","history","push","this","_this2","map","Info","course_title","simpledescription","recommendation_Bottom","v_list_base","key","course_id","image_name","PureComponent","VideoCatalog","i","videoCatalog","index","classnames","active","activeIndex","name","duration","video_auth","Component","DatumCatalog","datum","accordion_default","length","Panel","header","dir_name","files","file_id","file_name","defaultProps","alert","modal_default","Video","title","video_catalog","currentVideoSrc","isAuth","course","salePrice","isLoading","initializePlayer","window","HELP_IMPROVE_VIDEOJS","player","videojs","video","controls","preload","bigPlayButton","textTrackDisplay","posterImage","errorDisplay","enableTouchActivity","hasAuth","setPlayerSrc","playVideo","getVideoCatalog","courseID","lessonAvailable","Promise","resolve","playWithAuth","getCoursePrice","text","onPress","type","play","_this$state","_this$state2","_this$state3","lesson","getParam","getDatumCatalog","prevProps","prevState","console","log","dispose","_this3","_this$props","match","location","_this$state4","HeaderBar","arrow","common","ref","el","react_router_dom","to","url","replace","activeClassName","react_router","exact","from","pathname","search","path","render","video_video_catalog","Object","assign","video_datum_catalog","video_recommendation"],"mappings":"qHAkBeA,IAfD,SAACC,GACX,OACIC,EAAAC,EAAAC,cAAA,MAAIC,UAAU,mBAAmBC,QAASL,EAAMM,YAAYC,YAAWP,EAAMQ,KACzEP,EAAAC,EAAAC,cAAA,OAAKC,UAAU,WACXH,EAAAC,EAAAC,cAAA,OAAKC,UAAU,SACVJ,EAAMS,OACPR,EAAAC,EAAAC,cAAA,OAAKO,IAAKV,EAAMW,IAAKC,IAAI,MAE5BZ,EAAMa,MAEVb,EAAMc,mVCLbC,EAAS,SAAAC,GAAY,IAAVC,EAAUD,EAAVC,KACb,OACIC,EAAAhB,EAAAC,cAAA,OAAK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cAAA,WACIe,EAAAhB,EAAAC,cAACoI,EAAA,EAAD,CAASC,GAAE,GAAA3G,OAAKkG,EAAMU,IAAX,UACFC,SAAO,EACPC,gBAAgB,UAFzB,mBAOZzH,EAAAhB,EAAAC,cAACyI,EAAA,EAAD,KACI1H,EAAAhB,EAAAC,cAACyI,EAAA,EAAD,CAAUC,OAAK,EAACC,KAAM,QAASN,GAAI,CAC/BO,SAAU,cACVC,OAAQhB,EAASgB,UAErB9H,EAAAhB,EAAAC,cAACyI,EAAA,EAAD,CAAOK,KAAI,GAAApH,OAAKkG,EAAMkB,KAAX,UAAyBC,OAAQ,SAAAlJ,GACxC,OAAOkB,EAAAhB,EAAAC,cAACgJ,EAADC,OAAAC,OAAA,CACHxF,YAAagE,EAAKvG,MAAMuC,YACxBvD,YAAauH,EAAKvH,YAClBmD,aAAcoE,EAAKvG,MAAM2D,eACrBjF,OAEZkB,EAAAhB,EAAAC,cAACyI,EAAA,EAAD,CAAOK,KAAI,GAAApH,OAAKkG,EAAMkB,KAAX,UAAyBC,OAAQ,SAAAlJ,GACxC,OAAOkB,EAAAhB,EAAAC,cAACmJ,EAADF,OAAAC,OAAA,GAAkBrJ,EAAlB,CAAyBmE,MAAO0D,EAAKvG,MAAM6C,aAG1DjD,EAAAhB,EAAAC,cAACyI,EAAA,EAAD,CAAOM,OAAQ,SAAAlJ,GACX,OAAO6H,EAAKvG,MAAMW,UAAYf,EAAAhB,EAAAC,cAACoJ,EAADH,OAAAC,OAAA,GAAoBrJ,EAApB,CAA2BiC,UAAW4F,EAAKvG,MAAMW,aACzE,gBA3PNgC,aAmQLc","file":"static/js/video.1cacaecc.chunk.js","sourcesContent":["import React from 'react';\nimport './index.scss'\n\nconst VList = (props) => {\n return (\n <li className='v-list-base-item' onClick={props.handleClick.bind(this, props.id)}>\n <div className=\"content\">\n <div className=\"cover\">\n {props.status}\n <img src={props.img} alt=\"\"/>\n </div>\n {props.info}\n </div>\n {props.tab}\n </li>\n );\n};\n\nexport default VList;","import React, { PureComponent } from 'react';\nimport './recommendation.scss'\nimport { http, api } from '@/utils'\nimport { Toast } from \"antd-mobile\";\nimport VList from '@/common/v-list-base';\n\n\n\nconst Bottom = ({item}) => {\n return (\n <div className='bottom'>\n <span className='price'>¥{item.price1}</span>\n <span className='stale-price'>¥{item.price0}</span>\n </div>\n )\n}\n\n\n\nclass Recommendation extends PureComponent {\n state = {\n num: 10,\n list: [],\n courseId: null\n }\n\n\n componentDidMount() {\n this.getRecommendation()\n }\n\n getRecommendation = () => {\n http.get(`${api.home}/m/play/recommend_course/${this.props.vCourseId}?num=${this.state.num}`)\n .then(res => {\n const data = res.data\n if(data.code === 200){\n\n this.setState({\n list: data.data\n })\n\n }else {\n Toast.info(data.msg)\n }\n })\n }\n\n\n handleClick = id => {\n this.props.history.push(`/detail?id=${id}`)\n }\n\n render() {\n return (\n <div className='recommendation'>\n <div className={'title'}>相关推荐</div>\n <ul>\n {\n this.state.list.map(item => {\n const Info = (\n <div className=\"info\">\n <p className='title'>{item.course_title}</p>\n <p className='des'>{item.simpledescription}</p>\n <Bottom\n item={item}\n />\n </div>\n )\n\n return (\n <VList\n key={item.course_id}\n img={item.image_name}\n handleClick={this.handleClick}\n info={Info}\n id={item.course_id}\n />\n )\n })\n }\n </ul>\n </div>\n );\n }\n}\n\nexport default Recommendation;","import React, { Component } from 'react';\nimport './video-catalog.scss'\nimport classnames from 'classnames'\n\n\nclass VideoCatalog extends Component {\n\n handleClick = (i) => {\n this.props.handleClick(i)\n }\n\n render() {\n return (\n <div className='video-catalog'>\n <ul>\n {\n this.props.videoCatalog.map((item, index) => {\n return (\n <li key={item.id}\n className={classnames({active: this.props.activeIndex === index})}\n onClick={this.handleClick.bind(this, index)}\n >\n <span className=\"title\">{item.name}</span>\n <span className='duration'>{item.duration}</span>\n <i className={classnames(`iconfont`,\n [item.video_auth === 0\n ? 'iconiconfront-74'\n : 'iconiconfront-35'],\n )}/>\n </li>\n )\n })\n }\n </ul>\n </div>\n );\n }\n}\n\nexport default VideoCatalog;","import React, { Component } from 'react';\nimport './datum-catalog.scss'\nimport { Accordion } from \"antd-mobile\";\n\n\nclass DatumCatalog extends Component {\n\n static defaultProps = {\n datum: [{\n dir_name: '',\n files: [{\n file_name: '',\n file_id: 0\n }]\n }]\n }\n\n render() {\n const {datum} = this.props\n return (\n <div className='datum-catalog'>\n <p className='prompt'>课程资料请到PC端播放页下载</p>\n <Accordion>\n {\n datum && datum.length && datum.map((item, index) => {\n return (\n <Accordion.Panel header={item.dir_name} key={index}>\n {\n item.files.map(item => {\n return (\n <div key={item.file_id} className='file-name'>\n {item.file_name}\n </div>\n )\n })\n }\n </Accordion.Panel>\n )\n })\n }\n </Accordion>\n </div>\n );\n }\n}\n\nexport default DatumCatalog;","import React, { Component } from 'react';\nimport HeaderBar from '@/common/HeaderBar'\nimport './video.scss'\nimport { NavLink, Route, Redirect, Switch } from 'react-router-dom';\nimport { http, api, getParam } from '@/utils'\nimport Recommendation from './recommendation'\nimport VideoCatalog from './video-catalog'\nimport DatumCatalog from './datum-catalog'\nimport { Toast } from 'antd-mobile';\nimport videojs from 'video.js'\nimport 'video.js/dist/video-js.min.css'\nimport { Modal } from \"antd-mobile\";\nimport { Loading } from '@/common'\n\nlet alert = Modal.alert\n\n\nclass Video extends Component {\n\n video\n player\n courseID\n\n\n state = {\n title: '',\n courseId: null,\n video_catalog: [],\n datum: [],\n currentVideoSrc: '',\n activeIndex: 0,\n isAuth: true,\n course: null,\n salePrice: null,\n vCourseId: null,\n isLoading: true\n }\n\n\n componentDidMount() {\n this.courseID = getParam('id')\n this.setState({\n courseId: this.courseID\n })\n this.getVideoCatalog()\n this.getDatumCatalog()\n }\n\n initializePlayer = () => {\n window.HELP_IMPROVE_VIDEOJS = false;\n this.player = videojs(this.video, {\n controls: true,\n preload: 'auto',\n bigPlayButton: true,\n textTrackDisplay: false,\n posterImage: false,\n errorDisplay: false\n })\n this.player.enableTouchActivity()\n\n }\n\n componentDidUpdate(prevProps, prevState) {\n console.log(this.video);\n }\n\n\n componentWillUnmount() {\n if (this.player) {\n\n this.player.dispose()\n }\n }\n\n handleClick = index => {\n if (this.hasAuth()) {\n this.setPlayerSrc(this.state.video_catalog[index]['play_url'])\n this.playVideo()\n }\n this.setState({\n activeIndex: index\n })\n }\n\n\n getVideoCatalog = () => {\n http.get(`${api.home}/m/course/play/${this.courseID}`)\n .then(res => {\n const data = res.data\n if (data.code === 200) {\n\n this.setState(\n state => ({\n video_catalog: data.data['lessons'],\n currentVideoSrc: data.data['lessons'][state.activeIndex]['play_url'],\n course: data.data.course,\n courseId: data.data.course['course_id'],\n vCourseId: data.data.course['v_course_id'],\n title: data.data.course['course_title'],\n isLoading: false\n }),\n () => {\n if (this.lessonAvailable()) {\n if (this.hasAuth(this.state.activeIndex)) {\n Promise.resolve().then(() => {\n this.initializePlayer()\n this.playWithAuth()\n })\n } else {\n this.getCoursePrice();\n }\n } else {\n alert('暂无视频', '', [{\n text: 'OK',\n onPress: () => {\n this.props.history.push('/')\n }\n }])\n }\n }\n )\n } else {\n Toast.info(data.msg)\n }\n })\n }\n\n setPlayerSrc = src => {\n this.player.src({\n src,\n type: 'application/x-mpegURL'\n })\n }\n\n playVideo = () => {\n this.player.play()\n }\n\n\n getDatumCatalog() {\n http.get(`${api.home}/m/course/data/${this.courseID}`)\n .then(res => {\n const data = res.data\n if (data.code === 200) {\n\n this.setState({\n datum: data.data\n })\n\n } else {\n Toast.info(data.msg)\n }\n })\n }\n\n lessonAvailable = () => {\n const {video_catalog, activeIndex} = this.state\n return video_catalog[activeIndex]['video_size'] !== 0\n }\n\n getCoursePrice = () => {\n http.get(`${api.home}/sys/course/price/${this.state.courseId}`)\n .then(res => {\n const {data} = res\n if (data.code === 200) {\n this.setState({\n salePrice: data.data['sale_price']\n })\n }\n })\n }\n\n playWithAuth = () => {\n const {video_catalog, activeIndex} = this.state\n\n if (this.hasAuth()) {\n this.setPlayerSrc(video_catalog[activeIndex]['play_url'])\n }\n }\n\n hasAuth = (index) => {\n const {course, video_catalog, activeIndex} = this.state\n let lesson = video_catalog[activeIndex]\n if (!lesson['is_free']) {\n if (course['is_audition']) {\n this.setState({\n isAuth: true\n })\n return true\n } else {\n if (lesson['video_auth']) {\n this.setState({\n isAuth: true\n })\n return true\n }\n this.setState({\n isAuth: false\n })\n return false\n }\n\n }\n this.setState({\n isAuth: true\n })\n return true\n }\n\n\n render() {\n let {match, location} = this.props\n const {video_catalog, activeIndex, isAuth, salePrice} = this.state\n return (\n <div className='play'>\n <HeaderBar title={this.state.title} arrow={true}/>\n <Loading isLoading={this.state.isLoading}>\n <div className=\"video\">\n <video className={'video-js'} ref={el => this.video = el}>\n <source src={'/'} type='application/x-mpegURL'/>\n </video>\n {\n !isAuth && (\n <div className=\"purchase-box\">\n <div className='hint'>您尚未购买该课时,请购买后学习。</div>\n <div className='btns'>\n <button type='button' className='purchase-class'>¥{salePrice} 购买课程</button>\n <button type='button'\n className='purchase-episode'>¥{video_catalog.length && video_catalog[activeIndex]['class_price']} 购买单集\n </button>\n </div>\n </div>\n )\n }\n </div>\n <div className='tab'>\n <div>\n <NavLink to={`${match.url}/video`}\n replace\n activeClassName='active'\n >视频</NavLink>\n </div>\n <div>\n <NavLink to={`${match.url}/datum`}\n replace\n activeClassName='active'\n >资料</NavLink>\n </div>\n </div>\n </Loading>\n <Switch>\n <Redirect exact from={'/play'} to={{\n pathname: '/play/video',\n search: location.search\n }}/>\n <Route path={`${match.path}/video`} render={props => {\n return <VideoCatalog\n activeIndex={this.state.activeIndex}\n handleClick={this.handleClick}\n videoCatalog={this.state.video_catalog}\n {...props}/>\n }}/>\n <Route path={`${match.path}/datum`} render={props => {\n return <DatumCatalog {...props} datum={this.state.datum}/>\n }}/>\n </Switch>\n <Route render={props => {\n return this.state.vCourseId ? <Recommendation {...props} vCourseId={this.state.vCourseId}/>\n : null\n }}/>\n </div>\n );\n }\n}\n\n\nexport default Video;"],"sourceRoot":""}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment