|
@@ -54,6 +54,11 @@ Page({
|
|
|
usercode:e.detail.value
|
|
|
})
|
|
|
},
|
|
|
+ fundchange(e){
|
|
|
+ this.setData({
|
|
|
+ init_fund: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
logout(){
|
|
|
wx.removeStorage({
|
|
|
key: 'userInfo'
|
|
@@ -147,7 +152,34 @@ Page({
|
|
|
})
|
|
|
|
|
|
},
|
|
|
-
|
|
|
+ save(){
|
|
|
+ if (!this.data.init_fund) {
|
|
|
+ wx.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '请输入初始资金',
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ wx.request({
|
|
|
+ url: host + '/api/wx/player/fund',
|
|
|
+ data: {
|
|
|
+ init_fund: this.data.init_fund
|
|
|
+ },
|
|
|
+ header: {
|
|
|
+ 'Authorization': this.data.userInfo.token
|
|
|
+ },
|
|
|
+ method: 'PUT',
|
|
|
+ success: res => {
|
|
|
+ wx.showToast({
|
|
|
+ title: '提交成功',
|
|
|
+ })
|
|
|
+ this.getUserData()
|
|
|
+ },
|
|
|
+ fail: error => {
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
@@ -159,7 +191,7 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function () {
|
|
|
-
|
|
|
+ // this.getUserData()
|
|
|
},
|
|
|
|
|
|
/**
|