ebike-ui/ebike-user/pages/user/login/RepairReport.vue

198 lines
4.2 KiB
Vue
Raw Normal View History

2025-04-28 15:37:57 +08:00
<template>
<view class="container">
2025-05-16 16:52:21 +08:00
2025-04-28 15:37:57 +08:00
<!-- 切换的页面内容 -->
<view class="content">
2025-05-16 16:52:21 +08:00
<!-- 消费页面内容 -->
2025-05-20 14:30:55 +08:00
<z-paging ref="paging_consume" :fixed="false" height="100vh" v-model="ConsumeDataList"
2025-05-16 16:52:21 +08:00
@query="loadMoreDataConsume" :default-page-no="1" :default-page-size="4" :auto-show-back-to-top="true">
<uni-card :title="`车辆编号:${item.bikeCode}`" v-for="(item,index) in ConsumeDataList">
<view class="flex justify-between card-header">
<view class="order-time">提交时间{{item.reportAt}}</view>
</view>
<view class="flex justify-between card-info">
<view class="ride-info">
<image :src="`${imgPath}static/userui/icon/问题描述.png`"></image>
<span>问题描述:{{item.faultDescription}}</span>
2025-04-28 15:37:57 +08:00
</view>
2025-05-16 16:52:21 +08:00
</view>
<view class="text-right status-tag">
<span class="corui-completed">已上报故障</span>
</view>
</uni-card>
</z-paging>
2025-04-28 15:37:57 +08:00
</view>
</view>
</template>
<script setup>
2025-05-16 16:52:21 +08:00
import {
ref,
onMounted
} from 'vue';
2025-04-28 15:37:57 +08:00
import * as api from '@/utils/api.js';
import config from '@/utils/config';
const imgPath = config.imgPath;
2025-05-16 16:52:21 +08:00
import {
showModelMessage,
jkcBaseEncode,
jkcBaseDecode
} from '@/utils/tools.js';
import {
onLoad
} from '@dcloudio/uni-app';
2025-04-28 15:37:57 +08:00
// 使用ref来声明选中的标签
const selectedTab = ref('consume');
// 切换选中的标签
const selectTab = (tab) => {
selectedTab.value = tab;
};
2025-05-16 16:52:21 +08:00
const wechat_user = ref({});
2025-04-28 15:37:57 +08:00
const paging_consume = ref(null);
2025-05-16 16:52:21 +08:00
const paging_refund = ref(null);
2025-04-28 15:37:57 +08:00
const RefundDataList = ref([]);
const ConsumeDataList = ref([]);
const scrollHeight = ref(null);
// 加载消费数据
const loadMoreDataConsume = (pageNo, pageSize) => {
const params = {
2025-05-16 16:52:21 +08:00
"userId": wechat_user.value.userId,
"pageParam": {
"pageNum": pageNo,
"pageSize": pageSize
}
2025-04-28 15:37:57 +08:00
};
2025-05-16 16:52:21 +08:00
api.callOrdereApi("ebikeUserFaultreport/getFaultListByWeChatUser", params).then((res) => {
2025-04-28 15:37:57 +08:00
if (res.code === 200) {
const records = res.data;
paging_consume.value.complete(records);
} else {
paging_consume.value.complete(false);
}
});
};
2025-05-16 16:52:21 +08:00
const goToRepairDetails = () => {
uni.navigateTo({
url: '/pages/user/login/RepairDetails'
});
2025-04-28 15:37:57 +08:00
}
// 加载退款数据
const loadMoreDataRefund = (pageNo, pageSize) => {
const params = {
"用户ID": 123,
2025-05-16 16:52:21 +08:00
"pageParam": {
"pageNum": pageNo,
"pageSize": pageSize
}
2025-04-28 15:37:57 +08:00
};
2025-05-16 16:52:21 +08:00
2025-04-28 15:37:57 +08:00
api.callEbikeInfo("订单接口???", params).then((res) => {
if (res.code === 200) {
const records = res.data;
paging_refund.value.complete(records);
} else {
paging_refund.value.complete(false);
}
});
};
2025-05-16 16:52:21 +08:00
onLoad((options) => {
2025-04-28 15:37:57 +08:00
// 获取设备信息
const systemInfo = uni.getSystemInfoSync();
2025-05-16 16:52:21 +08:00
// 获取屏幕高度和状态栏高度
2025-04-28 15:37:57 +08:00
const screenHeight = systemInfo.screenHeight;
const statusBarHeight = systemInfo.statusBarHeight;
2025-05-16 16:52:21 +08:00
// 计算去掉状态栏后的可用区域高度
2025-04-28 15:37:57 +08:00
scrollHeight.value = screenHeight - statusBarHeight;
2025-05-16 16:52:21 +08:00
wechat_user.value = JSON.parse(jkcBaseDecode(uni.getStorageSync("wechat_user")));
})
2025-04-28 15:37:57 +08:00
</script>
<style scoped>
.container {
height: 100vh;
background-color: white;
}
.selectTop {
width: 20px;
height: 2px;
background-color: rgb(76, 188, 74);
margin-left: 30px;
margin-top: 5px;
border-radius: 2px;
}
.separator {
color: rgb(202, 202, 202);
}
.wztitle {
font-size: 16px;
font-weight: bold;
}
.active {
color: rgb(76, 188, 74);
}
.card-header {
font-size: 14px;
color: #333;
}
.card-header .order-time {
font-size: 12px;
color: #a2a2a2;
}
.card-info {
margin-top: 2px;
font-size: 16px;
}
.card-info .ride-info {
color: rgb(15, 27, 38);
font-size: 15px;
}
.card-info .ride-info image {
width: 15px;
height: 15px;
margin-right: 5px;
}
.status-tag {
margin-top: 2px;
}
.corui-ride-in-progress {
background-color: rgb(37, 172, 51);
color: #fff;
padding: 4px 10px;
font-size: 12px;
border-radius: 5px;
}
2025-05-16 16:52:21 +08:00
.corui-completed {
2025-04-28 15:37:57 +08:00
background-color: rgb(195, 198, 203);
color: #fff;
padding: 4px 10px;
font-size: 12px;
border-radius: 5px;
}
2025-05-16 16:52:21 +08:00
.corui-processing {
2025-04-28 15:37:57 +08:00
background-color: rgb(218, 102, 17);
color: #fff;
padding: 4px 10px;
font-size: 12px;
border-radius: 5px;
}
2025-05-16 16:52:21 +08:00
</style>