风险测评小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.1 KiB

  1. <template>
  2. <view class="page__view">
  3. <view class="header"></view>
  4. <template v-if="isLogin">
  5. <view class="list">
  6. <view class="list-item" v-for="item in list" :key="item.id">
  7. <reportCard :data="item"></reportCard>
  8. </view>
  9. </view>
  10. </template>
  11. <!-- 用户登陆 -->
  12. <template v-else>
  13. <view class="login">
  14. <button class="btn" @click="$utils.toLogin">立即登录</button>
  15. <view class="tips">暂未登录 请先登录</view>
  16. </view>
  17. </template>
  18. <tabber select="report" />
  19. </view>
  20. </template>
  21. <script>
  22. import mixinsList from '@/mixins/list.js'
  23. import tabber from '@/components/base/tabbar.vue'
  24. import reportCard from '@/components/report/reportCard.vue'
  25. export default {
  26. mixins: [mixinsList],
  27. components: {
  28. tabber,
  29. reportCard,
  30. },
  31. data() {
  32. return {
  33. mixinsListApi: '',
  34. }
  35. },
  36. onLoad() {
  37. if(uni.getStorageSync('token')){
  38. this.$store.commit('getUserInfo')
  39. }
  40. },
  41. computed: {
  42. isLogin() {
  43. return this.userInfo && this.userInfo.id
  44. },
  45. },
  46. onShow() {
  47. this.mixinsListApi = uni.getStorageSync('token') ? 'queryReportList' : ''
  48. this.getData()
  49. },
  50. methods: {
  51. },
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .page__view {
  56. background: #F5F5F5;
  57. }
  58. .header {
  59. width: 100%;
  60. height: calc(var(--status-bar-height) + 120rpx);
  61. background: linear-gradient(164deg, #014FA2, #4C8FD6);
  62. }
  63. .list {
  64. width: 100%;
  65. padding: 29rpx;
  66. box-sizing: border-box;
  67. background: #F5F5F5;
  68. &-item {
  69. & + & {
  70. margin-top: 23rpx;
  71. }
  72. }
  73. }
  74. .login {
  75. margin-top: 307rpx;
  76. width: 100%;
  77. padding: 0 128rpx;
  78. box-sizing: border-box;
  79. .btn {
  80. padding: 16rpx 0;
  81. font-family: PingFang SC;
  82. font-weight: 500;
  83. font-size: 36rpx;
  84. line-height: 1.4;
  85. color: #FFFFFF;
  86. background: #014FA2;
  87. border-radius: 41rpx;
  88. }
  89. .tips {
  90. margin-top: 16rpx;
  91. text-align: center;
  92. font-family: PingFang SC;
  93. font-weight: 400;
  94. font-size: 26rpx;
  95. line-height: 1.4;
  96. color: #A3A3A3;
  97. }
  98. }
  99. </style>