orderdetails.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view>
  3. <view>
  4. <view>
  5. <up-tag text="标签" type="error" style="width: 40rpx; height: 30rpx;"></up-tag>
  6. <view>
  7. {{listData.address.area}}
  8. </view>
  9. <view>
  10. {{listData.address.name}}
  11. {{listData.address.telephone}}
  12. </view>
  13. <view>
  14. {{listData.address.address}}
  15. </view>
  16. </view>
  17. </view>
  18. <view>
  19. <up-card title="志愿者介绍" :head-style="{ height: '80rpx', padding: '20rpx',}">
  20. <template #body>
  21. <view class="card-container">
  22. <image class="card-image" :src="listData.volunteerInfo.certificationPicture" mode="aspectFill">
  23. </image>
  24. <view class="card-info">
  25. <view class="info-item">{{listData.volunteerInfo.name}}</view>
  26. <view class="info-item">类别:11</view>
  27. <view class="info-item">科目:111</view>
  28. <view class="Telephone">电话:{{listData.volunteerInfo.phonenumber}}</view>
  29. <view class="info-item">住址:{{listData.volunteerInfo.city}}</view>
  30. </view>
  31. <view class="card-rating">4.5 评分</view>
  32. </view>
  33. </template>
  34. </up-card>
  35. <up-card title="技能介绍" :head-style="{ height: '80rpx', padding: '20rpx',}">
  36. <template #body>
  37. {{listData.volunteerInfo.remark}}
  38. </template>
  39. </up-card>
  40. <up-card title="证书" :head-style="{ height: '80rpx', padding: '20rpx',}">
  41. <template #body>
  42. <image src="/static/zhiyuanzhe.jpg" mode="" style="width: 100%;"></image>
  43. </template>
  44. </up-card>
  45. </view>
  46. <view>
  47. <up-list @scrolltolower="scrolltolower">
  48. <up-list-item v-for="(item, index) in listData.secondOrderList" :key="index">
  49. <view class="Wrap-top">
  50. <text>第一节课</text>
  51. </view>
  52. <view class="list-item">
  53. <image src="/static/img/dd.png" mode="aspectFill" class="item-image"></image>
  54. <!-- 状态:orderStatus: 0未开始 ,1进行中,2已完成-->
  55. <!-- score如果=null,显示待评价, -->
  56. <view class="item-info">
  57. <view class="info-line">类别:serviceCategory</view>
  58. <text>开始日期:{{item.workDate}}</text>
  59. <text>开始时间: {{item.workStartTime}}</text>
  60. </view>
  61. <view class="item-right">
  62. <view class="rating" v-if="score === null">待评价</view>
  63. <up-tag v-if="orderStatus == 0">未开始</up-tag>
  64. <up-tag v-else-if="orderStatus == 1">进行中</up-tag>
  65. <up-tag v-else-if="orderStatus == 2">已完成</up-tag>
  66. </view>
  67. </view>
  68. </up-list-item>
  69. </up-list>
  70. </view>
  71. </view>
  72. </template>
  73. <script setup>
  74. import {
  75. onLoad
  76. } from '@dcloudio/uni-app'
  77. import {
  78. ref
  79. } from "vue";
  80. import {
  81. orderInfomainOrderId
  82. } from "@/api/userList.js";
  83. const listData = ref(); //志愿者详情数据
  84. const orderStatus = ref(0)
  85. const score = ref(null)
  86. const mainOrderId = ref(''); //志愿者ID
  87. // 获取传递的参数
  88. onLoad(async (options) => {
  89. mainOrderId.value = options.mainOrderId; // 存储到响应式变量
  90. const res = await orderInfomainOrderId(mainOrderId.value)
  91. listData.value = res.data;
  92. console.log(listData.value, '获取用户详情')
  93. });
  94. </script>
  95. <style scoped>
  96. .card-container {
  97. display: flex;
  98. position: relative;
  99. padding: 20rpx;
  100. align-items: flex-start;
  101. background-color: #fff;
  102. border-radius: 12rpx;
  103. }
  104. /* 左侧图片 */
  105. .card-image {
  106. width: 240rpx;
  107. height: 340rpx;
  108. border-radius: 12rpx;
  109. margin-right: 30rpx;
  110. flex-shrink: 0;
  111. }
  112. /* 中间信息区域 */
  113. .card-info {
  114. flex: 1;
  115. padding-right: 100rpx;
  116. }
  117. /* 中间信息区域 */
  118. .card-info {
  119. flex: 1;
  120. padding-right: 100rpx;
  121. }
  122. .Telephone {
  123. white-space: nowrap;
  124. margin-bottom: 24rpx;
  125. font-size: 28rpx;
  126. line-height: 1.6;
  127. color: #333;
  128. }
  129. .info-item {
  130. margin-bottom: 24rpx;
  131. font-size: 28rpx;
  132. line-height: 1.6;
  133. color: #333;
  134. }
  135. /* 右上角评分 */
  136. .card-rating {
  137. position: absolute;
  138. top: 20rpx;
  139. right: 20rpx;
  140. background-color: #f8f8f8;
  141. padding: 6rpx 16rpx;
  142. border-radius: 20rpx;
  143. font-size: 24rpx;
  144. color: #ff9900;
  145. font-weight: bold;
  146. }
  147. /* 上课时间 */
  148. .Wrap-top {
  149. display: flex;
  150. justify-content: space-between;
  151. align-items: center;
  152. padding: 24rpx 20rpx 0rpx 24rpx;
  153. }
  154. .list-item {
  155. display: flex;
  156. padding: 24rpx;
  157. align-items: flex-start;
  158. gap: 24rpx;
  159. }
  160. .item-image {
  161. width: 160rpx;
  162. height: 180rpx;
  163. border-radius: 16rpx;
  164. object-fit: cover;
  165. }
  166. .item-info {
  167. flex: 1;
  168. display: flex;
  169. flex-direction: column;
  170. gap: 14rpx;
  171. }
  172. .info-line {
  173. font-size: 28rpx;
  174. color: #333;
  175. line-height: 1.6;
  176. }
  177. .item-right {
  178. display: flex;
  179. flex-direction: column;
  180. align-items: flex-end;
  181. gap: 16rpx;
  182. min-width: 160rpx;
  183. }
  184. .rating {
  185. font-size: 28rpx;
  186. color: #f39c12;
  187. font-weight: bold;
  188. }
  189. .tag {
  190. transform: scale(0.9);
  191. /* 缩小标签尺寸 */
  192. }
  193. .action-btn {
  194. margin-top: 18rpx;
  195. width: 100%;
  196. }
  197. </style>