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

197 lines
4.8 KiB

  1. <template>
  2. <!-- <view>伴宠师认证</view> -->
  3. <view class="page">
  4. <view class="box">
  5. <view class="content bg-fff">
  6. <view class="group" v-for="(group, gIdx) in list" :key="`group-${gIdx}`">
  7. <view class="label size-22 level" :style="{borderRadius:'10rpx'}">
  8. {{ group.title }}
  9. </view>
  10. <view class="">
  11. <questionCard
  12. v-for="(item, qIdx) in group.children"
  13. :key="`${gIdx}-question-${qIdx}`"
  14. :index="qIdx"
  15. :data="item"
  16. mode="display"
  17. ></questionCard>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="footer-btn flex-colc">
  23. <view class="size-22 color-777 tips-rest">
  24. <!-- todo -->
  25. 剩余考试机会<text class="highlight">{{ restTimes }}</text>
  26. </view>
  27. <view class="btn" @click="onClick">
  28. 重新考试
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup>
  34. import { ref } from 'vue'
  35. import { onShow } from '@dcloudio/uni-app'
  36. import { usePageList } from "@/utils/pageList";
  37. import questionCard from '../components/questionCard.vue';
  38. const { list, getData } = usePageList()
  39. const restTimes = ref()
  40. onShow(() => {
  41. // todo: fetch
  42. restTimes.value = 3
  43. list.value = [
  44. {
  45. title: '选择题',
  46. children: [
  47. {
  48. question: '猫咪每天在地上走路,时不时还会打滚,身上是很不干净的,最好每个星期洗次澡',
  49. options: [
  50. {
  51. label: '对',
  52. value: 0,
  53. },
  54. {
  55. label: '错',
  56. value: 1,
  57. },
  58. ],
  59. answer: 0,
  60. value: 1,
  61. },
  62. {
  63. question: '当狗狗出现乱拉乱尿或者捣乱拆家等反映时,您会如何处理?',
  64. options: [
  65. {
  66. label: '暴力制止,根据情况是否严重来判断下手轻重,让狗狗知道这样做会受到惩罚',
  67. value: 0,
  68. },
  69. {
  70. label: '奖罚分明,制止后耐心引导,直到狗狗做出正确的行为,并立马给出奖励',
  71. value: 1,
  72. },
  73. {
  74. label: '狗狗也不是故意的,也不会造成什么很大的影响,默默打扫好就算了吧',
  75. value: 2,
  76. },
  77. ],
  78. answer: 1,
  79. value: 2,
  80. },
  81. {
  82. question: '狗狗和猫咪一样是肉食性动物,最好可以纯肉喂养,对狗狗的身心健康有很大好处',
  83. options: [
  84. {
  85. label: '对',
  86. value: 0,
  87. },
  88. {
  89. label: '错',
  90. value: 1,
  91. },
  92. ],
  93. answer: 1,
  94. value: 0,
  95. },
  96. ]
  97. },
  98. {
  99. title: '主观题',
  100. children: [
  101. {
  102. question: '喂养服务流程:如果您收到一笔喂养猫咪的订单,备注猫咪性格活泼,请问您会如何进行服务?请详细描述和上一题服务过程的不同之处(若服务宠物不包含猫咪可回答“略”)',
  103. reason: '字数低于700字,不予合格',
  104. value: '猫咪性格怕生,我耐心的与猫咪接触,和它玩耍 先建立良好的关系,再进行喂养。',
  105. },
  106. {
  107. question: '喂养服务流程:如果您收到一笔喂养猫咪的订单,备注猫咪性格活泼,请问您会如何进行服务?请详细描述和上一题服务过程的不同之处(若服务宠物不包含猫咪可回答“略”)',
  108. reason: '字数低于700字,不予合格',
  109. value: '猫咪性格怕生,我耐心的与猫咪接触,和它玩耍 先建立良好的关系,再进行喂养。',
  110. },
  111. {
  112. question: '喂养服务流程:如果您收到一笔喂养猫咪的订单,备注猫咪性格活泼,请问您会如何进行服务?请详细描述和上一题服务过程的不同之处(若服务宠物不包含猫咪可回答“略”)',
  113. reason: '字数低于700字,不予合格',
  114. value: '猫咪性格怕生,我耐心的与猫咪接触,和它玩耍 先建立良好的关系,再进行喂养。',
  115. },
  116. ]
  117. }
  118. ]
  119. })
  120. const onClick = () => {
  121. uni.reLaunch({
  122. url: "/otherPages/authentication/examination/start"
  123. // todo: check
  124. // url: "/otherPages/authentication/list/index"
  125. })
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. $bar-height: 163rpx;
  130. .page {
  131. padding-bottom: $bar-height;
  132. }
  133. .box {
  134. // background-image: linear-gradient(to bottom, #ffbf60, #f2f2f2);
  135. padding: 16rpx;
  136. .step {
  137. width: 720rpx;
  138. height: 32rpx;
  139. border-radius: 32rpx;
  140. background-color: #D9D9D9;
  141. .in {
  142. width: 50%;
  143. height: 32rpx;
  144. background-color: #ffbf60;
  145. border-radius: 32rpx;
  146. }
  147. }
  148. }
  149. .content {
  150. border-radius: 20rpx;
  151. padding: 15rpx 20rpx;
  152. .label {
  153. width: 86rpx;
  154. padding: 5rpx 15rpx;
  155. color: #fff;
  156. background-color: #FFBF60;
  157. justify-content: center;
  158. }
  159. }
  160. .group + .group {
  161. margin-top: 68rpx;
  162. }
  163. .level {
  164. display: flex;
  165. }
  166. .footer-btn {
  167. height: $bar-height;
  168. }
  169. .tips {
  170. &-rest {
  171. color: #707070;
  172. font-size: 22rpx;
  173. margin: 9rpx 0 13rpx 0;
  174. .highlight {
  175. color: #FF8DC6;
  176. }
  177. }
  178. }
  179. </style>