Commit f8ce382b by xuzhenghua

强制拼团

parents 40e4edc5 73bfcd95
......@@ -83,8 +83,8 @@
"deposit-pay-order.js": "/mrstatic/js/deposit-pay-order.05053d4f.chunk.js",
"deposit-pay-order.js.map": "/mrstatic/js/deposit-pay-order.05053d4f.chunk.js.map",
"detail.css": "/mrstatic/css/detail.418d7070.chunk.css",
"detail.js": "/mrstatic/js/detail.7fede5e4.chunk.js",
"detail.js.map": "/mrstatic/js/detail.7fede5e4.chunk.js.map",
"detail.js": "/mrstatic/js/detail.d2b1b8fb.chunk.js",
"detail.js.map": "/mrstatic/js/detail.d2b1b8fb.chunk.js.map",
"intelligent-recommend.css": "/mrstatic/css/intelligent-recommend.aac549ab.chunk.css",
"intelligent-recommend.js": "/mrstatic/js/intelligent-recommend.2d9acb19.chunk.js",
"intelligent-recommend.js.map": "/mrstatic/js/intelligent-recommend.2d9acb19.chunk.js.map",
......@@ -115,8 +115,8 @@
"python-class.css": "/mrstatic/css/python-class.1718dcc2.chunk.css",
"python-class.js": "/mrstatic/js/python-class.d8a017e8.chunk.js",
"python-class.js.map": "/mrstatic/js/python-class.d8a017e8.chunk.js.map",
"runtime~main.js": "/mrstatic/js/runtime~main.a9acd112.js",
"runtime~main.js.map": "/mrstatic/js/runtime~main.a9acd112.js.map",
"runtime~main.js": "/mrstatic/js/runtime~main.90e7a176.js",
"runtime~main.js.map": "/mrstatic/js/runtime~main.90e7a176.js.map",
"search.css": "/mrstatic/css/search.9c45e5d3.chunk.css",
"search.js": "/mrstatic/js/search.04ec5377.chunk.js",
"search.js.map": "/mrstatic/js/search.04ec5377.chunk.js.map",
......@@ -130,8 +130,8 @@
"system-notices.js": "/mrstatic/js/system-notices.dc2aada6.chunk.js",
"system-notices.js.map": "/mrstatic/js/system-notices.dc2aada6.chunk.js.map",
"togroup.css": "/mrstatic/css/togroup.15481724.chunk.css",
"togroup.js": "/mrstatic/js/togroup.1014a362.chunk.js",
"togroup.js.map": "/mrstatic/js/togroup.1014a362.chunk.js.map",
"togroup.js": "/mrstatic/js/togroup.9e8d72b1.chunk.js",
"togroup.js.map": "/mrstatic/js/togroup.9e8d72b1.chunk.js.map",
"treasure-box-home.css": "/mrstatic/css/treasure-box-home.2c70c52e.chunk.css",
"treasure-box-home.js": "/mrstatic/js/treasure-box-home.820746da.chunk.js",
"treasure-box-home.js.map": "/mrstatic/js/treasure-box-home.820746da.chunk.js.map",
......@@ -264,6 +264,6 @@
"mrstatic/media/iconfont.css": "/mrstatic/media/iconfont.f2f4294d.woff",
"mrstatic/media/kanjia_cg_icon.png": "/mrstatic/media/kanjia_cg_icon.81a489ac.png",
"mrstatic/media/video.scss": "/mrstatic/media/progress-share-bg.80011994.png",
"precache-manifest.e37f9f92c689ff118019fc5ad7cd9f0f.js": "/precache-manifest.e37f9f92c689ff118019fc5ad7cd9f0f.js",
"precache-manifest.7299112a336d569d87f0a2427df91ba7.js": "/precache-manifest.7299112a336d569d87f0a2427df91ba7.js",
"service-worker.js": "/service-worker.js"
}
\ 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([[45],{1153:function(e,a,t){"use strict";t.r(a);t(137);var n,c=t(73),s=t.n(c),r=(t(86),t(26)),i=t.n(r),o=(t(136),t(36)),l=t.n(o),d=(t(207),t(88)),m=t.n(d),u=(t(40),t(10)),p=t.n(u),E=t(3),f=t(5),_=t(4),h=t(6),v=t(7),N=t(0),g=t.n(N),b=(t(745),t(23)),w=t(2),y=t(20),k=t(13),C=Object(y.b)(function(e){return{user:e.user}})(n=function(e){function a(e){var t;return Object(E.a)(this,a),(t=Object(_.a)(this,Object(h.a)(a).call(this,e))).invitedFriends=function(){var e=t.state,a=e.pdd_price,n=e.number,c=e.data;if(w.b.isWeixin){var s=t.state.share;t.setState({share:!s}),Object(w.l)({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.href+"&is_originator=1",imgUrl:c.image_name})}else p.a.info("\u8bf7\u5728\u5fae\u4fe1\u4e2d\u4f7f\u7528\u5206\u4eab\u529f\u80fd\uff01",2)},t.toCourseDetail=function(e){return t.props.history.push("/detail?id=".concat(e),{href:"/classify"}),!1},t.handleToGroup=function(){var e=t.state,a=e.isBuy,n=void 0!==a&&a,c=e.data,s=void 0===c?{}:c,r=t.props,i=r.user,o=r.history,l=r.location;if(i.hasError)if(w.b.isWeixin){var d=window.location.href;if(d.includes("code=")&&d.includes("state=STATE")){var m=d.lastIndexOf("code=");d=d.substr(0,m-1)}window.location.assign("https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=".concat(encodeURIComponent(d),"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"))}else o.push("/passport",{from:l});else n?t.setState({modal:!0}):o.push("/order?id=".concat(s.course_id),{group:1,pdd_order_id:t.state.pddOrderId})},t.state={data:{},share:!1,pdd_price:0,groupon_member:[],person_num:0,is_success:!1,number:0,isBuy:!1,modal:!1,pddOrderId:""},t}return Object(v.a)(a,e),Object(f.a)(a,[{key:"componentDidMount",value:function(){var e=this;w.e.get("".concat(API["base-api"],"/pdd/info/").concat(Object(w.c)("id"))).then(function(a){if(0===a.data.errno){if(e.setState({data:a.data.data.course_info,pdd_price:a.data.data.pdd_price,groupon_member:a.data.data.groupon_member,is_success:a.data.data.is_success,person_num:a.data.data.person_num,course_list:a.data.data.course_list,number:a.data.data.number,pddOrderId:a.data.data.pdd_order_id,countdown:"",isBuy:a.data.data.is_buy}),0===a.data.data.is_success){var t=1e3*a.data.data.end_time,n=0,c=0,s=0;setInterval(function(){t-=1e3,n="".concat(parseInt(t/36e5)).padStart(2,0),c="".concat(parseInt((t-36e5*n)/6e4)).padStart(2,0),s="".concat(parseInt((t-36e5*n-6e4*c)/1e3)).padStart(2,0),e.setState({countdown:"".concat(n,":").concat(c,":").concat(s)})},1e3)}}else p.a.info(a.data.msg,2)})}},{key:"render",value:function(){var e=this,a=this.state,t=a.data,n=t.course_id,c=t.course_title,s=t.simpledescription,r=t.price0,i=t.price1,o=(a.pdd_price,a.is_success),d=(a.person_num,a.groupon_member,a.course_list),u=g.a.createElement("div",{className:"info"},g.a.createElement("p",{className:"title",onClick:function(){return e.toCourseDetail(n)}},c),g.a.createElement("p",{className:"contact text-overflow-2"},s),g.a.createElement("div",{className:"des"},g.a.createElement("p",{className:"course-price"},g.a.createElement("span",{className:"new"},"\xa5",i),g.a.createElement("span",{className:"old"},"\xa5",r))));return g.a.createElement("div",{className:"to-group-box"},g.a.createElement(b.e,{title:"\u62fc\u56e2",cart:!1,toHref:"/"}),g.a.createElement(m.a,{transparent:!0,visible:this.state.modal,title:"\u63d0\u793a",footer:[{text:"\u786e\u5b9a",onPress:function(){e.setState({modal:!1}),e.props.history.push("/")}}]},g.a.createElement("p",null,"\u60a8\u5df2\u7ecf\u8d2d\u4e70\u8fc7\u8be5\u8bfe\u7a0b\uff5e")),!o&&g.a.createElement(b.k,{img:this.state.data.image_name,id:this.state.data.course_id,info:u,toDetail:this.toCourseDetail}),g.a.createElement(O,{data:this.state,invitedFriends:this.invitedFriends,handleToGroup:this.handleToGroup,userInfo:this.props.user}),g.a.createElement(l.a,null),g.a.createElement("div",{className:"group-course"},g.a.createElement("div",{className:"top-title"},g.a.createElement("span",null,"\u672c\u5468\u7279\u60e0"),g.a.createElement(k.b,{to:"/preferential",className:"more"},"\u66f4\u591a",g.a.createElement("i",{className:"iconfont iconiconfront-70"}))),d&&d.length>0&&d[0].course&&d[0].course.length>0&&d[0].course.slice(0,4).map(function(a){var t=g.a.createElement("div",{className:"info"},g.a.createElement("p",{className:"title",onClick:function(){return e.toCourseDetail(a.course_id)}},a.course_title),g.a.createElement("p",{className:"contact text-overflow-2"},a.simpledescription),g.a.createElement("div",{className:"des"},g.a.createElement("p",{className:"course-price"},g.a.createElement("span",{className:"new"},"\xa5",a.price1),g.a.createElement("span",{className:"old"},"\xa5",a.price0))));return g.a.createElement(b.k,{img:a.image_name,key:a.uid,id:a.course_id,info:t,toDetail:e.toCourseDetail})})))}}]),a}(N.Component))||n;function O(e){for(var a,t,n,c,r=e.data,o=r.pdd_price,l=r.data,d=r.groupon_member,m=r.is_success,u=r.person_num,p=r.share,E=r.number,f=r.countdown,_=e.userInfo,h=[],v=E;0!=v;)h.push(v),v--;if(c=g.a.createElement("div",{className:"group-user-list"},g.a.createElement(i.a,{justify:"center",className:"imgList"},d.map(function(e){return g.a.createElement("div",{className:"imgContainer",key:Math.random()},g.a.createElement("img",{className:"imgname",src:e.avatar,alt:""}),1===e.user_type?g.a.createElement("div",{className:"leaderFlag"},g.a.createElement("span",null,"\u56e2\u957f")):null)}),h.map(function(e){return g.a.createElement("div",{className:"imgContainer",key:Math.random()},g.a.createElement("div",{className:"imgname"},g.a.createElement("i",{className:"iconfont iconwode-xianxing no-body"})))}))),d&&d.length>0){var N=!1;!_.hasError&&d.map(function(e){e.uid!=_.data.uid||(N=!0)}),N?(a=g.a.createElement("p",{className:"tip"},"\u62fc\u56e2\u7701\uffe5".concat(l.price1-o,"\u5143")),t=g.a.createElement("span",{className:"group-btn",onClick:e.invitedFriends},"\u9080\u8bf7\u597d\u53cb\u53c2\u56e2 ",f," \u540e\u7ed3\u675f"),n=g.a.createElement("p",{className:"dec"},"\u5206\u4eab\u52303\u4e2a\u7fa4\u540e\uff0c\u6210\u56e2\u7387\u9ad8\u8fbe98%")):1==Object(w.c)("is_originator")?(a=g.a.createElement("p",{className:"tip"},"\u62fc\u56e2\u7701\uffe5".concat(l.price1-o,"\u5143")),t=g.a.createElement("a",{href:"javascript:;",className:"group-btn",onClick:e.handleToGroup},"\u4e00\u952e\u53c2\u56e2")):(a=g.a.createElement("p",{className:"tip"},"\u62fc\u56e2\u7701\uffe5".concat(l.price1-o,"\u5143")),t=g.a.createElement("span",{className:"group-btn",onClick:e.invitedFriends},"\u9080\u8bf7\u597d\u53cb\u53c2\u56e2 ",f," \u540e\u7ed3\u675f"),n=g.a.createElement("p",{className:"dec"},"\u5206\u4eab\u52303\u4e2a\u7fa4\u540e\uff0c\u6210\u56e2\u7387\u9ad8\u8fbe98%"))}return 1===m&&(a=g.a.createElement("p",{className:"success"},"\u62fc\u56e2\u6210\u529f"),t=g.a.createElement(k.b,{to:"/detail?id=".concat(l.course_id),className:"tostudy"},"\u53bb\u5b66\u4e60")),g.a.createElement("div",{className:"gorup-content"},p?g.a.createElement("div",{className:"groupSuccessMbc",onClick:e.invitedFriends},g.a.createElement("div",{className:"tipContent"},"\u8fd8\u5dee".concat(E,"\u4eba\uff0c\u5206\u4eab\u52303\u4e2a\u7fa4\uff0c\u6210\u56e2\u7387\u9ad8\u8fbe98%")),g.a.createElement("div",{className:"tipArrow"},g.a.createElement("i",{className:"iconfont iconyindao"}))):null,a,g.a.createElement(s.a,null,c),g.a.createElement(s.a,null,t),n,!m&&g.a.createElement("div",{className:"group-dec"},g.a.createElement("span",null,g.a.createElement("i",{className:"iconfont iconiconfront-1"}),"\xb7\u597d\u53cb\u53c2\u56e2 \xb7\u4eba\u6ee1\u6210\u4ea4 \xb7\u4eba\u4e0d\u6ee1\u9000\u6b3e"),g.a.createElement("span",{className:"allNum"},"\u7d2f\u8ba1".concat(u,"\u4eba\u6210\u56e2"))))}a.default=C},745:function(e,a,t){}}]);
//# sourceMappingURL=togroup.1014a362.chunk.js.map
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{1153:function(e,a,t){"use strict";t.r(a);t(137);var n,c=t(73),s=t.n(c),r=(t(86),t(26)),i=t.n(r),o=(t(136),t(36)),l=t.n(o),d=(t(207),t(88)),m=t.n(d),u=(t(40),t(10)),p=t.n(u),E=t(3),f=t(5),_=t(4),h=t(6),v=t(7),N=t(0),g=t.n(N),b=(t(745),t(23)),w=t(2),y=t(20),k=t(13),C=Object(y.b)(function(e){return{user:e.user}})(n=function(e){function a(e){var t;return Object(E.a)(this,a),(t=Object(_.a)(this,Object(h.a)(a).call(this,e))).invitedFriends=function(){var e=t.state,a=e.pdd_price,n=e.number,c=e.data;if(w.b.isWeixin){var s=t.state.share;t.setState({share:!s}),Object(w.l)({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.href+"&is_originator=1",imgUrl:c.image_name})}else p.a.info("\u8bf7\u5728\u5fae\u4fe1\u4e2d\u4f7f\u7528\u5206\u4eab\u529f\u80fd\uff01",2)},t.toCourseDetail=function(e){return t.props.history.push("/detail?id=".concat(e),{href:"/classify"}),!1},t.handleToGroup=function(){var e=t.state,a=e.isBuy,n=void 0!==a&&a,c=e.data,s=void 0===c?{}:c,r=t.props,i=r.user,o=r.history,l=r.location;if(i.hasError)if(w.b.isWeixin){var d=window.location.href;if(d.includes("code=")&&d.includes("state=STATE")){var m=d.lastIndexOf("code=");d=d.substr(0,m-1)}window.location.assign("https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=".concat(encodeURIComponent(d),"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"))}else o.push("/passport",{from:l});else n?t.setState({modal:!0}):o.push("/order?id=".concat(s.course_id),{group:1,pdd_order_id:t.state.pddOrderId})},t.state={data:{},share:!1,pdd_price:0,groupon_member:[],person_num:0,is_success:!1,number:0,isBuy:!1,modal:!1,pddOrderId:""},t}return Object(v.a)(a,e),Object(f.a)(a,[{key:"componentDidMount",value:function(){var e=this;w.e.get("".concat(API["base-api"],"/pdd/info/").concat(Object(w.c)("id"))).then(function(a){if(0===a.data.errno){if(e.setState({data:a.data.data.course_info,pdd_price:a.data.data.pdd_price,groupon_member:a.data.data.groupon_member,is_success:a.data.data.is_success,person_num:a.data.data.person_num,course_list:a.data.data.course_list,number:a.data.data.number,pddOrderId:a.data.data.pdd_order_id,countdown:"",isBuy:a.data.data.is_buy}),0===a.data.data.is_success){var t=1e3*a.data.data.end_time,n=0,c=0,s=0,r=0;setInterval(function(){t-=1e3,a.data.data.end_time>86400?(n="".concat(parseInt(t/864e5)).padStart(2,0),c="".concat(parseInt((t-36e5*n*24)/36e5)).padStart(2,0),s="".concat(parseInt((t-36e5*n*24-36e5*c)/6e4)).padStart(2,0),e.setState({countdown:"".concat(n,":").concat(c,":").concat(s)})):(c="".concat(parseInt(t/36e5)).padStart(2,0),s="".concat(parseInt((t-36e5*c)/6e4)).padStart(2,0),r="".concat(parseInt((t-36e5*c-6e4*s)/1e3)).padStart(2,0),e.setState({countdown:"".concat(c,":").concat(s,":").concat(r)}))},1e3)}}else p.a.info(a.data.msg,2)})}},{key:"render",value:function(){var e=this,a=this.state,t=a.data,n=t.course_id,c=t.course_title,s=t.simpledescription,r=t.price0,i=t.price1,o=(a.pdd_price,a.is_success),d=(a.person_num,a.groupon_member,a.course_list),u=g.a.createElement("div",{className:"info"},g.a.createElement("p",{className:"title",onClick:function(){return e.toCourseDetail(n)}},c),g.a.createElement("p",{className:"contact text-overflow-2"},s),g.a.createElement("div",{className:"des"},g.a.createElement("p",{className:"course-price"},g.a.createElement("span",{className:"new"},"\xa5",i),g.a.createElement("span",{className:"old"},"\xa5",r))));return g.a.createElement("div",{className:"to-group-box"},g.a.createElement(b.e,{title:"\u62fc\u56e2",cart:!1,toHref:"/"}),g.a.createElement(m.a,{transparent:!0,visible:this.state.modal,title:"\u63d0\u793a",footer:[{text:"\u786e\u5b9a",onPress:function(){e.setState({modal:!1}),e.props.history.push("/")}}]},g.a.createElement("p",null,"\u60a8\u5df2\u7ecf\u8d2d\u4e70\u8fc7\u8be5\u8bfe\u7a0b\uff5e")),!o&&g.a.createElement(b.k,{img:this.state.data.image_name,id:this.state.data.course_id,info:u,toDetail:this.toCourseDetail}),g.a.createElement(I,{data:this.state,invitedFriends:this.invitedFriends,handleToGroup:this.handleToGroup,userInfo:this.props.user}),g.a.createElement(l.a,null),g.a.createElement("div",{className:"group-course"},g.a.createElement("div",{className:"top-title"},g.a.createElement("span",null,"\u672c\u5468\u7279\u60e0"),g.a.createElement(k.b,{to:"/preferential",className:"more"},"\u66f4\u591a",g.a.createElement("i",{className:"iconfont iconiconfront-70"}))),d&&d.length>0&&d[0].course&&d[0].course.length>0&&d[0].course.slice(0,4).map(function(a){var t=g.a.createElement("div",{className:"info"},g.a.createElement("p",{className:"title",onClick:function(){return e.toCourseDetail(a.course_id)}},a.course_title),g.a.createElement("p",{className:"contact text-overflow-2"},a.simpledescription),g.a.createElement("div",{className:"des"},g.a.createElement("p",{className:"course-price"},g.a.createElement("span",{className:"new"},"\xa5",a.price1),g.a.createElement("span",{className:"old"},"\xa5",a.price0))));return g.a.createElement(b.k,{img:a.image_name,key:a.course_id,id:a.course_id,info:t,toDetail:e.toCourseDetail})})))}}]),a}(N.Component))||n;function I(e){for(var a,t,n,c,r=e.data,o=r.pdd_price,l=r.data,d=r.groupon_member,m=r.is_success,u=r.person_num,p=r.share,E=r.number,f=r.countdown,_=e.userInfo,h=[],v=E;0!=v;)h.push(v),v--;if(c=g.a.createElement("div",{className:"group-user-list"},g.a.createElement(i.a,{justify:"center",className:"imgList"},d.map(function(e){return g.a.createElement("div",{className:"imgContainer",key:Math.random()},g.a.createElement("img",{className:"imgname",src:e.avatar,alt:""}),1===e.user_type?g.a.createElement("div",{className:"leaderFlag"},g.a.createElement("span",null,"\u56e2\u957f")):null)}),h.map(function(e){return g.a.createElement("div",{className:"imgContainer",key:Math.random()},g.a.createElement("div",{className:"imgname"},g.a.createElement("i",{className:"iconfont iconwode-xianxing no-body"})))}))),d&&d.length>0){var N=!1;!_.hasError&&d.map(function(e){e.uid!=_.data.uid||(N=!0)}),N?(a=g.a.createElement("p",{className:"tip"},"\u62fc\u56e2\u7701\uffe5".concat(l.price1-o,"\u5143")),t=g.a.createElement("span",{className:"group-btn",onClick:e.invitedFriends},"\u9080\u8bf7\u597d\u53cb\u53c2\u56e2 ",f," \u540e\u7ed3\u675f"),n=g.a.createElement("p",{className:"dec"},"\u5206\u4eab\u52303\u4e2a\u7fa4\u540e\uff0c\u6210\u56e2\u7387\u9ad8\u8fbe98%")):1==Object(w.c)("is_originator")?(a=g.a.createElement("p",{className:"tip"},"\u62fc\u56e2\u7701\uffe5".concat(l.price1-o,"\u5143")),t=g.a.createElement("a",{href:"javascript:;",className:"group-btn",onClick:e.handleToGroup},"\u4e00\u952e\u53c2\u56e2")):(a=g.a.createElement("p",{className:"tip"},"\u62fc\u56e2\u7701\uffe5".concat(l.price1-o,"\u5143")),t=g.a.createElement("span",{className:"group-btn",onClick:e.invitedFriends},"\u9080\u8bf7\u597d\u53cb\u53c2\u56e2 ",f," \u540e\u7ed3\u675f"),n=g.a.createElement("p",{className:"dec"},"\u5206\u4eab\u52303\u4e2a\u7fa4\u540e\uff0c\u6210\u56e2\u7387\u9ad8\u8fbe98%"))}return 1===m&&(a=g.a.createElement("p",{className:"success"},"\u62fc\u56e2\u6210\u529f"),t=g.a.createElement(k.b,{to:"/detail?id=".concat(l.course_id),className:"tostudy"},"\u53bb\u5b66\u4e60")),g.a.createElement("div",{className:"gorup-content"},p?g.a.createElement("div",{className:"groupSuccessMbc",onClick:e.invitedFriends},g.a.createElement("div",{className:"tipContent"},"\u8fd8\u5dee".concat(E,"\u4eba\uff0c\u5206\u4eab\u52303\u4e2a\u7fa4\uff0c\u6210\u56e2\u7387\u9ad8\u8fbe98%")),g.a.createElement("div",{className:"tipArrow"},g.a.createElement("i",{className:"iconfont iconyindao"}))):null,a,g.a.createElement(s.a,null,c),g.a.createElement(s.a,null,t),n,!m&&g.a.createElement("div",{className:"group-dec"},g.a.createElement("span",null,g.a.createElement("i",{className:"iconfont iconiconfront-1"}),"\xb7\u597d\u53cb\u53c2\u56e2 \xb7\u4eba\u6ee1\u6210\u4ea4 \xb7\u4eba\u4e0d\u6ee1\u9000\u6b3e"),g.a.createElement("span",{className:"allNum"},"\u7d2f\u8ba1".concat(u,"\u4eba\u6210\u56e2"))))}a.default=C},745:function(e,a,t){}}]);
//# sourceMappingURL=togroup.9e8d72b1.chunk.js.map
\ No newline at end of file
......@@ -24,16 +24,16 @@ self.__precacheManifest = [
"url": "/mrstatic/js/3.f20653be.chunk.js"
},
{
"revision": "6902434f8f18a23319d57d0ac8aaea8c",
"url": "/mrstatic/media/redb_sp_bj@2x.6902434f.png"
"revision": "c79abf5cb7ae8a82009cf68fe44d1078",
"url": "/mrstatic/media/redb_money_bj@2x.c79abf5c.png"
},
{
"revision": "33fd19f4a827d64b7b03",
"url": "/mrstatic/js/4.ed571284.chunk.js"
},
{
"revision": "c79abf5cb7ae8a82009cf68fe44d1078",
"url": "/mrstatic/media/redb_money_bj@2x.c79abf5c.png"
"revision": "6902434f8f18a23319d57d0ac8aaea8c",
"url": "/mrstatic/media/redb_sp_bj@2x.6902434f.png"
},
{
"revision": "13e16197c46f5ea96007",
......@@ -88,8 +88,8 @@ self.__precacheManifest = [
"url": "/mrstatic/js/Examination.06a23b06.chunk.js"
},
{
"revision": "64fd0b167457064e12ff8a6afcd31720",
"url": "/mrstatic/media/iconfont.64fd0b16.eot"
"revision": "99b2454970e48c8bb00578cdca15b3d2",
"url": "/mrstatic/media/iconfont.99b24549.ttf"
},
{
"revision": "c6257f33d81e1b721f25",
......@@ -100,8 +100,8 @@ self.__precacheManifest = [
"url": "/mrstatic/js/MyEdit.43227cdc.chunk.js"
},
{
"revision": "99b2454970e48c8bb00578cdca15b3d2",
"url": "/mrstatic/media/iconfont.99b24549.ttf"
"revision": "64fd0b167457064e12ff8a6afcd31720",
"url": "/mrstatic/media/iconfont.64fd0b16.eot"
},
{
"revision": "adefb4b287572732dd1f",
......@@ -220,8 +220,8 @@ self.__precacheManifest = [
"url": "/mrstatic/js/56.71c6b91d.chunk.js"
},
{
"revision": "cec67766f02b884f265a",
"url": "/mrstatic/js/detail.7fede5e4.chunk.js"
"revision": "9a7bde63f88eb67371e2",
"url": "/mrstatic/js/detail.d2b1b8fb.chunk.js"
},
{
"revision": "dc8f2acd3ede37009c43",
......@@ -296,16 +296,16 @@ self.__precacheManifest = [
"url": "/mrstatic/js/purchased.f30a7066.chunk.js"
},
{
"revision": "049b4d74ff3989e9c270",
"url": "/mrstatic/js/togroup.1014a362.chunk.js"
"revision": "6f91b07137d59378dd0b",
"url": "/mrstatic/js/togroup.9e8d72b1.chunk.js"
},
{
"revision": "1ccf789ce8665c5f5972",
"url": "/mrstatic/js/python-class.d8a017e8.chunk.js"
},
{
"revision": "177a2c8d123ab42de767",
"url": "/mrstatic/js/runtime~main.a9acd112.js"
"revision": "2e970bbc8e6214c6b5f4",
"url": "/mrstatic/js/runtime~main.90e7a176.js"
},
{
"revision": "690501db508dd409a1ce",
......@@ -340,7 +340,7 @@ self.__precacheManifest = [
"url": "/mrstatic/css/video.59319dd4.chunk.css"
},
{
"revision": "049b4d74ff3989e9c270",
"revision": "6f91b07137d59378dd0b",
"url": "/mrstatic/css/togroup.15481724.chunk.css"
},
{
......@@ -428,7 +428,7 @@ self.__precacheManifest = [
"url": "/mrstatic/css/56.f03957a5.chunk.css"
},
{
"revision": "cec67766f02b884f265a",
"revision": "9a7bde63f88eb67371e2",
"url": "/mrstatic/css/detail.418d7070.chunk.css"
},
{
......@@ -568,7 +568,7 @@ self.__precacheManifest = [
"url": "/mrstatic/css/1.4f6c0784.chunk.css"
},
{
"revision": "70b36ea9386beccf936c78240d175e8d",
"revision": "0a4bcf6003750e39179bfe157d4766b6",
"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.e37f9f92c689ff118019fc5ad7cd9f0f.js"
"/precache-manifest.7299112a336d569d87f0a2427df91ba7.js"
);
workbox.clientsClaim();
......
......@@ -106,15 +106,24 @@ class Group extends Component {
formatTimeByMillisecond = (millisecond) => {
let date = millisecond * 1000,
day = 0,
hours = 0,
minutes = 0,
seconds = 0;
date -= 1000;
if (millisecond > 86400) {
day = `${parseInt(date / (3600000 * 24))}`.padStart(2, 0)
hours = `${parseInt((date - day * 3600000 * 24) / 3600000)}`.padStart(2, 0)
minutes = `${parseInt((date - day * 3600000 * 24 - hours * 3600000) / 60000)}`.padStart(2, 0)
return `${day}:${hours}:${minutes}`;
} else {
hours = `${parseInt(date / (60 * 60 * 1000))}`.padStart(2, 0);
minutes = `${parseInt((date - hours * 3600000) / 60000)}`.padStart(2, 0);
seconds = `${parseInt((date - hours * 3600000 - minutes * 60000) / 1000)}`.padStart(2, 0);
return `${hours}:${minutes}:${seconds}`;
}
}
render() {
const { courseInfo } = this.props;
......
import React, { Component } from 'react'
import React, {Component} from 'react'
import './togroup.scss'
import { HeaderBar, VList } from '../../../common'
import { getParam, http, browser, wxShare } from "@/utils";
import { connect } from "react-redux"
import { Link } from "react-router-dom"
import { WingBlank, WhiteSpace, Flex, Toast, Modal } from 'antd-mobile'
import {HeaderBar, VList} from '../../../common'
import {getParam, http, browser, wxShare} from "@/utils"
import {connect} from "react-redux"
import {Link} from "react-router-dom"
import {WingBlank, WhiteSpace, Flex, Toast, Modal} from 'antd-mobile'
@connect(state => ({user: state.user}))
......@@ -21,34 +21,34 @@ class ToGroup extends Component {
number: 0, // 差几人成团
isBuy: false,
modal: false,
pddOrderId:''
pddOrderId: ''
}
}
invitedFriends = () => {
const {pdd_price, number, data} = this.state;
const {pdd_price, number, data} = this.state
if (browser.isWeixin) {
let share = this.state.share;
let share = this.state.share
this.setState({
share: !share,
});
})
wxShare({
title: `【仅剩${number}个名额】我${pdd_price}元拼了《${data.course_title}》`,
desc: data.course_title,
link: location.href+'&is_originator=1',
link: location.href + '&is_originator=1',
imgUrl: data.image_name,
});
})
} else {
Toast.info('请在微信中使用分享功能!', 2);
Toast.info('请在微信中使用分享功能!', 2)
}
}
componentDidMount() {
http.get(`${API['base-api']}/pdd/info/${getParam('id')}`).then(res => {
if (res.data.errno !== 0) {
Toast.info(res.data.msg, 2);
return;
Toast.info(res.data.msg, 2)
return
}
this.setState({
data: res.data.data.course_info,
......@@ -61,41 +61,51 @@ class ToGroup extends Component {
pddOrderId: res.data.data.pdd_order_id,
countdown: '',
isBuy: res.data.data.is_buy
});
})
if (res.data.data.is_success === 0) {
let date = res.data.data.end_time * 1000,
day = 0,
hours = 0,
minutes = 0,
seconds = 0;
seconds = 0
setInterval(() => {
date -= 1000
hours = `${parseInt(date / (60 * 60 * 1000))}`.padStart(2, 0);
minutes = `${parseInt((date - hours * 3600000) / 60000)}`.padStart(2, 0);
seconds = `${parseInt((date - hours * 3600000 - minutes * 60000) / 1000)}`.padStart(2, 0);
if (res.data.data.end_time > 86400) {
day = `${parseInt(date / (3600000 * 24))}`.padStart(2, 0)
hours = `${parseInt((date - day * 3600000 * 24) / 3600000)}`.padStart(2, 0)
minutes = `${parseInt((date - day * 3600000 * 24 - hours * 3600000) / 60000)}`.padStart(2, 0)
this.setState({
countdown: `${day}:${hours}:${minutes}`
})
} else {
hours = `${parseInt(date / (60 * 60 * 1000))}`.padStart(2, 0)
minutes = `${parseInt((date - hours * 3600000) / 60000)}`.padStart(2, 0)
seconds = `${parseInt((date - hours * 3600000 - minutes * 60000) / 1000)}`.padStart(2, 0)
this.setState({
countdown: `${hours}:${minutes}:${seconds}`
});
})
}
}, 1000)
}
});
})
}
toCourseDetail = (id) => {
const {history} = this.props;
history.push(`/detail?id=${id}`, {href: '/classify'});
return false;
const {history} = this.props
history.push(`/detail?id=${id}`, {href: '/classify'})
return false
}
handleToGroup = () => {
const {isBuy = false, data = {}} = this.state;
const {user, history, location} = this.props;
const {isBuy = false, data = {}} = this.state
const {user, history, location} = this.props
if (user.hasError) {
if (browser.isWeixin) {
let redirectURI = window.location.href
if (redirectURI.includes('code=') && redirectURI.includes('state=STATE')) {
let index = redirectURI.lastIndexOf('code=');
redirectURI = redirectURI.substr(0, index - 1);
let index = redirectURI.lastIndexOf('code=')
redirectURI = redirectURI.substr(0, index - 1)
}
window.location.assign(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=${encodeURIComponent(redirectURI)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`)
} else {
......@@ -110,7 +120,7 @@ class ToGroup extends Component {
`/order?id=${data.course_id}`,
{
group: 1,
pdd_order_id:this.state.pddOrderId
pdd_order_id: this.state.pddOrderId
}
)
} else {
......@@ -121,7 +131,7 @@ class ToGroup extends Component {
}
render() {
const {data: {course_id, course_title, simpledescription, price0, price1}, pdd_price, is_success, person_num, groupon_member, course_list} = this.state;
const {data: {course_id, course_title, simpledescription, price0, price1}, pdd_price, is_success, person_num, groupon_member, course_list} = this.state
const Info = (
<div className="info">
<p className='title' onClick={() => this.toCourseDetail(course_id)}>
......@@ -151,8 +161,8 @@ class ToGroup extends Component {
onPress: () => {
this.setState({
modal: false
});
this.props.history.push('/');
})
this.props.history.push('/')
}
}
]}
......@@ -203,7 +213,7 @@ class ToGroup extends Component {
return (
<VList
img={item.image_name}
key={item.uid}
key={item.course_id}
id={item.course_id}
info={weekInfo}
toDetail={this.toCourseDetail}
......@@ -219,13 +229,14 @@ class ToGroup extends Component {
}
function GorupContent(props) {
let tip, btn, dec, groupTip, shareTip, groupSuccessMbc;
const {pdd_price, data, groupon_member, is_success, person_num, share, number, countdown} = props.data;
let tip, btn, dec, groupTip, shareTip, groupSuccessMbc
const {pdd_price, data, groupon_member, is_success, person_num, share, number, countdown} = props.data
const {userInfo} = props
let ary = [], num = number;
let ary = [], num = number
while (num != 0) {
ary.push(num);
num--;
ary.push(num)
num--
}
groupTip = (<div className='group-user-list'>
<Flex justify='center' className='imgList'>
......@@ -241,7 +252,7 @@ function GorupContent(props) {
</div>
) : null
}
</div>);
</div>)
})
}
{
......@@ -254,14 +265,14 @@ function GorupContent(props) {
})
}
</Flex>
</div>);
</div>)
if (groupon_member && groupon_member.length > 0) {
let flag = false;
let flag = false
!userInfo.hasError && groupon_member.map(item => {
if (item.uid == userInfo.data.uid) {
flag = true
return;
return
}
})
if (flag) {
......@@ -269,7 +280,7 @@ function GorupContent(props) {
btn = <span className='group-btn' onClick={props.invitedFriends}>邀请好友参团 {countdown} 后结束</span>
dec = <p className='dec'>分享到3个群后,成团率高达98%</p>
} else {
if(getParam('is_originator') == 1){
if (getParam('is_originator') == 1) {
tip = <p className='tip'>{`拼团省¥${data.price1 - pdd_price}元`}</p>
btn = <a href="javascript:;" className='group-btn' onClick={props.handleToGroup}>一键参团</a>
} else {
......
......@@ -419,11 +419,12 @@ class Detail extends Component {
seconds = 0
setInterval(() => {
date -= 1000
console.log(endTime)
if (endTime > 86400) {
day = `${parseInt(date / (3600000 * 24))}`.padStart(2, 0)
hours = `${parseInt((date - day * 3600000 * 24) / 3600000)}`.padStart(2, 0)
minutes = `${parseInt((date - day * 3600000 * 24 - hours * 3600000) / 60000)}`.padStart(2, 0)
// seconds = `${parseInt((date - day * 3600000 * 24 - hours * 3600000 - minutes * 60000) / 1000)}`.padStart(2, 0);
this.setState({
countdown: `${day}:${hours}:${minutes}`
})
......
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