123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- // 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
- })
- }
- }
- })
|