风险测评小程序前端代码仓库
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.

114 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: 'queryReportList',
  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. mixinsListApi() {
  46. if(uni.getStorageSync('token')){
  47. return 'queryReportList'
  48. }
  49. return ''
  50. }
  51. },
  52. methods: {
  53. },
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .page__view {
  58. background: #F5F5F5;
  59. }
  60. .header {
  61. width: 100%;
  62. height: calc(var(--status-bar-height) + 120rpx);
  63. background: linear-gradient(164deg, #014FA2, #4C8FD6);
  64. }
  65. .list {
  66. width: 100%;
  67. padding: 29rpx;
  68. box-sizing: border-box;
  69. background: #F5F5F5;
  70. &-item {
  71. & + & {
  72. margin-top: 23rpx;
  73. }
  74. }
  75. }
  76. .login {
  77. margin-top: 307rpx;
  78. width: 100%;
  79. padding: 0 128rpx;
  80. box-sizing: border-box;
  81. .btn {
  82. padding: 16rpx 0;
  83. font-family: PingFang SC;
  84. font-weight: 500;
  85. font-size: 36rpx;
  86. line-height: 1.4;
  87. color: #FFFFFF;
  88. background: #014FA2;
  89. border-radius: 41rpx;
  90. }
  91. .tips {
  92. margin-top: 16rpx;
  93. text-align: center;
  94. font-family: PingFang SC;
  95. font-weight: 400;
  96. font-size: 26rpx;
  97. line-height: 1.4;
  98. color: #A3A3A3;
  99. }
  100. }
  101. </style>