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

386 lines
7.6 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. <template>
  2. <view class="containers po-r">
  3. <image src="" mode="" class="mainBg"></image>
  4. <view class="w-100 po-a content">
  5. <view class="flex-rowl">
  6. <image src="@/static/images/ydd/logo.png" mode="" class="logo"></image>
  7. <view class="size-36 fw700 color-fff">
  8. 伴宠师认证
  9. </view>
  10. </view>
  11. <view class="renz flex-rowl mt10">
  12. <text class="size-28 color-fff mr24">查看认证要求工作详情服务酬劳扥信息</text>
  13. <image src="@/static/images/ydd/more.png" mode=""></image>
  14. </view>
  15. <view class="neir bg-fff mt24">
  16. <view class="steps flex-between">
  17. <view class="step flex-colc">
  18. <view class="num mb6 flex-rowc size-26 color-fff">
  19. 1
  20. </view>
  21. <text class="size-22">基本考核</text>
  22. </view>
  23. <view class="line"></view>
  24. <view class="step flex-colc">
  25. <view class="num mb6 flex-rowc size-26 color-fff">
  26. 2
  27. </view>
  28. <text class="size-22">培训考核</text>
  29. </view>
  30. <view class="line"></view>
  31. <view class="step flex-colc">
  32. <view class="num mb6 flex-rowc size-26 color-fff">
  33. 3
  34. </view>
  35. <text class="size-22">最终准备</text>
  36. </view>
  37. </view>
  38. <view class="color-ffb size-22 mt32">
  39. 为保证喂养员认证顺利进行请认真填写并确保信息的真实性
  40. </view>
  41. </view>
  42. <view class="bg-fff mt22 form ">
  43. <view class="title fw700 size-30 flex-rowl">
  44. 基本信息
  45. </view>
  46. <dForm ref="formRef" :list="state.list" labelWidth="220rpx" :isFooter="false" @input="onFormInput"></dForm>
  47. </view>
  48. <view class="license__view" v-if="form.license">
  49. <view class="license">
  50. <up-checkbox-group
  51. v-model="licenseData.selected"
  52. shape="circle"
  53. activeColor="#FFBF60"
  54. labelColor="#000000"
  55. labelSize="26rpx"
  56. >
  57. <view class="license-options">
  58. <up-checkbox
  59. v-for="item in LICENSE_OPTIONS"
  60. :key="`license-${item.value}`"
  61. :label="item.label"
  62. :name="item.value"
  63. >
  64. </up-checkbox>
  65. </view>
  66. </up-checkbox-group>
  67. <view class="tips">
  68. 温馨提示上传专业执照将大大增加通过概率且会快速晋升为高级伴宠师获取更高报酬
  69. </view>
  70. <up-upload
  71. :fileList="licenseData.fileList"
  72. @afterRead="afterRead"
  73. @delete="deletePic"
  74. multiple
  75. >
  76. <image src="../static/list/icon-upload.png" style="width: 144rpx;height: 144rpx;"></image>
  77. </up-upload>
  78. </view>
  79. </view>
  80. <view class="bg-fff mt22 form bt120">
  81. <view class="title fw700 size-30 flex-rowl">
  82. 个人宠物类型
  83. </view>
  84. <view class="flex-between wrap mt32">
  85. <view class="type">
  86. <image src="../static/list/cat.png" mode="widthFix" @click="onSelectPet('cat')"></image>
  87. <image class="active" v-if="petType === 'cat'" src="../static/list/cat-active.png" mode="widthFix"></image>
  88. </view>
  89. <view class="type">
  90. <image src="../static/list/dog.png" mode="widthFix" @click="onSelectPet('dog')"></image>
  91. <image class="active" v-if="petType === 'dog'" src="../static/list/dog-active.png" mode="widthFix"></image>
  92. </view>
  93. <view class="type">
  94. <image src="../static/list/special-pet.png" mode="widthFix" @click="onSelectPet('special-pet')"></image>
  95. <image class="active" v-if="petType === 'special-pet'" src="../static/list/special-pet-active.png" mode="widthFix"></image>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="footer-btn" @click="toNext">
  100. <view class="btn">
  101. 下一步
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </template>
  107. <script setup>
  108. import { ref, reactive } from "vue";
  109. import dForm from "@/components/dForm/index.vue"
  110. const state = reactive({
  111. list: [{
  112. type: "input",
  113. label: "姓名",
  114. key: "name",
  115. placeholder: "请输入您的真实姓名",
  116. },
  117. {
  118. type: "input",
  119. label: "身份证号",
  120. key: "idCard",
  121. placeholder: "请输入您的真实身份证号",
  122. },
  123. {
  124. type: "radio",
  125. label: "性别",
  126. key: "sex",
  127. options: [{
  128. name: "男",
  129. value: 0,
  130. },
  131. {
  132. name: "女",
  133. value: 1,
  134. }
  135. ]
  136. },
  137. {
  138. type: "input",
  139. label: "年龄",
  140. key: "gender",
  141. placeholder: "请输入您的年龄",
  142. },
  143. {
  144. type: "input",
  145. label: "养宠经验",
  146. key: "shij",
  147. placeholder: "请输入您的养宠年限",
  148. unit: "年"
  149. },
  150. {
  151. type: "radio",
  152. label: "是否有专业执照",
  153. key: "license",
  154. placeholder: "请选择",
  155. options: [{
  156. name: "是",
  157. value: 1,
  158. }, {
  159. name: "没有",
  160. value: 0,
  161. }]
  162. },
  163. ]
  164. })
  165. const formRef = ref()
  166. const form = ref({})
  167. const onFormInput = (e) => {
  168. form.value = e
  169. }
  170. const licenseData = reactive({
  171. selected: [],
  172. fileList: []
  173. })
  174. const LICENSE_OPTIONS = [
  175. {
  176. label: '兽医职称专业执照',
  177. value: 0,
  178. },
  179. {
  180. label: '宠物美容洗护专业执照',
  181. value: 1,
  182. },
  183. {
  184. label: '宠物康复护理专业执照',
  185. value: 2,
  186. },
  187. {
  188. label: '宠物膳食管理专业执照',
  189. value: 3,
  190. },
  191. {
  192. label: '其他专业执照',
  193. value: 4,
  194. },
  195. ]
  196. const afterRead = () => {
  197. // todo
  198. }
  199. const deletePic = (event) => {
  200. licenseData.fileList.splice(event.index, 1);
  201. };
  202. const petType = ref()
  203. const onSelectPet = (type) => {
  204. petType.value = type
  205. }
  206. const toNext = () => {
  207. // todo: save data
  208. const data = {
  209. ...form.value,
  210. ...licenseData,
  211. petType: petType.value,
  212. }
  213. console.log('--data', data)
  214. uni.navigateTo({
  215. url: "/otherPages/authentication/examination/start"
  216. })
  217. }
  218. </script>
  219. <style lang="scss" scoped>
  220. .bt120 {
  221. margin-bottom: 120rpx;
  222. width: 716rpx;
  223. box-sizing: border-box;
  224. }
  225. .footer-btn {
  226. width: 100vw;
  227. height: 144rpx;
  228. background-color: #fff;
  229. display: flex;
  230. justify-content: center;
  231. position: fixed;
  232. bottom: 0;
  233. left: 0;
  234. align-items: center;
  235. .btn {
  236. font-size: 30rpx;
  237. color: #fff;
  238. display: flex;
  239. justify-content: center;
  240. align-items: center;
  241. width: 574rpx;
  242. height: 94rpx;
  243. border-radius: 94rpx;
  244. background-color: #FFBF60;
  245. }
  246. }
  247. .type {
  248. width: 190rpx;
  249. margin-bottom: 74rpx;
  250. position: relative;
  251. image {
  252. width: 100%;
  253. }
  254. .active {
  255. position: absolute;
  256. top: 0;
  257. left: 0;
  258. }
  259. }
  260. .form {
  261. padding: 40rpx 32rpx;
  262. box-sizing: border-box;
  263. width: 716rpx;
  264. }
  265. .title {
  266. &::before {
  267. content: "";
  268. display: block;
  269. width: 9rpx;
  270. height: 33rpx;
  271. background-color: #FFBF60;
  272. margin-right: 7rpx;
  273. }
  274. }
  275. .mb6 {
  276. margin-bottom: 6rpx;
  277. }
  278. .containers {
  279. .neir {
  280. padding: 47rpx 27rpx 36rpx 27rpx;
  281. border-radius: 16rpx;
  282. box-sizing: border-box;
  283. width: 716rpx;
  284. .steps {
  285. .line {
  286. width: 163rpx;
  287. height: 3rpx;
  288. background-color: #BDBDBD;
  289. margin-bottom: 30rpx;
  290. }
  291. .num {
  292. width: 50rpx;
  293. height: 50rpx;
  294. background-color: #FFBF60;
  295. border-radius: 50%;
  296. }
  297. }
  298. }
  299. .mainBg {
  300. width: 100vw;
  301. height: 442rpx;
  302. background-image: linear-gradient(to bottom, #FFBF60, #f5f5f5);
  303. }
  304. .content {
  305. top: 0;
  306. left: 0;
  307. padding: 16rpx;
  308. .logo {
  309. width: 194rpx;
  310. height: 70rpx;
  311. }
  312. .renz {
  313. image {
  314. width: 26rpx;
  315. height: 26rpx;
  316. }
  317. }
  318. }
  319. }
  320. .license__view {
  321. width: 716rpx;
  322. padding-bottom: 40rpx;
  323. box-sizing: border-box;
  324. background-color: #FFFFFF;
  325. .license {
  326. width: 100%;
  327. padding: 13rpx 16rpx;
  328. box-sizing: border-box;
  329. background-color: #FFFCF1;
  330. &-options {
  331. display: grid;
  332. grid-template-columns: repeat(2, 1fr);
  333. }
  334. }
  335. .tips {
  336. margin: 22rpx 0 24rpx 0;
  337. color: #FFBF60;
  338. font-size: 22rpx;
  339. width: 100%;
  340. word-break: break-all;
  341. }
  342. }
  343. </style>