const app = getApp(); var utils = require("../../../utils/http"), page = 1; Page({ /** * 页面的初始数据 */ data: { imgUrl: app.globalData.imgUrl, videotext: '', videolist: [], leftlist: [], rightlist: [], titlist: [], secondtitlist: [], nowTagText:'', firsTitext:'', datashow:false, videotop:80, top:app.globalData.statusBarHeight, hgt:app.globalData.titleBarHeight, loginFlag:false, mobileflag:false, canIUseGetUserProfile: false, companyobj:{}, showAction: false, }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { wx.hideHomeButton() wx.showLoading({ title: '加载中...', }) if (wx.getUserProfile) { this.setData({ canIUseGetUserProfile: true }) } if(!!options.scene){ options=unescape(options.scene); let arr=options.split('&'); let obj={}; for(let i=0;i { wx.createSelectorQuery().select('.leftvideolistbox').boundingClientRect(function(res){ leftheight=res.height; wx.createSelectorQuery().select('.rightvideolistbox').boundingClientRect(function(rs){ leftlist=that.data.leftlist; rightlist=that.data.rightlist; rightheight=rs.height; if(leftheight<=rightheight){ leftlist.push(vidoemsg); videolist.shift(); }else{ rightlist.push(vidoemsg); videolist.shift(); } that.setData({ videolist:videolist, leftlist:leftlist, rightlist:rightlist }) }).exec(); }).exec(); },100) } }, firsttap:function(e){ var that=this; if(e.currentTarget.dataset.fid!=''){ that.setData({ firsTitext:e.currentTarget.dataset.fid, nowTagText:'', videotop:'168',//顶部padding secondtitlist:that.data.titlist[e.currentTarget.dataset.idx].sonLabel }) }else{ that.setData({ firsTitext:e.currentTarget.dataset.fid, nowTagText:'', videotop:'80',//顶部padding secondtitlist:[] }) } this.videodata() }, childtypetap:function(e){ this.setData({ nowTagText:e.currentTarget.dataset.sid, }) this.videodata(); }, videoTap:function(e){ wx.navigateTo({ url: "/share/pages/videoshare/videoshare?vid=" + e.currentTarget.dataset.vid+'&userid='+app.globalData.shareuserid+'&ctp='+app.globalData.clientype }); }, golastap:function(){ wx.navigateBack() }, goindextap:function(){ wx.reLaunch({ url: '/pages/index/index?state=1', }) }, toPageNameCard () { wx.navigateTo({ url: '/share/pages/shareCard/shareCard?uid='+ app.globalData.shareuserid + '&empid=' + app.globalData.currentUserId + '&ctp=' + app.globalData.clientype + '&ftype=share', }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { var that = this; page=1; utils.$post({ url: app.globalData.webUrl + 'client/video/list', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { type: that.data.firsTitext, label: that.data.nowTagText, page: 1, limit: "10", keyword: '' }, success: function (res) { wx.stopPullDownRefresh() if (res.data.code == 0) { that.setData({ videolist: res.data.data, leftlist: [], rightlist: [] }) setTimeout(function () { that.videoimgload(); }, 50) } } }) }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { let that=this; page=page*1+1; wx.showLoading({ title: '加载中...', }) utils.$post({ url: app.globalData.webUrl + 'client/video/list', header: { 'Authorization':'bearer '+app.globalData.token }, data: { type: that.data.firsTitext, label:that.data.nowTagText, page: page, limit: "10", user_id:app.globalData.personMsg.id }, success: function (res) { setTimeout(function(){ wx.hideLoading() },1200) if(res.data.code==0){ var arr=res.data.data; var arrflag=false; var videolist=that.data.videolist; if(videolist.length!=0){ arrflag=true; } for(var i=0;i