123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- <template>
- <view>
- <view class="address-container">
- <view class="address-header">
- <!-- 左侧默认标签-->
- <up-tag text="默认" type="error" style="width: 40rpx; height: 30rpx; margin-right: 10rpx;"></up-tag>
- <!-- 中间收货人信息 -->
- <view class="contact-info">
- {{listData.address.name}}
- {{listData.address.telephone}}
- </view>
- <!-- 右侧图标 -->
- <up-icon name="arrow-right" class="arrow-icon"></up-icon>
- </view>
- <!-- 下方地址信息 -->
- <view class="address-detail">
- {{listData.address.provinceName}}
- {{listData.address.cityName}}
- {{listData.address.districtName}}
- </view>
- </view>
- <view>
- <up-card title="志愿者介绍" :head-style="{ height: '80rpx', padding: '20rpx',}">
- <template #body>
- <view class="card-container">
- <image class="card-image" :src="listData.volunteerInfo.volunteerPicture" mode="aspectFill">
- </image>
- <view class="card-info">
- <view class="info-item">{{listData.volunteerInfo.name}}</view>
- <view class="info-item">类别:{{ listData.volunteerInfo.projectName }} </view>
- <view class="info-item">科目:{{ listData.volunteerInfo.serviceSubjectName }} </view>
- <view class="Telephone">电话:{{listData.volunteerInfo.phonenumber}}</view>
- <view class="info-item">住址:{{listData.volunteerInfo.city}}</view>
- </view>
- <view class="card-rating">4.5 评分</view>
- </view>
- </template>
- </up-card>
- <up-card title="技能介绍" :head-style="{ height: '80rpx', padding: '20rpx',}">
- <template #body>
- {{listData.volunteerInfo.skillDescribe}}
- </template>
- </up-card>
- <up-card title="证书" :head-style="{ height: '80rpx', padding: '20rpx',}">
- <template #body>
- <view class="certificate">
- <image v-for="item in certificationPictures" :key="item" :src="item" mode=""
- style="width: 100%;" class="certificate-img"></image>
- </view>
- </template>
- </up-card>
- </view>
- <view>
- <up-list @scrolltolower="scrolltolower">
- <up-list-item v-for="(item, index) in listData.secondOrderList" :key="index">
- <view class="Wrap-top">
- <text>第一节课</text>
- </view>
- <view class="list-item">
- <image :src="listData.volunteerInfo.volunteerPicture" mode="aspectFill" class="item-image">
- </image>
- <view class="item-info">
- <view class="info-line">
- 类别:{{ listData.volunteerInfo.projectName }}-{{ listData.volunteerInfo.serviceSubjectName }}
- </view>
- <text>开始日期:{{item.workDate}}</text>
- <text>开始时间: {{item.workStartTime}}</text>
-
-
- {{dictSortMap[item.orderStatus]}}
- </view>
- <view class="status-tags">
- {{dataList.dictLabel}}
- </view>
- </view>
- <view>
- <up-button type="primary" text="评论" @click="handlButClick"></up-button>
- </view>
- </up-list-item>
- </up-list>
- </view>
- </view>
- </template>
- <script setup>
- import {
- onLoad
- } from '@dcloudio/uni-app'
- import {
- ref,
- computed,
- onMounted
- } from "vue";
- import {
- orderInfomainOrderId
- } from "@/api/userList.js";
- import {
- systemDictdaTalist
- } from "@/api/userList.js"
- const listData = ref(); //志愿者详情数据
- const dataList = ref([])
- const orderStatus = ref(0)
- const score = ref(null)
- const mainOrderId = ref(''); //志愿者ID
- const certificationPictures = computed(() => {
- if (listData.value.volunteerInfo.certificationPicture) {
- return listData.value.volunteerInfo.certificationPicture.split(',')
- }
- return []
- })
-
- const dictSortMap = computed(() => {
- let mapObj = {}
- dataList.value.forEach((item => {
- mapObj[item.dictValue] = item.dictLabel
- }))
- return mapObj
- })
- //获取用户订单列表状态
- async function getData() {
- console.log('进入');
- try {
- const res = await systemDictdaTalist().catch(err => {
- console.error('接口请求失败:', err);
- throw err; // 重新抛出以进入 catch 块
- });
- dataList.value = res.rows;
- console.log(dataList.value, 'dataList.value');
- } catch (e) {
- console.error('获取数据异常:', e); // 确保这里打印错误
- }
- }
- const handlButClick = (item) => {
- uni.navigateTo({
- url: `/pages_classify/pages/orderItem/userComment?mainOrderId=${mainOrderId.value}&data=${encodeURIComponent(JSON.stringify(listData.value))}`
- });
- }
- // 获取传递的参数
- onLoad(async (options) => {
- mainOrderId.value = options.mainOrderId;
- const res = await orderInfomainOrderId(mainOrderId.value)
- console.log(res, '>>>>>>>res>>>>>>>>132')
- listData.value = res.data;
- });
- onMounted(() => {
- getData()
- })
- </script>
- <style scoped>
- .address-container {
- padding: 20rpx;
- border: 1rpx solid #eee;
- border-radius: 10rpx;
- }
- .address-header {
- display: flex;
- align-items: center;
- margin-bottom: 10rpx;
- }
- .contact-info {
- flex: 1;
- /* 占据剩余空间 */
- font-size: 28rpx;
- margin-left: 25rpx;
- }
- .arrow-icon {
- margin-left: auto;
- /* 将图标推到最右侧 */
- }
- .address-detail {
- font-size: 26rpx;
- color: #666;
- }
- .card-container {
- display: flex;
- position: relative;
- padding: 20rpx;
- align-items: flex-start;
- background-color: #fff;
- border-radius: 12rpx;
- }
- /* 左侧图片 */
- .card-image {
- width: 240rpx;
- height: 340rpx;
- border-radius: 12rpx;
- margin-right: 30rpx;
- flex-shrink: 0;
- }
- /* 中间信息区域 */
- .card-info {
- flex: 1;
- padding-right: 100rpx;
- }
- /* 中间信息区域 */
- .card-info {
- flex: 1;
- padding-right: 100rpx;
- }
- .Telephone {
- white-space: nowrap;
- margin-bottom: 24rpx;
- font-size: 28rpx;
- line-height: 1.6;
- color: #333;
- }
- .info-item {
- margin-bottom: 24rpx;
- font-size: 28rpx;
- line-height: 1.6;
- color: #333;
- }
- /* 右上角评分 */
- .card-rating {
- position: absolute;
- top: 20rpx;
- right: 20rpx;
- background-color: #f8f8f8;
- padding: 6rpx 16rpx;
- border-radius: 20rpx;
- font-size: 24rpx;
- color: #ff9900;
- font-weight: bold;
- }
- /* 上课时间 */
- .Wrap-top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 24rpx 20rpx 0rpx 24rpx;
- }
- .list-item {
- display: flex;
- padding: 24rpx;
- align-items: flex-start;
- gap: 24rpx;
- }
- .item-image {
- width: 160rpx;
- height: 180rpx;
- border-radius: 16rpx;
- object-fit: cover;
- }
- .item-info {
- flex: 1;
- display: flex;
- flex-direction: column;
- gap: 14rpx;
- }
- .info-line {
- font-size: 28rpx;
- color: #333;
- line-height: 1.6;
- }
- .item-right {
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- gap: 16rpx;
- min-width: 160rpx;
- }
- .rating {
- font-size: 28rpx;
- color: #f39c12;
- font-weight: bold;
- }
- .tag {
- transform: scale(0.9);
- /* 缩小标签尺寸 */
- }
- .action-btn {
- margin-top: 18rpx;
- width: 100%;
- }
- .certificate {
- display: flex;
- flex-direction: column;
- }
- .certificate-img {
- margin-bottom: 24rpx;
- }
- </style>
|