You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
929 B
38 lines
929 B
4 months ago
|
<template>
|
||
|
<view class="card_view ">
|
||
|
<text class="card_batch ">纳入便次</text>
|
||
|
<text class="card_content ">{{timestampToDateFormat(planArriveTime)}}<text v-if='deliNo && planArriveTime'>-</text>{{String(deliNo).length < 2 ? ('0' + deliNo) :deliNo }}</text>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
data() {
|
||
|
return {}
|
||
|
},
|
||
|
props: {
|
||
|
planArriveTime: {
|
||
|
type: String,
|
||
|
default: ""
|
||
|
},
|
||
|
deliNo: {
|
||
|
type: String,
|
||
|
default: ""
|
||
|
}
|
||
|
},
|
||
|
methods:{
|
||
|
timestampToDateFormat(timestamp) {
|
||
|
const dateObj = new Date(timestamp); // 创建Date对象
|
||
|
const year = dateObj.getFullYear(); // 获取年份
|
||
|
const month = ("0" + (dateObj.getMonth() + 1)).slice(-2); // 获取月份,并补零
|
||
|
const day = ("0" + dateObj.getDate()).slice(-2); // 获取日期,并补零
|
||
|
return `${year}${month}${day}`; // 返回转换后的日期格式
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style>
|
||
|
</style>
|