1 |
- !function(){function e(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function t(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function n(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(r){o(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e,r,t,n,o,a,c){try{var u=e[a](c),i=u.value}catch(s){return void t(s)}u.done?r(i):Promise.resolve(i).then(n,o)}function c(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var c=e.apply(r,t);function u(e){a(c,n,o,u,i,"next",e)}function i(e){a(c,n,o,u,i,"throw",e)}u(void 0)}))}}System.register(["./ResizeObserver.es-legacy.a3d44ddf.js","./orderStatus-legacy.a4640058.js"],(function(r){"use strict";var t,o,a,u;return{setters:[function(e){t=e.g,o=e.y,a=e.w},function(e){u=e.a}],execute:function(){var i="STUDENT"===t.platformType?"/api-student":"/api-teacher",s=function(e,r){var t=e||new Date,n=a(new Date).format("YYYY-MM-DD");return"MONTH"===r?n=a(t).add(1,"month").format("YYYY-MM-DD"):"QUARTERLY"===r?n=a(t).add(3,"month").format("YYYY-MM-DD"):"YEAR_HALF"===r?n=a(t).add(6,"month").format("YYYY-MM-DD"):"YEAR"===r&&(n=a(t).add(1,"year").format("YYYY-MM-DD")),{startTime:a(t).format("YYYY-MM-DD"),endTime:n}},d=function(){var e=c(regeneratorRuntime.mark((function e(r,o){var c,u,i,d,l,y,h,b,w,D,N,T,Y,O,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=r.goodType,u={},e.t0=c,e.next="LIVE"===e.t0?5:"PRACTICE"===e.t0||"VIP_COURSE"===e.t0?19:"VIDEO"===e.t0?22:"VIP"===e.t0||"SVIP"===e.t0?34:"DISCOUNT"===e.t0?49:"MUSIC"===e.t0?52:"ALBUM"===e.t0?63:"ACTI_REGIST"===e.t0?74:85;break;case 5:return e.prev=5,e.next=8,m(r.bizId);case 8:i=e.sent,d=[],(i.planList||[]).forEach((function(e){var r=e.startTime||new Date,t=e.endTime||new Date;d.push({courseTime:"".concat(a(r).format("YYYY-MM-DD")," ").concat(a(r).format("HH:mm"),"~").concat(a(t).format("HH:mm")),coursePlan:e.plan,id:e.courseId})})),u={orderType:r.goodType,goodName:r.goodName,courseGroupId:i.courseGroupId,courseGroupName:i.courseGroupName,coursePrice:i.coursePrice,teacherName:i.userName||"游客".concat(i.teacherId||""),teacherId:i.teacherId,avatar:i.avatar,courseInfo:d},e.next=18;break;case 15:throw e.prev=15,e.t1=e.catch(5),new Error(e.t1.message);case 18:case 33:case 48:case 62:case 73:case 84:return e.abrupt("break",85);case 19:return l=JSON.parse(r.bizContent),u=n(n({},l),{},{teacherName:r.username,starGrade:r.starGrade,avatar:r.avatar}),e.abrupt("break",85);case 22:return e.prev=22,e.next=25,p(r.bizId);case 25:y=e.sent,h=y.lessonGroup,b=y.detailList,u={orderType:r.goodType,goodName:r.goodName,courseGroupId:h.id,courseGroupName:h.lessonName,coursePrice:h.lessonPrice,teacherName:h.username,teacherId:h.teacherId,avatar:h.avatar,courseInfo:b},e.next=33;break;case 30:throw e.prev=30,e.t2=e.catch(22),new Error(e.t2.message);case 34:e.prev=34,w=(null==o?void 0:o.expectPrice)||r.actualPrice,"MEMBER"!==r.activityType&&null!=o&&o.couponAmount&&(w=Number(((null==o?void 0:o.expectPrice)-(o.couponAmount-o.discountPrice)/r.goodNum).toFixed(2))),D=new Date,"SVIP"===r.goodType?D=a(t.user.data.userVip.svipEndDate||new Date).toDate():"VIP"===r.goodType&&(D=a(t.user.data.userVip.vipEndDate||t.user.data.userVip.svipEndDate||new Date).toDate()),N=new Date,"MONTH"===r.period?N=a(D).add(1*r.goodNum,"month").toDate():"QUARTERLY"===r.period?N=a(D).add(3*r.goodNum,"month").toDate():"YEAR_HALF"===r.period?N=a(D).add(6*r.goodNum,"month").toDate():"YEAR"===r.period&&(N=a(D).add(1*r.goodNum,"year").toDate()),(u={orderType:r.goodType,goodName:r.goodName,num:r.goodNum,id:r.id,title:r.goodName||"",vipEndDays:r.vipEndDays,price:w,period:r.period,startTime:a(D).format("YYYY-MM-DD"),endTime:a(N).format("YYYY-MM-DD"),activityList:[],discountEndTime:t.user.data.discountEndTime,discountStartTime:t.user.data.discountStartTime}).activityList=(r.activityList||[]).map((function(e){var r=e.goodType,t=e.goodName,n=e.goodNum,o=e.giftFlag,a=e.bizId,c=e.period;return{goodType:r,goodName:t,goodNum:n,bizContent:a,giftFlag:o,vipEndDays:null,goodsNum:n,unit:c}})),e.next=48;break;case 45:throw e.prev=45,e.t3=e.catch(34),new Error(e.t3.message);case 49:return T=t.user.data||{},u=n({orderType:r.goodType,goodName:r.goodName,num:r.goodNum,id:r.id,title:r.goodName||"",price:r.expectPrice},s(T.discountEndTime,r.period)),e.abrupt("break",85);case 52:return e.prev=52,e.next=55,f(r.bizId);case 55:Y=e.sent,u=n({orderType:r.goodType,goodName:r.goodName},Y),e.next=62;break;case 59:throw e.prev=59,e.t4=e.catch(52),new Error(e.t4.message);case 63:return e.prev=63,e.next=66,v(r.bizId);case 66:O=e.sent,u=n({orderType:r.goodType,goodName:r.goodName},O),e.next=73;break;case 70:throw e.prev=70,e.t5=e.catch(63),new Error(e.t5.message);case 74:return e.prev=74,e.next=77,g(r.bizId);case 77:E=e.sent,u={orderType:r.goodType,goodsName:E.activityName,activityId:E.id,actualPrice:E.registrationPrice},e.next=84;break;case 81:throw e.prev=81,e.t6=e.catch(74),new Error(e.t6.message);case 85:return u.orderType=c,u.goodName=r.goodName,e.abrupt("return",u);case 88:case"end":return e.stop()}}),e,null,[[5,15],[22,30],[34,45],[52,59],[63,70],[74,81]])})));return function(r,t){return e.apply(this,arguments)}}(),p=function(){var e=c(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.get("".concat(i,"/videoLesson/selectVideoLesson"),{params:{groupId:r}});case 3:return t=e.sent,e.abrupt("return",t.data);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("获取视频课详情失败");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(r){return e.apply(this,arguments)}}(),m=function(){var e=c(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.get("".concat(i,"/courseGroup/queryLiveCourseInfo"),{params:{groupId:r}});case 3:return t=e.sent,e.abrupt("return",t.data);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("获取直播课详情失败");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(r){return e.apply(this,arguments)}}(),f=r("g",function(){var e=c(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.get("".concat(i,"/music/sheet/detail/").concat(r));case 3:return t=e.sent,e.abrupt("return",t.data);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("获取曲目详情失败");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(r){return e.apply(this,arguments)}}()),g=function(){var e=c(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.post("".concat(i,"/open/activity/info/").concat(r));case 3:return t=e.sent,e.abrupt("return",t.data);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("获取曲目详情失败");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(r){return e.apply(this,arguments)}}(),v=function(){var e=c(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.post("".concat(i,"/music/album/detail"),{data:{id:r}});case 3:return t=e.sent,e.abrupt("return",t.data);case 7:throw e.prev=7,e.t0=e.catch(0),new Error("获取专辑详情失败");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(r){return e.apply(this,arguments)}}(),l=function(){var r=u.orderObject.orderList||[],t=r.findIndex((function(e){return"DISCOUNT"===e.orderType}));if(-1!==t){var n=r.splice(t,1);u.orderObject.orderList=[].concat(e(r),e(n))}};r("t",function(){var e=c(regeneratorRuntime.mark((function e(r,t){var o,a,i,s,p,m,f,g,v,y,h,b,w,D,N;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=r.orderNo,a=r.actualPrice,i=r.orderDesc,s=r.orderName,p=r.orderType,m=r.orderDetailList,f=r.couponAmount,g=r.cardDiscountPrice,v=r.discountPrice,y=r.paymentConfig,h=r.paymentVendor,b=r.paymentVersion,w=r.expectPrice,u.orderObject.orderType=p,u.orderObject.orderName=s,u.orderObject.orderDesc=i,u.orderObject.actualPrice=a,u.orderObject.orderNo=o,u.orderObject.discountCardPrice=g,u.orderObject.discountPrice=v,u.orderObject.couponAmount=f,u.orderObject.paymentConfig=n(n({},y),{},{paymentVendor:h,paymentVersion:b}),u.orderObject.orderList=[];try{D=[],N=[],m.map((function(e){e.giftFlag?N.push(e):D.push(e)})),D[0]&&(D[0].activityList=N),D.forEach(function(){var e=c(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d(r,{couponAmount:f,discountPrice:v,expectPrice:w});case 2:t=e.sent,u.orderObject.orderList.push(t),l();case 5:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()),t&&t()}catch(T){}case 12:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}())}}}))}();
|