You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

757 lines
20 KiB

2 months ago
  1. <template>
  2. <view class="home-content">
  3. <view class="card-container">
  4. <view class="companion-info">
  5. <view class="companion-info-img">
  6. <image class="people-img" slot='cover'
  7. :src="companionInfo&&companionInfo.staffImages&&companionInfo.staffImages.length>0?companionInfo.staffImages[0].url:defaultStaffIamge">
  8. </image>
  9. </view>
  10. <view class="companion-info-detail">
  11. <view class="companion-info-left">
  12. <text class="companion-info-left-title">{{companionInfo.name}}</text>
  13. <view>
  14. <img :src="companionInfo.gender==1?'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_m.png':
  15. 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_f.png'" alt="sex"
  16. style="width: 40rpx;height: 40rpx;" />
  17. </view>
  18. </view>
  19. <view class="companion-info-right" @click="onClickFav">
  20. <view v-if="collect">
  21. <uni-icons type="star-filled" size="18" color="#FFB13F"></uni-icons>
  22. <text style="font-size: 16px; color: #FFB13F; margin-left: 6rpx;">已收藏</text>
  23. </view>
  24. <view v-else>
  25. <uni-icons type="star" size="18" color="#7D8196"></uni-icons>
  26. <text style="font-size: 16px; color: #7D8196; margin-left: 6rpx;">收藏</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="companion-info-des">
  32. <text class="companion-info-des-text">
  33. <!-- {{companionInfo.shortDescription}} -->
  34. 你好我叫小鱼养过两只猫目前养了只布偶女猫两岁了11工作比较自由方便喂养咪咪很高兴认识你和你的猫
  35. </text>
  36. </view>
  37. <view class="personal-pet">
  38. <uni-card :is-shadow="false" padding=0 margin="10px">
  39. <view class="service-new-title" slot="title">
  40. <view class="service-new-title-left">
  41. <view class="service-new-flag"></view>
  42. <view>他的宠物</view>
  43. </view>
  44. </view>
  45. <view class="split-line"></view>
  46. <view class="service-new-pet-content">
  47. <view v-for="(item,index) in petList" :key="index">
  48. <view class="personal-pet-list-item">
  49. <view class="personal-pet-info">
  50. <view>
  51. <u-avatar :src="item.photo?item.photo:defaultStaffIamge" size="60"
  52. shape="circle"></u-avatar>
  53. </view>
  54. <view class="personal-pet-info-1">
  55. <view class="personal-pet-info-2">
  56. <view class="personal-pet-name">
  57. {{item.name}}
  58. </view>
  59. <view class="personal-pet-sex">
  60. <img :src="item.gender=='男生'?'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_m.png':
  61. 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/sex_f.png'" alt="sex"
  62. style="width: 20px;height: 20px;" />
  63. </view>
  64. </view>
  65. <view class="personal-pet-info-3" style="width: 100%;">
  66. <view v-if="item.breed" class="ellipsis" style="max-width: 45%;">
  67. {{item.breed}}
  68. </view>
  69. <view v-if="item.age" class="personal-pet-info-age"
  70. style="max-width: 60px;">
  71. {{item.age}}
  72. </view>
  73. <view v-if="item.weight" class="ellipsis">
  74. {{item.weight}}KG
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <!-- <view style="display: flex;">
  82. <view style="width: 28%;">
  83. <image class="pet-img" slot='cover'
  84. :src="companionInfo&&companionInfo.staffImages&&companionInfo.staffImages.length>0?companionInfo.staffImages[0].url:defaultStaffIamge">
  85. </image>
  86. </view>
  87. <view>
  88. <view>
  89. <text style="font-size: 16px; margin-right: 4px;">{{companionInfo.name}}</text>
  90. <uni-icons type="person" size="20" color="#FFB13F"></uni-icons>
  91. </view>
  92. <view>
  93. <text style="font-size: 14px;color: #AAA">
  94. 中华田园猫 | 1 | 体重1KG
  95. </text>
  96. </view>
  97. </view>
  98. </view> -->
  99. </view>
  100. </uni-card>
  101. </view>
  102. <view>
  103. <image @click="changeOrderType" style="height: 132rpx; width: 710rpx; margin: 0 20rpx 0 20rpx;"
  104. slot='cover'
  105. src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/CMDFServiceDetail.png">
  106. <!-- <uni-card padding=0>
  107. <view class="service-new-pet-content" style="padding: 10px 0 5px 0;">
  108. <view style="display: flex;">
  109. <view>
  110. <image class="service-img" slot='cover' :src="defaultStaffIamge">
  111. </image>
  112. </view>
  113. <view
  114. style="display: flex; margin-left: 10px; align-items: center; justify-content: space-between; width: 100%;">
  115. <view>
  116. <view>
  117. <text
  118. style="font-weight: 500; font-size: 28rpx; color: #333333; line-height: 33rpx;">宠物服务详解</text>
  119. </view>
  120. <view>
  121. <text style="font-size: 12px;color: #AAA">
  122. 服务介绍收费标准常见问题服务记录
  123. </text>
  124. </view>
  125. </view>
  126. <view>
  127. <uni-icons type="right" size="20" color="#AAA"></uni-icons>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. </uni-card> -->
  133. </view>
  134. <!-- <view class="personal-pet" style="padding-bottom: 10px;">
  135. <uni-card :is-shadow="false" padding=0 margin="10px">
  136. <view class="service-new-title" slot="title">
  137. <view class="service-new-title-left">
  138. <view class="service-new-flag"></view>
  139. <view>近期评价</view>
  140. </view>
  141. </view>
  142. <view class="split-line"></view>
  143. <view class="service-new-pet-content">
  144. <view v-for="(item,index) in rewardList" :key="index">
  145. <view class="reward-list-item">
  146. <view class="reward-info">
  147. <view>
  148. <u-avatar :src="item.photo?item.photo:defaultStaffIamge" size="60"
  149. shape="circle"></u-avatar>
  150. </view>
  151. <view class="reward-info-1">
  152. <view class="reward-info-2">
  153. <view class="reward-name">
  154. {{item.name}}
  155. </view>
  156. <view class="star">
  157. <uni-rate :readonly="true" size="18" :value="item.star" />
  158. </view>
  159. </view>
  160. <view class="reward-info-3" style="width: 100%;">
  161. <view>
  162. {{item.time}}
  163. </view>
  164. <view>
  165. {{item.des}}
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. </view>
  173. </uni-card>
  174. </view> -->
  175. <view class="service-record" style="padding-bottom: 55px;">
  176. <uni-card :is-shadow="false" padding=0 margin="10px">
  177. <view class="service-record-title" slot="title">
  178. <view class="service-record-title-left">
  179. <view class="service-record-flag"></view>
  180. <view>服务记录</view>
  181. </view>
  182. </view>
  183. <view class="split-line"></view>
  184. <view class="service-record-content">
  185. <view v-for="(item,index) in serviceRecordList" :key="index">
  186. <view class="service-record-item">
  187. <view class="service-record-info">
  188. <view>
  189. <u-avatar :src="item.photo?item.photo:defaultStaffIamge" size="40"
  190. shape="circle"></u-avatar>
  191. </view>
  192. <view class="service-record-info-1">
  193. <view class="service-record-info-2">
  194. <view class="service-record-info-title">
  195. <view class="service-record-name">
  196. {{item.name}}
  197. </view>
  198. </view>
  199. <view class="service-record-location">
  200. <text style="color: #FFB13F;">{{item.location}}</text>
  201. </view>
  202. </view>
  203. <view class="service-record-info-3" style="width: 100%;">
  204. <view class="ellipsis">
  205. {{item.type == 1 ? '上门喂猫' : '上门遛狗'}}
  206. </view>
  207. <view style="margin: 0 10rpx 0 10rpx;">
  208. |
  209. </view>
  210. <view class="ellipsis">
  211. {{item.time}}
  212. </view>
  213. </view>
  214. <view class="service-record-info-4" style="width: 100%;">
  215. <view class="ellipsis" style="max-width: 225px;">
  216. 宠物{{item.petName}}
  217. </view>
  218. </view>
  219. </view>
  220. </view>
  221. <view class="service-record-des">
  222. {{item.des}}
  223. </view>
  224. <view class="service-record-pet-images">
  225. <view v-for="(img,index) in item.imageList" :key="index">
  226. <image class="service-record-pet-images-item" slot='cover' :src="img.url">
  227. </image>
  228. </view>
  229. </view>
  230. </view>
  231. <view class="split-line"></view>
  232. </view>
  233. </view>
  234. </uni-card>
  235. </view>
  236. <view class="bottom-btn-sticky" style="padding: 10rpx 40rpx 0 40rpx;">
  237. <!-- <button class="bottom-btn" @click="getOrder">立即预约</button> -->
  238. <image style="width: 670rpx; height: 80rpx;" slot='cover' src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/petServiceOrder/orderNow.png" />
  239. </view>
  240. </view>
  241. </view>
  242. </template>
  243. <script>
  244. import {
  245. getCompanionInfo
  246. } from "@/api/system/companion"
  247. import uniRate from '@/uni_modules/uni-rate/components/uni-rate/uni-rate.vue';
  248. export default {
  249. data() {
  250. return {
  251. currentCompanionPetId: '',
  252. companionInfo: null,
  253. defaultStaffIamge: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png',
  254. collect: false,
  255. petList: [{
  256. gender: '女生',
  257. name: '大咪',
  258. breed: '中华田园猫',
  259. age: '12',
  260. weight: '13.5'
  261. }, {
  262. gender: '女生',
  263. name: '大咪',
  264. breed: '中华田园猫',
  265. age: '12',
  266. weight: '13.5'
  267. }],
  268. rewardList: [{
  269. name: '小咪',
  270. star: 3,
  271. time: '2025-1-1 18:00',
  272. des: '服务贴心,态度热情,非常满意',
  273. }, {
  274. name: '中咪',
  275. star: 4,
  276. time: '2025-1-1 18:00',
  277. des: '服务贴心,态度热情,非常满意',
  278. }, {
  279. name: '大咪',
  280. star: 5,
  281. time: '2025-1-1 18:00',
  282. des: '服务贴心,态度热情,非常满意',
  283. }],
  284. serviceRecordList: [{
  285. name: '修狗',
  286. location: '重庆市',
  287. type: 1,
  288. time: '2025-1-15 18:09:32',
  289. petName: '修狗',
  290. des: '猫咪正常饮食,无任何异常,排尿较少,可能天气原因, 服务过程全程与主人视频。',
  291. imageList: [{
  292. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  293. },
  294. {
  295. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  296. },
  297. {
  298. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  299. },
  300. {
  301. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  302. },
  303. {
  304. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  305. }
  306. ]
  307. }, {
  308. name: '修猫',
  309. location: '上海市',
  310. type: 2,
  311. time: '2025-1-15 18:09:32',
  312. petName: '修猫',
  313. des: '猫咪正常饮食,无任何异常,排尿较少,可能天气原因, 服务过程全程与主人视频。',
  314. imageList: [{
  315. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  316. },
  317. {
  318. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  319. },
  320. {
  321. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  322. }
  323. ],
  324. }, {
  325. name: '修修补补',
  326. location: '上海市',
  327. type: 2,
  328. time: '2025-1-15 18:09:32',
  329. petName: '修猫',
  330. des: '猫咪正常饮食,无任何异常,排尿较少,可能天气原因, 服务过程全程与主人视频。',
  331. imageList: [{
  332. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  333. },
  334. {
  335. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  336. },
  337. {
  338. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  339. },
  340. {
  341. url: 'https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/banner/gold_people.png'
  342. }
  343. ],
  344. }]
  345. }
  346. },
  347. components: {
  348. uniRate,
  349. },
  350. onLoad: function(option) {
  351. this.currentCompanionPetId = option.id;
  352. },
  353. mounted() {
  354. this.getCurrentCompanionPetInfo(this.currentCompanionPetId)
  355. },
  356. methods: {
  357. onClickFav() {
  358. this.collect = !this.collect
  359. this.$forceUpdate()
  360. },
  361. getCurrentCompanionPetInfo(id) {
  362. getCompanionInfo(id).then(response => {
  363. if (response && response.code == 200) {
  364. console.log('getCurrentCompanionPetInfo', response);
  365. this.companionInfo = response.data
  366. }
  367. console.log('getCurrentCompanionPetInfo', response);
  368. })
  369. },
  370. getOrder() {
  371. uni.navigateTo({
  372. // url: '/pages/newOrder/serviceNew2',
  373. url: `/pages/newOrder/serviceNew2?userName=${this.companionInfo.name}&servicerId=${this.companionInfo.id}`,
  374. });
  375. },
  376. }
  377. }
  378. </script>
  379. <style lang="scss">
  380. .home-content {
  381. background: linear-gradient(360deg, #F5F5F7 82%, #FFBF60 99%);
  382. .card-container {
  383. margin: 0;
  384. padding: 0;
  385. .uni-card {
  386. border-radius: 16rpx;
  387. }
  388. .companion-info {
  389. display: flex;
  390. .companion-info-img {
  391. margin: 20rpx 20rpx 20rpx 40rpx;
  392. .people-img {
  393. width: 168rpx;
  394. height: 168rpx;
  395. border: #FEA714 5rpx solid;
  396. border-radius: 168rpx;
  397. }
  398. }
  399. .companion-info-detail {
  400. width: 70%;
  401. display: flex;
  402. align-items: center;
  403. .companion-info-left {
  404. display: flex;
  405. width: 70%;
  406. .companion-info-left-title {
  407. color: #333;
  408. font-size: 32rpx;
  409. line-height: 32rpx;
  410. margin-right: 10rpx;
  411. font-weight: 900;
  412. font-style: normal;
  413. }
  414. }
  415. }
  416. }
  417. .companion-info-des {
  418. background-color: #FFF4E5;
  419. margin: 20rpx;
  420. display: flex;
  421. align-items: center;
  422. justify-content: center;
  423. border-radius: 16rpx;
  424. .companion-info-des-text {
  425. color: #FFB13F;
  426. margin: 20rpx 34rpx 20rpx 34rpx;
  427. }
  428. }
  429. .bottom-btn-sticky {
  430. z-index: 10;
  431. position: fixed;
  432. bottom: 40rpx;
  433. /* 距离底部的距离 */
  434. // right: 32rpx;
  435. /* 距离右侧的距离 */
  436. // width: 50px;
  437. // /* 按钮的宽度 */
  438. // height: 50px;
  439. .bottom-btn {
  440. width: 670rpx;
  441. height: 80rpx;
  442. border-radius: 120rpx;
  443. background: #FFB13F;
  444. font-size: 32rpx;
  445. color: #FFFFFF;
  446. }
  447. }
  448. .pet-img {
  449. width: 70px;
  450. height: 70px;
  451. border: #FFBF60 1px solid;
  452. border-radius: 35px;
  453. }
  454. .personal-pet-list-item {
  455. // margin: 10px 10px 0 10px;
  456. // border-radius: 5px;
  457. padding: 10px 0px 10px 0;
  458. .personal-pet-info {
  459. display: flex;
  460. align-items: center;
  461. justify-content: flex-start;
  462. .personal-pet-info-1 {
  463. margin-left: 10px;
  464. .personal-pet-info-2 {
  465. display: flex;
  466. flex-wrap: wrap;
  467. .personal-pet-name {
  468. color: #333;
  469. font-size: 16px;
  470. margin-right: 10px;
  471. }
  472. }
  473. .personal-pet-info-3 {
  474. display: flex;
  475. align-items: baseline;
  476. font-size: 14px;
  477. margin-top: 5px;
  478. color: #7D8196;
  479. .personal-pet-info-age {
  480. padding: 0 10px;
  481. margin: 0 10px;
  482. border-left: solid 2px #7D8196;
  483. border-right: solid 2px #7D8196;
  484. }
  485. }
  486. }
  487. }
  488. .personal-pet-info-disposition {
  489. padding: 10px;
  490. color: #7D8196;
  491. font-size: 14px;
  492. background: #f9f9f9;
  493. border-radius: 5px;
  494. margin-top: 10px;
  495. }
  496. .personal-pet-info-btns {
  497. display: flex;
  498. justify-content: flex-end;
  499. margin-top: 10px;
  500. .personal-pet-info-btn {
  501. display: flex;
  502. font-size: 14px;
  503. color: #7D8196;
  504. margin-left: 20px;
  505. }
  506. }
  507. }
  508. .reward-list-item {
  509. padding: 10px 0px 10px 0;
  510. .reward-info {
  511. display: flex;
  512. // align-items: center;
  513. justify-content: flex-start;
  514. .reward-info-1 {
  515. margin-left: 10px;
  516. width: 100%;
  517. .reward-info-2 {
  518. display: flex;
  519. flex-wrap: wrap;
  520. .reward-name {
  521. color: #333;
  522. font-size: 16px;
  523. width: 60%;
  524. }
  525. }
  526. .reward-info-3 {
  527. align-items: baseline;
  528. font-size: 14px;
  529. margin-top: 5px;
  530. color: #7D8196;
  531. }
  532. }
  533. }
  534. .personal-pet-info-disposition {
  535. padding: 10px;
  536. color: #7D8196;
  537. font-size: 14px;
  538. background: #f9f9f9;
  539. border-radius: 5px;
  540. margin-top: 10px;
  541. }
  542. .personal-pet-info-btns {
  543. display: flex;
  544. justify-content: flex-end;
  545. margin-top: 10px;
  546. .personal-pet-info-btn {
  547. display: flex;
  548. font-size: 14px;
  549. color: #7D8196;
  550. margin-left: 20px;
  551. }
  552. }
  553. }
  554. .service-img {
  555. width: 60px;
  556. height: 60px;
  557. // border: #FFBF60 1px solid;
  558. // border-radius: 35px;
  559. }
  560. .personal-pet {
  561. width: 100%;
  562. .service-new-title {
  563. display: flex;
  564. font-weight: 500;
  565. font-size: 28rpx;
  566. color: #333333;
  567. line-height: 33rpx;
  568. margin: 42rpx 0 30rpx;
  569. justify-content: space-between;
  570. .service-new-title-left {
  571. display: flex;
  572. align-items: center;
  573. .service-new-flag {
  574. width: 8rpx;
  575. height: 32rpx;
  576. background: #FFBF60;
  577. border-radius: 30rpx 30rpx 30rpx 30rpx;
  578. margin-right: 10rpx;
  579. }
  580. }
  581. }
  582. .split-line {
  583. width: 100%;
  584. height: 1rpx;
  585. background: #EFEFEF;
  586. }
  587. .service-new-pet-content {
  588. // padding: 20rpx;
  589. }
  590. }
  591. .service-record {
  592. width: 100%;
  593. .service-record-title {
  594. display: flex;
  595. font-weight: 500;
  596. font-size: 28rpx;
  597. color: #333333;
  598. line-height: 33rpx;
  599. margin: 42rpx 0 30rpx;
  600. justify-content: space-between;
  601. .service-record-title-left {
  602. display: flex;
  603. align-items: center;
  604. .service-record-flag {
  605. width: 8rpx;
  606. height: 32rpx;
  607. background: #FFBF60;
  608. border-radius: 30rpx 30rpx 30rpx 30rpx;
  609. margin-right: 10rpx;
  610. }
  611. }
  612. }
  613. .split-line {
  614. width: 100%;
  615. height: 1rpx;
  616. background: #EFEFEF;
  617. }
  618. .service-record-content {
  619. // padding: 20rpx;
  620. .service-record-item {
  621. padding: 10px 0px 0px 0;
  622. .service-record-info {
  623. display: flex;
  624. align-items: center;
  625. justify-content: flex-start;
  626. .service-record-info-1 {
  627. margin-left: 10px;
  628. width: 100%;
  629. .service-record-info-2 {
  630. display: flex;
  631. flex-wrap: wrap;
  632. .service-record-info-title {
  633. display: flex;
  634. flex-wrap: wrap;
  635. width: 80%;
  636. }
  637. .service-record-name {
  638. color: #333;
  639. font-size: 28rpx;
  640. // line-height: 28rpx;
  641. font-weight: 500;
  642. font-style: normal;
  643. }
  644. .service-record-location {
  645. color: #FFAA48;
  646. font-size: 28rpx;
  647. font-weight: 400;
  648. // line-height: 32rpx;
  649. }
  650. }
  651. .service-record-info-3 {
  652. display: flex;
  653. align-items: baseline;
  654. font-size: 24rpx;
  655. // line-height: 32rpx;
  656. color: #7D8196;
  657. font-weight: 400;
  658. }
  659. .service-record-info-4 {
  660. display: flex;
  661. align-items: baseline;
  662. font-size: 24rpx;
  663. // margin-top: 10px;
  664. color: #7D8196;
  665. font-weight: 400;
  666. line-height: 32rpx;
  667. }
  668. }
  669. }
  670. .service-record-des {
  671. margin: 20rpx 0 20rpx 0;
  672. font-size: 28rpx;
  673. font-weight: 400;
  674. color: #333;
  675. }
  676. .service-record-pet-images {
  677. margin: 20rpx 0 20rpx 0;
  678. display: flex;
  679. flex-wrap: wrap;
  680. .service-record-pet-images-item {
  681. width: 152rpx;
  682. height: 152rpx;
  683. border-radius: 20rpx;
  684. margin-right: 10rpx;
  685. }
  686. }
  687. }
  688. }
  689. }
  690. }
  691. }
  692. </style>