小程序

ctrl s 刷新页面
app.js
在这里插入图片描述
需要刷新后访问的页面 放在最前面

 data: {
    navIndex:0,
    navList: [
      {
        text: "收支明细"
      },
      {
        text: "提现明细"
      }
    ],
    orderList:[
      [
        {
          ctime: "2018-10-01"
          ,money:"1001"
        }
      ]
      ,[
        {
          ctime: "2018-10-01"
          ,money:"10012"  
        },
        
      ]
    ]
  },
顶部  let url = getApp().globalData.feizhuUrl;

  wx.request({
      url: 'https://zyc1h1p.zhu1o1hanet.com/Feizhu.php/Account/incomeExpend',
      method: "POST",
      header: { "Content-Type": "application/x-www-form-urlencoded" },   //必填
      data: {
        uid: 50092
      },
      success: function (res) {
         var that = this;
        if (res.data.code) {
          that.setData({
            ["orderList[0]"]: res.data.data
          });
        }
        else {
          wx.showToast({
            title: '加载失败',
            icon: 'loading'
          })
        }
      }
    })  
在 app.js 中 
  globalData: {
    userInfo: null,
    hostUrl: 'https://www.xxx.cn/xxx.php/',//api地址
    hostUrl2: 'http://xxxx.xx.cn/',//图片地址
    feizhuUrl: 'https://zycsxxx.com/feizhu.php/',//飞猪url请求
    navBarInfo:{
      height:0
      , position:{}
    }
  }
**baocun:function(){
    if(this.data.name.length==0){
      wx.showToast({
        title: '请输入昵称',
      })
    }else{
      var uid = '50112';
      var username = this.data.name;
      console.log(username)
      
      wx.request({
        url: hostUrl2 + 'Api.php/Littles/editusername',
        data:{
          uid : uid,
          nickname: username
        },
        header: {//请求头
          'content-type': 'application/x-www-form-urlencoded'
        },
        success: function (res) {
          // console.log(res.data);
          wx.showToast({
            title: res.data.msg,
            mask: false,
            success: function () {
              setTimeout(function () {
                wx.redirectTo({
                  url: '../my/my',
                })
              }, 1500)
            }
          })
          
        },
        fail:function()
        {
          console.log('连接失败')
        }


      })
    }
  },**
  */
  onLoad: function (options) {
    var that = this;
    wx.request({
      url: `${url}Banks/getBankcard`,
      method: "GET",
      header: { "Content-Type": "application/x-www-form-urlencoded" },   //必填
      data: {
        uid: 111
      },
      success: function (res) {
        if (res.data.code) {
          that.setData({
            ["bankArr"]: res.data.data 
          }); 
        }
        else {
          wx.showToast({
            title: '暂未绑定银行卡',
            // mask: false,
              icon: 'loading',
            // duration: 3000,
            success: function () {
              setTimeout(function () {
                wx.redirectTo({
                  url: '../bindBank/bindBank',
                })
              }, 50)
            }
          })
        }
      }
    }) 
    pub.openLoading();

  },
   wx.showToast({
                  title: res.data.data,
                  mask: false,
                  success: function () {
                    setTimeout(function () {
                      wx.redirectTo({
                        url: '../tongcheng/tongcheng',
                      })
                    }, 100)
                  }
                })
 
let url = getApp().globalData.hostUrl;


app.js

  globalData: {
    userInfo: null,
    sessionKey: null,
    openId: null,
    hostUrl: 'https://zycshop. 学习.com/feizhu.php/', //api地址
    hostUrl2: 'http://feizhu. 学学学.cn/',//图片地址
    navBarInfo:{
      height:0
      , position:{}
    }

  }
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值