1 line
7.2 KiB
Plaintext
1 line
7.2 KiB
Plaintext
{"version":3,"file":"index.js","sources":["../../../../../src/pages/certification/index.vue","../../../../../uniPage:/cGFnZXMvY2VydGlmaWNhdGlvbi9pbmRleC52dWU"],"sourcesContent":["<route lang=\"json5\" type=\"page\">\n{\n layout: \"default\",\n style: {\n navigationBarTitleText: \"宠托师认证页面\",\n navigationStyle: \"custom\",\n },\n}\n</route>\n\n<template>\n <!-- 返回按钮 -->\n <TopBar />\n <image\n class=\"absolute w-full h-full\"\n :src=\"'/static/certification/certification_bg.png'\"\n mode=\"aspectFill\"\n ></image>\n <!-- 如果没有申请就显示这里,申请显示申请状态 -->\n <view\n v-if=\"!applyState || user.userInfo.isPetNursery\"\n class=\"flex justify-center items-center h-screen bg-gray-100 pt-10\"\n >\n <view class=\"text-center flex gap-5 flex-col\" v-if=\"!user.userInfo.isPetNursery\">\n <text class=\"text-xl text-gray-700 mb-4\">您还未认证,加入我们成为宠托师!</text>\n <image\n class=\"w-full h-[90px]\"\n :src=\"imgUrl('@/static/certification/wy.png')\"\n mode=\"scaleToFill\"\n @click=\"goToApplication\"\n />\n <image\n class=\"w-full h-[90px]\"\n :src=\"imgUrl('@/static/certification/wyl.png')\"\n mode=\"scaleToFill\"\n @click=\"goToApplication\"\n />\n <image\n class=\"w-full h-[90px]\"\n :src=\"imgUrl('@/static/certification/mr.png')\"\n mode=\"scaleToFill\"\n @click=\"goToApplication\"\n />\n </view>\n\n <view\n class=\"text-center bg-white rounded absolute z-1 w-[80vw] h-[80vh] top-2/6\"\n v-else\n >\n <image\n class=\"absolute inset-0 w-full h-full object-cover z-[-1]\"\n :src=\"imgUrl('@/static/certification/cert.png')\"\n mode=\"widthFix\"\n />\n <text\n class=\"text-[20px] mb-4 absolute top-[24%] left-[50%] text-[#5D392C] font-700 transform translate-x-[-50%] translate-y-[-50%]\"\n >\n 您的宠托师证书\n </text>\n <text class=\"absolute top-[32%] left-[50%] translate-x-[-50%]\">证书详情</text>\n <view\n class=\"flex flex-col items-start z-2 absolute top-[38%] left-[21%] text-[#7E5B2E]\"\n >\n <text class=\"mb-2\">证书编号: {{ certificate.cardId }}</text>\n <text class=\"mb-2\">证书类型: {{ certificate.type || \"宠托师\" }}</text>\n <text class=\"mb-2\">服务次数: {{ certificate.serviceNumber }}</text>\n <text class=\"mb-2\">创建时间: {{ formatDate(certificate.createTime) }}</text>\n <text class=\"mb-2\">过期时间: {{ formatDate(certificate.expiredTime) }}</text>\n <text class=\"mb-2\">最后更新: {{ formatDate(certificate.updateTime) }}</text>\n </view>\n </view>\n </view>\n <view v-else>\n <view\n class=\"z-999 absolute top-[48%] left-[50%] transform-translate-x-[-50%] font-800 text-size-2xl\"\n >\n {{ applyStateData }}\n </view>\n </view>\n <wd-popup\n :close-on-click-modal=\"false\"\n v-model=\"show\"\n position=\"center\"\n :style=\"{ width: '100%' }\"\n >\n <CertPopup @handleJoin=\"handleJoin\" @handleReturn=\"handleReturn\" />\n </wd-popup>\n</template>\n\n<script setup>\nimport TopBar from \"@/components/TopBar.vue\";\nimport { useUserStore } from \"@/store\";\nimport { httpGet } from \"@/utils/http\";\nimport { ref } from \"vue\";\nimport CertPopup from \"./components/certPopup.vue\";\nimport { imgUrl } from \"@/utils/commUtils\";\nimport { getUserInfo } from \"@/service/userService\";\n\nconst user = useUserStore();\nconst certificate = ref({}); // 证书信息\nconst show = ref(!user.userInfo.isPetNursery && false);\nconst applyState = ref(false);\nconst applyStateData = ref(\"\");\n\nconst handleReturn = () => {\n show.value = false;\n uni.navigateBack();\n};\n\nconst handleJoin = () => {\n show.value = false;\n};\n\n// 获取认证状态和证书信息\nconst getCertificationStatus = async () => {\n const res = await httpGet(\"/petInfo/getExpertInfo\");\n // 说明有宠托师证书\n if (res.code == 200) {\n certificate.value = res.data;\n if (!user.userInfo.isPetNursery) {\n const userInfo = await getUserInfo();\n }\n }\n // 如果返回值不是两百就表示该角色没有宠托师信息,获取申请状态\n else {\n const stateRes = await httpGet(\"/petInfo/getApplyState\");\n if (stateRes.code == 200) {\n // 这里是显示申请进度的地方\n applyState.value = true;\n applyStateData.value = stateRes.data;\n if (stateRes.data == \"已通过\") {\n // 这里是显示证书的地方\n // 获取用户信息,判断是否是宠托师,如果是就显示证书,否则就显示申请状态\n const userInfo = await getUserInfo();\n if (userInfo.isPetNursery) {\n // 证书信息\n const epRes = await httpGet(\"/petInfo/getExpertInfo\");\n if (epRes.code == 200) {\n certificate.value = epRes.data;\n }\n }\n }\n } else {\n // 这里跳转到申请界面, 好吧这里就是申请界面了,啥都不用干\n }\n }\n};\n\n// 格式化日期\nconst formatDate = (dateStr) => {\n const date = new Date(dateStr);\n return date.toLocaleDateString();\n};\n\n// 页面加载时获取认证状态和证书信息\nonLoad(async () => {\n await getCertificationStatus();\n});\n\n// 跳转到申请页面\nconst goToApplication = () => {\n uni.navigateTo({\n url: \"/pages/certification/pet-sitter\",\n });\n};\n</script>\n\n<style scoped>\n/* 证书样式 */\n.flex {\n display: flex;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.items-start {\n align-items: flex-start;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.bg-white {\n background-color: white;\n}\n\n.rounded {\n border-radius: 0.5rem;\n}\n\n.shadow {\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n}\n\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n</style>\n","import MiniProgramPage from 'D:/App/Work/addr/acdr-ui/src/pages/certification/index.vue'\nwx.createPage(MiniProgramPage)"],"names":["useUserStore","ref","uni","httpGet","getUserInfo","onLoad"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQQ,MAAA,SAAA,MAAA;AAAA,MAAA,YAAA,MAAA;;;;AAAA,UAAA,OAAAA,WAAA,aAAA;AAAA,UAAA,cAAAC,cAAAA,IAAA,CAAA,CAAA;AAAA,UAAA,OAAAA,cAAA,IAAA,CAAA,KAAA,SAAA,gBAAA,KAAA;AAAA,UAAA,aAAAA,cAAAA,IAA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