123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- var that;
- var Util = require('../../utils/util.js');
- var app = getApp();
- Page({
- data: {
- urlHttp: '',
- hiddenmodal: true,
- userPhoto: '',
- userName: '',
- recordList : {},
- accountList:{},
- allMoney : 0,
- allEarnings : 0,
- allInviteNum : 0,
-
- },
- onLoad: function (options) {
- var that = this;
- var host = getApp().globalData.servsers;
- var un_id = getApp().globalData.un_id;
- var openid = getApp().globalData.openid;
- console.log("un_id:" + un_id);
- console.log("openid:" + openid);
- if ((un_id == undefined || un_id == '' || un_id == null) || (openid == undefined || openid == '' || openid == null)) {
- wx.navigateTo({
- url: '/pages/authorize/authorize?link=partnerMineEarnings',
- })
- }else{
- console.log(getApp().globalData.userInfo);
- var userPhoto = getApp().globalData.userInfo.avatarUrl;
- var userName = getApp().globalData.userInfo.nickName;
- that.setData({
- urlHttp: host,
- userPhoto: userPhoto,
- userName: userName
- })
- }
- },
- onShow: function () {
- var that = this;
- var host = getApp().globalData.servsers;
- var un_id = getApp().globalData.un_id;
- var openid = getApp().globalData.openid;
- var userRole = getApp().globalData.userRole;
-
- wx.request({
- url: host + "api/distributeSell/getMyEarnInfo",
- data: {
- userId : un_id,
- userRole: userRole,
- },
- method: 'GET',
- header: {
- 'Accept': 'application/json'
- },
- success: function (res) {
- console.log(res);
- if (res.data.code == '200') {
- that.setData({
- allMoney: res.data.data.accountBalance,
- allEarnings: res.data.data.accumulativeTotalEarn,
- allInviteNum: res.data.data.sharePersonNum,
- })
- }
- if (res == null || res.data == null) {
- console.error('网络请求失败');
- return;
- }
- }
- })
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
-
- inviteRecord:function(e){
- var that = this;
- var id = e.currentTarget.dataset.id;
- wx.navigateTo({
- url: '/pages/partnerCommonRecord/partnerCommonRecord?id=' + id,
- })
- },
-
- applyWithdrawal:function(e){
- var that = this;
- that.setData({
- hiddenmodal: false,
- modalCont: '账户金额不足提现最低金额'
- })
- setTimeout(function () {
- that.setData({
- hiddenmodal: true
- })
- }, 1000)
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- onShareAppMessage: function (res) {
- var that = this;
- var host = getApp().globalData.servsers;
- var un_id = getApp().globalData.un_id;
- var fromUserPhoto = getApp().globalData.userInfo.avatarUrl;
- var fromUserName = getApp().globalData.userInfo.nickName;
- var fromUserRole = getApp().globalData.userRole;
- console.log("share-un_id:" + un_id);
- if (res.from === 'button') {
-
- }
- return {
- title: that.data.title,
- path: '/pages/midAutumn/midAutumn?fromUserId=' + un_id + '&fromUserRole=' + fromUserRole,
- imageUrl: '/images/share_img.jpg',
- success: function (res) {
-
- that.setData({
- hiddenmodal: false,
- modalCont: '分享成功'
- })
- setTimeout(function () {
- that.setData({
- hiddenmodal: true
- })
- }, 1000)
- },
- fail: function (res) {
-
- }
- }
- },
- })
|