index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="service-detail-page">
  3. <!-- 顶部主图区域 -->
  4. <view class="hero-section">
  5. <image :src="serviceData.heroImg" class="hero-img" mode="aspectFill"></image>
  6. <view class="hero-overlay"></view>
  7. <view class="hero-title-box">
  8. <text class="hero-main-title">{{ serviceData.heroTitle }}</text>
  9. <text class="hero-sub-title">{{ serviceData.heroSubTitle }}</text>
  10. </view>
  11. </view>
  12. <!-- 购买数据 -->
  13. <view class="info-section card">
  14. <view class="service-price-row">
  15. <view class="price-box">
  16. <text class="price-label">订单服务费:</text>
  17. <text class="price-symbol">¥</text>
  18. <text class="price-num">{{ serviceData.price }}</text>
  19. <text class="price-unit">{{ serviceData.unit }}</text>
  20. </view>
  21. <text class="bought-count">{{ serviceData.booked }}</text>
  22. </view>
  23. <text class="service-name-text">{{ serviceData.title }}</text>
  24. </view>
  25. <!-- 详情选项卡 -->
  26. <view class="tab-section card">
  27. <view class="tab-header">
  28. <view :class="['tab-btn', { active: activeTab === 'intro' }]" @click="activeTab = 'intro'">
  29. <text>服务介绍</text>
  30. </view>
  31. <view :class="['tab-btn', { active: activeTab === 'notice' }]" @click="activeTab = 'notice'">
  32. <text>下单须知</text>
  33. </view>
  34. </view>
  35. <view class="tab-content" v-if="activeTab === 'intro'">
  36. <text class="content-title">服务介绍</text>
  37. <rich-text :nodes="serviceData.intro" class="content-text"></rich-text>
  38. <view class="intro-images" v-if="serviceData.introImages && serviceData.introImages.length">
  39. <image v-for="(img, idx) in serviceData.introImages" :key="idx" :src="img" class="intro-img"
  40. mode="widthFix"></image>
  41. </view>
  42. </view>
  43. <view class="tab-content" v-if="activeTab === 'notice'">
  44. <text class="content-title">下单须知</text>
  45. <rich-text :nodes="serviceData.notice" class="content-text"></rich-text>
  46. </view>
  47. </view>
  48. <!-- 底部操作栏 -->
  49. <view class="footer-bar safe-bottom">
  50. <button class="buy-btn" @click="goToOrderApply">立即预约</button>
  51. </view>
  52. </view>
  53. </template>
  54. <script setup>
  55. import { ref, computed } from 'vue'
  56. import { onLoad } from '@dcloudio/uni-app'
  57. const activeTab = ref('intro')
  58. const serviceKey = ref('接送')
  59. const serviceConfigs = {
  60. '接送': {
  61. type: 'transport',
  62. title: '宠物接送',
  63. heroTitle: '专业宠物托运',
  64. heroSubTitle: '专业速度快 安全服务好',
  65. heroImg: 'https://images.unsplash.com/photo-1544568100-847a948585b9?q=80&w=600&auto=format&fit=crop',
  66. price: '40',
  67. unit: '起',
  68. booked: '158+ 人已约',
  69. intro: '宠物接送对于有出行需求的宠物主们来说,是解决距离难题的最佳选择。<br><br>✨ <b>服务特色:</b><br>专车专送、不拼车、无应激,配有专业航空箱,全天候接单响应。',
  70. introImages: ['/static/images/transport-guide.png'],
  71. notice: '<div style="background:#fdfaf5;border:1px solid #f9ecec;border-radius:10px;padding:14px;margin-bottom:16px;"><b>📜 服务细节</b><br>1. 请提前至少一天预约出行时间。<br>2. 接送期间发送状态视频及定位。<br>3. 价格按实际公里数计算。</div><div style="background:#fdfaf5;border:1px solid #f9ecec;border-radius:10px;padding:14px;"><b>⚠️ 禁忌项</b><br>1. 孕期宠物严禁长途颠簸。<br>2. 传染病宠物谢绝托运。<br>3. 出发前4小时内请勿大量喂食。</div>'
  72. },
  73. '托运': {
  74. type: 'transport',
  75. title: '跨区托运',
  76. heroTitle: '跨区宠物托运',
  77. heroSubTitle: '全国直达 安全高效',
  78. heroImg: 'https://images.unsplash.com/photo-1544568100-847a948585b9?q=80&w=600&auto=format&fit=crop',
  79. price: '199',
  80. unit: '起',
  81. booked: '286+ 人已约',
  82. intro: '宠物长途托运包含汽车、航空等多种方式可选。一站式服务。<br><br>✨ <b>服务特色:</b><br>恒温车厢保障、到达后专属客服报平安。',
  83. introImages: ['/static/images/transport-guide.png'],
  84. notice: '<div style="background:#fdfaf5;border:1px solid #f9ecec;border-radius:10px;padding:14px;margin-bottom:16px;"><b>📜 服务细节</b><br>1. 长途托运需提前3天预约。<br>2. 提供加固航空箱。<br>3. 客服1对1跟踪行程。</div>'
  85. },
  86. '喂养': {
  87. type: 'feed',
  88. title: '上门喂遛',
  89. heroTitle: '贴心上门喂遛',
  90. heroSubTitle: '解放双手 贴心陪伴',
  91. heroImg: 'https://images.unsplash.com/photo-1548247416-ec66f4900b2e?q=80&w=600&auto=format&fit=crop',
  92. price: '35',
  93. unit: ' / 次起',
  94. booked: '1240+ 人已约',
  95. intro: '专业宠托师上门喂食、铲屎及陪玩/遛狗服务。<br><br>✨ <b>服务特色:</b><br>每次服务30~60分钟,提供手机直播或录像。',
  96. introImages: ['https://images.unsplash.com/photo-1583511655857-d19b40a7a54e?w=600&q=80'],
  97. notice: '<div style="background:#fdfaf5;border:1px solid #f9ecec;border-radius:10px;padding:14px;"><b>📜 服务细节</b><br>1. 确认入户方式。<br>2. 离场提供照片及视频汇报单。</div>'
  98. },
  99. '洗护': {
  100. type: 'wash',
  101. title: '上门洗护SPA',
  102. heroTitle: '高端上门洗护',
  103. heroSubTitle: '足不出户 尊享SPA',
  104. heroImg: 'https://images.unsplash.com/photo-1516734212186-a967f81ad0d7?q=80&w=600&auto=format&fit=crop',
  105. price: '98',
  106. unit: ' / 次起',
  107. booked: '842+ 人已约',
  108. intro: '宠物美容师带全套设备上门,提供洗沐、剪甲、清耳道等全方位护理。<br><br>✨ <b>服务特色:</b><br>纯手工精细揉搓洗浴,低敏无泪植物配方。',
  109. introImages: ['https://images.unsplash.com/photo-1516734212186-a967f81ad0d7?w=600&q=80'],
  110. notice: '<div style="background:#fdfaf5;border:1px solid #f9ecec;border-radius:10px;padding:14px;"><b>📜 服务细节</b><br>1. 请确保家中有热水及洗浴空间。<br>2. 费用依宠物体型及毛长而定。</div>'
  111. }
  112. }
  113. onLoad((options) => {
  114. if (options && options.service) {
  115. serviceKey.value = decodeURIComponent(options.service)
  116. }
  117. })
  118. const serviceData = computed(() => {
  119. const key = Object.keys(serviceConfigs).find(k => serviceKey.value.includes(k)) || '接送'
  120. return serviceConfigs[key]
  121. })
  122. const goToOrderApply = () => {
  123. uni.navigateTo({
  124. url: `/pages/order/apply/index?service=${serviceData.value.type}`
  125. })
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .service-detail-page { background-color: #f5f5f5; min-height: 100vh; padding-bottom: 160rpx; }
  130. .hero-section { position: relative; width: 100%; height: 640rpx; overflow: hidden; }
  131. .hero-img { width: 100%; height: 100%; }
  132. .hero-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.4) 80%, rgba(0, 0, 0, 0.7) 100%); }
  133. .hero-title-box { position: absolute; bottom: 48rpx; left: 40rpx; right: 40rpx; z-index: 2; }
  134. .hero-main-title { display: block; font-size: 52rpx; font-weight: 900; color: #fff; margin-bottom: 12rpx; }
  135. .hero-sub-title { display: block; font-size: 28rpx; color: rgba(255, 255, 255, 0.9); font-weight: 600; }
  136. .card { background-color: #fff; margin-bottom: 20rpx; }
  137. .info-section { padding: 32rpx 40rpx; position: relative; z-index: 3; border-radius: 24rpx 24rpx 0 0; margin-top: -24rpx; }
  138. .service-price-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20rpx; }
  139. .price-box { display: flex; align-items: baseline; color: #f44336; }
  140. .price-label { font-size: 26rpx; color: #333; font-weight: bold; margin-right: 12rpx; }
  141. .price-symbol { font-size: 28rpx; font-weight: bold; }
  142. .price-num { font-size: 56rpx; font-weight: 900; line-height: 1; }
  143. .price-unit { font-size: 24rpx; color: #999; margin-left: 4rpx; }
  144. .bought-count { font-size: 24rpx; color: #999; background: #f5f5f5; padding: 4rpx 16rpx; border-radius: 20rpx; }
  145. .service-name-text { font-size: 32rpx; color: #111; font-weight: bold; }
  146. .tab-section { padding: 0; }
  147. .tab-header { display: flex; border-bottom: 1rpx solid #f0f0f0; }
  148. .tab-btn { flex: 1; text-align: center; padding: 24rpx 0; font-size: 28rpx; color: #666; position: relative; }
  149. .tab-btn.active { color: #fcd53f; font-weight: bold; }
  150. .tab-btn.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60rpx; height: 6rpx; background: #fcd53f; border-radius: 6rpx; }
  151. .tab-content { padding: 40rpx 32rpx; }
  152. .content-title { display: block; font-size: 32rpx; color: #333; font-weight: 900; margin-bottom: 24rpx; padding-left: 20rpx; position: relative; }
  153. .content-title::before { content: ''; position: absolute; left: 0; top: 4rpx; bottom: 4rpx; width: 8rpx; background: #fcd53f; border-radius: 4rpx; }
  154. .content-text { font-size: 28rpx; color: #555; line-height: 1.8; }
  155. .intro-images { margin-top: 32rpx; display: flex; flex-direction: column; gap: 24rpx; }
  156. .intro-img { width: 100%; border-radius: 20rpx; }
  157. .footer-bar { position: fixed; bottom: 0; left: 0; right: 0; padding: 20rpx 32rpx 40rpx; background-color: #fff; z-index: 10; box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05); }
  158. .buy-btn { width: 100%; height: 92rpx; font-size: 32rpx; font-weight: bold; color: #333; background: linear-gradient(90deg, #ffd53f, #ff9500); border: none; border-radius: 46rpx; line-height: 92rpx; }
  159. </style>