1 line
5.7 KiB
Plaintext
1 line
5.7 KiB
Plaintext
{"version":3,"file":"pet-sitter.js","sources":["../../../../../src/pages/certification/pet-sitter.vue","../../../../../uniPage:/cGFnZXMvY2VydGlmaWNhdGlvbi9wZXQtc2l0dGVyLnZ1ZQ"],"sourcesContent":["<route lang=\"json5\" type=\"page\">\n{\n layout: 'default',\n style: {\n navigationBarTitleText: '宠托师资格证申请页面',\n // 设置为白色\n navigationBarBackgroundColor: '#ffffff', // 设置导航栏背景颜色为白色\n },\n}\n</route>\n\n<template>\n <view class=\"bg-gray-100\">\n <view class=\"h-full w-full bg-white p-6\">\n <view class=\"mb-4 flex items-center justify-between\">\n <label for=\"type\" class=\"block\">申请职位</label>\n <picker\n mode=\"selector\"\n :range=\"positionOptions\"\n :value=\"application.typeIndex\"\n @change=\"pickerTypeChange\"\n >\n <view class=\"w-full pl-3 border rounded py-2 w-full\">\n {{ positionOptions[application.typeIndex] || '请选择职位' }}\n </view>\n </picker>\n </view>\n\n <view class=\"mb-4\">\n <label for=\"content\" class=\"block mb-2\">审核内容</label>\n <textarea\n v-model=\"application.content\"\n id=\"content\"\n placeholder=\"请输入审核内容\"\n class=\"w-full p-3 border rounded bg-gray-100\"\n rows=\"5\"\n ></textarea>\n </view>\n\n <view class=\"mb-4\">\n <label for=\"image_url\" class=\"block mb-2\">审核材料</label>\n <view class=\"flex flex-wrap gap-4\">\n <view v-for=\"(image, index) in application.imageUrls\" :key=\"index\" class=\"w-20 h-20\">\n <image :src=\"image\" class=\"w-full h-full object-cover rounded\" />\n </view>\n <button\n v-if=\"application.imageUrls.length < 6\"\n class=\"text-size-3xl ml-0 w-20 h-20 bg-gray-200 flex justify-center items-center rounded\"\n @click=\"chooseImages\"\n >\n +\n </button>\n </view>\n </view>\n\n <button\n class=\"w-full py-3 bg-[#FCCB30] text-black text-lg rounded-full flex items-center justify-center\"\n @click=\"submitApplication\"\n >\n 提交申请\n </button>\n </view>\n </view>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport { httpPost, httpPostMultipart, httpUploadMultipleFiles } from '@/utils/http' // 使用httpPostMultipart方法\nimport { toPath } from '@/utils/commUtils'\n\nconst positionOptions = [\n '宠托师',\n '宠物营养师',\n '宠物陪伴师',\n '宠物心理健康指导员',\n '宠物达人',\n '其他宠物师',\n]\n\nconst application = ref({\n typeIndex: 0, // 存储选择的职位索引\n content: '',\n imageUrls: [], // 存储图片文件路径\n})\n\nconst pickerTypeChange = (e) => {\n application.value.typeIndex = e.detail.value\n}\n\nconst chooseImages = () => {\n uni.chooseImage({\n count: 6 - application.value.imageUrls.length, // 最多选择的图片数量\n success: (res) => {\n application.value.imageUrls.push(...res.tempFilePaths)\n },\n })\n}\n\nconst submitApplication = async () => {\n try {\n // 将本地文件上传到服务器上\n application.value.imageUrls = await httpUploadMultipleFiles(\n '/file/upload',\n application.value.imageUrls,\n )\n application.value.type = positionOptions[application.value.typeIndex]\n\n // 上传文件和表单数据\n const response = await httpPost('/petInfo/apply', application.value)\n console.log(response)\n\n if (response.code == 200) {\n uni.showToast({ title: '申请已提交', icon: 'none' })\n application.value = {\n typeIndex: 0,\n content: '',\n imageUrls: [],\n }\n } else {\n uni.showToast({ title: '提交失败 ' + response.message, icon: 'none' })\n if (response.message.includes('未实名认证')) {\n // 暂停一段时间\n await new Promise((resolve) => setTimeout(resolve, 500))\n // 跳转到实名认证页面\n toPath('/pages/permission/real-name-auth')\n }\n }\n } catch (err) {\n uni.showToast({ title: '提交失败', icon: 'none' })\n }\n}\n</script>\n\n<style scoped>\n/* 调整图片容器和布局 */\n.flex {\n display: flex;\n}\n\n.flex-wrap {\n flex-wrap: wrap;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.w-20 {\n width: 5rem;\n}\n\n.h-20 {\n height: 5rem;\n}\n</style>\n","import MiniProgramPage from 'D:/App/Work/addr/acdr-ui/src/pages/certification/pet-sitter.vue'\nwx.createPage(MiniProgramPage)"],"names":["ref","uni","httpUploadMultipleFiles","httpPost","toPath"],"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