index-legacy.350be01e.js 7.6 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),a=o.value}catch(u){return void n(u)}o.done?t(a):Promise.resolve(a).then(i,c)}var i=document.createElement("style");i.innerHTML='._subjects_1t5fp_1{padding:.4rem 0 0;background:#f6f8f9;min-height:calc(100vh - .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:#2dc7aa;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(i),System.register(["./index-legacy.fba2875c.js","./index-legacy.45490234.js","./index-legacy.32d1c54d.js","./index-legacy.d92f7da7.js","./index-legacy.23cbc114.js","./index-legacy.edb65d0c.js","./checkbox_default-legacy.16e4afe4.js","./index-legacy.94e5c17b.js"],(function(t){"use strict";var i,c,r,s,o,a,u,l,f,d,_,p,b,h,m,g,j;return{setters:[function(e){i=e.d,c=e.T,r=e.j,s=e.z,o=e.F,a=e.aS,u=e.M,l=e.C,f=e.B},function(e){d=e.C},function(){},function(e){_=e.I},function(e){p=e.R,b=e.a},function(e){h=e.S},function(e){m=e.c,g=e.a},function(e){j=e.C}],execute:function(){var x="_subjects_1t5fp_1",v="_subjectContainer_1t5fp_6",y="_subjectMaxLength_1t5fp_9",k="_title_1t5fp_19",S="_subject-list_1t5fp_37",w="_subject-item_1t5fp_43",C="_topBg_1t5fp_53",B="_checkbox_1t5fp_61",z="_name_1t5fp_66";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,a,"next",e)}function a(e){n(s,c,r,o,a,"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:x},[r("div",{class:v},[this.subjectList.length?"Checkbox"===this.selectType?r(j,{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:S},[t.subjects&&t.subjects.map((function(t){return r("div",{class:w,onClick:function(){return e.onSelect(t.id)}},[r(_,{src:t.img||"xxx",width:"100%",height:"100%",fit:"cover"},{loading:function(){return r(a,{type:"spinner",size:20},null)}}),r("div",{class:C},[r(d,{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?m:g,size:"20"},null)}}),r("p",{class:z},[t.name])])])}))])]):null})),e.single?r("div",{class:S},[e.subjectList.map((function(t){return r("div",{class:w,onClick:function(){return e.onSelect(t.id)}},[r(_,{src:t.img||"xxx",width:"100%",height:"100%",fit:"cover"},{loading:function(){return r(a,{type:"spinner",size:20},null)}}),r("div",{class:C},[r(d,{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?m:g,size:"20"},null)}}),r("p",{class:z},[t.name])])])}))]):null]}}):r(p,{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:S},[t.subjects&&t.subjects.map((function(t){return r("div",{class:w,onClick:function(){return e.onSelect(t.id)}},[r(_,{src:t.img||"xxx",width:"100%",height:"100%",fit:"cover"},{loading:function(){return r(a,{type:"spinner",size:20},null)}}),r("div",{class:C},[r(b,{name:t.id,class:B},{icon:function(e){return r(u,{name:e.checked?m:g,size:"20"},null)}}),r("p",{class:z},[t.name])])])}))])]):null})),e.single?r("div",{class:S},[e.subjectList.map((function(t){return r("div",{class:w,onClick:function(){return e.onSelect(t.id)}},[r(_,{src:t.img||"xxx",width:"100%",height:"100%",fit:"cover"},{loading:function(){return r(a,{type:"spinner",size:20},null)}}),r("div",{class:C},[r(b,{name:t.id,class:B},{icon:function(e){return r(u,{name:e.checked?m:g,size:"20"},null)}}),r("p",{class:z},[t.name])])])}))]):null]}}):r(l,{tips:"暂无声部数据",btnStatus:!1},null)]),this.subjectList.length>0&&r(h,{offsetBottom:0,position:"bottom"},{default:function(){return[r("div",{class:"btnGroup"},[r(f,{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("确定")]}})])]}})])}}))}}}))}();