2025-04-01 09:03:51 +08:00

1 line
6.3 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"643f":function(t,e,n){"use strict";var o=n("87b1"),i=n.n(o);i.a},"7d07":function(t,e,n){"use strict";n.r(e);var o=n("ad6b"),i=n("c353");for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("643f");var u=n("828b"),c=Object(u["a"])(i["default"],o["b"],o["c"],!1,null,"0343ac32",null,!1,o["a"],void 0);e["default"]=c.exports},"87b1":function(t,e,n){},ad4b:function(t,e,n){"use strict";(function(t){var o=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=o(n("af34")),a={components:{MySwiper:function(){n.e("components/fuyu-MixSwiper/fuyu-MixSwiper").then(function(){return resolve(n("e9f8"))}.bind(null,n)).catch(n.oe)}},data:function(){return{topImg:{},swiperList:[],teacherList:[],wqList:[],hotList:[],unread_number:"",count:5,current:0,autoplay:!0,scrollTop:0,dotsShow:!0,videoList:[],currentItemType:"",videoAutoplay:!1,show:!0,backgroundImage:"https://testy.hschool.com.cn/uploads/20250219/4554df3bea7bd9cdbd75462ceedb8ea7.png",groupImage:"https://testy.hschool.com.cn/uploads/20250219/5b09b1878ab6d7774540f0d1a8c6675a.png"}},onLoad:function(){t.hideTabBar()},mounted:function(){this.videoContext=t.createVideoContext("myVideo")},onShow:function(){this.getinit(),this.getHotList(),this.getTeacherList(),this.getWqList()},beforeDestroy:function(){this.autoplay=!1},methods:{capsuleHeight:function(){var e;return null!==(e=t)&&void 0!==e&&e.getMenuButtonBoundingClientRect()?"".concat(2*t.getMenuButtonBoundingClientRect().height+2*t.getMenuButtonBoundingClientRect().top+26,"rpx"):"180rpx"},click:function(e){t.navigateTo({url:e})},handleChange:function(e){var n=e.detail.current,o=[].concat((0,i.default)(this.swiperList),(0,i.default)(this.videoList))[n];if(this.currentItemType=o.showtype,"video"===this.currentItemType){this.videoList.forEach((function(e,o){if(o!==n){var i=t.createVideoContext("myVideo".concat(o));i.pause()}})),this.videoAutoplay=!0,this.autoplay=!1,this.dotsShow=!1;var a=t.createVideoContext("myVideo".concat(n));a.play()}else this.videoList.forEach((function(e,n){var o=t.createVideoContext("myVideo".concat(n));o.pause()})),this.videoAutoplay=!1,this.autoplay=!0,this.dotsShow=!0},getinit:function(){var e=this;t.$u.http.get("/api/index/init",{}).then((function(n){1==n.code?(e.topImg=n.data.home_data.top_image,e.swiperList=n.data.home_data.top_images.list):t.showToast({title:n.msg,icon:"none",duration:2e3})})).catch((function(e){t.showToast({title:"请求失败,请稍后再试",icon:"none",duration:2e3})}))},toApply:function(){var e=t.getStorageSync("token");e?t.navigateTo({url:"/pages/index/Apply"}):t.showToast({title:"请登录",icon:"none",duration:2e3,complete:function(){setTimeout((function(){t.switchTab({url:"/pages/my/index"})}),2e3)}})},toAbout:function(){t.navigateTo({url:"/packageA/index/About"})},toGroup:function(e){t.navigateTo({url:e})},toCenter:function(){t.reLaunch({url:"/pages/center/index"})},toWq:function(){t.navigateTo({url:"/pages/index/previousList"})},getWqList:function(){var e=this;t.$u.http.get("/api/school/classes/classes_list",{params:{page:1,limit:6,order:"normal",is_expire:1}}).then((function(n){1==n.code?e.wqList=n.data.list:t.showToast({title:n.msg,icon:"none",duration:2e3})})).catch((function(e){t.showToast({title:"请求失败,请稍后再试",icon:"none",duration:2e3})}))},getTeacherList:function(){var e=this;t.$u.http.get("/api/school/teacher/teacher_list",{params:{page:1,limit:10,recommend:1}}).then((function(n){1==n.code?e.teacherList=n.data.list:t.showToast({title:n.msg,icon:"none",duration:2e3})})).catch((function(e){t.showToast({title:"请求失败,请稍后再试",icon:"none",duration:2e3})}))},toTeacher:function(e){t.navigateTo({url:"/pages/center/teacherDetail?id=".concat(e)})},getPeople:function(e){return t.$u.http.get("/api/school/classes/people",{params:{id:e,have_real:1}}).then((function(e){if(1==e.code)return e.data.unpaid_user_data;throw t.showToast({title:e.msg,icon:"none",duration:2e3}),new Error(e.msg)})).catch((function(e){throw t.showToast({title:"请求失败,请稍后再试",icon:"none",duration:2e3}),e}))},getHotList:function(){var e=this;t.$u.http.get("/api/school/classes/classes_list",{params:{page:1,limit:6,order:"hot",has_shop:1,is_expire:2}}).then((function(n){if(1==n.code){var o=n.data.list.data||[],i=o.map((function(t){return e.getPeople(t.id).then((function(e){t.unpaid_user_data=e})).catch((function(e){console.error("Failed to get people data for id ".concat(t.id,":"),e)}))}));Promise.all(i).then((function(){e.hotList=o})).catch((function(t){console.error("Error in fetching people data:",t)}))}else t.showToast({title:n.msg,icon:"none",duration:2e3})})).catch((function(e){t.showToast({title:"请求失败,请稍后再试",icon:"none",duration:2e3})}))},detail:function(e){t.navigateTo({url:"/pages/center/detail?id="+e})},Wqdetail:function(e){t.navigateTo({url:"/packageA/index/previousDetail?id="+e})}}};e.default=a}).call(this,n("df3c")["default"])},ad6b:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var o={uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,"3fd2"))},uAvatarGroup:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-avatar-group/u-avatar-group")]).then(n.bind(null,"2145"))},uParse:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-parse/u-parse")]).then(n.bind(null,"4e7a"))}},i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.show?t.capsuleHeight():null),o=t.show?null:t.capsuleHeight(),i=t.__map(t.hotList,(function(e,n){var o=t.__get_orig(e),i=e.unpaid_user_data.length,a=Number(e.sign_num+e.virtual_num);return{$orig:o,g0:i,m2:a}}));t._isMounted||(t.e0=function(e){e.stopPropagation(),t.show=!1}),t.$mp.data=Object.assign({},{$root:{m0:n,m1:o,l0:i}})},a=[]},c353:function(t,e,n){"use strict";n.r(e);var o=n("ad4b"),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=i.a},ef0b:function(t,e,n){"use strict";(function(t,e){var o=n("47a9");n("5e3a");o(n("3240"));var i=o(n("7d07"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])}},[["ef0b","common/runtime","common/vendor"]]]);