const app = getApp(); Page({ /** * 页面的初始数据 */ data: { list: [], no_more: false, page: 1, mobile: '', }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.getMobile(); }, onShow() { this.resetParam(); this.getList(); }, getMobile() { let self = this; //获取数据 app.get('talent/appointment/getAdminMobile',function(res){ self.setData({mobile:res.mobile}); }) }, //获取数据 getList() { let self = this; //没有下一页 if (this.data.no_more) { return false; } //获取数据 app.post('talent/appointment/lists',{ page:self.data.page, keyword:self.data.keyword, },function(res){ if (res.length < 10) { self.setData({no_more:true}); } let list = self.data.list; list = list.concat(res); let page = self.data.page; page++; self.setData({list:list,page:page}); }) }, //重置参数 resetParam() { this.setData({list:[],no_more:false,page:1}); }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { this.resetParam(); this.getList(); wx.stopPullDownRefresh(); }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { this.getList(); }, toIndex() { wx.redirectTo({ url: '/pages/talent/appointment/index', }) }, ViewImage(e) { wx.previewImage({ urls: [e.currentTarget.dataset.url], }); }, showQrcode:function(e){ let code = e.target.dataset.code; wx.previewImage({ current: 0, // 当前显示图片的http链接 urls: [app.globalData.http_host + 'qrcode.php?code=' + code] // 需要预览的图片http链接列表 }) }, //拔打电话 callMobile(e){ let mobile = this.data.mobile; if (mobile == '') { app.msg('暂无联系方式!'); return false; } wx.makePhoneCall({ phoneNumber: mobile }) }, toEva(e) { let id = e.currentTarget.dataset.id; wx.navigateTo({ url: '/pages/talent/appointment/evaluate?id=' + id, }) } })