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

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