2 Commits

Author SHA1 Message Date
  前端-胡立永 f8bc894a10 Merge branch 'master' of http://175.178.51.79:3000/hly/pet-front-order 2 days ago
  前端-胡立永 b67f8287a6 feat(companionPetInfo): 新增伴宠师详情页数据接口及展示优化 2 days ago
3 changed files with 224 additions and 116 deletions
Split View
  1. +65
    -8
      api/order/order.js
  2. +153
    -103
      pages/companionPetList/companionPetInfo.vue
  3. +6
    -5
      pages/companionPetList/companionPetList.vue

+ 65
- 8
api/order/order.js View File

@ -3,12 +3,69 @@ import request from '@/utils/request'
// 查询伴宠师列表
export function getTeacherList(params) {
return request({
url: '/applet/mall/teacher/getTeacherList',
headers: {
"isToken": true
},
method: 'get',
params
})
return request({
url: '/applet/mall/teacher/getTeacherList',
headers: {
"isToken": true
},
method: 'get',
params
})
}
// 查询伴宠师详情
export function getTeacherDetail(params) {
return request({
url: '/applet/mall/teacher/getTeacherDetail',
headers: {
"isToken": true
},
method: 'get',
params
})
}
// 查询指定伴宠师的宠物列表
export function getTeacherPetList(params) {
return request({
headers: {
"isToken": true
},
url: "/applet/pet/list",
method: 'get',
params
})
}
// 查询指定伴宠师的地址列表
export const getTeacherAddressList = (params) => {
return request({
url: '/applet/address/addressList',
headers: {
isToken: true
},
method: "get",
params
})
}
// 查询指定伴宠师的服务小结
export const getTeacherServiceLogList = (params) => {
return request({
url: '/applet/serviceLog/serviceLogList',
headers: {
isToken: true
},
method: "get",
params
}).then(res => {
return res.data?.map?.(item => {
return {
...item,
typeIds: item.serviceType?.split?.(','),
images: item.image?.split?.(',') || []
}
}) || []
})
}

+ 153
- 103
pages/companionPetList/companionPetInfo.vue View File

