balance.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. const app = getApp();
  2. const { axios } = app.globalData;
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. },
  9. success () {
  10. wx.navigateTo({
  11. url: '/pages/detailed/detailed',
  12. })
  13. },
  14. // 请求余额
  15. Request () {
  16. let that = this;
  17. axios({
  18. url: '/option/balance/',
  19. method: 'get',
  20. success (res) {
  21. let { data } = res.data;
  22. that.setData({
  23. ...data[0]
  24. })
  25. wx.stopPullDownRefresh()
  26. }
  27. })
  28. },
  29. /**
  30. * 生命周期函数--监听页面加载
  31. */
  32. onLoad: function (options) {
  33. wx.lxd.Ctr({
  34. // nav
  35. title: "我的余额", //标题
  36. })
  37. },
  38. /**
  39. * 生命周期函数--监听页面初次渲染完成
  40. */
  41. onReady: function () {
  42. },
  43. /**
  44. * 生命周期函数--监听页面显示
  45. */
  46. onShow: function () {
  47. this.Request();
  48. },
  49. /**
  50. * 生命周期函数--监听页面隐藏
  51. */
  52. onHide: function () {
  53. },
  54. /**
  55. * 生命周期函数--监听页面卸载
  56. */
  57. onUnload: function () {
  58. },
  59. /**
  60. * 页面相关事件处理函数--监听用户下拉动作
  61. */
  62. onPullDownRefresh: function () {
  63. this.Request();
  64. },
  65. /**
  66. * 页面上拉触底事件的处理函数
  67. */
  68. onReachBottom: function () {
  69. },
  70. })