猫妈狗爸伴宠师小程序前端代码
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.

138 lines
2.8 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="po-r">
  3. <image class="bg" src="" mode=""></image>
  4. <view class="po-a content w-100">
  5. <view class="top bg-fff">
  6. <view class="com-title size-32 fw700 flex-rowl">
  7. 您选择的宠物类型
  8. </view>
  9. <image class="mt32" :src="petTypeImg" mode="widthFix"></image>
  10. </view>
  11. <view class="text po-r bg-fff">
  12. <up-parse class="size-28" :content="configList.pet_raising_details.paramValueArea"></up-parse>
  13. <view class="po-a flex-rowl tips">
  14. <image class="ml16" src="@/static/images/ydd/icon1.png" mode="widthFix"></image>
  15. <text class="size-28 ml16">养宠考试说明</text>
  16. </view>
  17. </view>
  18. <view class="text po-r bg-fff mb150">
  19. <up-parse class="size-28" :content="configList.pet_attention_details.paramValueArea"></up-parse>
  20. <view class="po-a flex-rowl tips">
  21. <image class="ml16" src="@/static/images/ydd/icon2.png" mode="widthFix"></image>
  22. <text class="size-28 ml16">考试注意事项</text>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="footer-btn flex-colc">
  27. <view class="size-22 color-777 tips-rest">
  28. <!-- todo -->
  29. 剩余考试机会<text class="highlight">{{ restTimes }}</text>
  30. </view>
  31. <view class="btn" @click="toNext">
  32. 开始考试
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script setup>
  38. import { ref, computed } from 'vue'
  39. import { useStore } from 'vuex'
  40. import { onLoad } from '@dcloudio/uni-app'
  41. const store = useStore()
  42. const petType = ref()
  43. const restTimes = ref()
  44. const configList = computed(() => {
  45. return store.getters.configList
  46. })
  47. const petTypeImg = computed(() => {
  48. return store.getters.petTypeOptions.find(item => item.id == petType.value)?.image
  49. })
  50. onLoad((option) => {
  51. store.dispatch('fetchPetTypeOptions')
  52. petType.value = option.petType
  53. // todo: fetch
  54. restTimes.value = 3
  55. })
  56. const toNext = () => {
  57. uni.navigateTo({
  58. url: "/otherPages/authentication/examination/base"
  59. })
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .mb150 {
  64. margin-bottom: 150rpx;
  65. }
  66. .text {
  67. padding: 50rpx 37rpx;
  68. border-radius: 20rpx;
  69. margin-top: 43px;
  70. }
  71. .tips {
  72. width: 302rpx;
  73. height: 67rpx;
  74. background-color: #FFEBCE;
  75. top: -28rpx;
  76. left: 20rpx;
  77. border-radius: 0 90rpx 0 0;
  78. image {
  79. width: 40rpx;
  80. }
  81. }
  82. .content {
  83. padding: 16rpx;
  84. width: 718rpx;
  85. left: 0;
  86. top: 0;
  87. }
  88. .bg {
  89. width: 750rpx;
  90. height: 432px;
  91. background-image: linear-gradient(to bottom, #FFBF60, #f5f5f5);
  92. }
  93. .top {
  94. padding: 46rpx 17rpx 17rpx;
  95. margin: 16rpx;
  96. border-radius: 20rpx;
  97. image {
  98. width: 198rpx;
  99. }
  100. }
  101. .tips {
  102. &-rest {
  103. color: #707070;
  104. font-size: 22rpx;
  105. margin: 9rpx 0 13rpx 0;
  106. .highlight {
  107. color: #FF8DC6;
  108. }
  109. }
  110. }
  111. .footer-btn {
  112. height: 163rpx;
  113. box-sizing: border-box;
  114. padding-bottom: 18rpx;
  115. }
  116. </style>