• 微信小程序-翻页


    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);
    }
    }
    });
    }
  • 相关阅读:
    hibernate缓存清除(转)
    hibernate缓存
    hibernate延迟加载
    session进行增删改查操作
    curl命令详解
    CURL 宏定义列表
    CURL常用命令---样例
    打印 上一主题 下一主题 利用cURL实现单个文件分多段同时下载,支持断点续传(修订版)
    curl断点续载
    CURL常用命令
  • 原文地址:https://www.cnblogs.com/weiwentaweb/p/8135038.html
Copyright © 2020-2023  润新知