orderdetails.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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=""
  48. style="width: 100%;" class="certificate-img"></image>
  49. </view>
  50. </template>
  51. </up-card>
  52. </view>
  53. <view>
  54. <up-list @scrolltolower="scrolltolower">
  55. <up-list-item v-for="(item, index) in listData.secondOrderList" :key="index">
  56. <view class="Wrap-top">
  57. <text>第一节课</text>
  58. </view>
  59. <view class="list-item">
  60. <image :src="listData.volunteerInfo.volunteerPicture" mode="aspectFill" class="item-image">
  61. </image>
  62. <view class="item-info">
  63. <view class="info-line">
  64. 类别:{{ listData.volunteerInfo.projectName }}-{{ listData.volunteerInfo.serviceSubjectName }}
  65. </view>
  66. <text>开始日期:{{item.workDate}}</text>
  67. <text>开始时间: {{item.workStartTime}}</text>
  68. </view>
  69. <view class="status-tags">
  70. {{dataList.dictLabel}}
  71. </view>
  72. </view>
  73. <view>
  74. <up-button type="primary" text="评论" @click="handlButClick"></up-button>
  75. </view>
  76. </up-list-item>
  77. </up-list>
  78. </view>
  79. </view>
  80. </template>
  81. <script setup>
  82. import {
  83. onLoad
  84. } from '@dcloudio/uni-app'
  85. import {
  86. ref,
  87. computed,
  88. onMounted
  89. } from "vue";
  90. import {
  91. orderInfomainOrderId
  92. } from "@/api/userList.js";
  93. import {
  94. systemDictdaTalist
  95. } from "@/api/userList.js"
  96. const listData = ref(); //志愿者详情数据
  97. const dataList = ref([])
  98. const orderStatus = ref(0)
  99. const score = ref(null)
  100. const mainOrderId = ref(''); //志愿者ID
  101. const certificationPictures = computed(() => {
  102. if (listData.value.volunteerInfo.certificationPicture) {
  103. return listData.value.volunteerInfo.certificationPicture.split(',')
  104. }
  105. return []
  106. })
  107. //获取用户订单列表状态
  108. async function getData() {
  109. console.log('进入');
  110. try {
  111. const res = await systemDictdaTalist().catch(err => {
  112. console.error('接口请求失败:', err);
  113. throw err; // 重新抛出以进入 catch 块
  114. });
  115. dataList.value = res.rows;
  116. console.log(dataList.value, 'dataList.value');
  117. } catch (e) {
  118. console.error('获取数据异常:', e); // 确保这里打印错误
  119. }
  120. }
  121. const handlButClick = (item) => {
  122. uni.navigateTo({
  123. url: `/pages_classify/pages/orderItem/userComment?mainOrderId=${mainOrderId.value}&data=${encodeURIComponent(JSON.stringify(listData.value))}`
  124. });
  125. }
  126. // 获取传递的参数
  127. onLoad(async (options) => {
  128. mainOrderId.value = options.mainOrderId;
  129. const res = await orderInfomainOrderId(mainOrderId.value)
  130. console.log(res, '>>>>>>>res>>>>>>>>132')
  131. listData.value = res.data;
  132. });
  133. onMounted(() => {
  134. getData()
  135. })
  136. </script>
  137. <style scoped>
  138. .address-container {
  139. padding: 20rpx;
  140. border: 1rpx solid #eee;
  141. border-radius: 10rpx;
  142. }
  143. .address-header {
  144. display: flex;
  145. align-items: center;
  146. margin-bottom: 10rpx;
  147. }
  148. .contact-info {
  149. flex: 1;
  150. /* 占据剩余空间 */
  151. font-size: 28rpx;
  152. margin-left: 25rpx;
  153. }
  154. .arrow-icon {
  155. margin-left: auto;
  156. /* 将图标推到最右侧 */
  157. }
  158. .address-detail {
  159. font-size: 26rpx;
  160. color: #666;
  161. }
  162. .card-container {
  163. display: flex;
  164. position: relative;
  165. padding: 20rpx;
  166. align-items: flex-start;
  167. background-color: #fff;
  168. border-radius: 12rpx;
  169. }
  170. /* 左侧图片 */
  171. .card-image {
  172. width: 240rpx;
  173. height: 340rpx;
  174. border-radius: 12rpx;
  175. margin-right: 30rpx;
  176. flex-shrink: 0;
  177. }
  178. /* 中间信息区域 */
  179. .card-info {
  180. flex: 1;
  181. padding-right: 100rpx;
  182. }
  183. /* 中间信息区域 */
  184. .card-info {
  185. flex: 1;
  186. padding-right: 100rpx;
  187. }
  188. .Telephone {
  189. white-space: nowrap;
  190. margin-bottom: 24rpx;
  191. font-size: 28rpx;
  192. line-height: 1.6;
  193. color: #333;
  194. }
  195. .info-item {
  196. margin-bottom: 24rpx;
  197. font-size: 28rpx;
  198. line-height: 1.6;
  199. color: #333;
  200. }
  201. /* 右上角评分 */
  202. .card-rating {
  203. position: absolute;
  204. top: 20rpx;
  205. right: 20rpx;
  206. background-color: #f8f8f8;
  207. padding: 6rpx 16rpx;
  208. border-radius: 20rpx;
  209. font-size: 24rpx;
  210. color: #ff9900;
  211. font-weight: bold;
  212. }
  213. /* 上课时间 */
  214. .Wrap-top {
  215. display: flex;
  216. justify-content: space-between;
  217. align-items: center;
  218. padding: 24rpx 20rpx 0rpx 24rpx;
  219. }
  220. .list-item {
  221. display: flex;
  222. padding: 24rpx;
  223. align-items: flex-start;
  224. gap: 24rpx;
  225. }
  226. .item-image {
  227. width: 160rpx;
  228. height: 180rpx;
  229. border-radius: 16rpx;
  230. object-fit: cover;
  231. }
  232. .item-info {
  233. flex: 1;
  234. display: flex;
  235. flex-direction: column;
  236. gap: 14rpx;
  237. }
  238. .info-line {
  239. font-size: 28rpx;
  240. color: #333;
  241. line-height: 1.6;
  242. }
  243. .item-right {
  244. display: flex;
  245. flex-direction: column;
  246. align-items: flex-end;
  247. gap: 16rpx;
  248. min-width: 160rpx;
  249. }
  250. .rating {
  251. font-size: 28rpx;
  252. color: #f39c12;
  253. font-weight: bold;
  254. }
  255. .tag {
  256. transform: scale(0.9);
  257. /* 缩小标签尺寸 */
  258. }
  259. .action-btn {
  260. margin-top: 18rpx;
  261. width: 100%;
  262. }
  263. .certificate {
  264. display: flex;
  265. flex-direction: column;
  266. }
  267. .certificate-img {
  268. margin-bottom: 24rpx;
  269. }
  270. </style>