index-legacy.df807cec.js 7.7 KB

1
  1. !function(){function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return t(e,n)}(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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function n(e,t,n,i,c,r,s){try{var o=e[r](s),d=o.value}catch(u){return void n(u)}o.done?t(d):Promise.resolve(d).then(i,c)}var i=document.createElement("style");i.innerHTML='._subjects_1djd7_1{padding:.4rem 0 0;background:#f6f8f9;min-height:calc(100vh - .4rem)}._subjects_1djd7_1 ._subjectContainer_1djd7_6{min-height:calc(100vh - 2.53333rem)}._subjects_1djd7_1 ._subjectMaxLength_1djd7_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_1djd7_1 ._title_1djd7_19{padding:.32rem 0;margin:0 .4rem;color:#333;font-size:.42667rem;display:flex;align-items:center}._subjects_1djd7_1 ._title_1djd7_19:before{content:" ";display:inline-block;width:.08rem;height:.42667rem;background:#2dc7aa;border-radius:.08rem;margin-right:.21333rem;vertical-align:text-bottom}._subjects_1djd7_1 ._subject-list_1djd7_37{display:flex;align-items:center;flex-wrap:wrap;padding:0 .26667rem}._subjects_1djd7_1 ._subject-list_1djd7_37 ._subject-item_1djd7_43{position:relative;width:2.88rem;height:2.88rem;margin-right:.13333rem;margin-left:.13333rem;margin-bottom:.26667rem;border-radius:.18667rem;overflow:hidden}._subjects_1djd7_1 ._subject-list_1djd7_37 ._topBg_1djd7_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_1djd7_1 ._subject-list_1djd7_37 ._checkbox_1djd7_61{position:absolute;right:.18667rem;top:.18667rem}._subjects_1djd7_1 ._subject-list_1djd7_37 ._name_1djd7_66{position:absolute;bottom:.18667rem;left:.18667rem;font-size:.42667rem;font-weight:500;color:#fff;line-height:.58667rem}._subjects_1djd7_1 ._subject-list_1djd7_37 .van-checkbox__icon,._subjects_1djd7_1 ._subject-list_1djd7_37 .van-radio__icon{height:.58667rem}._subjects_1djd7_1 ._subject-list_1djd7_37 .van-checkbox__icon .van-icon,._subjects_1djd7_1 ._subject-list_1djd7_37 .van-radio__icon .van-icon{border:0;background-color:transparent}._subjects_1djd7_1 ._subject-list_1djd7_37 .van-checkbox__icon--checked .van-icon,._subjects_1djd7_1 ._subject-list_1djd7_37 .van-radio__icon--checked .van-icon{background-color:transparent;border:transparent}._subjectBtnGroup_1djd7_89{padding-bottom:.8rem}\n',document.head.appendChild(i),System.register(["./ResizeObserver.es-legacy.44b91b4c.js","./index-legacy.39123961.js","./index-legacy.23131301.js","./index-legacy.4be048cf.js","./index-legacy.421f1fa7.js","./index-legacy.3ccba950.js","./checkbox_default-legacy.9f48b0e4.js","./index-legacy.b257cee5.js"],(function(t){"use strict";var i,c,r,s,o,d,u,a,l,_,f,b,j,m,h,g,p;return{setters:[function(e){i=e.d,c=e.T,r=e.j,s=e.A,o=e.F,d=e.aT,u=e.N,a=e.C,l=e.B},function(e){_=e.C},function(){},function(e){f=e.I},function(e){b=e.R,j=e.a},function(e){m=e.S},function(e){h=e.c,g=e.a},function(e){p=e.C}],execute:function(){var v="_subjects_1djd7_1",x="_subjectContainer_1djd7_6",y="_subjectMaxLength_1djd7_9",k="_title_1djd7_19",w="_subject-list_1djd7_37",S="_subject-item_1djd7_43",C="_topBg_1djd7_53",B="_checkbox_1djd7_61",z="_name_1djd7_66",L="_subjectBtnGroup_1djd7_89";t("S",i({name:"SubjectList",props:{onChoice:{type:Function,default:function(e){}},choiceSubjectIds:{type:Array,default:[]},subjectList:{type:Array,default:[]},max:{type:Number,default:5},selectType:{type:String,default:"Checkbox"},single:{type:Boolean,default:!1}},data:function(){return{checkBox:[],checkboxRefs:[],radio:null}},mounted:function(){var e,t=this;return(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"Radio"===t.selectType?t.radio=t.choiceSubjectIds[0]:t.checkBox=t.choiceSubjectIds;case 1:case"end":return e.stop()}}),e)})),function(){var t=this,i=arguments;return new Promise((function(c,r){var s=e.apply(t,i);function o(e){n(s,c,r,o,d,"next",e)}function d(e){n(s,c,r,o,d,"throw",e)}o(void 0)}))})()},watch:{choiceSubjectIds:function(t,n){this.checkBox=e(t)}},methods:{onSelect:function(e){"Checkbox"===this.selectType?(this.max!==this.checkBox.length||this.checkBox.includes(e)||c("乐器最多选择".concat(this.max,"个")),this.checkboxRefs[e].toggle()):"Radio"===this.selectType&&(this.radio=e)}},render:function(){var e=this;return r("div",{class:v},[r("div",{class:x},[this.subjectList.length?"Checkbox"===this.selectType?r(p,{modelValue:this.checkBox,"onUpdate:modelValue":function(t){return e.checkBox=t},max:this.max},{default:function(){return[r("div",{class:y},[s("最多可选择"),e.max,s("个乐器")]),!e.single&&e.subjectList.map((function(t){return t.subjects&&t.subjects.length>0?r(o,null,[r("div",{class:k},[t.name]),r("div",{class:w},[t.subjects&&t.subjects.map((function(t){return r("div",{class:S,onClick:function(){return e.onSelect(t.id)}},[r(f,{src:t.img||"xxx",width:"100%",height:"100%",fit:"cover"},{loading:function(){return r(d,{type:"spinner",size:20},null)}}),r("div",{class:C},[r(_,{name:t.id,class:B,disabled:!0,ref:function(n){return e.checkboxRefs[t.id]=n}},{icon:function(e){return r(u,{name:e.checked?h:g,size:"20"},null)}}),r("p",{class:z},[t.name])])])}))])]):null})),e.single?r("div",{class:w},[e.subjectList.map((function(t){return r("div",{class:S,onClick:function(){return e.onSelect(t.id)}},[r(f,{src:t.img||"xxx",width:"100%",height:"100%",fit:"cover"},{loading:function(){return r(d,{type:"spinner",size:20},null)}}),r("div",{class:C},[r(_,{name:t.id,class:B,disabled:!0,ref:function(n){return e.checkboxRefs[t.id]=n}},{icon:function(e){return r(u,{name:e.checked?h:g,size:"20"},null)}}),r("p",{class:z},[t.name])])])}))]):null]}}):r(b,{modelValue:this.radio,"onUpdate:modelValue":function(t){return e.radio=t}},{default:function(){return[!e.single&&e.subjectList.map((function(t){return t.subjects&&t.subjects.length>0?r(o,null,[r("div",{class:k},[t.name]),r("div",{class:w},[t.subjects&&t.subjects.map((function(t){return r("div",{class:S,onClick:function(){return e.onSelect(t.id)}},[r(f,{src:t.img||"xxx",width:"100%",height:"100%",fit:"cover"},{loading:function(){return r(d,{type:"spinner",size:20},null)}}),r("div",{class:C},[r(j,{name:t.id,class:B},{icon:function(e){return r(u,{name:e.checked?h:g,size:"20"},null)}}),r("p",{class:z},[t.name])])])}))])]):null})),e.single?r("div",{class:w},[e.subjectList.map((function(t){return r("div",{class:S,onClick:function(){return e.onSelect(t.id)}},[r(f,{src:t.img||"xxx",width:"100%",height:"100%",fit:"cover"},{loading:function(){return r(d,{type:"spinner",size:20},null)}}),r("div",{class:C},[r(j,{name:t.id,class:B},{icon:function(e){return r(u,{name:e.checked?h:g,size:"20"},null)}}),r("p",{class:z},[t.name])])])}))]):null]}}):r(a,{tips:"暂无声部数据",btnStatus:!1},null)]),this.subjectList.length>0&&r(m,{offsetBottom:0,position:"bottom"},{default:function(){return[r("div",{class:["btnGroup",L]},[r(l,{round:!0,block:!0,type:"primary",style:{width:"96%",margin:"0 auto"},onClick:function(){return e.onChoice("Checkbox"===e.selectType?e.checkBox:e.radio)}},{default:function(){return[s("确认")]}})])]}})])}}))}}}))}();