// pages/mine/mydc/mydc.js const app = getApp() Page({ /** * 页面的初始数据 */ data: { wv_Introduction_total: '', wv_withdraw_total: '', wv_register_count: '', wv_contract_count: '', wv_finish_count: '', loaddisplay: true, wv_extract_count: '', wv_account_number: '', wv_account_name: '', Introduction_arr: [] }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { let _this = this; _this.setData({ navH: app.globalData.navHeight }) // var that = this // wx.request({ // url: app.globalData.url + '/checkDcIntroducers', // method: 'get', // data: { // wv_phone: app.globalData.userphone // }, // success: function (res) { // that.setData({ // wv_Introduction_total: res.data.wv_Introduction_total.toFixed(2), // wv_withdraw_total: res.data.wv_withdraw_total.toFixed(2), // wv_register_count: res.data.wv_register_count, // wv_contract_count: res.data.wv_contract_count, // wv_finish_count: res.data.wv_finish_count, // wv_extract_count: res.data.wv_extract_count, // wv_account_number: res.data.wv_account_number // }) // wx.request({ // url: app.globalData.url + '/getDcIntroduceLogs', // method: 'get', // data: { // phone: app.globalData.userphone // }, // success: function (res) { // that.setData({ // Introduction_arr: res.data // }) // } // }) // } // }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { var that = this wx.request({ url: app.globalData.url + '/checkDcIntroducers', method: 'get', data: { wv_phone: app.globalData.userphone }, success: function (res) { that.setData({ wv_Introduction_total: res.data.wv_Introduction_total.toFixed(2), wv_withdraw_total: res.data.wv_withdraw_total.toFixed(2), wv_register_count: res.data.wv_register_count, wv_contract_count: res.data.wv_contract_count, wv_finish_count: res.data.wv_finish_count, wv_extract_count: res.data.wv_extract_count, wv_account_number: res.data.wv_account_number, wv_account_name: res.data.wv_account_name }) wx.request({ url: app.globalData.url + '/getDcIntroduceLogs', method: 'get', data: { phone: app.globalData.userphone }, success: function (res) { that.setData({ Introduction_arr: res.data, loaddisplay: 'none' }) }, fail() { app.timeOut() } }) }, fail() { app.timeOut() } }) }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, hrefExtract: function () { wx.navigateTo({ url: '/pages/mine/mydc/myextract/myextract' }) }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, extract: function () { if (this.data.wv_account_number == null || this.data.wv_account_number == "" || this.data.wv_account_name == null || this.data.wv_account_name =="") { wx.navigateTo({ url: '/pages/mine/myinfo/myinfo' }) } else if (this.data.wv_Introduction_total <= 0) { wx.showToast({ title: '请,您没有可提取的金额!', icon: 'none', duration: 1500 }) } else { wx.navigateTo({ url: '/pages/mine/mydc/applyextract/applyextract?amount=' + this.data.wv_Introduction_total }) } } })