123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719 |
- ;(function () {
- function _toConsumableArray(arr) {
- return (
- _arrayWithoutHoles(arr) ||
- _iterableToArray(arr) ||
- _unsupportedIterableToArray(arr) ||
- _nonIterableSpread()
- )
- }
- function _nonIterableSpread() {
- 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 _unsupportedIterableToArray(o, minLen) {
- if (!o) return
- if (typeof o === 'string') return _arrayLikeToArray(o, minLen)
- var n = Object.prototype.toString.call(o).slice(8, -1)
- if (n === 'Object' && o.constructor) n = o.constructor.name
- if (n === 'Map' || n === 'Set') return Array.from(o)
- if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
- return _arrayLikeToArray(o, minLen)
- }
- function _iterableToArray(iter) {
- if (
- (typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null) ||
- iter['@@iterator'] != null
- )
- return Array.from(iter)
- }
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) return _arrayLikeToArray(arr)
- }
- function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i]
- }
- return arr2
- }
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
- try {
- var info = gen[key](arg)
- var value = info.value
- } catch (error) {
- reject(error)
- return
- }
- if (info.done) {
- resolve(value)
- } else {
- Promise.resolve(value).then(_next, _throw)
- }
- }
- function _asyncToGenerator(fn) {
- return function () {
- var self = this,
- args = arguments
- return new Promise(function (resolve, reject) {
- var gen = fn.apply(self, args)
- function _next(value) {
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value)
- }
- function _throw(err) {
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err)
- }
- _next(undefined)
- })
- }
- }
- var __vite_style__ = document.createElement('style')
- __vite_style__.innerHTML =
- '._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'
- document.head.appendChild(__vite_style__)
- System.register(
- [
- './vendor-legacy.09f20d09.js',
- './index-legacy.f25f109a13.js',
- './index-legacy.f25f109a14.js',
- './index-legacy.f25f109a2.js',
- './index-legacy.637f35565.js',
- './index-legacy.f25f109a3.js',
- './checkbox_default-legacy.88950e5d.js',
- './index-legacy.595c24c3.js'
- ],
- function (exports) {
- 'use strict'
- var defineComponent,
- Toast,
- createVNode,
- CheckboxGroup,
- createTextVNode,
- Fragment,
- Image,
- Loading,
- Checkbox,
- Icon,
- RadioGroup,
- Radio,
- Sticky,
- Button,
- checkBoxActive,
- checkBoxDefault,
- ColResult
- return {
- setters: [
- function (module) {
- defineComponent = module.d
- Toast = module.T
- createVNode = module.a
- CheckboxGroup = module.a4
- createTextVNode = module.j
- Fragment = module.F
- Image = module.I
- Loading = module.L
- Checkbox = module.a5
- Icon = module.K
- RadioGroup = module.ac
- Radio = module.ad
- Sticky = module.S
- Button = module.B
- },
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function (module) {
- checkBoxActive = module.c
- checkBoxDefault = module.a
- },
- function (module) {
- ColResult = module.C
- }
- ],
- execute: function execute() {
- var subjects = '_subjects_1t5fp_1'
- var subjectContainer = '_subjectContainer_1t5fp_6'
- var subjectMaxLength = '_subjectMaxLength_1t5fp_9'
- var title = '_title_1t5fp_19'
- var topBg = '_topBg_1t5fp_53'
- var checkbox = '_checkbox_1t5fp_61'
- var name = '_name_1t5fp_66'
- var styles = {
- subjects: subjects,
- subjectContainer: subjectContainer,
- subjectMaxLength: subjectMaxLength,
- title: title,
- 'subject-list': '_subject-list_1t5fp_37',
- 'subject-item': '_subject-item_1t5fp_43',
- topBg: topBg,
- checkbox: checkbox,
- name: name
- }
- var SubjectModel = exports(
- 'S',
- defineComponent({
- name: 'SubjectList',
- props: {
- onChoice: {
- type: Function,
- default: function _default(item) {}
- },
- choiceSubjectIds: { type: Array, default: [] },
- subjectList: { type: Array, default: [] },
- max: {
- // 最多可选数量
- type: Number,
- default: 5
- },
- selectType: {
- // 选择类型,Radio:单选,Checkbox:多选
- type: String,
- default: 'Checkbox'
- },
- single: {
- // 单选模式
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- checkBox: [],
- checkboxRefs: [],
- radio: null // 单选
- }
- },
- mounted: function mounted() {
- var _this = this
- return _asyncToGenerator(
- /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
- return regeneratorRuntime.wrap(function _callee$(_context) {
- while (1) {
- switch ((_context.prev = _context.next)) {
- case 0:
- if (_this.selectType === 'Radio') {
- _this.radio = _this.choiceSubjectIds[0]
- } else {
- _this.checkBox = _this.choiceSubjectIds
- }
- case 1:
- case 'end':
- return _context.stop()
- }
- }
- }, _callee)
- })
- )()
- },
- watch: {
- choiceSubjectIds: function choiceSubjectIds(val, oldVal) {
- // 同步更新显示数据
- this.checkBox = _toConsumableArray(val)
- }
- },
- methods: {
- onSelect: function onSelect(id) {
- if (this.selectType === 'Checkbox') {
- if (
- this.max === this.checkBox.length &&
- !this.checkBox.includes(id)
- ) {
- Toast(
- '\u4E50\u5668\u6700\u591A\u9009\u62E9'.concat(
- this.max,
- '\u4E2A'
- )
- )
- }
- this.checkboxRefs[id].toggle()
- } else if (this.selectType === 'Radio') {
- this.radio = id
- }
- }
- },
- render: function render() {
- var _this2 = this
- return createVNode('div', { class: styles.subjects }, [
- createVNode('div', { class: styles.subjectContainer }, [
- this.subjectList.length
- ? this.selectType === 'Checkbox'
- ? createVNode(
- CheckboxGroup,
- {
- modelValue: this.checkBox,
- 'onUpdate:modelValue':
- function onUpdateModelValue($event) {
- return (_this2.checkBox = $event)
- },
- max: this.max
- },
- {
- default: function _default() {
- return [
- createVNode(
- 'div',
- { class: styles.subjectMaxLength },
- [
- createTextVNode(
- '\u6700\u591A\u53EF\u9009\u62E9'
- ),
- _this2.max,
- createTextVNode('\u4E2A\u4E50\u5668')
- ]
- ),
- !_this2.single &&
- _this2.subjectList.map(function (item) {
- return item.subjects &&
- item.subjects.length > 0
- ? createVNode(Fragment, null, [
- createVNode(
- 'div',
- { class: styles.title },
- [item.name]
- ),
- createVNode(
- 'div',
- { class: styles['subject-list'] },
- [
- item.subjects &&
- item.subjects.map(function (
- sub
- ) {
- return createVNode(
- 'div',
- {
- class:
- styles[
- 'subject-item'
- ],
- onClick:
- function onClick() {
- return _this2.onSelect(
- sub.id
- )
- }
- },
- [
- createVNode(
- Image,
- {
- src:
- sub.img || 'xxx',
- width: '100%',
- height: '100%',
- fit: 'cover'
- },
- {
- loading:
- function loading() {
- return createVNode(
- Loading,
- {
- type: 'spinner',
- size: 20
- },
- null
- )
- }
- }
- ),
- createVNode(
- 'div',
- {
- class: styles.topBg
- },
- [
- createVNode(
- Checkbox,
- {
- name: sub.id,
- class:
- styles.checkbox,
- disabled: true,
- ref: function ref(
- el
- ) {
- return (_this2.checkboxRefs[
- sub.id
- ] = el)
- }
- },
- {
- icon: function icon(
- props
- ) {
- return createVNode(
- Icon,
- {
- name: props.checked
- ? checkBoxActive
- : checkBoxDefault,
- size: '20'
- },
- null
- )
- }
- }
- ),
- createVNode(
- 'p',
- {
- class:
- styles.name
- },
- [sub.name]
- )
- ]
- )
- ]
- )
- })
- ]
- )
- ])
- : null
- }),
- _this2.single
- ? createVNode(
- 'div',
- { class: styles['subject-list'] },
- [
- _this2.subjectList.map(function (
- item
- ) {
- return createVNode(
- 'div',
- {
- class: styles['subject-item'],
- onClick: function onClick() {
- return _this2.onSelect(
- item.id
- )
- }
- },
- [
- createVNode(
- Image,
- {
- src: item.img || 'xxx',
- width: '100%',
- height: '100%',
- fit: 'cover'
- },
- {
- loading:
- function loading() {
- return createVNode(
- Loading,
- {
- type: 'spinner',
- size: 20
- },
- null
- )
- }
- }
- ),
- createVNode(
- 'div',
- { class: styles.topBg },
- [
- createVNode(
- Checkbox,
- {
- name: item.id,
- class: styles.checkbox,
- disabled: true,
- ref: function ref(el) {
- return (_this2.checkboxRefs[
- item.id
- ] = el)
- }
- },
- {
- icon: function icon(
- props
- ) {
- return createVNode(
- Icon,
- {
- name: props.checked
- ? checkBoxActive
- : checkBoxDefault,
- size: '20'
- },
- null
- )
- }
- }
- ),
- createVNode(
- 'p',
- { class: styles.name },
- [item.name]
- )
- ]
- )
- ]
- )
- })
- ]
- )
- : null
- ]
- }
- }
- )
- : createVNode(
- RadioGroup,
- {
- modelValue: this.radio,
- 'onUpdate:modelValue':
- function onUpdateModelValue($event) {
- return (_this2.radio = $event)
- }
- },
- {
- default: function _default() {
- return [
- !_this2.single &&
- _this2.subjectList.map(function (item) {
- return item.subjects &&
- item.subjects.length > 0
- ? createVNode(Fragment, null, [
- createVNode(
- 'div',
- { class: styles.title },
- [item.name]
- ),
- createVNode(
- 'div',
- { class: styles['subject-list'] },
- [
- item.subjects &&
- item.subjects.map(function (
- sub
- ) {
- return createVNode(
- 'div',
- {
- class:
- styles[
- 'subject-item'
- ],
- onClick:
- function onClick() {
- return _this2.onSelect(
- sub.id
- )
- }
- },
- [
- createVNode(
- Image,
- {
- src:
- sub.img || 'xxx',
- width: '100%',
- height: '100%',
- fit: 'cover'
- },
- {
- loading:
- function loading() {
- return createVNode(
- Loading,
- {
- type: 'spinner',
- size: 20
- },
- null
- )
- }
- }
- ),
- createVNode(
- 'div',
- {
- class: styles.topBg
- },
- [
- createVNode(
- Radio,
- {
- name: sub.id,
- class:
- styles.checkbox
- },
- {
- icon: function icon(
- props
- ) {
- return createVNode(
- Icon,
- {
- name: props.checked
- ? checkBoxActive
- : checkBoxDefault,
- size: '20'
- },
- null
- )
- }
- }
- ),
- createVNode(
- 'p',
- {
- class:
- styles.name
- },
- [sub.name]
- )
- ]
- )
- ]
- )
- })
- ]
- )
- ])
- : null
- }),
- _this2.single
- ? createVNode(
- 'div',
- { class: styles['subject-list'] },
- [
- _this2.subjectList.map(function (
- item
- ) {
- return createVNode(
- 'div',
- {
- class: styles['subject-item'],
- onClick: function onClick() {
- return _this2.onSelect(
- item.id
- )
- }
- },
- [
- createVNode(
- Image,
- {
- src: item.img || 'xxx',
- width: '100%',
- height: '100%',
- fit: 'cover'
- },
- {
- loading:
- function loading() {
- return createVNode(
- Loading,
- {
- type: 'spinner',
- size: 20
- },
- null
- )
- }
- }
- ),
- createVNode(
- 'div',
- { class: styles.topBg },
- [
- createVNode(
- Radio,
- {
- name: item.id,
- class: styles.checkbox
- },
- {
- icon: function icon(
- props
- ) {
- return createVNode(
- Icon,
- {
- name: props.checked
- ? checkBoxActive
- : checkBoxDefault,
- size: '20'
- },
- null
- )
- }
- }
- ),
- createVNode(
- 'p',
- { class: styles.name },
- [item.name]
- )
- ]
- )
- ]
- )
- })
- ]
- )
- : null
- ]
- }
- }
- )
- : createVNode(
- ColResult,
- { tips: '暂无声部数据', btnStatus: false },
- null
- )
- ]),
- this.subjectList.length > 0 &&
- createVNode(
- Sticky,
- { offsetBottom: 0, position: 'bottom' },
- {
- default: function _default() {
- return [
- createVNode('div', { class: 'btnGroup' }, [
- createVNode(
- Button,
- {
- round: true,
- block: true,
- type: 'primary',
- style: { width: '96%', margin: '0 auto' },
- onClick: function onClick() {
- return _this2.onChoice(
- _this2.selectType === 'Checkbox'
- ? _this2.checkBox
- : _this2.radio
- )
- }
- },
- {
- default: function _default() {
- return [createTextVNode('\u786E\u5B9A')]
- }
- }
- )
- ])
- ]
- }
- }
- )
- ])
- }
- })
- )
- }
- }
- }
- )
- })()
|