;(function(){function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e2){throw _e2;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o);},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e3){didErr=true;err=_e3;},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return();}finally{if(didErr)throw err;}}};}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);iimg{vertical-align:middle}._formTitle_opgdl_1 ._col-left_opgdl_8 ._required_opgdl_18{font-style:normal;color:#ff4e19;font-size:.45333rem}._formTitle_opgdl_1 ._col-icon_opgdl_23{display:flex;align-items:center}._col-field_opgdl_27{margin-bottom:.42667rem}._col-field-group_1vk7j_1{margin:0 .37333rem .32rem;border-radius:.26667rem;overflow:hidden;background-color:#fff;padding:.32rem;padding-bottom:0}._col-field-group_1vk7j_1 .van-field{padding-left:0;padding-right:0}._userAuth_1jf99_1{min-height:100vh;background-color:#f6f8f9;overflow:hidden}._userAuth_1jf99_1 ._btnGroup_1jf99_6{padding:0 .37333rem .4rem}._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";document.head.appendChild(__vite_style__);System.register(['./vendor-legacy.73abbe39.js','./index-legacy.637f3556.js','./index-legacy.372e7f90.js','./index-legacy.890d473e.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a3.js','./item-legacy.8c78baa8.js'],function(exports){'use strict';var defineComponent,createVNode,Popup,Col,Icon,createTextVNode,Row,Toast,Field,Button,Form,Fragment,Loading,Cell,ColHeader,state,request,ColResult,Item;return{setters:[function(module){defineComponent=module.d;createVNode=module.b;Popup=module.P;Col=module.C;Icon=module.q;createTextVNode=module.j;Row=module.k;Toast=module.T;Field=module.l;Button=module.B;Form=module.K;Fragment=module.F;Loading=module.L;Cell=module.p;},function(){},function(module){ColHeader=module.C;},function(module){state=module.s;request=module.r;ColResult=module.C;},function(){},function(){},function(module){Item=module.I;}],execute:function execute(){var queryString={};var strictUriEncode=function strictUriEncode(str){return encodeURIComponent(str).replace(/[!'()*]/g,function(x){return"%".concat(x.charCodeAt(0).toString(16).toUpperCase());});};var token='%[a-f0-9]{2}';var singleMatcher=new RegExp(token,'gi');var multiMatcher=new RegExp('('+token+')+','gi');function decodeComponents(components,split){try{// Try to decode the entire string first return decodeURIComponent(components.join(''));}catch(err){// Do nothing }if(components.length===1){return components;}split=split||1;// Split the array in 2 parts var left=components.slice(0,split);var right=components.slice(split);return Array.prototype.concat.call([],decodeComponents(left),decodeComponents(right));}function decode(input){try{return decodeURIComponent(input);}catch(err){var tokens=input.match(singleMatcher);for(var i=1;i0?'&cPop='+ +new Date():'?cPop='+ +new Date();history.pushState('','',"".concat(origin).concat(url));}else{var _splitUrl=window.location.hash.slice(1).split('?');var _query=qs.parse(_splitUrl[1]);if(_query.cPop){window.history.go(-1);}}if(this.$refs.protocolPopup){this.$refs.protocolPopup.scrollTop=0;}}},render:function render(){var _this=this;return createVNode(Popup,{"ref":"protocolPopup","show":this.modelValue,"transitionAppear":true,"position":this.position,"style":{height:this.height},"onClosed":function onClosed(){if(_this.destroy){_this.isDestroy=true;}}},{default:function _default(){return[_this.$slots.default&&!_this.isDestroy&&_this.$slots.default()];}});}}));var formTitle="_formTitle_opgdl_1";var required="_required_opgdl_18";var styles$3={formTitle:formTitle,"col-left":"_col-left_opgdl_8",required:required,"col-icon":"_col-icon_opgdl_23","col-field":"_col-field_opgdl_27"};var ColField=defineComponent({name:'col-field',props:{required:{type:Boolean,default:false},title:{type:String},border:{type:Boolean,default:true},iconName:{type:String}},render:function render(){var _this2=this;return createVNode(Row,{"class":styles$3['col-field']},{default:function _default(){return[createVNode(Col,{"span":24,"class":styles$3.formTitle},{default:function _default(){return[createVNode("div",{"class":styles$3['col-left']},[createVNode("div",{"class":styles$3['col-icon']},[_this2.$slots.icon?_this2.$slots.icon():_this2.iconName?createVNode(Icon,{"name":_this2.iconName,"size":"24"},null):null]),_this2.required?createVNode("i",{"class":styles$3.required},[createTextVNode("*")]):null,_this2.$slots.title?_this2.$slots.title():createVNode("div",{"class":styles$3.pdL},[_this2.title])]),createVNode("div",{"class":styles$3['col-right']},[_this2.$slots.right&&_this2.$slots.right()])];}}),createVNode(Col,{"span":24,"class":_this2.border?'van-hairline--bottom':null},{default:function _default(){return[_this2.$slots.default&&_this2.$slots.default()];}})];}});}});var styles$2={"col-field-group":"_col-field-group_1vk7j_1"};var ColFieldGroup=defineComponent({name:"ColFieldGroup",render:function render(){return createVNode("div",{"class":styles$2['col-field-group']},[this.$slots.default&&this.$slots.default()]);}});var userAuth="_userAuth_1jf99_1";var btnGroup="_btnGroup_1jf99_6";var styles$1={userAuth:userAuth,btnGroup:btnGroup};var UserAuth=exports('a',defineComponent({name:'UserAuth',props:{onSuccess:{// 实名成功 type:Function,default:function _default(){}}},computed:{students:function students(){var _state$user$data;var students=((_state$user$data=state.user.data)===null||_state$user$data===void 0?void 0:_state$user$data.student)||{};return students;}},data:function data(){return{form:{id:state.user.data.id,certificateType:'IDENTITY',realName:'',idCardNo:''}};},mounted:function mounted(){this.form.realName=this.students.realName;this.form.idCardNo=this.students.idCardNo;},methods:{onSubmit:function onSubmit(){var _this3=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return request.post('/api-auth/user/update',{requestType:'form',data:_objectSpread({},_this3.form)});case 3:Toast('实名成功');state.user.data.student.realName=_this3.form.realName;state.user.data.student.idCardNo=_this3.form.idCardNo;setTimeout(function(){_this3.onSuccess();},500);_context.next=11;break;case 9:_context.prev=9;_context.t0=_context["catch"](0);case 11:case"end":return _context.stop();}}},_callee,null,[[0,9]]);}))();}},render:function render(){var _this4=this;return createVNode(Form,{"class":styles$1.userAuth,"onSubmit":this.onSubmit},{default:function _default(){return[createVNode(ColHeader,{"title":"实名认证"},null),createVNode(ColFieldGroup,{"style":{marginTop:'15px'}},{default:function _default(){return[createVNode(ColField,{"title":"姓名","required":true},{default:function _default(){return[createVNode(Field,{"name":"lessonName","maxlength":20,"modelValue":_this4.form.realName,"onUpdate:modelValue":function onUpdateModelValue($event){return _this4.form.realName=$event;},"placeholder":"请输入真实姓名","rules":[{required:true,message:'请输入真实姓名'}]},null)];}}),createVNode(ColField,{"title":"证件号码","required":true},{default:function _default(){return[createVNode(Field,{"name":"lessonSubjectName","modelValue":_this4.form.idCardNo,"onUpdate:modelValue":function onUpdateModelValue($event){return _this4.form.idCardNo=$event;},"rules":[{required:true,message:'请输入身份证号'},{pattern:/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,message:'请输入正确的身份证号'}],"placeholder":"请输入身份证号"},null)];}})];}}),createVNode("div",{"class":['btnGroup']},[createVNode(Button,{"block":true,"round":true,"type":"primary","native-type":"submit"},{default:function _default(){return[createTextVNode("\u786E\u5B9A")];}})])];}});}}));var useCoupon="_useCoupon_dzp2v_1";var couponCount="_couponCount_dzp2v_5";var choiceCoupon="_choiceCoupon_dzp2v_14";var couponTitle="_couponTitle_dzp2v_20";var iconClose="_iconClose_dzp2v_32";var couponContent="_couponContent_dzp2v_39";var couponFooter="_couponFooter_dzp2v_46";var couponSelectText="_couponSelectText_dzp2v_53";var styles={useCoupon:useCoupon,couponCount:couponCount,choiceCoupon:choiceCoupon,couponTitle:couponTitle,iconClose:iconClose,couponContent:couponContent,couponFooter:couponFooter,couponSelectText:couponSelectText};var ChoiceCoupon=defineComponent({name:'choice-coupon',props:{orderAmount:{type:Number,default:0},useCoupon:{type:Array,default:function _default(){return[];}},couponCategory:{type:String,default:'UNIVERSAL'},couponList:{type:Array,default:function _default(){return[];}}},emits:['close','submit'],data:function data(){return{list:[],// consumeAmount: 0 // 消耗金额 dataLoading:false};},computed:{// 使用优惠券的数量 useLength:function useLength(){return this.list.filter(function(list){return list.checked;}).length||0;}},mounted:function mounted(){var _this5=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var canUsable,canUsed;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:// this.getList() // 处理显示已选择的优惠券 // 处理可用优惠券是否支付使用 _this5.couponList.forEach(function(item){_this5.useCoupon.forEach(function(coupon){if(item.couponCodeId===coupon.couponCodeId){item.checked=true;}});});canUsable=_this5.couponList.filter(function(list){return!list.disabled;});canUsed=_this5.couponList.filter(function(list){return list.disabled;});_this5.list=[].concat(_toConsumableArray(canUsable),_toConsumableArray(canUsed));_this5.calcCoupon();case 5:case"end":return _context2.stop();}}},_callee2);}))();},methods:{// async getList() { // if (this.dataLoading) return // this.dataLoading = true // try { // const res = await request.post(`${state.platformApi}/couponInfo/page`, { // data: { // couponCategory: this.couponCategory, // couponType: 'FULL_DISCOUNT', // useState: 'USABLE', // page: 1, // rows: 100 // } // }) // this.dataLoading = false // const result = res.data || {} // // 处理重复请求数据 // if (this.list.length > 0 && result.pageNo === 1) return // this.list = result.rows || [] // // 处理可用优惠券是否支付使用 // this.list.forEach((item: any) => { // item.checked = false // // 如果使用金额大于订单金额则优惠券不可用 // if (item.useLimit > this.orderAmount) { // item.disabled = true // } else { // item.disabled = false // } // // 处理显示已选择的优惠券 // this.useCoupon.forEach((coupon: any) => { // if (item.couponIssueId === coupon.couponIssueId) { // item.checked = true // } // }) // }) // // 初始化排序 // const canUsable = this.list.filter((list: any) => !list.disabled) // const canUsed = this.list.filter((list: any) => list.disabled) // this.list = [...canUsable, ...canUsed] // this.calcCoupon() // } catch { // // // } // }, onSubmit:function onSubmit(){// 返回选中的优惠券 this.$emit('submit',this.list.filter(function(list){return list.checked;}));this.list.forEach(function(item){item.checked=false;});},onSelect:function onSelect(item){item.checked=!item.checked;this.calcCoupon();},calcCoupon:function calcCoupon(){// 计算优惠券 // 已使用的优惠券 var useList=this.list.filter(function(list){return list.checked;});var limitCount=useList.map(function(list){return Number(list.fullAmount||0);});var usePrice=limitCount.length>0?limitCount.reduce(function(sum,list){return sum+list;}):0;// 使用优惠券后,可判断的金额 var useLastAmount=this.orderAmount-usePrice;// 判断使用优惠券之后还有没有其它优惠券可用 this.list.forEach(function(item){if(Number(item.fullAmount)>useLastAmount&&!item.checked){item.disabled=true;}else{item.disabled=false;}});}},render:function render(){var _this6=this;return createVNode("div",{"class":styles.choiceCoupon},[createVNode("div",{"class":styles.couponTitle},[createVNode("span",null,[createTextVNode("\u4F18\u60E0\u5238")]),createVNode("i",{"class":styles.iconClose,"onClick":function onClick(){return _this6.$emit('close');}},null)]),createVNode("div",{"class":styles.couponContent},[!this.dataLoading?createVNode(Fragment,null,[this.list.length>0?createVNode(Fragment,null,[this.list.map(function(item){return createVNode(Item,{"item":item,"isSelect":true,"onClick":_this6.onSelect},null);})]):createVNode(ColResult,{"btnStatus":false,"tips":"暂无优惠券","classImgSize":"SMALL"},null)]):createVNode(Loading,{"size":48,"color":"#01C1B5","vertical":true,"style":{height:'100%',justifyContent:'center'}},{default:function _default(){return[createTextVNode("\u52A0\u8F7D\u4E2D...")];}})]),createVNode("div",{"class":[styles.couponFooter,'van-hairline--top']},[createVNode("div",{"class":styles.couponSelectText},[createTextVNode("\u5DF2\u9009"),createVNode("span",null,[this.useLength]),createTextVNode("\u5F20")]),createVNode(Button,{"type":"primary","round":true,"style":{minWidth:'105px',fontSize:'16px'},"onClick":this.onSubmit},{default:function _default(){return[createTextVNode("\u786E\u5B9A")];}})])]);}});var UseCoupons=exports('U',defineComponent({name:'use-conpon',props:{disabled:{type:Boolean,default:false},orderAmount:{type:Number,default:0},orderType:{type:String,default:''},discountPrice:{// 优惠券使用金额 type:Number,default:0},useSystem:{type:String,default:'MEC'},typeDetail:{type:String,default:''}},emits:['couponSelect'],data:function data(){return{popupStatus:false,popupLoading:false,useCouponList:[],useCouponLoading:false,useCouponCount:0,dataLoading:false,list:[]};},computed:{couponCount:function couponCount(){var limitCount=this.useCouponList.map(function(list){return Number(list.faceValue||0);});var count=0;if(this.disabled){count=this.discountPrice;}else{count=limitCount.length>0?limitCount.reduce(function(sum,list){return sum+list;}):0;}return count;}},mounted:function mounted(){this.getList();},methods:{getList:function getList(){var _this7=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee3(){var res,result,count;return regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:console.log(_this7.orderAmount);if(!_this7.dataLoading){_context3.next=3;break;}return _context3.abrupt("return");case 3:_this7.dataLoading=true;_context3.prev=4;_context3.next=7;return request.get("".concat(state.platformApi,"/sysCouponCode/queryPage"),{params:{useSystem:_this7.useSystem,typeDetail:_this7.typeDetail,usageStatus:0,page:1,rows:100}});case 7:res=_context3.sent;_this7.dataLoading=false;result=res.data||{};// 处理重复请求数据 if(!(_this7.list.length>0&&result.pageNo===1)){_context3.next=12;break;}return _context3.abrupt("return");case 12:_this7.list=result.rows||[];// 处理可用优惠券是否支付使用 _this7.list.forEach(function(item){item.checked=false;// 如果使用金额大于订单金额则优惠券不可用 if(item.fullAmount>_this7.orderAmount){item.disabled=true;}else{item.disabled=false;}});count=0;_this7.list.forEach(function(item){if(!item.disabled){count++;}});console.log(_this7.list,'list');_this7.useCouponCount=count;_context3.next=22;break;case 20:_context3.prev=20;_context3.t0=_context3["catch"](4);case 22:case"end":return _context3.stop();}}},_callee3,null,[[4,20]]);}))();},// async getUseableCoupon() { // try { // this.useCouponLoading = true // // 判断是哪个端 // const url = // state.platformType === 'STUDENT' ? '/api-student' : '/api-teacher' // const res = await request.get(`${url}/couponInfo/statInfo`) // this.useCouponLoading = false // const result = (res.data || []).find( // result => result.useState === 'USABLE' // ) // this.useCouponCount = result.total || 0 // } catch { // // TODO: handle // } // }, onSubmit:function onSubmit(item){// useCouponList this.useCouponList=item;this.$emit('couponSelect',item);this.popupStatus=false;this.popupLoading=false;}},render:function render(){var _this8=this;return createVNode(Fragment,null,[createVNode(Cell,{"title":"优惠券","class":styles.useCoupon,"style":{borderRadius:'8px'},"isLink":!this.disabled,"clickable":false,"onClick":function onClick(){if(_this8.disabled)return;_this8.popupStatus=true;_this8.popupLoading=true;}},{value:function value(){return!_this8.useCouponLoading&&createVNode(Fragment,null,[_this8.couponCount>0?createVNode("span",{"class":styles.couponCount},[createVNode("i",null,[createTextVNode("-\uFFE5")]),_this8.couponCount]):createVNode(Fragment,null,[_this8.useCouponCount>0?"".concat(_this8.useCouponCount,"\u5F20\u53EF\u4F7F\u7528"):'暂无可使用优惠券'])]);}}),createVNode(Popup,{"show":this.popupStatus,"onUpdate:show":function onUpdateShow($event){return _this8.popupStatus=$event;},"position":"bottom","round":true,"safeAreaInsetBottom":true,"style":{height:'75%'},"onClosed":function onClosed(){_this8.popupLoading=false;}},{default:function _default(){return[_this8.popupLoading&&createVNode(ChoiceCoupon,{"useCoupon":_this8.useCouponList,"orderAmount":_this8.orderAmount,"couponList":_this8.list,"onClose":function onClose(){return _this8.popupStatus=false;},"onSubmit":function onSubmit(item){return _this8.onSubmit(item);}},null)];}})]);}}));}};});})();