bztang-admin/addons/yun_shop/static/app/js/chunk-2a79add8.18874c66.js

1 line
4.9 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2a79add8"],{"05e3":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("div",{staticClass:"search-head"},[o("van-sticky",[o("van-search",{attrs:{placeholder:"请输入搜索关键词"},on:{input:t.courseSearch},model:{value:t.keyword,callback:function(e){t.keyword=e},expression:"keyword"}})],1)],1),t.courseList.length>0?o("div",{staticClass:"course-list",style:t.iPnoneBottomBol?"padding-bottom: 34px;":""},t._l(t.courseList,(function(t,e){return o("block",{key:e},[o("course-item",{attrs:{datas:t,courseType:1}})],1)})),1):o("van-empty",{attrs:{description:"暂无数据"}})],1)},a=[],n=o("2909"),r=(o("ac1f"),o("466d"),o("b0c0"),o("99af"),o("ac0d")),s=o("c359"),c={name:"",components:{courseItem:s["a"]},mixins:[r["a"]],data:function(){return{courseList:[],iPnoneBottomBol:!1,keyword:"",page:1,lecturerId:"",isLoadMore:!0,total_page:0,timer:""}},computed:{},watch:{},methods:{courseSearch:function(t){var e=this;this.keyword=t,this.page=1,this.courseList=[],this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){e.debounce(e.getCourseList())}),500)},getiPnoneBottom:function(){var t=navigator.userAgent,e=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);this.iPnoneBottomBol=!!e},debounce:function(t,e){var o,i;return function(a){var n=this,r=arguments,s=+new Date;o&&s<o+e?(clearTimeout(i),i=setTimeout((function(){o=s,t.apply(n,r)}),e)):(o=s,t.apply(n,r))}},getCourseList:function(){var t=this,e={keyword:this.keyword,page:this.page,lecturerId:this.lecturerId,basic_info:1};$http.post("plugin.course-supply.api.course.index",e,"加载中..").then((function(e){if(1==e.result){var o=e.data,i=e.basic_info;t.isLoadMore=!0,t.total_page=o.last_page,t.total_page||(t.page=0),t.courseList=o.data,t.$nextTick((function(){var e,o;t.fun.wxShare("",{mid:t.fun.getKeyByMid()},{link:window.location.href,title:"课程供应链-"+(null===i||void 0===i||null===(e=i.home.mailInfo)||void 0===e?void 0:e.name),imgUrl:null===i||void 0===i||null===(o=i.home.mailInfo)||void 0===o?void 0:o.logo_url,description:"课程供应链"})}),50)}else t.page=t.page-1,t.isLoadMore=!1,t.$dialog.alert({message:e.msg})}))},getMoreData:function(){var t=this;if(this.isLoadMore=!1,!(this.page>=this.total_page)){this.page=this.page+1;var e={keyword:this.keyword,page:this.page,lecturerId:this.lecturerId,basic_info:1};$http.post("plugin.course-supply.api.course.index",e,"加载中").then((function(e){if(t.isLoadMore=!0,1===e.result){var o=e.data.data;t.courseList=[].concat(Object(n["a"])(t.courseList),Object(n["a"])(o))}else t.page=t.page-1,t.isLoadMore=!1}),(function(t){}))}}},created:function(){},mounted:function(){},beforeCreate:function(){},beforeMount:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},activated:function(){this.page=1,this.getCourseList(),this.getiPnoneBottom()}},u=c,l=u,d=(o("56cf"),o("fd19"),o("2877")),f=Object(d["a"])(l,i,a,!1,null,"1897fa27",null);e["default"]=f.exports},"2bee2":function(t,e,o){var i=o("24fb");e=i(!1),e.push([t.i,".course-list[data-v-1897fa27] .courseItem{padding:.625rem .625rem 0 .625rem}.course-list[data-v-1897fa27] .courseItem:first-child{border-radius:.9375rem .9375rem 0 0}",""]),t.exports=e},"49ec":function(t,e,o){var i=o("705d");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=o("499e").default;a("f5112266",i,!0,{sourceMap:!1,shadowMode:!1})},"56cf":function(t,e,o){"use strict";o("f5b8")},"705d":function(t,e,o){var i=o("24fb");e=i(!1),e.push([t.i,".search-head[data-v-1897fa27]{padding-bottom:.8125rem}.course-list[data-v-1897fa27]{background-color:#fff;border-radius:.9375rem}.course-list .courseItem[data-v-1897fa27]{padding:.625rem .625rem 0 .625rem}",""]),t.exports=e},ac0d:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));var i=document.documentElement,a=document.body,n={data:function(){return{}},activated:function(){window.addEventListener("scroll",this.handleScroll)},deactivated:function(){window.removeEventListener("scroll",this.handleScroll)},methods:{getScrollTop:function(){var t=0;return i&&i.scrollTop?t=i.scrollTop:a&&(t=a.scrollTop),t},getClientHeight:function(){var t=0;return t=a.clientHeight&&i.clientHeight?Math.min(a.clientHeight,i.clientHeight):Math.max(a.clientHeight,i.clientHeight),t},getScrollHeight:function(){return Math.max(a.scrollHeight,i.scrollHeight)},handleScroll:function(){this.otherScroll();var t=document.documentElement.scrollTop||document.body.scrollTop;this.btnFlag=t>60,this.getScrollTop()+this.getClientHeight()+105>this.getScrollHeight()?(this.isLoadMore&&this.getMoreData(),this.isBottom=!0):this.isBottom=!1},otherScroll:function(){}}}},f5b8:function(t,e,o){var i=o("2bee2");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=o("499e").default;a("47e76bb0",i,!0,{sourceMap:!1,shadowMode:!1})},fd19:function(t,e,o){"use strict";o("49ec")}}]);