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

137 lines
2.6 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="page__view">
  3. <view class="bg"></view>
  4. <view class="main">
  5. <view class="swiper">
  6. <uv-swiper
  7. :list="bannerList" keyName="image"
  8. indicator
  9. indicatorMode="dot"
  10. indicatorActiveColor="#62BBFF"
  11. indicatorInactiveColor="#FFFFFF"
  12. height="340rpx"
  13. :autoplay="false"
  14. ></uv-swiper>
  15. </view>
  16. <view class="flex flex-column card">
  17. <view class="title">公司风险检测</view>
  18. <image class="icon" src="@/static/image/icon-index.png" mode="widthFix"></image>
  19. <button class="btn" @click="onStartTest">开始测评</button>
  20. </view>
  21. <unfinishTestPopup ref="unfinishTestPopup"></unfinishTestPopup>
  22. <tabber select="home" />
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import tabber from '@/components/base/tabbar.vue'
  28. import unfinishTestPopup from '@/components/home/unfinishTestPopup.vue'
  29. export default {
  30. components: {
  31. tabber,
  32. unfinishTestPopup,
  33. },
  34. data() {
  35. return {
  36. bannerList: [],
  37. }
  38. },
  39. onLoad() {
  40. if(uni.getStorageSync('token')){
  41. this.$store.commit('getUserInfo')
  42. }
  43. this.fetchUnfinish()
  44. this.fetchBanner()
  45. },
  46. methods: {
  47. async fetchBanner() {
  48. try {
  49. this.bannerList = (await this.$fetch('queryBannerList', { type: '0' }))?.records // type:0-首页
  50. } catch (err) {
  51. }
  52. },
  53. async fetchUnfinish() {
  54. // todo: delete
  55. // let data = { id: '001', unfinishCount: 15, current: 18, }
  56. // this.$refs.unfinishTestPopup.open(data)
  57. // todo: fetch
  58. },
  59. onStartTest() {
  60. uni.navigateTo({
  61. url: `/pages_order/test/start`
  62. })
  63. },
  64. },
  65. }
  66. </script>
  67. <style scoped lang="scss">
  68. .bg {
  69. width: 100%;
  70. height: 376rpx;
  71. background: linear-gradient(164deg, #014FA2 30%, #4C8FD6);
  72. }
  73. .main {
  74. position: absolute;
  75. top: 0;
  76. left: 0;
  77. width: 100%;
  78. padding: 174rpx 30rpx 0 30rpx;
  79. box-sizing: border-box;
  80. }
  81. .swiper {
  82. border-radius: 10rpx;
  83. overflow: hidden;
  84. }
  85. .card {
  86. margin-top: 32rpx;
  87. justify-content: space-between;
  88. min-height: 803rpx;
  89. padding: 135rpx 0 55rpx 0;
  90. box-sizing: border-box;
  91. background: linear-gradient(rgba($color: #FCFDFE, $alpha: 0.93), rgba($color: #FCFDFE, $alpha: 0.93) 180rpx, rgba($color: #3381D4, $alpha: 0.43));
  92. border-radius: 25rpx;
  93. border: 3rpx solid #FFFFFF;
  94. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  95. .title {
  96. font-size: 32rpx;
  97. font-weight: 600;
  98. color: #000000;
  99. }
  100. .icon {
  101. margin: 99rpx 0 86rpx;
  102. width: 285rpx;
  103. height: auto;
  104. }
  105. .btn {
  106. padding: 20rpx 212rpx;
  107. font-size: 30rpx;
  108. white-space: nowrap;
  109. color: #FFFFFF;
  110. line-height: 1.4;
  111. background: #014FA2;
  112. border-radius: 42rpx;
  113. }
  114. }
  115. </style>