123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- Page({
- data: {
- arr:[],
- link:'',
- mobile:'',
- name:'',
- return:false,
- user_id:'',
- money:'',
- userMoney:''
- },
- onLoad: function (options) {
- this.method()
- },
- mobile:function(e){
- this.setData({mobile:e.detail.value})
- },
- name:function(){
- this.setData({name:e.detail.name})
- },
- chaxun:function(){
- this.method()
- },
- chongzhi:function(){
- this.setData({name:'',mobile:''})
- this.method()
- },
- quxiao:function(){
- this.setData({return:false,user_id:'',money:''})
- },
- fanxian:function(e){
- this.setData({return:true,user_id:e.currentTarget.dataset.id,money:e.currentTarget.dataset.money})
- },
- userMoney:function(e){
- this.setData({userMoney:e.detail.value})
- },
- queding:function(){
- var that = this;
- var data={
- user_id:that.data.user_id,
- money:that.data.userMoney
- }
- wx.request({
- url: 'https://yutang.web.ximengnaikang.com/api/admin/handTiXian',
- method: 'POST',
- header: {
- 'content-type': 'application/x-www-form-urlencoded',
- 'Authorization':wx.getStorageSync('token')
- },
- data:data,
- success: function (res) {
- console.log(res)
- if(res.statusCode==200){
- wx.showToast({
- title: '操作成功!',
- icon:'none'
- })
- }else{
- wx.showToast({
- title: res.data.message,
- icon:'none'
- })
- }
- that.setData({return:false})
- }
- })
- },
- method:function(){
- var that = this;
- wx.request({
- url: 'https://yutang.web.ximengnaikang.com/api/admin/users?mobile='+that.data.mobile+'&nickname='+that.data.name,
- method: 'GET',
- header: {
- 'content-type': 'application/x-www-form-urlencoded',
- 'Authorization':wx.getStorageSync('token')
- },
- success: function (res) {
- console.log(res.data.data)
- if(res.statusCode==200){
- that.setData({arr:res.data.data.data,link:res.data.data.next_page_url})
- }
- }
- })
- },
- onReady: function () {
- },
- onShow: function () {
- },
- onHide: function () {
- },
- onUnload: function () {
- },
- onPullDownRefresh: function () {
- },
- onReachBottom: function () {
- var that = this;
- wx.request({
- url: that.data.link,
- method: 'GET',
- header: {
- 'content-type': 'application/x-www-form-urlencoded',
- 'Authorization':wx.getStorageSync('token')
- },
- success: function (res) {
- console.log(res.data.data)
- if(res.statusCode==200){
- that.setData({arr:that.data.arr.concat(res.data.data.data),link:res.data.data.next_page_url})
- }
- }
- })
- },
- onShareAppMessage: function () {
- }
- })
|