proxyApply.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. var _request = require('../../../../utils/request.js')
  2. var util = require('../../../../utils/util.js')
  3. Page({
  4. data: {
  5. page: 1,
  6. per_page: 20,
  7. list: [],
  8. more: true,
  9. balance: 0,
  10. userinfo:{},
  11. applylist:'',
  12. tel: '',
  13. uid:0
  14. },
  15. onLoad: function (options) {
  16. var uid = options.uid;
  17. this.getUserOrderInfo(uid);
  18. this.getApplyList(uid);
  19. this.setData({
  20. uid: uid
  21. })
  22. },
  23. onShow () {
  24. },
  25. onReachBottom: function () {
  26. if (this.data.more) {
  27. var page = this.data.page + 1
  28. this.setData({
  29. page: page
  30. })
  31. this.getBalanceList()
  32. }
  33. },
  34. getUserOrderInfo(uid) {
  35. var that = this
  36. var url = 'v1/user/others_info/'+ uid
  37. var params = {
  38. }
  39. var success = function (res) {
  40. var result = res.data.wx_user
  41. that.setData({
  42. userinfo: result
  43. })
  44. }
  45. _request.$get(url, params, success)
  46. },
  47. getApplyList(uid) {
  48. var that = this
  49. var url = 'v1/user/history_apply/'+ uid
  50. var params = {
  51. }
  52. var success = function (res) {
  53. var result = res.data
  54. that.setData({
  55. applylist: result
  56. })
  57. }
  58. _request.$get(url, params, success)
  59. },
  60. applySubmit(){
  61. var that = this
  62. var url = 'v1/user/agent_apply';
  63. var tel = that.data.tel;
  64. var uid = that.data.uid;
  65. var params = {
  66. mobile:tel,
  67. wx_uid:uid
  68. }
  69. var success = function (res) {
  70. var result = res.data.result
  71. // that.setData({
  72. // applylist: result
  73. // })
  74. console.log('submitres',result)
  75. if(result){
  76. wx.showToast({
  77. title: '申请成功,请耐心等待审核!',
  78. icon: 'none',
  79. duration: 2000
  80. })
  81. that.getApplyList(uid);
  82. }
  83. }
  84. _request.$post(url, params, success)
  85. },
  86. getDetail (val) {
  87. var id = val.currentTarget.dataset.val
  88. wx.navigateTo({
  89. url: '/packageUser/pages/user/radishDetail/radishDetail?id=' + id
  90. })
  91. },
  92. bindPhone (e) {
  93. this.setData({
  94. tel: e.detail.value
  95. })
  96. },
  97. onShareAppMessage: function (val) {
  98. return _request.share({
  99. sc: 'xcx_user_radish'
  100. })
  101. }
  102. })