orderdetails.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. });
  104. </script>
  105. <style scoped>
  106. .address-container {
  107. padding: 20rpx;
  108. border: 1rpx solid #eee;
  109. border-radius: 10rpx;
  110. }
  111. .address-header {
  112. display: flex;
  113. align-items: center;
  114. margin-bottom: 10rpx;
  115. }
  116. .contact-info {
  117. flex: 1; /* 占据剩余空间 */
  118. font-size: 28rpx;
  119. margin-left: 25rpx;
  120. }
  121. .arrow-icon {
  122. margin-left: auto; /* 将图标推到最右侧 */
  123. }
  124. .address-detail {
  125. font-size: 26rpx;
  126. color: #666;
  127. }
  128. .card-container {
  129. display: flex;
  130. position: relative;
  131. padding: 20rpx;
  132. align-items: flex-start;
  133. background-color: #fff;
  134. border-radius: 12rpx;
  135. }
  136. /* 左侧图片 */
  137. .card-image {
  138. width: 240rpx;
  139. height: 340rpx;
  140. border-radius: 12rpx;
  141. margin-right: 30rpx;
  142. flex-shrink: 0;
  143. }
  144. /* 中间信息区域 */
  145. .card-info {
  146. flex: 1;
  147. padding-right: 100rpx;
  148. }
  149. /* 中间信息区域 */
  150. .card-info {
  151. flex: 1;
  152. padding-right: 100rpx;
  153. }
  154. .Telephone {
  155. white-space: nowrap;
  156. margin-bottom: 24rpx;
  157. font-size: 28rpx;
  158. line-height: 1.6;
  159. color: #333;
  160. }
  161. .info-item {
  162. margin-bottom: 24rpx;
  163. font-size: 28rpx;
  164. line-height: 1.6;
  165. color: #333;
  166. }
  167. /* 右上角评分 */
  168. .card-rating {
  169. position: absolute;
  170. top: 20rpx;
  171. right: 20rpx;
  172. background-color: #f8f8f8;
  173. padding: 6rpx 16rpx;
  174. border-radius: 20rpx;
  175. font-size: 24rpx;
  176. color: #ff9900;
  177. font-weight: bold;
  178. }
  179. /* 上课时间 */
  180. .Wrap-top {
  181. display: flex;
  182. justify-content: space-between;
  183. align-items: center;
  184. padding: 24rpx 20rpx 0rpx 24rpx;
  185. }
  186. .list-item {
  187. display: flex;
  188. padding: 24rpx;
  189. align-items: flex-start;
  190. gap: 24rpx;
  191. }
  192. .item-image {
  193. width: 160rpx;
  194. height: 180rpx;
  195. border-radius: 16rpx;
  196. object-fit: cover;
  197. }
  198. .item-info {
  199. flex: 1;
  200. display: flex;
  201. flex-direction: column;
  202. gap: 14rpx;
  203. }
  204. .info-line {
  205. font-size: 28rpx;
  206. color: #333;
  207. line-height: 1.6;
  208. }
  209. .item-right {
  210. display: flex;
  211. flex-direction: column;
  212. align-items: flex-end;
  213. gap: 16rpx;
  214. min-width: 160rpx;
  215. }
  216. .rating {
  217. font-size: 28rpx;
  218. color: #f39c12;
  219. font-weight: bold;
  220. }
  221. .tag {
  222. transform: scale(0.9);
  223. /* 缩小标签尺寸 */
  224. }
  225. .action-btn {
  226. margin-top: 18rpx;
  227. width: 100%;
  228. }
  229. .certificate {
  230. display: flex;
  231. flex-direction: column;
  232. }
  233. .certificate-img {
  234. margin-bottom: 24rpx;
  235. }
  236. </style>