| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- 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,
- })
- }
- })
|