index.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. let myPro = require("../../../utils/wxRequest.js");
  2. let util = require("../../../utils/util.js");
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. imgUrl: getApp().globalData.imgUrl,
  9. info: null,
  10. money: null
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad: function (options) {
  16. },
  17. /**
  18. * 生命周期函数--监听页面初次渲染完成
  19. */
  20. onReady: function () {
  21. },
  22. /**
  23. * 生命周期函数--监听页面显示
  24. */
  25. onShow: function () {
  26. let that = this;
  27. that.getShopInfo();
  28. },
  29. /**
  30. * 生命周期函数--监听页面隐藏
  31. */
  32. onHide: function () {
  33. },
  34. /**
  35. * 生命周期函数--监听页面卸载
  36. */
  37. onUnload: function () {
  38. },
  39. /**
  40. * 页面相关事件处理函数--监听用户下拉动作
  41. */
  42. onPullDownRefresh: function () {
  43. },
  44. /**
  45. * 页面上拉触底事件的处理函数
  46. */
  47. onReachBottom: function () {
  48. },
  49. /**
  50. * 用户点击右上角分享
  51. */
  52. // 获取个人信息
  53. getShopInfo(){
  54. let that = this;
  55. myPro.wxRequest("store/info","GET",{}).then(res=>{
  56. that.setData({
  57. info: res.result
  58. });
  59. }).catch(err=>{
  60. console.log('报错信息',err);
  61. wx.showToast({
  62. title: err,
  63. icon: "none"
  64. });
  65. });
  66. },
  67. // 获取输入金额
  68. getChargeMoney(event){
  69. // console.log(event)
  70. let that = this;
  71. that.setData({
  72. money: event.detail
  73. })
  74. },
  75. // 提现
  76. nextFun(){
  77. let that = this;
  78. if(!that.data.money){
  79. wx.showToast({
  80. title: "请输入提现金额",
  81. icon: "none"
  82. });
  83. return;
  84. }
  85. let params = {
  86. money: parseFloat(that.data.money)
  87. };
  88. myPro.wxRequest("store/tx/apply","POST",params).then(res=>{
  89. wx.showToast({
  90. title: res.msg,
  91. icon: "none"
  92. });
  93. that.goCashOutLog()
  94. }).catch(err=>{
  95. console.log('报错信息',err);
  96. wx.showToast({
  97. title: err,
  98. icon: "none"
  99. })
  100. });
  101. },
  102. // 进入提现列表
  103. goCashOutLog(){
  104. wx.navigateTo({
  105. url: '/pages/shopRole/cashoutlog/index?status=0'
  106. })
  107. }
  108. })