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

272 lines
5.2 KiB

  1. <template>
  2. <!-- <view>基本考核完成</view> -->
  3. <view class="page po-r">
  4. <image src="" mode="" class="mainBg"></image>
  5. <view class="w-100 po-a content">
  6. <stepProgress :step="2"></stepProgress>
  7. <view class="info">
  8. <view class="top">
  9. <view class="flex-rowl top-title">
  10. <up-icon class="icon" name="checkmark-circle-fill" color="#FFBF60" size="34rpx"></up-icon>
  11. <text>基本考核答题已完成</text>
  12. </view>
  13. <view class="flex-rowl top-desc">
  14. <up-icon class="icon" name="error-circle" color="#707070" size="27rpx"></up-icon>
  15. <text>进行培训考核的答题前请认真观看下面的视频和资料</text>
  16. </view>
  17. </view>
  18. <view class="info-box">
  19. <view class="info-box-title">
  20. 平台&服务介绍
  21. </view>
  22. <view class="info-box-content">
  23. <view class="flex-colc info-item"
  24. v-for="item in serviceList"
  25. :key="`service-${item.id}`"
  26. >
  27. <view class="video">
  28. <video
  29. :src="item.video"
  30. play-btn-position="center"
  31. :picture-in-picture-mode="[]"
  32. ></video>
  33. </view>
  34. <text class="desc">{{ item.title }}</text>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="info-box">
  39. <view class="info-box-title">
  40. 服务培训
  41. </view>
  42. <view class="info-box-content">
  43. <view class="flex-colc info-item"
  44. v-for="item in trainList"
  45. :key="`train-${item.id}`"
  46. @click="openPopup(item.title, item.content)"
  47. >
  48. <image :src="configList.pet_service_training.paramValueImage" mode="widthFix"></image>
  49. <text class="desc">{{ item.title }}</text>
  50. </view>
  51. </view>
  52. <up-popup
  53. :show="popupData.show"
  54. round="16rpx"
  55. @close="closePopup"
  56. >
  57. <view class="popup">
  58. <view class="popup-header">
  59. <text class="popup-title">{{ popupData.title }}</text>
  60. </view>
  61. <view class="popup-content">
  62. <up-parse class="size-28" :content="popupData.content"></up-parse>
  63. </view>
  64. </view>
  65. </up-popup>
  66. </view>
  67. <view class="flex-rowc tools">
  68. <view class="flex-rowc btn" @click="toNext">
  69. 进入培训考核
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script setup>
  77. import { ref, reactive } from 'vue'
  78. import { onShow } from '@dcloudio/uni-app'
  79. import { store } from '@/store'
  80. import { getServiceList, getTrainList } from '@/api/examination'
  81. import stepProgress from '../components/stepProgress.vue';
  82. const configList = store.state.system.configList
  83. const toNext = () => {
  84. uni.navigateTo({
  85. url: "/otherPages/authentication/examination/train"
  86. })
  87. }
  88. const serviceList = ref([])
  89. const fetchServiceList = async () => {
  90. try {
  91. serviceList.value = await getServiceList()
  92. } catch (err) {
  93. }
  94. }
  95. const trainList = ref([])
  96. const fetchTrainList = async () => {
  97. try {
  98. trainList.value = await getTrainList()
  99. } catch (err) {
  100. }
  101. }
  102. const popupData = reactive({
  103. show: false,
  104. title: null,
  105. content: null,
  106. })
  107. const openPopup = (title, content) => {
  108. popupData.show = true
  109. popupData.title = title
  110. popupData.content = content
  111. }
  112. const closePopup = () => {
  113. popupData.show = false
  114. }
  115. onShow(() => {
  116. fetchServiceList()
  117. fetchTrainList()
  118. })
  119. </script>
  120. <style scoped lang="scss">
  121. .page {
  122. position: relative;
  123. width: 100vw;
  124. .mainBg {
  125. width: 100vw;
  126. height: 442rpx;
  127. background-image: linear-gradient(to bottom, #FFBF60, #f5f5f5);
  128. }
  129. .content {
  130. top: 0;
  131. left: 0;
  132. padding: 16rpx;
  133. width: 100%;
  134. box-sizing: border-box;
  135. }
  136. }
  137. .info{
  138. margin-top: 22rpx;
  139. box-sizing: border-box;
  140. width: 100%;
  141. height: auto;
  142. background-color: #FFFFFF;
  143. padding: 22rpx 20rpx 38rpx 20rpx;
  144. border-radius: 16rpx;
  145. .top{
  146. width: 100%;
  147. background-color: #FFFCF1;
  148. box-sizing: border-box;
  149. padding: 19rpx 26rpx;
  150. border-radius: 16rpx;
  151. color: #707070;
  152. &-title {
  153. font-size: 28rpx;
  154. .icon {
  155. margin-right: 5rpx;
  156. }
  157. }
  158. &-desc {
  159. margin-top: 22rpx;
  160. font-size: 22rpx;
  161. .icon {
  162. margin-right: 12rpx;
  163. }
  164. }
  165. }
  166. &-box {
  167. margin-top: 30rpx;
  168. &-title {
  169. display: inline-block;
  170. font-size: 30rpx;
  171. &::before {
  172. content: "";
  173. display: inline-block;
  174. width: 9rpx;
  175. height: 33rpx;
  176. background-color: #FFBF60;
  177. margin-right: 7rpx;
  178. border-radius: 5rpx;
  179. }
  180. }
  181. &-content {
  182. display: grid;
  183. grid-template-columns: repeat(2, 1fr);
  184. grid-column-gap: 27rpx;
  185. }
  186. }
  187. &-item {
  188. width: 100%;
  189. margin-top: 30rpx;
  190. .video {
  191. width: 100%;
  192. height: 197rpx;
  193. border-radius: 16rpx;
  194. overflow: hidden;
  195. }
  196. video {
  197. width: 100%;
  198. height: 100%;
  199. }
  200. image {
  201. width: 100%;
  202. }
  203. .desc {
  204. color: #707070;
  205. font-size: 22rpx;
  206. line-height: 40rpx;
  207. }
  208. }
  209. }
  210. .tools {
  211. margin-top: 79rpx;
  212. }
  213. .btn {
  214. font-size: 30rpx;
  215. line-height: 40rpx;
  216. color: #fff;
  217. width: 574rpx;
  218. padding: 27rpx 0;
  219. box-sizing: border-box;
  220. border-radius: 41rpx;
  221. background-color: #FFBF60;
  222. }
  223. .popup {
  224. padding: 28rpx;
  225. &-header {
  226. margin-bottom: 28rpx;
  227. }
  228. &-title {
  229. color: #000000;
  230. font-weight: 700;
  231. font-size: 30rpx;
  232. line-height: 40rpx;
  233. }
  234. }
  235. </style>