orderdetails.vue 6.1 KB

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