var kImg = ''//图片 var kTit = ''//标题 var kCount = ''//人数 var kURL = ''//跳转 var audioC = ''//多少节课 var nPrice = '' var oPrice = '' var cID = $('.kc_ListBox').attr('categoryid') var listItem = '
教你利用\\/信群,没钱没人脉也能月入十万
百万学堂丨共8节课
1.0万次学习
¥99
¥299
' var page = 1 function getData() { // category_id=2 //课程id page++ axios({ url: 'courses?page=' + page + '&category_id=' + cID, type: 'get', dataType: 'json', }).then(function (res) { if (res.data.error_code != 0 || res.data.data == "") { $('.loadIng').html('没有更多') } else { $('.loadIng').html('加载中') } $.each(res.data.data, function (index, el) { kImg = el.image if (kImg != undefined) { kTit = el.name kCount = el.fictitious kURL = el.course_visited_url audioC = el.audio.length; oPrice = el.price nPrice = el.discounted_price $('.kc_ListBox').append('
' + kTit + '
百万学堂丨共' + audioC + '节课
' + kCount + '次学习
¥' + nPrice + '
¥' + oPrice + '
') } }) }).catch(function (err) { $('.loadIng').html('没有更多') console.log(err); }) } $('select[name=page]').change(function () { location.href = $('a[class="kcm_items"]').attr('url') + "/page_" + this.value + ".html"; }) // getData() // $(window).scroll(function () { // // scroll at bottom // if ($(window).scrollTop() + $(window).height() == $(document).height()) { // getData() // } // }); // $('.spr_b_4').addClass('active_btn')