@ -4,7 +4,7 @@
<view class="companion-info">
<view class="companion-info-img">
<image class="people-img" slot='cover'
:src="companionInfo&&companionInfo.staffImages&&companionInfo.staffImages.length>0?companionInfo.staffImages[0].url:defaultStaffIamge">
:src="companionInfo.userImage || defaultStaffIamge">
</image>
</view>
<view class="companion-info-detail">
@ -12,7 +12,7 @@
<view class="companion-info-left">
<text class="companion-info-left-title">{{companionInfo.name}}</text>
<view>
<img :src="companionInfo.gender==1?'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_m.png':
<img :src="companionInfo.appletUsersTeacher.sex==1?'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_m.png':
'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_f.png'" alt="sex"
style="width: 40rpx;height: 40rpx;" />
</view>
@ -36,8 +36,8 @@
</view>
<view class="companion-info-des">
<text class="companion-info-des-text">
<!-- {{companionInfo.shortDescription}} -->
你好我叫小鱼养过两只猫目前养了只布偶女猫两岁了11工作比较自由方便喂养咪咪很高兴认识你和你的猫
{{ companionInfo.appletUsersTeacher.userBrief || '暂无简介' }}
<!-- 你好我叫小鱼养过两只猫目前养了只布偶女猫两岁了11工作比较自由方便喂养咪咪很高兴认识你和你的猫 -->
</text>
</view>
<view class="personal-pet">
@ -50,27 +50,27 @@
</view>
<view class="split-line"></view>
<view class="service-new-pet-content">
<view v-for="(item,index) in petList" :key="index">
<view v-for="(item, index) in petList" :key="index">
<view class="personal-pet-list-item">
<view class="personal-pet-info">
<view>
<u-avatar :src="item.photo?item.photo:defaultStaffIamge" size="60"
<u-avatar :src="item.headImage?item.headImage:defaultStaffIamge" size="60"
shape="circle"></u-avatar>
</view>
<view class="personal-pet-info-1">
<view class="personal-pet-info-2">
<view class="personal-pet-name">
{{item.name}}
{{item.nickName}}
</view>
<view class="personal-pet-sex">
<img :src="item.gender=='男生'?'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_m.png':
<img :src="item.sex==0?'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_m.png':
'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_f.png'" alt="sex"
style="width: 20px;height: 20px;" />
</view>
</view>
<view class="personal-pet-info-3" style="width: 100%;">
<view v-if="item.breed" class="ellipsis" style="max-width: 45%;">
{{item.breed}}
{{item.type}}
</view>
<view v-if="item.age" class="personal-pet-info-age"
style="max-width: 60px;">
@ -179,7 +179,7 @@
</uni-card>
</view> -->
<view class="service-record" style="padding-bottom: 20rpx;">
<!-- <view class="service-record" style="padding-bottom: 20rpx;">
<uni-card :is-shadow="false" padding="0" margin="10px">
<view class="service-record-title" slot="title">
<view class="service-record-title-left">
@ -206,7 +206,7 @@
</view>
</uni-card>
</view>
</view> -->
<view class="service-record" style="padding-bottom: 20rpx;">
<uni-card :is-shadow="false" padding="0" margin="10px">
@ -220,8 +220,32 @@
<view class="">
<view class=""
style="margin: 10rpx 0;"
v-for="(address, index) in 3">
可接单地址{{ index + 1 }}湖南省湘潭市雨湖区雨湖路街道建设北路2号雨湖综合步步高商场内第一层103号格林楠图 20公里内
:key="index"
v-for="(address, index) in addressList">
可接单地址{{ index + 1 }}
{{ address.area }}
{{ address.address }}
{{ address.rangeNo ? address.rangeNo + '公里内' : '' }}
<view v-if="address.appletOutDate && address.appletOutDate.length">
<view class="service-record-content"
style="display: flex;justify-content: space-around;height: 100rpx;align-items: center;">
<view style="font-size: 30rpx;color: #333;">
共不接单{{ address.appletOutDate.length }}
</view>
<view style="font-size: 26rpx;color: #FFB13F;display: flex;align-items: center;"
@click="selectDate = address.appletOutDate.map(n => n.date);$refs.calendarPopup.open('bottom')">
<uni-icons type="calendar" size="40rpx" color="#FFB13F"
style="margin-top: 6rpx;"></uni-icons>
点击查看不接单日期
</view>
</view>
</view>
</view>
</view>
</uni-card>
@ -237,22 +261,22 @@
</view>
<view class="split-line"></view>
<view class="service-record-content">
<view v-for="(item,index) in serviceRecordList" :key="index">
<view v-for="(item, index) in serviceRecordList" :key="index">
<view class="service-record-item">
<view class="service-record-info">
<view>
<u-avatar :src="item.photo?item.photo:defaultStaffIamge" size="40"
<u-avatar :src="companionInfo.userImage || defaultStaffIamge" size="40"
shape="circle"></u-avatar>
</view>
<view class="service-record-info-1">
<view class="service-record-info-2">
<view class="service-record-info-title">
<view class="service-record-name">
{{item.name}}
{{companionInfo.name}}
</view>
</view>
<view class="service-record-location">
<text style="color: #FFB13F;">{{item.location}}</text>
<text style="color: #FFB13F;">{{item.serviceSpot}}</text>
</view>
</view>
<view class="service-record-info-3" style="width: 100%;">
@ -263,7 +287,7 @@
|
</view>
<view class="ellipsis">
{{item.time}}
{{item.serviceTime}}
</view>
</view>
<view class="service-record-info-4" style="width: 100%;">
@ -274,11 +298,11 @@
</view>
</view>
<view class="service-record-des">
{{item.des}}
{{item.text}}
</view>
<view class="service-record-pet-images">
<view v-for="(img,index) in item.imageList" :key="index">
<image class="service-record-pet-images-item" slot='cover' :src="img.url">
<view v-for="(img,index) in item.images" :key="index">
<image class="service-record-pet-images-item" slot='cover' :src="img">
</image>
</view>
</view>
@ -322,32 +346,42 @@
</template>
<script>
// import {
// getCompanionInfo
// } from "@/api/system/companion"
import {
getCompanionInfo
} from "@/api/system/companion"
getTeacherDetail,
getTeacherPetList,
getTeacherAddressList,
getTeacherServiceLogList,
} from "@/api/order/order"
import uniRate from '@/uni_modules/uni-rate/components/uni-rate/uni-rate.vue';
export default {
data() {
return {
currentCompanionPetId: '',
companionInfo: null,
companionInfo: {},
defaultStaffIamge: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png',
collect: false,
year : new Date().getFullYear(),
selectDate : ['2025-4-18', '2025-4-20'],
petList: [{
gender: '女生',
name: '大咪',
breed: '中华田园猫',
age: '12',
weight: '13.5'
}, {
gender: '女生',
name: '大咪',
breed: '中华田园猫',
age: '12',
weight: '13.5'
}],
petList: [
// {
// gender: '',
// name: '',
// breed: '',
// age: '12',
// weight: '13.5'
// },
// {
// gender: '',
// name: '',
// breed: '',
// age: '12',
// weight: '13.5'
// }
],
addressList: [],
rewardList: [{
name: '小咪',
star: 3,
@ -364,67 +398,71 @@
time: '2025-1-1 18:00',
des: '服务贴心,态度热情,非常满意',
}],
serviceRecordList: [{
name: '修狗',
location: '重庆市',
type: 1,
time: '2025-1-15 18:09:32',
petName: '修狗',
des: '猫咪正常饮食,无任何异常,排尿较少,可能天气原因, 服务过程全程与主人视频。',
imageList: [{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
},
{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
},
{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
},
{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
},
{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
}
]
}, {
name: '修猫',
location: '上海市',
type: 2,
time: '2025-1-15 18:09:32',
petName: '修猫',
des: '猫咪正常饮食,无任何异常,排尿较少,可能天气原因, 服务过程全程与主人视频。',
imageList: [{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
},
{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
},
{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
}
],
}, {
name: '修修补补',
location: '上海市',
type: 2,
time: '2025-1-15 18:09:32',
petName: '修猫',
des: '猫咪正常饮食,无任何异常,排尿较少,可能天气原因, 服务过程全程与主人视频。',
imageList: [{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
},
{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
},
{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
},
{
url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
}
],
}]
serviceRecordList: [
// {
// name: '',
// location: '',
// type: 1,
// time: '2025-1-15 18:09:32',
// petName: '',
// des: '尿 ',
// imageList: [
// {
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// },
// {
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// },
// {
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// },
// {
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// },
// {
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// }
// ]
// },
// {
// name: '',
// location: '',
// type: 2,
// time: '2025-1-15 18:09:32',
// petName: '',
// des: '尿 ',
// imageList: [{
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// },
// {
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// },
// {
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// }
// ],
// }, {
// name: '',
// location: '',
// type: 2,
// time: '2025-1-15 18:09:32',
// petName: '',
// des: '尿 ',
// imageList: [{
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// },
// {
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// },
// {
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// },
// {
// url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
// }
// ],
// }
]
}
},
components: {
@ -441,14 +479,26 @@
this.collect = !this.collect
this.$forceUpdate()
},
getCurrentCompanionPetInfo(id) {
getCompanionInfo(id).then(response => {
if (response && response.code == 200) {
console.log('getCurrentCompanionPetInfo', response);
this.companionInfo = response.data
getCurrentCompanionPetInfo(userId) {
getTeacherDetail({userId}).then(response => {
if (response) {
this.companionInfo = response
}
console.log('getCurrentCompanionPetInfo', response);
})
getTeacherPetList({userId}).then(response => {
if (response.code == 200) {
this.petList = response.data
}
})
getTeacherAddressList({userId}).then(response => {
if (response.code == 200) {
this.addressList = response.data
}
})
getTeacherServiceLogList({userId}).then(res => {
this.serviceRecordList = res
})
},
getOrder() {
uni.navigateTo({


+ 6
- 5
pages/companionPetList/companionPetList.vue View File

@ -94,10 +94,11 @@
<view>
<view v-if="companionList.length > 0">
<uni-row :span="12" v-for="(item,index) in companionList" :key="index">
<uni-card :is-shadow="false" padding=0 margin="10px">
<uni-card :is-shadow="false" padding=0 margin="10px"
@click="getInfo(item.userId)">
<view class="personal-list-item">
<view class="personal-info">
<view @click="getInfo(item.id)">
<view>
<!-- <image class="people-img" slot='cover'
:src="item&&item.staffImages&&item.staffImages.length>0?item.staffImages[0].url:defaultStaffIamge">
</image> -->
@ -109,7 +110,7 @@
</view>
<view class="personal-info-1">
<view class="personal-info-2">
<view class="personal-info-title" @click="getInfo(item.id)">
<view class="personal-info-title">
<view class="personal-name">
{{ item.userName || '匿名' }}
</view>
@ -120,7 +121,7 @@
</view>
</view>
<view class="personal-star" @click="checkIsLike">
<text style="color: #FFB13F;">客户点赞数{{ likeNum }}</text>
<text style="color: #FFB13F;">客户点赞数{{ item.appletUsersTeacher.thumbsUp || 0 }}</text>
<uni-icons v-if="isLike" type="hand-up-filled" size="20"
color="#FFB13F"></uni-icons>
<uni-icons v-else type="hand-up" size="20" color="#FFB13F"></uni-icons>
@ -136,7 +137,7 @@
</view>
<view class="personal-info-4" style="width: 100%;">
<view class="ellipsis" style="max-width: 225px;">
简介{{ item.shortDescription || '暂无' }}
简介{{ item.appletUsersTeacher.userBrief || '暂无' }}
</view>
</view>
</view>


Loading…
Cancel
Save