"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[85111],{73758:function(e,n,s){s.r(n),s.d(n,{default:function(){return V}});var i=s(7557),a=s.n(i),r=s(41498),c=s.n(r),t=s(79800),l=s.n(t),d=s(70236),u=s.n(d),o=s(59301),_="information___zSItT",h="bg___VfIGQ",p="content___ASHZ6",j="header___x8M2V",v="title___OttIa",x="des___S4eIV",m="main___p_J1u",f="info___ZucvQ",N="subject___PUwj6",g="img___M0YwU",b="footer___T2kqC",w="d1___EyB5j",y="d2___WY8x3",I="d3___gtusP",S=s(61621),k=s(3113),P=s(94171),Z=s(91689),C=s(49389),E=s(37712),V=function(e){u()(e);var n=(0,C.useParams)(),s=(0,o.useState)(!0),i=l()(s,2),r=i[0],t=i[1],d=(0,o.useState)(!1),V=l()(d,2),M=V[0],T=V[1],q=(0,o.useState)({}),G=l()(q,2),O=G[0],Q=G[1];(0,o.useEffect)((function(){R()}),[n.courseId]);var R=function(){var e=c()(a()().mark((function e(){var s;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t(!0),e.next=3,(0,P.ZP)("/api/subject_charges/detail.json",{method:"get",params:{subject_id:n.courseId}});case 3:null!=(s=e.sent)&&s.detail&&(Q(null==s?void 0:s.detail),t(!1));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),U=function(){var e=c()(a()().mark((function e(){var s;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),e.next=3,(0,P.ZP)("/api/payments.json",{method:"POST",body:{subject_id:n.courseId,payment_method:"wechat_qr"}});case 3:null!=(s=e.sent)&&s.num&&(T(!1),C.history.push("/order/".concat(n.courseId,"/pay?order_num=").concat(null==s?void 0:s.num)));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,E.jsxs)("section",{className:_,children:[(0,E.jsx)("aside",{className:h}),(0,E.jsxs)("div",{className:p,children:[(0,E.jsxs)("div",{className:j,children:[(0,E.jsx)("div",{className:v,children:"确认订单信息"}),(0,E.jsx)("div",{className:x,children:"注意：购买后不支持退款、转让，请确认有效期后再提交订单"})]}),(0,E.jsxs)(S.Z,{loading:r,active:!0,paragraph:{rows:5},children:[(0,E.jsxs)("div",{className:m,children:[(0,E.jsx)("div",{className:f,children:"商品信息"}),(0,E.jsxs)("div",{className:N,children:[(0,E.jsx)("span",{className:g,children:(0,E.jsx)("img",{src:"".concat(Z.Z.IMG_SERVER,"/images/avatars/Subject/").concat(null==O?void 0:O.subject_id),alt:"",width:160})}),(0,E.jsxs)("ul",{children:[(0,E.jsx)("li",{children:null==O?void 0:O.name}),(0,E.jsxs)("li",{children:["课程有效期：","1"===(null==O?void 0:O.expiration)&&"永久有效","2"===(null==O?void 0:O.expiration)&&"购买后".concat(null==O?void 0:O.days,"天有效"),"3"===(null==O?void 0:O.expiration)&&"".concat(null==O?void 0:O.start_at,"到").concat(null==O?void 0:O.end_at)]})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("span",{children:"￥"}),null==O?void 0:O.price]})]})]}),(0,E.jsxs)("div",{className:b,children:[!(null==O||!O.origin_price)&&(0,E.jsxs)("div",{className:w,children:["商品金额:",(0,E.jsxs)("b",{children:[(0,E.jsx)("span",{children:"￥"}),null==O?void 0:O.origin_price]})]}),(0,E.jsxs)("div",{className:y,children:["应付金额:",(0,E.jsxs)("b",{children:[(0,E.jsx)("span",{children:"￥"}),null==O?void 0:O.price]})]}),(0,E.jsxs)("div",{className:I,children:["提交订单则表示您同意",(0,E.jsx)("a",{href:"https://forge.educoder.net/help?index=4",children:"《EduCoder服务协议》"})]}),(0,E.jsx)(k.ZP,{loading:M,type:"primary",onClick:U,children:"提交订单"})]})]})]})]})}}}]);