orderdetails.vue 6.8 KB

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