acdr-ui/dist/dev/mp-weixin/pages/my/index.js.map

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 = userStore.userInfo\n\nconst stats = ref([\n { number: 0, label: '粉丝' },\n { number: 0, label: '关注' },\n { number: 0, label: '收藏' },\n { number: 0, label: '获赞' },\n])\n\nconst services = [\n { icon: '@/static/my/order.png', label: '我的订单', path: '/pages/order/index' },\n { icon: '@/static/my/pet.png', label: '我的服务', path: '/pages/service/my-service' },\n { icon: '@/static/my/wash.png', label: '我的评价', path: '/pages/order/index' },\n { icon: '@/static/my/service.png', label: '售后服务', path: '/pages/order/index' },\n]\n\nconst pets = ref([])\n\nonShow(async () => {\n await fetchActivities()\n await fetchPets()\n})\n\n// 获取社区活动的信息\nconst fetchActivities = async () => {\n try {\n const response = await httpGet('/posts/community')\n if (response.code == 200) {\n const index = 0\n for (const key in response.data) {\n if (response.data[key]) {\n stats.value[index] = { number: response.data[key], label: key }\n }\n }\n } else {\n console.log(response)\n }\n } catch (error) {\n console.log(error)\n }\n}\n\nconst fetchPets = async () => {\n try {\n const response = await httpGet('/petInfo/select', { userId: userStore.userInfo.id })\n pets.value = response.records.map((pet) => ({\n ...pet,\n icon: baseUrl + pet.profileUrl,\n }))\n } catch (error) {\n uni.showToast({ title: '网络错误,请重试', icon: 'error' })\n }\n}\n\nconst editPet = (pet) => {\n uni.navigateTo({\n url: `/pages/pet/pet-add-page?id=${pet.id}&name=${pet.name}&icon=${pet.icon}&breed=${pet.breed}&color=${pet.color}&birthday=${pet.birthday}&gender=${pet.gender}&userId=${pet.userId}`,\n })\n}\n\nconst items = [\n { icon: '@/static/my/send.png', label: '我的发布', to: '/pages/publish/index' },\n {\n icon: '@/static/my/handshake.png',\n label: '帮助中心',\n to: '/pages/others/official-account',\n },\n {\n icon: '@/static/my/feedback.png',\n label: '建议反馈',\n to: '/pages/others/official-account',\n },\n {\n icon: '@/static/my/badge.png',\n label: '宠托师认证',\n to: '/pages/certification/index',\n },\n { icon: '@/static/my/address.png', label: '我的地址', to: '/pages/address/index' },\n { icon: '@/static/my/settings.png', label: '设置', to: '/pages/settings/index' },\n { icon: '@/static/my/address.png', label: '地址', to: '/pages/map/index' },\n]\n\nconst toPath = (path) => {\n uni.navigateTo({\n url: path,\n })\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.my-page-container {\n position: relative;\n width: 100%;\n overflow: scroll;\n\n .bg {\n position: absolute;\n top: 250px;\n z-index: -1;\n width: 100%;\n height: 100%;\n background-color: #fbfbfb;\n }\n\n .card {\n margin: 10rpx;\n border-radius: 10px;\n }\n\n .background {\n position: absolute;\n top: 0;\n left: 0;\n z-index: -1;\n width: 100%;\n height: 30%;\n background-repeat: no-repeat;\n background-size: cover;\n }\n\n .cat-dog {\n position: absolute;\n top: 140px;\n right: 0;\n width: 120px;\n height: 127px;\n }\n\n .my-avatar {\n display: grid;\n grid-template-columns: auto 1fr;\n grid-gap: 10px;\n align-items: center;\n padding-top: 130px;\n padding-left: 30px;\n\n .info {\n display: flex;\n flex-direction: column;\n }\n\n .name {\n font-size: 20px;\n font-weight: bold;\n }\n\n .description {\n font-size: 16px;\n color: #666;\n }\n }\n\n .stats-container {\n display: flex;\n justify-content: space-around;\n padding: 20px 0;\n background-color: #fff;\n\n .stat-item {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .stat-number {\n font-size: 20px;\n font-weight: 500;\n }\n\n .stat-label {\n font-size: 14px;\n color: #666;\n }\n }\n\n .services-container {\n display: flex;\n justify-content: space-around;\n padding: 20px 0;\n background-color: #fff;\n\n .service-item {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .service-box {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 105rpx;\n height: 100rpx;\n padding: 8px;\n cursor: pointer;\n background-color: #fcd038;\n border-radius: 50%;\n }\n\n .service-icon {\n width: 100%;\n object-fit: cover;\n border-radius: inherit;\n }\n\n .service-label {\n padding-top: 8px;\n font-size: 14px;\n color: #666;\n }\n }\n\n .pets-container {\n padding: 20px;\n background-color: #fff;\n\n .pets-title {\n margin-bottom: 10px;\n font-size: 18px;\n font-weight: bold;\n }\n\n .pets-list {\n display: flex;\n gap: 30rpx;\n }\n\n .pet-item {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .pet-avatar {\n border: 2px solid #fcd038;\n border-radius: 50%;\n }\n\n .add-avatar {\n width: 102rpx;\n height: 102rpx;\n background-color: #fff;\n border: 2px dashed #fcd038;\n }\n\n .add-icon {\n font-size: 36px;\n line-height: 45px;\n color: #fcd038;\n text-align: center;\n }\n\n .pet-label {\n font-size: 14px;\n color: #666;\n }\n }\n\n .settings-container {\n background-color: #f5f5f5;\n\n .list {\n margin-bottom: 10px;\n overflow: hidden;\n background-color: #fff;\n border-radius: 10px;\n }\n\n .list-item {\n display: flex;\n align-items: center;\n padding: 15px 10px;\n border-bottom: 1px solid #eee;\n }\n\n .list-item:last-child {\n border-bottom: none;\n }\n\n .icon {\n margin-right: 10px;\n }\n\n .item-icon {\n width: 20px;\n height: 20px;\n }\n\n .label {\n flex: 1;\n font-size: 16px;\n }\n\n .arrow {\n font-size: 16px;\n color: #b2b2b2;\n }\n }\n}\n</style>\n","import MiniProgramPage from 'D:/App/Work/addr/acdr-ui/src/pages/my/index.vue'\nwx.createPage(MiniProgramPage)"],"names":["useUserStore","ref","onShow","httpGet","baseUrl","uni"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQQ,MAAA,SAAA,MAAA;;;;AAAA,UAAA,YAAAA,WAAAA,aAAA;AAAA,UAAA,WAAA,UAAA;AAAA,UAAA,QAAAC,cAAAA,IAAA;AAAA,MAAA,EAAA,QAAA,GAAA,OAAA,KAAA;AAAA,MAAA,EAAA,QAAA,GAAA,OAAA,KAAA;AAAA,MAAA,EAAA,QAAA,GAAA,OAAA,KAAA;AAAA,MAAA,EAAA,QAAA,GAAA,OAAA,KAAA;AAAA,IAAA,CAAA;AAAA,UAAA,WAAA;AAAA,MAAA,EAAA,MAAA,yBAAA,OAAA,QAAA,MAAA,qBAAA;AAAA,MAAA,EAAA,MAAA,uBAAA,OAAA,QAAA,MAAA,4BAAA;AAAA,MAAA,EAAA,MAAA,wBAAA,OAAA,QAAA,MAAA,qBAAA;AAAA,MAAA,EAAA,MAAA,2BAAA,OAAA,QAAA,MAAA,qBAAA;AAAA,IAAA;AAAA,UAAA,OAAAA,cAAA,IAAA,EAAA;AAAAC,kBAAAA,OAAA,MAAA;AAAA,YAAA,gBAAA;AAAA,YAAA,UAAA;AAAA,IAA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