index-legacy.018765a3.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. !(function () {
  2. function t(t) {
  3. return (
  4. (function (t) {
  5. if (Array.isArray(t)) return e(t)
  6. })(t) ||
  7. (function (t) {
  8. if (
  9. ('undefined' != typeof Symbol && null != t[Symbol.iterator]) ||
  10. null != t['@@iterator']
  11. )
  12. return Array.from(t)
  13. })(t) ||
  14. (function (t, n) {
  15. if (!t) return
  16. if ('string' == typeof t) return e(t, n)
  17. var o = Object.prototype.toString.call(t).slice(8, -1)
  18. 'Object' === o && t.constructor && (o = t.constructor.name)
  19. if ('Map' === o || 'Set' === o) return Array.from(t)
  20. if (
  21. 'Arguments' === o ||
  22. /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)
  23. )
  24. return e(t, n)
  25. })(t) ||
  26. (function () {
  27. throw new TypeError(
  28. 'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
  29. )
  30. })()
  31. )
  32. }
  33. function e(t, e) {
  34. ;(null == e || e > t.length) && (e = t.length)
  35. for (var n = 0, o = new Array(e); n < e; n++) o[n] = t[n]
  36. return o
  37. }
  38. function n(t, e, n, o, r, u, i) {
  39. try {
  40. var c = t[u](i),
  41. s = c.value
  42. } catch (a) {
  43. return void n(a)
  44. }
  45. c.done ? e(s) : Promise.resolve(s).then(o, r)
  46. }
  47. function o(t) {
  48. return function () {
  49. var e = this,
  50. o = arguments
  51. return new Promise(function (r, u) {
  52. var i = t.apply(e, o)
  53. function c(t) {
  54. n(i, r, u, c, s, 'next', t)
  55. }
  56. function s(t) {
  57. n(i, r, u, c, s, 'throw', t)
  58. }
  59. c(void 0)
  60. })
  61. }
  62. }
  63. var r = document.createElement('style')
  64. ;(r.innerHTML =
  65. '._useCoupon_dzp2v_1{padding-top:.42667rem;padding-bottom:.42667rem}._useCoupon_dzp2v_1 ._couponCount_dzp2v_5{color:#ff3535;font-size:.42667rem;font-weight:600}._useCoupon_dzp2v_1 ._couponCount_dzp2v_5 i{font-style:normal;font-size:.37333rem}._choiceCoupon_dzp2v_14{display:flex;flex-direction:column;overflow:hidden;height:100%}._couponTitle_dzp2v_20{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:0 .45333rem;height:1.6rem;line-height:1.6rem;font-size:.48rem;font-weight:600;color:#1a1a1a}._couponTitle_dzp2v_20 ._iconClose_dzp2v_32{display:inline-block;width:.64rem;height:.64rem;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAAXNSR0IArs4c6QAAAG9QTFRFAAAAzMzM8fHx8/Pz6+vr8fHx6urq7Ozs6urq6+vr7Ozs6+vr6+vr6+vr6+vr7Ozs6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr7OzsZmZma2trbGxsgYGBj4+PysrKy8vLzMzMz8/P39/f6+vrszxq/gAAABp0Uk5TAAUSFhkkJVBXZmt1jY+2yM7b6/Hz9Pj8/v60zef/AAABRUlEQVRIx61W2baCMAyMIIvsm6ChgGD+/xvvA4gta+O580TITE+bpEkBljDdMEqzsszSKHRNOIHhxQ+S8Ig944B+De60wj247tAvfkGbKPzLFt9KaBeJteY7OR0gd5b8W0WHqG4L/pNO8FQUTkWnqKRd2TlpILfneCakheQTXZ804U/5LXQFxZjzgLQRAAAYcv28W9EMX3NoRPuW68oAAE9eokXEuvtYXY2Irez3ACCWfwhERPEajddoyf4YwFTqv8GvYuRjo9wPE1zlVEM9KyZ+PSgEF0I1Dt1IE30/fXSqP4RoEblpYSFQPs6MCFLaVmzzKYWM9hVrPmVQrvM5bR9Fv/aVfAF7S+xDs8PKThy7NNjFxy5v/gViX1F2E+C3GXYj47dK3WZs/d7u+QOFP7L4QxHAPhq79n8Mdv7T4YfHic7z5w+yIe8epvSUygAAAABJRU5ErkJggg==) no-repeat center;background-size:contain}._couponContent_dzp2v_39{flex:1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:.32rem .37333rem;--coupon-point: #fff}._couponFooter_dzp2v_46{display:flex;align-items:center;justify-content:space-between;line-height:1.49333rem;padding:0 .42667rem}._couponFooter_dzp2v_46 ._couponSelectText_dzp2v_53{font-size:.42667rem;color:#1a1a1a}._couponFooter_dzp2v_46 ._couponSelectText_dzp2v_53 span{padding:0 .24rem;font-weight:600;color:#fc1a19}\n'),
  66. document.head.appendChild(r),
  67. System.register(
  68. [
  69. './index-legacy.50f53a42.js',
  70. './index-legacy.41961cda.js',
  71. './hooks-legacy.4e8e75f0.js',
  72. './item-legacy.f6888387.js'
  73. ],
  74. function (e) {
  75. 'use strict'
  76. var n, r, u, i, c, s, a, p, l, d, f, h, m
  77. return {
  78. setters: [
  79. function (t) {
  80. ;(n = t.d),
  81. (r = t.i),
  82. (u = t.w),
  83. (i = t.F),
  84. (c = t.C),
  85. (s = t.aP),
  86. (a = t.B),
  87. (p = t.e),
  88. (l = t.s),
  89. (d = t.aQ)
  90. },
  91. function (t) {
  92. f = t.C
  93. },
  94. function (t) {
  95. h = t.u
  96. },
  97. function (t) {
  98. m = t.I
  99. }
  100. ],
  101. execute: function () {
  102. var v = '_useCoupon_dzp2v_1',
  103. g = '_couponCount_dzp2v_5',
  104. A = '_choiceCoupon_dzp2v_14',
  105. _ = '_couponTitle_dzp2v_20',
  106. y = '_iconClose_dzp2v_32',
  107. C = '_couponContent_dzp2v_39',
  108. b = '_couponFooter_dzp2v_46',
  109. L = '_couponSelectText_dzp2v_53',
  110. z = n({
  111. name: 'choice-coupon',
  112. props: {
  113. orderAmount: { type: Number, default: 0 },
  114. useCoupon: {
  115. type: Array,
  116. default: function () {
  117. return []
  118. }
  119. },
  120. couponCategory: { type: String, default: 'UNIVERSAL' },
  121. couponList: {
  122. type: Array,
  123. default: function () {
  124. return []
  125. }
  126. }
  127. },
  128. emits: ['close', 'submit'],
  129. data: function () {
  130. return { list: [], dataLoading: !1 }
  131. },
  132. computed: {
  133. useLength: function () {
  134. return (
  135. this.list.filter(function (t) {
  136. return t.checked
  137. }).length || 0
  138. )
  139. }
  140. },
  141. mounted: function () {
  142. var e = this
  143. return o(
  144. regeneratorRuntime.mark(function n() {
  145. var o, r
  146. return regeneratorRuntime.wrap(function (n) {
  147. for (;;)
  148. switch ((n.prev = n.next)) {
  149. case 0:
  150. e.couponList.forEach(function (t) {
  151. e.useCoupon.forEach(function (e) {
  152. t.couponIssueId === e.couponIssueId &&
  153. (t.checked = !0)
  154. })
  155. }),
  156. (o = e.couponList.filter(function (t) {
  157. return !t.disabled
  158. })),
  159. (r = e.couponList.filter(function (t) {
  160. return t.disabled
  161. })),
  162. (e.list = [].concat(t(o), t(r))),
  163. e.calcCoupon(),
  164. h('优惠券')
  165. case 6:
  166. case 'end':
  167. return n.stop()
  168. }
  169. }, n)
  170. })
  171. )()
  172. },
  173. methods: {
  174. onSubmit: function () {
  175. this.$emit(
  176. 'submit',
  177. this.list.filter(function (t) {
  178. return t.checked
  179. })
  180. ),
  181. this.list.forEach(function (t) {
  182. t.checked = !1
  183. })
  184. },
  185. onSelect: function (t) {
  186. ;(t.checked = !t.checked), this.calcCoupon()
  187. },
  188. calcCoupon: function () {
  189. var t = this.list
  190. .filter(function (t) {
  191. return t.checked
  192. })
  193. .map(function (t) {
  194. return Number(t.useLimit || 0)
  195. }),
  196. e =
  197. t.length > 0
  198. ? t.reduce(function (t, e) {
  199. return t + e
  200. })
  201. : 0,
  202. n = this.orderAmount - e
  203. this.list.forEach(function (t) {
  204. Number(t.useLimit) > n && !t.checked
  205. ? (t.disabled = !0)
  206. : (t.disabled = !1)
  207. })
  208. }
  209. },
  210. render: function () {
  211. var t = this
  212. return r('div', { class: A }, [
  213. r('div', { class: _ }, [
  214. r('span', null, [u('优惠券')]),
  215. r(
  216. 'i',
  217. {
  218. class: y,
  219. onClick: function () {
  220. return t.$emit('close')
  221. }
  222. },
  223. null
  224. )
  225. ]),
  226. r('div', { class: C }, [
  227. this.dataLoading
  228. ? r(
  229. s,
  230. {
  231. size: 48,
  232. color: '#2dc7aa',
  233. vertical: !0,
  234. style: {
  235. height: '100%',
  236. justifyContent: 'center'
  237. }
  238. },
  239. {
  240. default: function () {
  241. return [u('加载中...')]
  242. }
  243. }
  244. )
  245. : r(i, null, [
  246. this.list.length > 0
  247. ? r(i, null, [
  248. this.list.map(function (e) {
  249. return r(
  250. m,
  251. {
  252. item: e,
  253. isSelect: !0,
  254. onClick: t.onSelect
  255. },
  256. null
  257. )
  258. })
  259. ])
  260. : r(
  261. c,
  262. {
  263. btnStatus: !1,
  264. tips: '暂无优惠券',
  265. classImgSize: 'SMALL'
  266. },
  267. null
  268. )
  269. ])
  270. ]),
  271. r('div', { class: [b, 'van-hairline--top'] }, [
  272. r('div', { class: L }, [
  273. u('已选'),
  274. r('span', null, [this.useLength]),
  275. u('张')
  276. ]),
  277. r(
  278. a,
  279. {
  280. type: 'primary',
  281. round: !0,
  282. style: { minWidth: '105px', fontSize: '16px' },
  283. onClick: this.onSubmit
  284. },
  285. {
  286. default: function () {
  287. return [u('确定')]
  288. }
  289. }
  290. )
  291. ])
  292. ])
  293. }
  294. }),
  295. S = {
  296. UNIVERSAL: 'UNIVERSAL',
  297. VIP: 'VIP',
  298. PIANO_ROOM: 'PIANO',
  299. GOODS: 'MALL',
  300. MUSIC: 'MUSIC',
  301. PRACTICE: 'SPARRING',
  302. LIVE: 'LIVE',
  303. VIDEO: 'VIDEO',
  304. ALBUM: 'ALBUM'
  305. }
  306. e(
  307. 'U',
  308. n({
  309. name: 'use-conpon',
  310. props: {
  311. disabled: { type: Boolean, default: !1 },
  312. orderAmount: { type: Number, default: 0 },
  313. orderType: { type: String, default: '' },
  314. discountPrice: { type: Number, default: 0 }
  315. },
  316. emits: ['couponSelect'],
  317. data: function () {
  318. return {
  319. popupStatus: !1,
  320. popupLoading: !1,
  321. useCouponList: [],
  322. useCouponLoading: !1,
  323. useCouponCount: 0,
  324. dataLoading: !1,
  325. list: []
  326. }
  327. },
  328. computed: {
  329. couponCount: function () {
  330. var t = this.useCouponList.map(function (t) {
  331. return Number(t.discountPrice || 0)
  332. })
  333. return this.disabled
  334. ? this.discountPrice
  335. : t.length > 0
  336. ? t.reduce(function (t, e) {
  337. return t + e
  338. })
  339. : 0
  340. },
  341. couponCategory: function () {
  342. return S[this.orderType] || 'UNIVERSAL'
  343. }
  344. },
  345. mounted: function () {
  346. this.getList()
  347. },
  348. methods: {
  349. getList: function () {
  350. var t = this
  351. return o(
  352. regeneratorRuntime.mark(function e() {
  353. var n, o, r
  354. return regeneratorRuntime.wrap(
  355. function (e) {
  356. for (;;)
  357. switch ((e.prev = e.next)) {
  358. case 0:
  359. if (!t.dataLoading) {
  360. e.next = 2
  361. break
  362. }
  363. return e.abrupt('return')
  364. case 2:
  365. return (
  366. (t.dataLoading = !0),
  367. (e.prev = 3),
  368. (e.next = 6),
  369. p.post(
  370. ''.concat(
  371. l.platformApi,
  372. '/couponInfo/page'
  373. ),
  374. {
  375. data: {
  376. couponCategory: t.couponCategory,
  377. couponType: 'FULL_DISCOUNT',
  378. useState: 'USABLE',
  379. orderUse: 1,
  380. page: 1,
  381. rows: 100
  382. }
  383. }
  384. )
  385. )
  386. case 6:
  387. if (
  388. ((n = e.sent),
  389. (t.dataLoading = !1),
  390. (o = n.data || {}),
  391. !(t.list.length > 0 && 1 === o.pageNo))
  392. ) {
  393. e.next = 11
  394. break
  395. }
  396. return e.abrupt('return')
  397. case 11:
  398. ;(t.list = o.rows || []),
  399. t.list.forEach(function (e) {
  400. ;(e.checked = !1),
  401. e.useLimit > t.orderAmount
  402. ? (e.disabled = !0)
  403. : (e.disabled = !1)
  404. }),
  405. (r = 0),
  406. t.list.forEach(function (t) {
  407. t.disabled || r++
  408. }),
  409. console.log(t.list, 'list'),
  410. (t.useCouponCount = r),
  411. (e.next = 21)
  412. break
  413. case 19:
  414. ;(e.prev = 19), (e.t0 = e.catch(3))
  415. case 21:
  416. case 'end':
  417. return e.stop()
  418. }
  419. },
  420. e,
  421. null,
  422. [[3, 19]]
  423. )
  424. })
  425. )()
  426. },
  427. onSubmit: function (t) {
  428. ;(this.useCouponList = t),
  429. this.$emit('couponSelect', t),
  430. (this.popupStatus = !1),
  431. (this.popupLoading = !1)
  432. }
  433. },
  434. render: function () {
  435. var t = this
  436. return r(i, null, [
  437. r(
  438. f,
  439. {
  440. title: '优惠券',
  441. class: v,
  442. style: { borderRadius: '8px' },
  443. isLink: !this.disabled,
  444. clickable: !1,
  445. onClick: function () {
  446. t.disabled ||
  447. ((t.popupStatus = !0), (t.popupLoading = !0))
  448. }
  449. },
  450. {
  451. value: function () {
  452. return (
  453. !t.useCouponLoading &&
  454. r(i, null, [
  455. t.couponCount > 0
  456. ? r('span', { class: g }, [
  457. r('i', null, [u('-¥')]),
  458. t.couponCount
  459. ])
  460. : r(i, null, [
  461. t.useCouponCount > 0
  462. ? ''.concat(t.useCouponCount, '张可使用')
  463. : '暂无可使用优惠券'
  464. ])
  465. ])
  466. )
  467. }
  468. }
  469. ),
  470. r(
  471. d,
  472. {
  473. show: this.popupStatus,
  474. 'onUpdate:show': function (e) {
  475. return (t.popupStatus = e)
  476. },
  477. position: 'bottom',
  478. round: !0,
  479. safeAreaInsetBottom: !0,
  480. style: { height: '75%' },
  481. onClosed: function () {
  482. t.popupLoading = !1
  483. }
  484. },
  485. {
  486. default: function () {
  487. return [
  488. t.popupLoading &&
  489. r(
  490. z,
  491. {
  492. couponCategory: t.couponCategory,
  493. useCoupon: t.useCouponList,
  494. orderAmount: t.orderAmount,
  495. couponList: t.list,
  496. onClose: function () {
  497. return (t.popupStatus = !1)
  498. },
  499. onSubmit: function (e) {
  500. return t.onSubmit(e)
  501. }
  502. },
  503. null
  504. )
  505. ]
  506. }
  507. }
  508. )
  509. ])
  510. }
  511. })
  512. )
  513. }
  514. }
  515. }
  516. )
  517. })()