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.

351 lines
8.5 KiB

  1. <template>
  2. <view class="order-detail-container">
  3. <!-- 日期信息 -->
  4. <view class="order-date">
  5. <view class="order-date-icon">
  6. <u-icon name="calendar" color="#FFAA48" size="22"></u-icon>
  7. </view>
  8. <view class="order-date-text">{{ orderDate }}</view>
  9. </view>
  10. <!-- 个人信息区域 -->
  11. <view class="order-section">
  12. <view class="order-section-title">个人信息</view>
  13. <view class="order-section-content">
  14. <view class="order-image-item">
  15. <view class="order-image-label">手套照片 (共2张)</view>
  16. <view class="order-image-container">
  17. <image class="order-image" src="/static/images/personal/used.png" mode="aspectFill" @click="previewImage('/static/images/personal/used.png')"></image>
  18. </view>
  19. </view>
  20. <view class="order-image-item">
  21. <view class="order-image-label">鞋套照片 (共2张)</view>
  22. <view class="order-image-container">
  23. <image class="order-image" src="/static/images/personal/invalid.png" mode="aspectFill" @click="previewImage('/static/images/personal/invalid.png')"></image>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <!-- 宠物状况记录 -->
  29. <view class="order-section">
  30. <view class="order-section-title">宠物状况记录</view>
  31. <view class="order-section-content">
  32. <view class="pet-record" v-for="(pet, index) in pets" :key="index">
  33. <view class="pet-name">{{ pet.name }} ({{ pet.photoCount }})</view>
  34. <view class="pet-images">
  35. <view class="pet-image-container" v-for="(photo, photoIndex) in pet.photos" :key="photoIndex">
  36. <image class="pet-image" :src="photo" mode="aspectFill" @click="previewImage(photo)"></image>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 基础服务记录 -->
  43. <view class="order-section">
  44. <view class="order-section-title">基础服务记录</view>
  45. <view class="order-section-content">
  46. <view class="service-record" v-for="(service, index) in services" :key="index">
  47. <view class="service-name">{{ service.name }}</view>
  48. <view class="service-comparison">
  49. <view class="service-before-after">
  50. <view class="service-image-container">
  51. <image class="service-image" :src="service.beforeImage" mode="aspectFill" @click="previewImage(service.beforeImage)"></image>
  52. <view class="service-image-label"></view>
  53. </view>
  54. <view class="service-image-container">
  55. <image class="service-image" :src="service.afterImage" mode="aspectFill" @click="previewImage(service.afterImage)"></image>
  56. <view class="service-image-label"></view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <!-- 定制服务记录 -->
  64. <view class="order-section">
  65. <view class="order-section-title">定制服务记录</view>
  66. <view class="order-section-content">
  67. <view class="custom-service">
  68. <view class="custom-service-item">
  69. <view class="custom-service-name">遛狗 (5-30分钟)</view>
  70. <view class="custom-service-images">
  71. <image class="custom-service-image" src="/static/images/tabBar/dog.png" mode="aspectFill" @click="previewImage('/static/images/tabBar/dog.png')"></image>
  72. <image class="custom-service-image" src="/static/images/tabBar/dog_.png" mode="aspectFill" @click="previewImage('/static/images/tabBar/dog_.png')"></image>
  73. <image class="custom-service-image" src="/static/images/tabBar/home.png" mode="aspectFill" @click="previewImage('/static/images/tabBar/home.png')"></image>
  74. </view>
  75. </view>
  76. <view class="custom-service-item">
  77. <view class="custom-service-name">梳毛 (5-30分钟)</view>
  78. <view class="custom-service-images">
  79. <image class="custom-service-image" src="/static/images/tabBar/cat.png" mode="aspectFill" @click="previewImage('/static/images/tabBar/cat.png')"></image>
  80. <image class="custom-service-image" src="/static/images/tabBar/cat_.png" mode="aspectFill" @click="previewImage('/static/images/tabBar/cat_.png')"></image>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. export default {
  90. data() {
  91. return {
  92. orderId: null,
  93. orderDate: '2024年12月08日',
  94. pets: [
  95. {
  96. name: '小汪',
  97. photoCount: 2,
  98. photos: [
  99. '/static/images/tabBar/dog.png',
  100. '/static/images/tabBar/dog_.png'
  101. ]
  102. },
  103. {
  104. name: 'Billion',
  105. photoCount: 2,
  106. photos: [
  107. '/static/images/tabBar/cat.png',
  108. '/static/images/tabBar/cat_.png'
  109. ]
  110. }
  111. ],
  112. services: [
  113. {
  114. name: '猫粮前后对比',
  115. beforeImage: '/static/images/personal/invalid.png',
  116. afterImage: '/static/images/personal/used.png'
  117. },
  118. {
  119. name: '水碗前后对比',
  120. beforeImage: '/static/images/personal/invalid.png',
  121. afterImage: '/static/images/personal/used.png'
  122. },
  123. {
  124. name: '猫砂盆 厚度前后对比',
  125. beforeImage: '/static/images/personal/invalid.png',
  126. afterImage: '/static/images/personal/used.png'
  127. }
  128. ]
  129. }
  130. },
  131. onLoad(options) {
  132. if (options.orderId) {
  133. this.orderId = options.orderId;
  134. // 这里可以根据orderId加载订单详情数据
  135. this.loadOrderDetail();
  136. }
  137. },
  138. methods: {
  139. loadOrderDetail() {
  140. // 这里可以调用API获取订单详情
  141. // 示例代码,实际项目中需要替换为真实API调用
  142. /*
  143. getOrderDetail(this.orderId).then(res => {
  144. if (res && res.code === 200) {
  145. this.orderDate = res.data.orderDate;
  146. this.pets = res.data.pets;
  147. this.services = res.data.services;
  148. }
  149. });
  150. */
  151. },
  152. // 图片预览功能
  153. previewImage(urls, current) {
  154. // 调用uni-app的图片预览API
  155. uni.previewImage({
  156. urls,
  157. current,
  158. indicator: 'number',
  159. loop: true
  160. });
  161. }
  162. }
  163. }
  164. </script>
  165. <style lang="scss">
  166. .order-detail-container {
  167. padding: 15px;
  168. background-color: #f5f5f7;
  169. min-height: 100vh;
  170. }
  171. .order-date {
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. padding: 12px 16px;
  176. background-color: #FFF9EF;
  177. border-radius: 10px;
  178. margin-bottom: 15px;
  179. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  180. .order-date-icon {
  181. margin-right: 12px;
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. width: 32px;
  186. height: 32px;
  187. background-color: rgba(255, 170, 72, 0.1);
  188. border-radius: 50%;
  189. }
  190. .order-date-text {
  191. color: #A94F20;
  192. font-size: 16px;
  193. font-weight: 500;
  194. letter-spacing: 0.5px;
  195. }
  196. }
  197. .order-section {
  198. background-color: #fff;
  199. border-radius: 8px;
  200. margin-bottom: 15px;
  201. overflow: hidden;
  202. .order-section-title {
  203. padding: 12px 15px;
  204. border-bottom: 1px solid #f0f0f0;
  205. color: #333;
  206. font-size: 16px;
  207. font-weight: 500;
  208. position: relative;
  209. &::before {
  210. content: '';
  211. position: absolute;
  212. left: 0;
  213. top: 12px;
  214. height: 16px;
  215. width: 4px;
  216. background-color: #ffaa48;
  217. border-radius: 0 2px 2px 0;
  218. }
  219. }
  220. .order-section-content {
  221. padding: 15px;
  222. }
  223. }
  224. .order-image-item {
  225. margin-bottom: 15px;
  226. .order-image-label {
  227. color: #666;
  228. font-size: 14px;
  229. margin-bottom: 8px;
  230. }
  231. .order-image-container {
  232. display: flex;
  233. flex-wrap: wrap;
  234. gap: 10px;
  235. .order-image {
  236. width: 80px;
  237. height: 80px;
  238. border-radius: 4px;
  239. object-fit: cover;
  240. }
  241. }
  242. }
  243. .pet-record {
  244. margin-bottom: 20px;
  245. .pet-name {
  246. color: #333;
  247. font-size: 15px;
  248. font-weight: 500;
  249. margin-bottom: 10px;
  250. }
  251. .pet-images {
  252. display: flex;
  253. flex-wrap: wrap;
  254. gap: 10px;
  255. .pet-image-container {
  256. .pet-image {
  257. width: 80px;
  258. height: 80px;
  259. border-radius: 4px;
  260. object-fit: cover;
  261. }
  262. }
  263. }
  264. }
  265. .service-record {
  266. margin-bottom: 20px;
  267. .service-name {
  268. color: #333;
  269. font-size: 15px;
  270. font-weight: 500;
  271. margin-bottom: 10px;
  272. }
  273. .service-comparison {
  274. .service-before-after {
  275. display: flex;
  276. gap: 15px;
  277. .service-image-container {
  278. position: relative;
  279. .service-image {
  280. width: 80px;
  281. height: 80px;
  282. border-radius: 4px;
  283. object-fit: cover;
  284. }
  285. .service-image-label {
  286. position: absolute;
  287. bottom: 0;
  288. left: 0;
  289. background-color: rgba(0,0,0,0.5);
  290. color: #fff;
  291. padding: 2px 8px;
  292. font-size: 12px;
  293. border-radius: 0 0 0 4px;
  294. }
  295. }
  296. }
  297. }
  298. }
  299. .custom-service {
  300. .custom-service-item {
  301. margin-bottom: 15px;
  302. .custom-service-name {
  303. color: #333;
  304. font-size: 15px;
  305. font-weight: 500;
  306. margin-bottom: 10px;
  307. }
  308. .custom-service-images {
  309. display: flex;
  310. flex-wrap: wrap;
  311. gap: 10px;
  312. .custom-service-image {
  313. width: 80px;
  314. height: 80px;
  315. border-radius: 4px;
  316. object-fit: cover;
  317. }
  318. }
  319. }
  320. }
  321. </style>