index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <view class="one_1">
  6. <text>{{user.integral||0}}</text><text>分</text>
  7. </view>
  8. <view class="one_2">
  9. <button type="default" size="mini">礼品兑换记录</button>
  10. </view>
  11. </view>
  12. <view class="two">
  13. <view class="two_1" v-if="list&&list.length>0">
  14. 数据列表
  15. </view>
  16. <view class="two_2" v-else>
  17. 已加载完全部
  18. </view>
  19. </view>
  20. </view>
  21. </mobile-frame>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. user: {},
  28. list: []
  29. };
  30. },
  31. onLoad: function(e) {
  32. },
  33. onShow: function() {
  34. const that = this;
  35. that.watchLogin()
  36. },
  37. methods: {
  38. watchLogin() {
  39. const that = this;
  40. uni.getStorage({
  41. key: 'token',
  42. success: function(res) {
  43. let user = that.$jwt(res.data);
  44. that.$set(that, `user`, user)
  45. }
  46. })
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss">
  52. .main {
  53. display: flex;
  54. flex-direction: column;
  55. width: 100vw;
  56. height: 100vh;
  57. .one {
  58. background-color: var(--fFB1Color);
  59. padding: 5vw 2vw;
  60. display: flex;
  61. justify-content: space-between;
  62. .one_1 {
  63. color: #fff;
  64. font-size: 25px;
  65. font-weight: bold;
  66. text:last-child {
  67. padding: 0 0 0 2vw;
  68. font-size: 15px;
  69. }
  70. }
  71. .one_2 {
  72. button {
  73. background: #fff;
  74. color: #ff0000;
  75. border-radius: 25px;
  76. font-size: 14px;
  77. }
  78. }
  79. }
  80. .two {
  81. .two_2 {
  82. text-align: center;
  83. color: #858585;
  84. font-size: 14px;
  85. margin: 5vw 0;
  86. }
  87. }
  88. }
  89. </style>