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