orderdetails.vue 5.6 KB

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