index-legacy.9696b334.js 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  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. var __vite_style__ = document.createElement('style')
  72. __vite_style__.innerHTML =
  73. '._subjects_1t5fp_1{padding:.4rem 0 0;background:#f6f8f9;min-height:calc(100vh - 0.4rem)}._subjects_1t5fp_1 ._subjectContainer_1t5fp_6{min-height:calc(100vh - 2.53333rem)}._subjects_1t5fp_1 ._subjectMaxLength_1t5fp_9{margin:0 .37333rem .26667rem;background:linear-gradient(139deg,#fff6ee 0%,#ffecdd 100%) #ffffff;border-radius:.26667rem;padding:.18667rem .29333rem;background:#ffffff;font-size:.37333rem;color:#ff9e5a;line-height:.58667rem}._subjects_1t5fp_1 ._title_1t5fp_19{padding:.32rem 0;margin:0 .4rem;color:#333;font-size:.42667rem;display:flex;align-items:center}._subjects_1t5fp_1 ._title_1t5fp_19:before{content:" ";display:inline-block;width:.08rem;height:.42667rem;background:#01C1B5;border-radius:.08rem;margin-right:.21333rem;vertical-align:text-bottom}._subjects_1t5fp_1 ._subject-list_1t5fp_37{display:flex;align-items:center;flex-wrap:wrap;padding:0 .26667rem}._subjects_1t5fp_1 ._subject-list_1t5fp_37 ._subject-item_1t5fp_43{position:relative;width:2.88rem;height:2.88rem;margin-right:.13333rem;margin-left:.13333rem;margin-bottom:.26667rem;border-radius:.18667rem;overflow:hidden}._subjects_1t5fp_1 ._subject-list_1t5fp_37 ._topBg_1t5fp_53{position:absolute;top:0;left:0;width:100%;height:100%;background:linear-gradient(180deg,rgba(0,0,0,0) 0%,rgba(0,0,0,.54) 100%)}._subjects_1t5fp_1 ._subject-list_1t5fp_37 ._checkbox_1t5fp_61{position:absolute;right:.18667rem;top:.18667rem}._subjects_1t5fp_1 ._subject-list_1t5fp_37 ._name_1t5fp_66{position:absolute;bottom:.18667rem;left:.18667rem;font-size:.42667rem;font-weight:500;color:#fff;line-height:.58667rem}._subjects_1t5fp_1 ._subject-list_1t5fp_37 .van-checkbox__icon,._subjects_1t5fp_1 ._subject-list_1t5fp_37 .van-radio__icon{height:.58667rem}._subjects_1t5fp_1 ._subject-list_1t5fp_37 .van-checkbox__icon .van-icon,._subjects_1t5fp_1 ._subject-list_1t5fp_37 .van-radio__icon .van-icon{border:0;background-color:transparent}._subjects_1t5fp_1 ._subject-list_1t5fp_37 .van-checkbox__icon--checked .van-icon,._subjects_1t5fp_1 ._subject-list_1t5fp_37 .van-radio__icon--checked .van-icon{background-color:transparent;border:transparent}\n'
  74. document.head.appendChild(__vite_style__)
  75. System.register(
  76. [
  77. './vendor-legacy.09f20d09.js',
  78. './index-legacy.f25f109a13.js',
  79. './index-legacy.f25f109a14.js',
  80. './index-legacy.f25f109a2.js',
  81. './index-legacy.637f35565.js',
  82. './index-legacy.f25f109a3.js',
  83. './checkbox_default-legacy.88950e5d.js',
  84. './index-legacy.595c24c3.js'
  85. ],
  86. function (exports) {
  87. 'use strict'
  88. var defineComponent,
  89. Toast,
  90. createVNode,
  91. CheckboxGroup,
  92. createTextVNode,
  93. Fragment,
  94. Image,
  95. Loading,
  96. Checkbox,
  97. Icon,
  98. RadioGroup,
  99. Radio,
  100. Sticky,
  101. Button,
  102. checkBoxActive,
  103. checkBoxDefault,
  104. ColResult
  105. return {
  106. setters: [
  107. function (module) {
  108. defineComponent = module.d
  109. Toast = module.T
  110. createVNode = module.a
  111. CheckboxGroup = module.a4
  112. createTextVNode = module.j
  113. Fragment = module.F
  114. Image = module.I
  115. Loading = module.L
  116. Checkbox = module.a5
  117. Icon = module.K
  118. RadioGroup = module.ac
  119. Radio = module.ad
  120. Sticky = module.S
  121. Button = module.B
  122. },
  123. function () {},
  124. function () {},
  125. function () {},
  126. function () {},
  127. function () {},
  128. function (module) {
  129. checkBoxActive = module.c
  130. checkBoxDefault = module.a
  131. },
  132. function (module) {
  133. ColResult = module.C
  134. }
  135. ],
  136. execute: function execute() {
  137. var subjects = '_subjects_1t5fp_1'
  138. var subjectContainer = '_subjectContainer_1t5fp_6'
  139. var subjectMaxLength = '_subjectMaxLength_1t5fp_9'
  140. var title = '_title_1t5fp_19'
  141. var topBg = '_topBg_1t5fp_53'
  142. var checkbox = '_checkbox_1t5fp_61'
  143. var name = '_name_1t5fp_66'
  144. var styles = {
  145. subjects: subjects,
  146. subjectContainer: subjectContainer,
  147. subjectMaxLength: subjectMaxLength,
  148. title: title,
  149. 'subject-list': '_subject-list_1t5fp_37',
  150. 'subject-item': '_subject-item_1t5fp_43',
  151. topBg: topBg,
  152. checkbox: checkbox,
  153. name: name
  154. }
  155. var SubjectModel = exports(
  156. 'S',
  157. defineComponent({
  158. name: 'SubjectList',
  159. props: {
  160. onChoice: {
  161. type: Function,
  162. default: function _default(item) {}
  163. },
  164. choiceSubjectIds: { type: Array, default: [] },
  165. subjectList: { type: Array, default: [] },
  166. max: {
  167. // 最多可选数量
  168. type: Number,
  169. default: 5
  170. },
  171. selectType: {
  172. // 选择类型,Radio:单选,Checkbox:多选
  173. type: String,
  174. default: 'Checkbox'
  175. },
  176. single: {
  177. // 单选模式
  178. type: Boolean,
  179. default: false
  180. }
  181. },
  182. data: function data() {
  183. return {
  184. checkBox: [],
  185. checkboxRefs: [],
  186. radio: null // 单选
  187. }
  188. },
  189. mounted: function mounted() {
  190. var _this = this
  191. return _asyncToGenerator(
  192. /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
  193. return regeneratorRuntime.wrap(function _callee$(_context) {
  194. while (1) {
  195. switch ((_context.prev = _context.next)) {
  196. case 0:
  197. if (_this.selectType === 'Radio') {
  198. _this.radio = _this.choiceSubjectIds[0]
  199. } else {
  200. _this.checkBox = _this.choiceSubjectIds
  201. }
  202. case 1:
  203. case 'end':
  204. return _context.stop()
  205. }
  206. }
  207. }, _callee)
  208. })
  209. )()
  210. },
  211. watch: {
  212. choiceSubjectIds: function choiceSubjectIds(val, oldVal) {
  213. // 同步更新显示数据
  214. this.checkBox = _toConsumableArray(val)
  215. }
  216. },
  217. methods: {
  218. onSelect: function onSelect(id) {
  219. if (this.selectType === 'Checkbox') {
  220. if (
  221. this.max === this.checkBox.length &&
  222. !this.checkBox.includes(id)
  223. ) {
  224. Toast(
  225. '\u4E50\u5668\u6700\u591A\u9009\u62E9'.concat(
  226. this.max,
  227. '\u4E2A'
  228. )
  229. )
  230. }
  231. this.checkboxRefs[id].toggle()
  232. } else if (this.selectType === 'Radio') {
  233. this.radio = id
  234. }
  235. }
  236. },
  237. render: function render() {
  238. var _this2 = this
  239. return createVNode('div', { class: styles.subjects }, [
  240. createVNode('div', { class: styles.subjectContainer }, [
  241. this.subjectList.length
  242. ? this.selectType === 'Checkbox'
  243. ? createVNode(
  244. CheckboxGroup,
  245. {
  246. modelValue: this.checkBox,
  247. 'onUpdate:modelValue':
  248. function onUpdateModelValue($event) {
  249. return (_this2.checkBox = $event)
  250. },
  251. max: this.max
  252. },
  253. {
  254. default: function _default() {
  255. return [
  256. createVNode(
  257. 'div',
  258. { class: styles.subjectMaxLength },
  259. [
  260. createTextVNode(
  261. '\u6700\u591A\u53EF\u9009\u62E9'
  262. ),
  263. _this2.max,
  264. createTextVNode('\u4E2A\u4E50\u5668')
  265. ]
  266. ),
  267. !_this2.single &&
  268. _this2.subjectList.map(function (item) {
  269. return item.subjects &&
  270. item.subjects.length > 0
  271. ? createVNode(Fragment, null, [
  272. createVNode(
  273. 'div',
  274. { class: styles.title },
  275. [item.name]
  276. ),
  277. createVNode(
  278. 'div',
  279. { class: styles['subject-list'] },
  280. [
  281. item.subjects &&
  282. item.subjects.map(function (
  283. sub
  284. ) {
  285. return createVNode(
  286. 'div',
  287. {
  288. class:
  289. styles[
  290. 'subject-item'
  291. ],
  292. onClick:
  293. function onClick() {
  294. return _this2.onSelect(
  295. sub.id
  296. )
  297. }
  298. },
  299. [
  300. createVNode(
  301. Image,
  302. {
  303. src:
  304. sub.img || 'xxx',
  305. width: '100%',
  306. height: '100%',
  307. fit: 'cover'
  308. },
  309. {
  310. loading:
  311. function loading() {
  312. return createVNode(
  313. Loading,
  314. {
  315. type: 'spinner',
  316. size: 20
  317. },
  318. null
  319. )
  320. }
  321. }
  322. ),
  323. createVNode(
  324. 'div',
  325. {
  326. class: styles.topBg
  327. },
  328. [
  329. createVNode(
  330. Checkbox,
  331. {
  332. name: sub.id,
  333. class:
  334. styles.checkbox,
  335. disabled: true,
  336. ref: function ref(
  337. el
  338. ) {
  339. return (_this2.checkboxRefs[
  340. sub.id
  341. ] = el)
  342. }
  343. },
  344. {
  345. icon: function icon(
  346. props
  347. ) {
  348. return createVNode(
  349. Icon,
  350. {
  351. name: props.checked
  352. ? checkBoxActive
  353. : checkBoxDefault,
  354. size: '20'
  355. },
  356. null
  357. )
  358. }
  359. }
  360. ),
  361. createVNode(
  362. 'p',
  363. {
  364. class:
  365. styles.name
  366. },
  367. [sub.name]
  368. )
  369. ]
  370. )
  371. ]
  372. )
  373. })
  374. ]
  375. )
  376. ])
  377. : null
  378. }),
  379. _this2.single
  380. ? createVNode(
  381. 'div',
  382. { class: styles['subject-list'] },
  383. [
  384. _this2.subjectList.map(function (
  385. item
  386. ) {
  387. return createVNode(
  388. 'div',
  389. {
  390. class: styles['subject-item'],
  391. onClick: function onClick() {
  392. return _this2.onSelect(
  393. item.id
  394. )
  395. }
  396. },
  397. [
  398. createVNode(
  399. Image,
  400. {
  401. src: item.img || 'xxx',
  402. width: '100%',
  403. height: '100%',
  404. fit: 'cover'
  405. },
  406. {
  407. loading:
  408. function loading() {
  409. return createVNode(
  410. Loading,
  411. {
  412. type: 'spinner',
  413. size: 20
  414. },
  415. null
  416. )
  417. }
  418. }
  419. ),
  420. createVNode(
  421. 'div',
  422. { class: styles.topBg },
  423. [
  424. createVNode(
  425. Checkbox,
  426. {
  427. name: item.id,
  428. class: styles.checkbox,
  429. disabled: true,
  430. ref: function ref(el) {
  431. return (_this2.checkboxRefs[
  432. item.id
  433. ] = el)
  434. }
  435. },
  436. {
  437. icon: function icon(
  438. props
  439. ) {
  440. return createVNode(
  441. Icon,
  442. {
  443. name: props.checked
  444. ? checkBoxActive
  445. : checkBoxDefault,
  446. size: '20'
  447. },
  448. null
  449. )
  450. }
  451. }
  452. ),
  453. createVNode(
  454. 'p',
  455. { class: styles.name },
  456. [item.name]
  457. )
  458. ]
  459. )
  460. ]
  461. )
  462. })
  463. ]
  464. )
  465. : null
  466. ]
  467. }
  468. }
  469. )
  470. : createVNode(
  471. RadioGroup,
  472. {
  473. modelValue: this.radio,
  474. 'onUpdate:modelValue':
  475. function onUpdateModelValue($event) {
  476. return (_this2.radio = $event)
  477. }
  478. },
  479. {
  480. default: function _default() {
  481. return [
  482. !_this2.single &&
  483. _this2.subjectList.map(function (item) {
  484. return item.subjects &&
  485. item.subjects.length > 0
  486. ? createVNode(Fragment, null, [
  487. createVNode(
  488. 'div',
  489. { class: styles.title },
  490. [item.name]
  491. ),
  492. createVNode(
  493. 'div',
  494. { class: styles['subject-list'] },
  495. [
  496. item.subjects &&
  497. item.subjects.map(function (
  498. sub
  499. ) {
  500. return createVNode(
  501. 'div',
  502. {
  503. class:
  504. styles[
  505. 'subject-item'
  506. ],
  507. onClick:
  508. function onClick() {
  509. return _this2.onSelect(
  510. sub.id
  511. )
  512. }
  513. },
  514. [
  515. createVNode(
  516. Image,
  517. {
  518. src:
  519. sub.img || 'xxx',
  520. width: '100%',
  521. height: '100%',
  522. fit: 'cover'
  523. },
  524. {
  525. loading:
  526. function loading() {
  527. return createVNode(
  528. Loading,
  529. {
  530. type: 'spinner',
  531. size: 20
  532. },
  533. null
  534. )
  535. }
  536. }
  537. ),
  538. createVNode(
  539. 'div',
  540. {
  541. class: styles.topBg
  542. },
  543. [
  544. createVNode(
  545. Radio,
  546. {
  547. name: sub.id,
  548. class:
  549. styles.checkbox
  550. },
  551. {
  552. icon: function icon(
  553. props
  554. ) {
  555. return createVNode(
  556. Icon,
  557. {
  558. name: props.checked
  559. ? checkBoxActive
  560. : checkBoxDefault,
  561. size: '20'
  562. },
  563. null
  564. )
  565. }
  566. }
  567. ),
  568. createVNode(
  569. 'p',
  570. {
  571. class:
  572. styles.name
  573. },
  574. [sub.name]
  575. )
  576. ]
  577. )
  578. ]
  579. )
  580. })
  581. ]
  582. )
  583. ])
  584. : null
  585. }),
  586. _this2.single
  587. ? createVNode(
  588. 'div',
  589. { class: styles['subject-list'] },
  590. [
  591. _this2.subjectList.map(function (
  592. item
  593. ) {
  594. return createVNode(
  595. 'div',
  596. {
  597. class: styles['subject-item'],
  598. onClick: function onClick() {
  599. return _this2.onSelect(
  600. item.id
  601. )
  602. }
  603. },
  604. [
  605. createVNode(
  606. Image,
  607. {
  608. src: item.img || 'xxx',
  609. width: '100%',
  610. height: '100%',
  611. fit: 'cover'
  612. },
  613. {
  614. loading:
  615. function loading() {
  616. return createVNode(
  617. Loading,
  618. {
  619. type: 'spinner',
  620. size: 20
  621. },
  622. null
  623. )
  624. }
  625. }
  626. ),
  627. createVNode(
  628. 'div',
  629. { class: styles.topBg },
  630. [
  631. createVNode(
  632. Radio,
  633. {
  634. name: item.id,
  635. class: styles.checkbox
  636. },
  637. {
  638. icon: function icon(
  639. props
  640. ) {
  641. return createVNode(
  642. Icon,
  643. {
  644. name: props.checked
  645. ? checkBoxActive
  646. : checkBoxDefault,
  647. size: '20'
  648. },
  649. null
  650. )
  651. }
  652. }
  653. ),
  654. createVNode(
  655. 'p',
  656. { class: styles.name },
  657. [item.name]
  658. )
  659. ]
  660. )
  661. ]
  662. )
  663. })
  664. ]
  665. )
  666. : null
  667. ]
  668. }
  669. }
  670. )
  671. : createVNode(
  672. ColResult,
  673. { tips: '暂无声部数据', btnStatus: false },
  674. null
  675. )
  676. ]),
  677. this.subjectList.length > 0 &&
  678. createVNode(
  679. Sticky,
  680. { offsetBottom: 0, position: 'bottom' },
  681. {
  682. default: function _default() {
  683. return [
  684. createVNode('div', { class: 'btnGroup' }, [
  685. createVNode(
  686. Button,
  687. {
  688. round: true,
  689. block: true,
  690. type: 'primary',
  691. style: { width: '96%', margin: '0 auto' },
  692. onClick: function onClick() {
  693. return _this2.onChoice(
  694. _this2.selectType === 'Checkbox'
  695. ? _this2.checkBox
  696. : _this2.radio
  697. )
  698. }
  699. },
  700. {
  701. default: function _default() {
  702. return [createTextVNode('\u786E\u5B9A')]
  703. }
  704. }
  705. )
  706. ])
  707. ]
  708. }
  709. }
  710. )
  711. ])
  712. }
  713. })
  714. )
  715. }
  716. }
  717. }
  718. )
  719. })()