menber.js
3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
var e = function (e) {
return e && e.__esModule ? e : {
default: e
};
}(require("../../../utils/LoadMore.js")), t = getApp(), a = t.request, o = t.globalData.setting, os = o,
i = require("../../../utils/util.js"), ut = i, s = require("../../../utils/common.js"), n = new e.default();
var regeneratorRuntime = require('../../../utils/runtime.js');
Page({
/**
* 页面的初始数据
*/
data: {
url: o.imghost,
user_money:0.00,
frozen_money:0.00,
iurl: o.imghost,
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var th=this;
//--先判断会员状态--
var user_info = getApp().globalData.userInfo;
if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
wx.navigateTo({ url: '/pages/togoin/togoin', })
return false;
}
this.init_fir();
wx.setNavigationBarTitle({
title: "余额",
})
//优惠券要实时更新
getApp().getConfig2(function(e) {
var json_d = JSON.parse(e.switch_list);
th.data.is_closetxbank=json_d.is_closetxbank;
th.data.is_tx_wx=json_d.is_tx_wx;
},1)
},
init_fir: function () {
this.myMoney(); //我的资产
},
//获取我的资产
async myMoney() {
var e = this, frozen_money, user_money;
var user_id = getApp().globalData.user_id;
var store_id = os.stoid;
console.log(user_id, "是什么用户", store_id);
await getApp().request.promiseGet("/api/weshop/users/getMymoney/" +store_id+ "/" + user_id
, {
data: {}
}).then(res => {
console.log("1" + res);
var a = res.data.data;
var a = res.data.data;
frozen_money = a.unavailable;
console.log(a,"s1w" + a.frozen_money);
user_money = a.liudong_money;
console.log("menber" + a.user_money );
getApp().globalData.user_money = user_money;
console.log("menberssss" + user_money);
// 赋值getApp().globalData.can_use_money = 10;
// 取值var can = getApp().globalData.can_use_money;
})
this.setData({
frozen_money: frozen_money, user_money: user_money});
},
//提现记录
urls: function () {
wx.navigateTo({
url: 'cash_record/cash_record',
})
},
//不可用资金明细
url: function () {
wx.navigateTo({
url: 'account_unable/account_unable',
})
},
// 流动资金提现
jumPage:function(){
//如果都关闭的情况下,不去提现
if(this.data.is_closetxbank && !this.data.is_tx_wx ){
wx.showToast({
title: "商家暂未开通提现功能,敬请期待!",
icon: 'none',
duration: 2000
})
return false;
}
wx.navigateTo({
url: 'bring/bring',
})
},
//流动资金明细
jumPages: function () {
wx.navigateTo({
url: 'account/account',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})