Commit c57dd383 by 胡悦

添加历史记录

1 parent 9e24a61b
<template>
<view class="layout">
<view class="title">{{ title }}</view>
<template v-if="historyList.length > 0">
<scroll-view class="record-box" scroll-y @scrolltolower="pageonReachBottom">
<view class="card-list">
<view class="card-item" v-for="item in historyList" :key="item.id">
<template>
<image
class="image-box"
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/pay.webp"
/>
</template>
<view class="name">{{ nameHide(item.customerName) }}</view>
<view class="goods-name">{{ item.customerName }}</view>
<view class="card-info">
<view class="label">车架号</view>
<view class="value">{{ item.carVin || "-" }}</view>
</view>
<view class="card-info">
<view class="label">工单号</view>
<view class="value">{{ item.payId }}</view>
</view>
<view class="card-info">
<view class="label">交易流水号</view>
<view class="value">{{ item.transactionNo }}</view>
</view>
<view class="card-info">
<view class="label">实收金额</view>
<view class="price"><view class="flag">¥</view>{{ accDiv(item.equityPrice) }}</view>
</view>
</view>
</view>
</scroll-view>
</template>
<template v-else>
<view class="no-data">
<glsx-image class="no-data-img" src="media/no-data.png" mode="scaleToFill" />
<view class="no-data-text">暂无数据</view>
</view>
</template>
<view class="end-text" v-if="historyList.length > 0 && isEnd">我是一个有底线的人</view>
</view>
</template>
<script>
import utils from '@/utils/utils';
export default {
name: 'History',
props: {
title: String,
madiaId: Number,
show: Boolean,
},
data() {
return {
historyList: [],
isEnd: false
}
},
watch: {
show (n) {
if (n) this.init()
},
watchStatus: {
immediate: true,
handler (newval) {
this.$refs?.tabs?.tabClick(0)
}
},
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
},
mounted () {
if (this.show) this.init()
},
methods: {
init () {
const { shopMerchantId } = uni.$storage.get("userInfo");
this.shopMerchantId = shopMerchantId
this.getQuotationList();
},
async getQuotationList (isSwitch = false, next = false) {
const { goodsName, shopMerchantId, currentPage } = this
if (next) this.currentPage++
const data = await uni.$api.commonApi.getQuotationList({
currentPage,
pageSize: 18,
merchantId: shopMerchantId,
orderStatus: 3,
goodsName
})
if (isSwitch) {
this.historyList = data.list
this.isEnd = false
} else {
if (data.list.length > 0) {
this.historyList = this.historyList.concat(data.list)
this.isEnd = false
} else {
if (this.historyList.length > 9) this.isEnd = true
}
}
},
pageonReachBottom() {
console.log('xiala ')
},
// 脱敏
nameHide(name) {
return name.substring(0, 1) + '*';
},
accDiv(val) {
return utils.accDiv(val, 100)
},
}
}
</script>
<style scoped lang="scss">
.layout {
width: 100vw;
height: 100vh;
position: relative;
background-image: url("@/assets/images/media/media-bg.webp");
background-size: 100%;
.title {
position: absolute;
left: 0;
top: 112rpx;
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
letter-spacing: 4rpx;
line-height: 64rpx;
text-align: center;
width: 100%;
z-index: 2;
}
.record-box {
height: 100%;
padding-top: 244rpx;
}
.card-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 48rpx;
padding: 0 64rpx 48rpx;
.card-item {
background-color: #F7F9FF;
border-radius: 32rpx;
height: 372rpx;
box-sizing: border-box;
border: 4rpx solid hsl(0, 80%, 100%);
position: relative;
box-shadow: inset 0 0 16rpx 0 #ffffff;
z-index: 11;
padding: 32rpx;
.name {
font-weight: 500;
font-size: 32rpx;
color: #292D33;
}
.goods-name {
margin-top: 12rpx;
margin-bottom: 16rpx;
font-weight: 500;
font-size: 32rpx;
color: #2C66F7;
}
.card-info {
display: flex;
align-items: center;
margin-bottom: 12rpx;
&:last-child {
margin-bottom: 0;
}
.label {
font-size: 24rpx;
color: #999EA8;
width: 136rpx;
}
.value {
font-size: 24rpx;
color: #666666;
}
.price {
display: flex;
align-items: baseline;
font-weight: 500;
font-size: 32rpx;
color: #22AC38;
.flag {
font-size: 24rpx;
}
}
}
.image-box {
position: absolute;
right: 0rpx;
top: 0rpx;
width: 252rpx;
height: 372rpx;
}
}
}
}
.end-text {
color: #999;
text-align: center;
margin: 50rpx 0;
}
.no-data {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
&-img {
width: 640rpx;
height: 272rpx;
}
&-text {
font-size: 32rpx;
color: #999999;
text-align: center;
margin-top: 24rpx;
}
}
</style>
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-04-08 11:30:30
* @LastEditors: huyue
* @LastEditTime: 2024-06-20 11:39:31
* @LastEditTime: 2024-06-24 13:52:12
-->
<template>
<view
......@@ -71,6 +71,7 @@ import ToolBox from "@/components/ToolBox.vue";
import Reception from "./components/Reception.vue";
import MediaComponent from "./components/MediaComponent.vue";
import Media_6 from "./components/Media_6.vue";
import History from "./components/History.vue";
import Guarantee from './components/Guarantee.vue';
import payPop from "./components/payPop.vue";
import FinishStep from '@/components/FinishStep.vue';
......@@ -83,7 +84,8 @@ export default {
Media_6,
payPop,
FinishStep,
Guarantee
Guarantee,
History
},
props: {
id: [String, Number],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!