zoukankan      html  css  js  c++  java
  • 微信小程序-翻页

    function cardInfo( flag, currentPage,that){
    wx.showLoading({
    title: '加载中',
    });
    wx.request({
    url: 'https://www.lenfshion.com/projectmng/appuser/exchangelist',
    method: "POST",
    data: {
    apptoken: wx.getStorageSync("token"),
    flag: flag,
    currentPage: currentPage
    },
    header: {
    'content-type': 'application/json'
    },
    success: function (res) {
    // console.log(res.data);
    wx.hideLoading();
    if(res.data.result=="01"){
    cardlength = res.data.list.length;
    if (currentPage==1){
    var cardList = res.data.list;
    for (var i = 0; i < cardlength; i++) {
    faceImg = imgUrl + cardList[i].face;
    cardList[i].face = faceImg;
    }
    // 赋值
    if (cardlength == 0) {
    if (that.data.currentTab == 0) {
    that.setData({
    cardList: cardList,
    numberdisplay: false,
    })
    state1 = false;
    } else if (that.data.currentTab == 1) {
    that.setData({
    exchangeList: cardList,
    changeDisplay: false,
    })
    state2 = false;
    } else {
    that.setData({
    CollectionList: cardList,
    callDisplay: false,
    })
    state3 = false;
    }
    } else {
    if (that.data.currentTab == 0) {
    that.setData({
    cardList: cardList,
    numberdisplay: true,
    })
    state1 = false;
    } else if (that.data.currentTab == 1) {
    that.setData({
    exchangeList: cardList,
    changeDisplay: true,
    })
    state2 = false;
    } else {
    that.setData({
    CollectionList: cardList,
    callDisplay: true,
    })
    state3 = false;
    }
    }
    }else{
    if (cardlength == "0") {
    return
    }
    var cardMore = '';
    var cardList = res.data.list
    for (var i = 0; i < cardlength; i++) {
    faceImg = imgUrl + cardList[i].face;
    cardList[i].face = faceImg;
    var arr = that.data.cardList;
    arr.push(res.data.list[i]);
    cardMore = arr;
    }
    // 加载更多
    if (that.data.currentTab==0){
    that.setData({
    cardList: cardMore,
    numberdisplay: true
    })
    } else if (that.data.currentTab == 1){
    that.setData({
    exchangeList: cardMore,
    changeDisplay: true
    })
    }else{
    that.setData({
    CollectionList: cardMore,
    callDisplay: true
    })
    }
    }
    }else{
    getApp().maskInfos(res.data.result, res.data.msg);
    }
    }
    });
    }
  • 相关阅读:
    http编程中的get和post混合使用方式
    SQLServer实现作业依赖(非步骤)
    SQLServer实现两个库的字段长度自动更新
    Python+SQLite数据库实现服务端高并发写入
    sqlite数据库相关使用
    sqlite语法
    VBA关键字总结
    VS2005 .net2.0 TreeView.设置SelectedNodeStyle控制TreeView中选定节点的外观的
    SQLSERVER 2005 如何给sa用户设置空密码?
    解决超过远程连接数而无法连接服务器的问题 踢出已断开用户
  • 原文地址:https://www.cnblogs.com/weiwentaweb/p/8135038.html
Copyright © 2011-2022 走看看