|
@@ -38,7 +38,10 @@ Page({
|
|
|
console.log(res)
|
|
|
|
|
|
that.setData({
|
|
|
- wallet: res.data.data
|
|
|
+ wallet: res.data.data,
|
|
|
+ order:true,
|
|
|
+ trans:false,
|
|
|
+ adminTrans:false
|
|
|
})
|
|
|
|
|
|
}
|
|
@@ -78,10 +81,275 @@ Page({
|
|
|
|
|
|
}
|
|
|
})
|
|
|
+ var opneId = wx.getStorageSync('openId')
|
|
|
+ wx.request( {
|
|
|
+ url: link + "/v1/forward/lhf",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "function":"/v1/user/open.id/get"
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: { openId: opneId },
|
|
|
+ success (res) {
|
|
|
+ console.log(res)
|
|
|
+
|
|
|
+ wx.setStorageSync('nickName', res.data.data.user.nickName)
|
|
|
+ wx.setStorageSync('userId', res.data.data.user.id)
|
|
|
+ if (res.data.data.user.admin == 2){
|
|
|
+ that.setData({
|
|
|
+ admin:true
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
|
|
|
},
|
|
|
+ copy:function (options) {
|
|
|
+ console.log(options)
|
|
|
+ wx.setClipboardData({
|
|
|
+ data: options.currentTarget.dataset.pay,
|
|
|
+ success (res) {
|
|
|
+ //点击确定
|
|
|
+ wx.showToast({
|
|
|
+ title: '复制成功',//提示文字
|
|
|
+ duration:2000,//显示时长
|
|
|
+ mask:true,//是否显示透明蒙层,防止触摸穿透,默认:false
|
|
|
+ icon:'success', //图标,支持"success"、"loading"
|
|
|
+ success:function(){ },//接口调用成功
|
|
|
+ fail: function () { }, //接口调用失败的回调函数
|
|
|
+ complete: function () { } //接口调用结束的回调函数
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ statusFail:function (options) {
|
|
|
+ console.log(options)
|
|
|
+ var that = this
|
|
|
+ var item = options.target.dataset.item
|
|
|
+ wx.showModal({
|
|
|
+ title: '拒绝提现',
|
|
|
+ content: '金额等数据异常,拒绝发放提现',
|
|
|
+ showCancel: true,//是否显示取消按钮
|
|
|
+ cancelText:"取消",//默认是“取消”
|
|
|
+ confirmText:"确定",//默认是“确定”
|
|
|
+
|
|
|
+ success: function (res) {
|
|
|
+ if (res.cancel) {
|
|
|
+ //点击取消,默认隐藏弹框
|
|
|
+ } else {
|
|
|
+ wx.request( {
|
|
|
+ url: link + "/v1/forward/lhf",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "function":"/v1/user/trans/update"
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: { pidStatus: item.pid_status,pay:item.pay,userId:item.userId,payName:item.payName,pid:item.pid,openId:item.openId,transStatus:2,id:item.id },
|
|
|
+ success (res) {
|
|
|
+ console.log(res)
|
|
|
+ wx.request( {
|
|
|
+ url: link + "/v1/forward/lhf",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "function":"/v1/user/trans/list"
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: { pageIndex:1,pageSize:999 },
|
|
|
+ complete: function( res ) {
|
|
|
+ console.log(res)
|
|
|
+ if( res == null || res.data == null ) {
|
|
|
+ console.error( '网络请求失败' );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ that.setData({
|
|
|
+ transList: res.data.data.rows,
|
|
|
+ order:false,
|
|
|
+ trans:true,
|
|
|
+ adminTrans:false
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function (res) { },//接口调用失败的回调函数
|
|
|
+ complete: function (res) { },//接口调用结束的回调函数(调用成功、失败都会执行)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ statusSuccess:function (options) {
|
|
|
+ console.log(options)
|
|
|
+ var that = this
|
|
|
+ var item = options.target.dataset.item
|
|
|
+ wx.showModal({
|
|
|
+ title: '提现已发放',
|
|
|
+ content: '金额已发放',
|
|
|
+ showCancel: true,//是否显示取消按钮
|
|
|
+ cancelText:"取消",//默认是“取消”
|
|
|
+ confirmText:"确定",//默认是“确定”
|
|
|
+
|
|
|
+ success: function (res) {
|
|
|
+ if (res.cancel) {
|
|
|
+ //点击取消,默认隐藏弹框
|
|
|
+ } else {
|
|
|
+ wx.request( {
|
|
|
+ url: link + "/v1/forward/lhf",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "function":"/v1/user/trans/update"
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: { pidStatus: item.pid_status,pay:item.pay,userId:item.userId,payName:item.payName,pid:item.pid,openId:item.openId,transStatus:3,id:item.id },
|
|
|
+ success (res) {
|
|
|
+ console.log(res)
|
|
|
+ wx.request( {
|
|
|
+ url: link + "/v1/forward/lhf",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "function":"/v1/user/trans/list"
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: { pageIndex:1,pageSize:999 },
|
|
|
+ complete: function( res ) {
|
|
|
+ console.log(res)
|
|
|
+ if( res == null || res.data == null ) {
|
|
|
+ console.error( '网络请求失败' );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ that.setData({
|
|
|
+ transList: res.data.data.rows,
|
|
|
+ order:false,
|
|
|
+ trans:true,
|
|
|
+ adminTrans:false
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function (res) { },//接口调用失败的回调函数
|
|
|
+ complete: function (res) { },//接口调用结束的回调函数(调用成功、失败都会执行)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ changeTabs:function(options){
|
|
|
+ console.log(options)
|
|
|
+ var that = this
|
|
|
+ if (options.detail.activeKey == "one"){
|
|
|
+ //查询数据
|
|
|
|
|
|
+ that.setData({
|
|
|
+ order:true,
|
|
|
+ trans:false,
|
|
|
+ adminTrans:false
|
|
|
+ })
|
|
|
+ } else if (options.detail.activeKey == "two"){
|
|
|
+ //查询提现数据
|
|
|
+ wx.request( {
|
|
|
+ url: link + "/v1/forward/lhf",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "function":"/v1/user/trans/list"
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: { pageIndex:1,pageSize:999 },
|
|
|
+ complete: function( res ) {
|
|
|
+ console.log(res)
|
|
|
+ if( res == null || res.data == null ) {
|
|
|
+ console.error( '网络请求失败' );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ that.setData({
|
|
|
+ transList: res.data.data.rows,
|
|
|
+ order:false,
|
|
|
+ trans:true,
|
|
|
+ adminTrans:false
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ } else if (options.detail.activeKey == "three"){
|
|
|
+ wx.request( {
|
|
|
+ url: link + "/v1/forward/lhf",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "function":"/v1/admin/amount/list"
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: { pageIndex:1,pageSize:999 },
|
|
|
+ complete: function( res ) {
|
|
|
+ console.log(res)
|
|
|
+ if( res == null || res.data == null ) {
|
|
|
+ console.error( '网络请求失败' );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ that.setData({
|
|
|
+ adminTransList: res.data.data.rows,
|
|
|
+ order:false,
|
|
|
+ trans:false,
|
|
|
+ adminTrans:true
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ adminAmount:function (options) {
|
|
|
+ var that = this
|
|
|
+ wx.request( {
|
|
|
+ url: link + "/v1/forward/lhf",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "function":"/v1/admin/amount"
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: { },
|
|
|
+ success (res) {
|
|
|
+ console.log(res)
|
|
|
+ wx.request( {
|
|
|
+ url: link + "/v1/forward/lhf",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "function":"/v1/admin/data"
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: { openId: "" },
|
|
|
+ success (res) {
|
|
|
+ console.log(res)
|
|
|
+
|
|
|
+ that.setData({
|
|
|
+ wallet: res.data.data,
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ trans:function(){
|
|
|
+ console.log('trans')
|
|
|
+ },
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|