mypoint.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view style="position: relative;">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view class="head">
  7. <view class="show-point">
  8. <p style="font-size: 36rpx">当前积分</p>
  9. <p style="margin-top: 20rpx;font-size: 36rpx;font-weight: 600;">0</p>
  10. </view>
  11. </view>
  12. <view class="content">
  13. <view class="point-card">
  14. <view class="point-card-left">
  15. <p>成团新用户</p>
  16. <p style="margin-top: 20rpx;font-size: 32rpx;">2022-7-12 14:00</p>
  17. </view>
  18. <view class="point-card-right">
  19. <p>+100</p>
  20. </view>
  21. </view>
  22. <view class="point-card">
  23. <view class="point-card-left">
  24. <p>成团新用户</p>
  25. <p style="margin-top: 20rpx;font-size: 32rpx;">2022-7-12 14:00</p>
  26. </view>
  27. <view class="point-card-right">
  28. <p>+100</p>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import mvBar from "@/components/mys_navBar/mysNavBar";
  36. import {
  37. fansview
  38. } from '@/components/utils.js';
  39. export default {
  40. components: {
  41. mvBar,
  42. },
  43. data() {
  44. return {
  45. navH: getApp().globalData.navHeight,
  46. mysNavConfig: {
  47. /* 开启单页显示首页图标 */
  48. isHome: true,
  49. /* 固定导航 */
  50. navFixed: true,
  51. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  52. navTitle: {
  53. text: "创作者积分明细",
  54. color: "",
  55. fontSize: "32rpx", // px upx rpx
  56. fontWeight: "normal", // 100 - 700
  57. },
  58. btnType: "type2",
  59. onLeftClick: "/pages/mycenter/mycenter",
  60. /* type2 按钮 */
  61. type2Config: {
  62. // 左图标
  63. leftPath: "/static/img/png2.png",
  64. // 右图标
  65. rightPath: "/static/img/png4.png",
  66. // 圆角
  67. radius: "40rpx",
  68. },
  69. },
  70. }
  71. },
  72. async onLoad(options) {
  73. // 判断登录
  74. await this.isLogin();
  75. if (this.token === '') {
  76. uni.showModal({
  77. content: '请先登录',
  78. success: function(res) {
  79. if (res.confirm) {
  80. uni.navigateTo({
  81. url: '/pages/login/login'
  82. });
  83. } else if (res.cancel) {
  84. uni.navigateBack();
  85. }
  86. }
  87. });
  88. }
  89. },
  90. methods: {
  91. // 判断登陆是否过期
  92. isLogin() {
  93. return this.$https.get('/youngee/c/t/g/is-login')
  94. .then(res => {
  95. if (res.data.code === 403) {
  96. // 登陆已失效
  97. this.token = ""
  98. uni.clearStorage();
  99. } else {
  100. this.token = uni.getStorageSync('token')
  101. }
  102. })
  103. },
  104. }
  105. }
  106. </script>
  107. <style>
  108. p {
  109. font-size: 32rpx;
  110. }
  111. .head {
  112. margin: 10rpx 3%;
  113. border-radius: 15rpx;
  114. background-color: #f0d232;
  115. height: 200rpx;
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. }
  120. .show-point {
  121. display: flex;
  122. flex-direction: column;
  123. align-items: center;
  124. }
  125. .content {
  126. margin: 10rpx 3%;
  127. }
  128. .point-card {
  129. padding: 20rpx 3%;
  130. display: flex;
  131. justify-content: space-between;
  132. align-items: center;
  133. }
  134. .point-card-left {
  135. display: flex;
  136. flex-direction: column;
  137. justify-content: start;
  138. }
  139. .point-card-right p {
  140. color: #f0d232;
  141. font-weight: 600;
  142. }
  143. </style>