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

145 lines
3.0 KiB

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