tradeOrder-legacy.a0af1df5.js 10 KB

1
  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){a(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 a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r,t,n,a,o,c){try{var u=e[o](c),i=u.value}catch(s){return void t(s)}u.done?r(i):Promise.resolve(i).then(n,a)}function c(e){return function(){var r=this,t=arguments;return new Promise((function(n,a){var c=e.apply(r,t);function u(e){o(c,n,a,u,i,"next",e)}function i(e){o(c,n,a,u,i,"throw",e)}u(void 0)}))}}System.register(["./ResizeObserver.es-legacy.44b91b4c.js","./orderStatus-legacy.12eb861d.js"],(function(r){"use strict";var t,a,o,u;return{setters:[function(e){t=e.g,a=e.y,o=e.w},function(e){u=e.o}],execute:function(){var i="STUDENT"===t.platformType?"/api-student":"/api-teacher",s=function(e,r,t){var n=e||new Date,a=o(new Date).format("YYYY-MM-DD");return"MONTH"===r?a=o(n).add(1,"month").format("YYYY-MM-DD"):"QUARTERLY"===r?a=o(n).add(3,"month").format("YYYY-MM-DD"):"YEAR_HALF"===r?a=o(n).add(6,"month").format("YYYY-MM-DD"):"YEAR"===r&&(a=o(n).add(1,"year").format("YYYY-MM-DD")),{startTime:t?o(n).add(1,"day").format("YYYY-MM-DD"):o(n).format("YYYY-MM-DD"),endTime:a}},d=function(){var e=c(regeneratorRuntime.mark((function e(r,a){var c,i,d,l,y,b,h,w,D,N,T,Y,O,P,x,I;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=r.goodType,i={},e.t0=c,e.next="LIVE"===e.t0||"GROUP"===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?53:"ALBUM"===e.t0?64:"ACTI_REGIST"===e.t0?75:86;break;case 5:return e.prev=5,e.next=8,m(r.bizId);case 8:d=e.sent,l=[],(d.planList||[]).forEach((function(e){var r=e.startTime||new Date,t=e.endTime||new Date;l.push({courseTime:"".concat(o(r).format("YYYY-MM-DD")," ").concat(o(r).format("HH:mm"),"~").concat(o(t).format("HH:mm")),coursePlan:e.plan,id:e.courseId})})),i={orderType:r.goodType,goodName:r.goodName,courseGroupId:d.courseGroupId,courseGroupName:d.courseGroupName,coursePrice:d.coursePrice,price:d.coursePrice,teacherName:d.userName||"游客".concat(d.teacherId||""),teacherId:d.teacherId,avatar:d.avatar,courseInfo:l},e.next=18;break;case 15:throw e.prev=15,e.t1=e.catch(5),new Error(e.t1.message);case 18:return e.abrupt("break",86);case 19:return y=JSON.parse(r.bizContent),i=n(n({},y),{},{teacherName:r.username,starGrade:r.starGrade,avatar:r.avatar}),e.abrupt("break",86);case 22:return e.prev=22,e.next=25,p(r.bizId);case 25:b=e.sent,h=b.lessonGroup,w=b.detailList,i={orderType:r.goodType,goodName:r.goodName,courseGroupId:h.id,courseGroupName:h.lessonName,coursePrice:h.lessonPrice,price:h.lessonPrice,teacherName:h.username,teacherId:h.teacherId,avatar:h.avatar,courseInfo:w},e.next=33;break;case 30:throw e.prev=30,e.t2=e.catch(22),new Error(e.t2.message);case 33:return e.abrupt("break",86);case 34:e.prev=34,D=(null==a?void 0:a.expectPrice)||r.actualPrice,D=null!=a&&a.couponAmount?Number((((null==a?void 0:a.expectPrice)-(a.couponAmount-a.discountPrice))/r.goodNum).toFixed(2)):Number(D/r.goodNum).toFixed(2),N=new Date,"SVIP"===r.goodType?N=o(t.user.data.userVip.svipEndDate||new Date).toDate():"VIP"===r.goodType&&(N=o(t.user.data.userVip.vipEndDate||t.user.data.userVip.svipEndDate||new Date).toDate()),T=new Date,"MONTH"===r.period?T=o(N).add(1*r.goodNum,"month").toDate():"QUARTERLY"===r.period?T=o(N).add(3*r.goodNum,"month").toDate():"YEAR_HALF"===r.period?T=o(N).add(6*r.goodNum,"month").toDate():"YEAR"===r.period&&(T=o(N).add(1*r.goodNum,"year").toDate()),(i={orderType:r.goodType,goodName:r.goodName,num:r.goodNum,id:r.id,title:r.goodName||"",vipEndDays:r.vipEndDays,price:D,period:r.period,startTime:o(N).format("YYYY-MM-DD"),endTime:o(T).format("YYYY-MM-DD"),activityList:[],discountCardFlag:t.user.data.discountCardFlag,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,a=e.giftFlag,o=e.bizId,c=e.period;return{goodType:r,goodName:t,goodNum:n,bizContent:o,giftFlag:a,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 48:return e.abrupt("break",86);case 49:return Y=t.user.data||{},O=Y.discountCardFlag?o(Y.discountEndTime||new Date).toDate():new Date,i=n({orderType:r.goodType,goodName:r.goodName,num:r.goodNum,id:r.id,title:r.goodName||"",price:r.expectPrice},s(O,r.period,Y.discountCardFlag)),e.abrupt("break",86);case 53:return e.prev=53,e.next=56,f(r.bizId);case 56:P=e.sent,i=n({orderType:r.goodType,goodName:r.goodName},P),e.next=63;break;case 60:throw e.prev=60,e.t4=e.catch(53),new Error(e.t4.message);case 63:return e.abrupt("break",86);case 64:return e.prev=64,e.next=67,v(r.bizId);case 67:x=e.sent,i=n({orderType:r.goodType,goodName:r.goodName},x),e.next=74;break;case 71:throw e.prev=71,e.t5=e.catch(64),new Error(e.t5.message);case 74:return e.abrupt("break",86);case 75:return e.prev=75,e.next=78,g(r.bizId);case 78:I=e.sent,i={orderType:r.goodType,goodsName:I.activityName,activityId:I.id,actualPrice:I.registrationPrice},e.next=85;break;case 82:throw e.prev=82,e.t6=e.catch(75),new Error(e.t6.message);case 85:return e.abrupt("break",86);case 86:i.orderType=c,i.goodName=r.goodName,u.orderObject.orderList.push(i);case 89:case"end":return e.stop()}}),e,null,[[5,15],[22,30],[34,45],[53,60],[64,71],[75,82]])})));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,a.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,a.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,a.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,a.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,a.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 a,o,c,i,s,p,m,f,g,v,y,b,h,w,D,N,T;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=r.orderNo,o=r.actualPrice,c=r.orderDesc,i=r.orderName,s=r.orderType,p=r.orderDetailList,m=r.couponAmount,f=r.cardDiscountPrice,g=r.discountPrice,v=r.paymentConfig,y=r.paymentVendor,b=r.paymentVersion,h=r.activityType,w=r.expectPrice,u.orderObject.orderType=s,u.orderObject.orderName=i,u.orderObject.orderDesc=c,u.orderObject.actualPrice=o,u.orderObject.orderNo=a,u.orderObject.discountCardPrice=f,u.orderObject.discountPrice=g,u.orderObject.couponAmount=m,u.orderObject.paymentConfig=n(n({},v),{},{paymentVendor:y,paymentVersion:b}),u.orderObject.orderList=[],e.prev=11,D=[],N=[],p.map((function(e){e.giftFlag?N.push(e):D.push(e)})),D[0]&&(D[0].activityList=N),T=0;case 17:if(!(T<D.length)){e.next=24;break}return e.next=20,d(D[T],{couponAmount:m,discountPrice:g,expectPrice:w,activityType:h});case 20:l();case 21:T++,e.next=17;break;case 24:t&&t(),e.next=29;break;case 27:e.prev=27,e.t0=e.catch(11);case 29:case"end":return e.stop()}}),e,null,[[11,27]])})));return function(r,t){return e.apply(this,arguments)}}())}}}))}();