mine_card.js 872 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // pages/mine_card/mine_card.js
  2. var app = getApp()
  3. Page({
  4. data: {
  5. cardList: []
  6. },
  7. onLoad: function (options) {
  8. var that = this;
  9. my.showLoading({
  10. content: '加载中...',
  11. mask: true
  12. })
  13. app.request("/card_riding/user_card", '', "GET").then(res => {
  14. console.log(res)
  15. my.hideLoading({
  16. complete: (res) => { },
  17. })
  18. if (res.data.data == '') {
  19. return;
  20. }
  21. that.setData({ cardList: res.data})
  22. }).catch(err => {
  23. console.log(err)
  24. })
  25. },
  26. onReady: function () {
  27. },
  28. onShow: function () {
  29. },
  30. onHide: function () {
  31. },
  32. onUnload: function () {
  33. },
  34. onPullDownRefresh: function () {
  35. },
  36. onReachBottom: function () {
  37. },
  38. onShareAppMessage: function () {
  39. },
  40. useRules: function () {
  41. my.navigateTo({
  42. url:'/pages/user_rules/user_rules',
  43. })
  44. }
  45. })