orderStatus-legacy.6131dfb6.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. ;(function () {
  2. function _toConsumableArray(arr) {
  3. return (
  4. _arrayWithoutHoles(arr) ||
  5. _iterableToArray(arr) ||
  6. _unsupportedIterableToArray(arr) ||
  7. _nonIterableSpread()
  8. )
  9. }
  10. function _nonIterableSpread() {
  11. throw new TypeError(
  12. 'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
  13. )
  14. }
  15. function _unsupportedIterableToArray(o, minLen) {
  16. if (!o) return
  17. if (typeof o === 'string') return _arrayLikeToArray(o, minLen)
  18. var n = Object.prototype.toString.call(o).slice(8, -1)
  19. if (n === 'Object' && o.constructor) n = o.constructor.name
  20. if (n === 'Map' || n === 'Set') return Array.from(o)
  21. if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  22. return _arrayLikeToArray(o, minLen)
  23. }
  24. function _iterableToArray(iter) {
  25. if (
  26. (typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null) ||
  27. iter['@@iterator'] != null
  28. )
  29. return Array.from(iter)
  30. }
  31. function _arrayWithoutHoles(arr) {
  32. if (Array.isArray(arr)) return _arrayLikeToArray(arr)
  33. }
  34. function _arrayLikeToArray(arr, len) {
  35. if (len == null || len > arr.length) len = arr.length
  36. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  37. arr2[i] = arr[i]
  38. }
  39. return arr2
  40. }
  41. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  42. try {
  43. var info = gen[key](arg)
  44. var value = info.value
  45. } catch (error) {
  46. reject(error)
  47. return
  48. }
  49. if (info.done) {
  50. resolve(value)
  51. } else {
  52. Promise.resolve(value).then(_next, _throw)
  53. }
  54. }
  55. function _asyncToGenerator(fn) {
  56. return function () {
  57. var self = this,
  58. args = arguments
  59. return new Promise(function (resolve, reject) {
  60. var gen = fn.apply(self, args)
  61. function _next(value) {
  62. asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value)
  63. }
  64. function _throw(err) {
  65. asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err)
  66. }
  67. _next(undefined)
  68. })
  69. }
  70. }
  71. System.register(
  72. ['./index-legacy.595c24c3.js', './vendor-legacy.09f20d09.js'],
  73. function (exports) {
  74. 'use strict'
  75. var state, request, reactive, Dialog
  76. return {
  77. setters: [
  78. function (module) {
  79. state = module.s
  80. request = module.r
  81. },
  82. function (module) {
  83. reactive = module.h
  84. Dialog = module.D
  85. }
  86. ],
  87. execute: function execute() {
  88. var original = function original() {
  89. return {
  90. orderType: '',
  91. orderInfo: { orderNo: '', actualPrice: 0, payStatus: true },
  92. orderObject: {
  93. orderNo: '',
  94. actualPrice: 0,
  95. orderName: '',
  96. orderDesc: '',
  97. orderType: '',
  98. recomUserId: null,
  99. orderList: [],
  100. activityId: '',
  101. couponId: '',
  102. discountPrice: 0
  103. }
  104. }
  105. }
  106. var orderStatus = exports('o', reactive(original()))
  107. var resestState = exports('r', function () {
  108. Object.assign(orderStatus, original())
  109. })
  110. var orderInfos = exports('b', function () {
  111. var orderList = orderStatus.orderObject.orderList || []
  112. return orderList.map(function (item) {
  113. var params = {
  114. goodType: item.orderType,
  115. goodName: item.goodsName,
  116. recomUserId: item.recomUserId,
  117. bizContent: {}
  118. }
  119. if (item.orderType === 'VIDEO') {
  120. params.bizContent = {
  121. videoLessonGroupId: item.courseGroupId,
  122. payMoney: item.coursePrice || 0
  123. }
  124. } else if (item.orderType === 'LIVE') {
  125. params.bizContent = { groupId: item.courseGroupId }
  126. } else if (item.orderType === 'PRACTICE') {
  127. var tempTime = item.classTime || []
  128. var classCourse = []
  129. tempTime.forEach(function (time) {
  130. classCourse.push({
  131. classDate: time.classDate,
  132. startTime: time.startTime,
  133. endTime: time.endTime
  134. })
  135. })
  136. params.bizContent = {
  137. courseGroupName: item.courseGroupName,
  138. courseIntroduce: item.courseIntroduce,
  139. subjectId: item.subjectId,
  140. singleCourseMinutes: item.singleCourseMinutes,
  141. courseNum: item.courseNum,
  142. coursePrice: item.coursePrice,
  143. teacherId: item.teacherId,
  144. classTime: classCourse
  145. }
  146. } else if (item.orderType === 'VIP') {
  147. params.bizContent = item.id
  148. } else if (item.orderType === 'MUSIC') {
  149. params.bizContent = {
  150. musicSheetId: item.id,
  151. actualPrice: item.actualPrice || 0,
  152. clientType: state.platformType
  153. }
  154. } else if (item.orderType === 'PINAO_ROOM') {
  155. params.bizContent = item.id
  156. } else if (item.orderType === 'ACTI_REGIST') {
  157. params.bizContent = { activityId: item.activityId }
  158. }
  159. return params
  160. })
  161. })
  162. var onSubmitZero = exports(
  163. 'a',
  164. /*#__PURE__*/ (function () {
  165. var _ref = _asyncToGenerator(
  166. /*#__PURE__*/ regeneratorRuntime.mark(function _callee(
  167. callBack
  168. ) {
  169. var orderObject, url, res, result
  170. return regeneratorRuntime.wrap(
  171. function _callee$(_context) {
  172. while (1) {
  173. switch ((_context.prev = _context.next)) {
  174. case 0:
  175. _context.prev = 0
  176. orderObject = orderStatus.orderObject
  177. url =
  178. state.platformType === 'TEACHER'
  179. ? '/api-teacher/userOrder/executeOrder'
  180. : '/api-student/userOrder/executeOrder'
  181. _context.next = 5
  182. return request.post(url, {
  183. data: {
  184. orderName: orderObject.orderName,
  185. orderDesc: orderObject.orderDesc,
  186. orderType: orderObject.orderType,
  187. actualPrice: orderObject.actualPrice || 0,
  188. recomUserId: orderObject.recomUserId,
  189. activityId: orderObject.activityId,
  190. orderInfos: _toConsumableArray(orderInfos())
  191. }
  192. })
  193. case 5:
  194. res = _context.sent
  195. result = res.data || {}
  196. if (result.status == 'PAID') {
  197. if (callBack) {
  198. callBack()
  199. } else {
  200. Dialog.alert({
  201. message: '\u9886\u53D6\u6210\u529F',
  202. confirmButtonText: '\u786E\u5B9A',
  203. confirmButtonColor: '#01C1B5'
  204. })
  205. }
  206. } else {
  207. Dialog.alert({
  208. message: result.msg,
  209. confirmButtonText: '\u786E\u5B9A',
  210. confirmButtonColor: '#01C1B5'
  211. })
  212. }
  213. _context.next = 13
  214. break
  215. case 10:
  216. _context.prev = 10
  217. _context.t0 = _context['catch'](0)
  218. Dialog.alert({
  219. title: '\u63D0\u793A',
  220. message:
  221. '\u652F\u4ED8\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\uFF01',
  222. confirmButtonText: '\u786E\u5B9A',
  223. confirmButtonColor: '#01C1B5'
  224. })
  225. case 13:
  226. case 'end':
  227. return _context.stop()
  228. }
  229. }
  230. },
  231. _callee,
  232. null,
  233. [[0, 10]]
  234. )
  235. })
  236. )
  237. return function (_x) {
  238. return _ref.apply(this, arguments)
  239. }
  240. })()
  241. )
  242. }
  243. }
  244. }
  245. )
  246. })()