1 line
6.4 KiB
Plaintext
1 line
6.4 KiB
Plaintext
|
{"version":3,"file":"pet-detail-page.js","sources":["../../../../../src/pages/pet/pet-detail-page.vue","../../../../../uniPage:/cGFnZXMvcGV0L3BldC1kZXRhaWwtcGFnZS52dWU"],"sourcesContent":["<route lang=\"json5\">\n{\n style: {\n navigationBarTitleText: '宠物详情',\n navigationStyle: 'custom',\n },\n}\n</route>\n\n<template>\n <TopBar />\n <image\n :src=\"imgUrl('@/static/push/bg.png')\"\n class=\"object-cover absolute top-[-80px] left-0 w-full z-[-1]\"\n mode=\"widthFix\"\n ></image>\n <view class=\"w-full h-40\"></view>\n <view class=\"w-full bg-[#ffff]\">\n <!-- 顶部背景和头像 -->\n <view class=\"relative\">\n <view class=\"absolute left-4 bottom-[-20px] z-10\">\n <image\n :src=\"petInfo.profileUrl ? imgUrl(petInfo.profileUrl) : imgUrl('@/static/icons/cat.png')\"\n class=\"w-20 h-20 object-cover rounded-full border-4 border-white\"\n ></image>\n </view>\n <!-- 圆角遮罩 -->\n <view\n class=\"absolute bottom-[-5px] left-0 w-full h-6 bg-white rounded-tl-xl rounded-tr-xl z-0\"\n ></view>\n </view>\n\n <!-- 数据统计 -->\n <view class=\"flex justify-around bg-white pt-4 rounded-lg\">\n <view class=\"text-center\">\n <text class=\"text-lg\">0</text>\n <text class=\"block text-gray-600\">粉丝</text>\n </view>\n <view class=\"text-center\">\n <text class=\"text-lg\">0</text>\n <text class=\"block text-gray-600\">关注度</text>\n </view>\n <view class=\"text-center\">\n <text class=\"text-lg\">0</text>\n <text class=\"block text-gray-600\">获得赞</text>\n </view>\n </view>\n\n <view class=\"pl-4 pr-4\">\n <!-- 宠物信息 -->\n <view class=\"bg-white p-4 rounded-lg\">\n <text class=\"text-xl\">{{ petInfo.name || 'cat' }}</text>\n <view class=\"flex items-center mt-2\">\n <wd-icon name=\"calendar\" size=\"20\" class=\"text-[#ffc107]\"></wd-icon>\n <text class=\"ml-2 text-gray-600\">\n 距离生日还有{{ daysUntilBirthday(petInfo.age) }}天哦\n </text>\n </view>\n </view>\n\n <!-- 操作按钮 -->\n <view class=\"flex justify-between py-4\">\n <button\n @click=\"editPet(petInfo.id)\"\n class=\"bg-[#F0985A] text-white rounded-lg py-2 px-6 h-9 flex-grow-[8] flex items-center justify-center\"\n >\n 修改信息\n </button>\n <button\n @click=\"share\"\n class=\"bg-[#ffc107] text-white rounded-lg py-2 px-6 h-9 flex-grow-[2] flex items-center justify-center ml-4\"\n >\n 分享\n </button>\n </view>\n\n <!-- 标签栏 -->\n <view class=\"flex justify-around bg-white py-2 rounded-lg\">\n <view\n v-for=\"tab in tabs\"\n :key=\"tab\"\n :class=\"[\n 'text-lg px-4',\n activeTab === tab\n ? 'text-[#ffc107] relative border-b-2 border-[#ffc107]'\n : 'text-gray-600',\n ]\"\n @click=\"activeTab = tab\"\n >\n {{ tab }}\n <view v-if=\"activeTab === tab\" class=\"active-underline\"></view>\n </view>\n </view>\n\n <!-- 内容提示 -->\n <EmptyState type=\"default\" message=\"暂无内容\" />\n </view>\n </view>\n</template>\n\n<script setup>\nimport EmptyState from '@/components/EmptyState.vue'\nimport TopBar from '@/components/TopBar.vue'\nimport { imgUrl, toast, toPath } from '@/utils/commUtils'\nimport { httpGet } from '@/utils/http'\nimport { ref } from 'vue'\n\nconst tabs = ref(['全部', '心情', '养护', '清洁'])\nconst activeTab = ref('全部')\nconst petInfo = ref({})\n\nconst getPetId = async (id) => {\n try {\n const res = await httpGet('/petInfo/find_by_id/' + id)\n if (res.code === 200) {\n petInfo.value = res.data\n console.log(petInfo.value)\n } else {\n toast(res.data.message)\n }\n } catch (e) {\n console.log(e)\n }\n}\n\nconst editPet = (id) => {\n
|