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

317 lines
6.0 KiB

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