1 line
12 KiB
Plaintext
1 line
12 KiB
Plaintext
|
{"version":3,"file":"index.js","sources":["../../../../../src/pages/my/index.vue","../../../../../uniPage:/cGFnZXMvbXkvaW5kZXgudnVl"],"sourcesContent":["<route lang=\"json5\">\n{\n style: {\n navigationBarTitleText: '我的页面',\n navigationStyle: 'custom',\n },\n needLogin: true,\n}\n</route>\n\n<template>\n <view class=\"my-page-container\">\n <view\n class=\"background\"\n :style=\"{ backgroundImage: `url(${imgUrl('@/static/my/my-bg.png')})` }\"\n ></view>\n <image :src=\"imgUrl('@/static/my/cat-dog.png')\" class=\"cat-dog\"></image>\n <view class=\"bg\"></view>\n <view class=\"my-avatar\">\n <wd-img\n :width=\"100\"\n :height=\"100\"\n round\n mode=\"aspectFill\"\n :src=\"userInfo.avatar == '' ? imgUrl('@/static/my/avatar.jpg') : imgUrl(userInfo.avatar)\"\n ></wd-img>\n <view class=\"info\">\n <view class=\"name\">{{ userInfo.nickname }}</view>\n <view class=\"description\">爱猫猫,爱狗狗</view>\n </view>\n </view>\n\n <view class=\"stats-container card\">\n <view class=\"stat-item\" v-for=\"(item, index) in stats\" :key=\"index\">\n <view class=\"stat-number\">{{ item.number }}</view>\n <view class=\"stat-label\">{{ item.label }}</view>\n </view>\n </view>\n\n <view class=\"services-container card\">\n <view\n class=\"service-item\"\n v-for=\"(service, index) in services\"\n @click=\"toPath(service.path)\"\n :key=\"index\"\n >\n <view class=\"service-box\">\n <wd-img\n v-if=\"service.label == '我的服务'\"\n :width=\"42\"\n :height=\"40\"\n :src=\"imgUrl(service.icon)\"\n class=\"service-icon\"\n />\n <wd-img\n v-else\n :width=\"38\"\n :height=\"40\"\n :src=\"imgUrl(service.icon)\"\n class=\"service-icon\"\n />\n </view>\n <view class=\"service-label\">{{ service.label }}</view>\n </view>\n </view>\n\n <!-- 判断该用户是否为宠托师 -->\n <view v-if=\"userInfo.isPetNursery\" class=\"services-container card\">\n <button class=\"w-full bg-[#ffc107]\" @click=\"toPath('/pages/order/take')\">接单页面</button>\n </view>\n\n <view class=\"pets-container card\">\n <view class=\"pets-title\">我的宠物</view>\n <view class=\"pets-list scroll-x overflow-x-auto\" scroll-x>\n <view class=\"pet-item\" v-for=\"(pet, index) in pets\" @click=\"editPet(pet)\" :key=\"index\">\n <wd-img :width=\"60\" :height=\"60\" round :src=\"pet.icon\" class=\"pet-avatar\" />\n <view class=\"pet-label\">{{ pet.name }}</view>\n </view>\n <view class=\"pet-item add-pet\" @click=\"toPath('/pages/pet/pet-add-page')\">\n <w-avatar :size=\"80\" class=\"pet-avatar add-avatar\">\n <view class=\"add-icon\">+</view>\n </w-avatar>\n <view class=\"pet-label\">添加</view>\n </view>\n </view>\n </view>\n\n <view class=\"settings-container card\">\n <view class=\"list\">\n <view\n class=\"list-item\"\n v-for=\"(item, index) in items\"\n @click=\"toPath(item.to)\"\n :key=\"index\"\n >\n <view class=\"icon\">\n <image :src=\"imgUrl(item.icon)\" class=\"item-icon\" />\n </view>\n <view class=\"label\">{{ item.label }}</view>\n <view class=\"arrow\">\n <wd-icon name=\"arrow-right\"></wd-icon>\n </view>\n </view>\n </view>\n </view>\n </view>\n\n <!-- 引入自定义Tabbar文件 -->\n <Tabbar />\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport { useUserStore } from '@/store/user'\nimport { baseUrl, imgUrl, toast } from '@/utils/commUtils'\nimport { httpGet } from '@/utils/http' // 假设你已经封装好了这个方法\nimport Tabbar from '@/components/Tabbar.vue'\n\nconst userStore = useUserStore()\n\nconst userInfo
|