Ver código fonte

upload

shopAdd
HolyKnightIX 2 anos atrás
pai
commit
1657b43c3a
6 arquivos alterados com 142 adições e 19 exclusões
  1. BIN
      assets/images/parking.png
  2. +3
    -3
      pages/passCar/showDetail/showDetail.js
  3. +1
    -4
      pages/passCar/showDetail/showDetail.wxml
  4. +86
    -2
      pages/passCar/showList/showList.js
  5. +10
    -2
      pages/passCar/showList/showList.wxml
  6. +42
    -8
      pages/passCar/showList/showList.wxss

BIN
assets/images/parking.png Ver arquivo

Antes Depois
Largura: 128  |  Altura: 128  |  Tamanho: 4.5 KiB

+ 3
- 3
pages/passCar/showDetail/showDetail.js Ver arquivo

@@ -19,9 +19,9 @@ Page({
*/
onLoad(options) {
const detail = JSON.parse(options.item)
detail.payTime = this.timestampToTime(detail.payTime)
detail.createTime = this.timestampToTime(detail.createTime)
detail.updateTime = this.timestampToTime(detail.updateTime)
detail.payTime = this.timestampToTime(detail.payTime, 'YYYY-MM-DD hh:mm:ss')
detail.createTime = this.timestampToTime(detail.createTime, 'YYYY-MM-DD hh:mm:ss')
detail.updateTime = this.timestampToTime(detail.updateTime, 'YYYY-MM-DD hh:mm:ss')
this.setData({
detail: detail
})


+ 1
- 4
pages/passCar/showDetail/showDetail.wxml Ver arquivo

@@ -23,10 +23,7 @@
车场订单号:{{detail.parkOrderNo}}
</view>
<view>
商户收款账户:{{detail.merchantAccount}}
</view>
<view>
商户编号:{{detail.merchantId}}
商户收款账户:{{detail.merchantAccount}}(尾号)
</view>
<view>
商户名称:{{detail.merchantName}}


+ 86
- 2
pages/passCar/showList/showList.js Ver arquivo

@@ -11,7 +11,40 @@ Page({
*/
data: {
navigationBarHeight,
carPayOrderList: [],
carPayOrderList: [
{
carNumber: '鄂A636VV',
payAmount: '55元',
payTime: '2023-2-20',
createTime: '2023-2-20',
updateTime: '2023-2-20',
parkNotify: 1
},
{
carNumber: '鄂A636VV',
payAmount: '55元',
payTime: '2023-2-20',
createTime: '2023-2-20',
updateTime: '2023-2-20',
parkNotify: 1
},
{
carNumber: '鄂A636VV',
payAmount: '55元',
payTime: '2023-2-20',
createTime: '2023-2-20',
updateTime: '2023-2-20',
parkNotify: 0
},
{
carNumber: '鄂A636VV',
payAmount: '55元',
payTime: '1676877157',
createTime: '1676877157',
updateTime: '1676877157',
parkNotify: 1
},
],
pageNum: '1'
},

@@ -21,6 +54,10 @@ Page({
url: config.api.carPayOrderList + `?pageNum=${pageNum}&pageSize=10`,
}).then(res => {
console.log(res, 'res');
res.data.list.forEach(item => {
item.payTime = this.timestampToTime(item.payTime)
item.createTime = this.timestampToTime(item.createTime)
})
if (pageNum == 1) {
const tempArr = res.data.list
tempArr.forEach(item => {
@@ -56,11 +93,58 @@ Page({
})
},

/**
* @description 根据时间戳获取时间
* @param {*} timestamp 必传,number类型,时间戳数据(10位及以下,10位至13位)
* @param {*} format 选传,string类型,提供以下时间格式:YYYY-MM-DD hh:mm:ss、YYYY/MM/DD hh:mm:ss、YYYY.MM.DD hh:mm:ss、YYYY MM DD hh:mm:ss、YYYY年MM月DD日 hh:mm:ss、YYYY-MM-DD、YYYY/MM/DD、YYYY.MM.DD、YYYY MM DD、YYYY年MM月DD日;若不传,则默认为:YYYY-MM-DD
* @returns 根据要求的时间格式
* @version V 1.0, Created by YWQ, 2022.10.20
*/
timestampToTime(timestamp, format) {
//时间戳为10位需*1000,时间戳为13位不需乘1000
const length = timestamp.length
if (length <= 10) {
var date = new Date(timestamp * 1000)
} else {
var date = new Date(timestamp)
}
let Y = String(date.getFullYear())
let M = String(date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
let D = String(date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate())
let h = String(date.getHours() + 1 < 10 ? '0' + (date.getHours()) : date.getHours())
let m = String(date.getMinutes() + 1 < 10 ? '0' + (date.getMinutes()) : date.getMinutes())
let s = String(date.getSeconds() + 1 < 10 ? '0' + (date.getSeconds()) : date.getSeconds())
// return Y + M + D + h + m + s
if (format == "YYYY-MM-DD hh:mm:ss") {
return Y + "-" + M + "-" + D + " " + h + ":" + m + ":" + s
} else if (format == "YYYY/MM/DD hh:mm:ss") {
return Y + "/" + M + "/" + D + " " + h + ":" + m + ":" + s
} else if (format == "YYYY.MM.DD hh:mm:ss") {
return Y + "." + M + "." + D + " " + h + ":" + m + ":" + s
} else if (format == "YYYY MM DD hh:mm:ss") {
return Y + " " + M + " " + D + " " + h + ":" + m + ":" + s
} else if (format == "YYYY年MM月DD日 hh:mm:ss") {
return Y + "年" + M + "月" + D + "日" + " " + h + ":" + m + ":" + s
} else if (format == "YYYY-MM-DD") {
return Y + "-" + M + "-" + D
} else if (format == "YYYY/MM/DD") {
return Y + "/" + M + "/" + D
} else if (format == "YYYY.MM.DD") {
return Y + "." + M + "." + D
} else if (format == "YYYY MM DD") {
return Y + " " + M + " " + D
} else if (format == "YYYY年MM月DD日") {
return Y + "年" + M + "月" + D + "日"
} else {
return Y + "-" + M + "-" + D
}
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getList(this.data.pageNum)
// this.getList(this.data.pageNum)
},

/**


+ 10
- 2
pages/passCar/showList/showList.wxml Ver arquivo

@@ -4,8 +4,16 @@
<view class="item" wx:for="{{carPayOrderList}}" wx:key="index">
<view data-item="{{item}}" bindtap="goDetial">
<view class="child">车牌号:{{item.carNumber}}</view>
<view class="child">支付金额:{{item.payAmount}}</view>
<view>支付时间:{{item.payTime}}</view>
<view class="payInfo">
<image class="parking" src="../../../assets/images/parking.png" mode="" />
<view class="time">
<view>创建时间:{{item.createTime}}</view>
<view>支付时间:{{item.payTime}}</view>
</view>

</view>

<view class="payFee">支付金额:<text class="highLight">{{item.payAmount}}</text></view>
<view class="detail">
查看详情
</view>


+ 42
- 8
pages/passCar/showList/showList.wxss Ver arquivo

@@ -1,36 +1,70 @@
/* pages/passCar/showList.wxss */
page {
background-color: #dfdfdf;
}
page {}

.list {
padding-top: 10rpx;

padding: 40rpx;
}

.list .item {
position: relative;
background-color: #fff;
margin-bottom: 40rpx;
margin-bottom: 15rpx;
border-radius: 20rpx;
padding: 20rpx;
padding: 20rpx 0 15rpx 0;
}

.list .item .child {
margin-bottom: 20rpx;
font-size: 28rpx;
margin: 0 0 20rpx 20rpx;
}

.list .item .payInfo {
display: flex;
padding: 0 0 20rpx 40rpx;
border-bottom: 1px solid #d1d1d1;
}

.list .item .payInfo .parking {
width: 110rpx;
height: 110rpx;
}

.list .item .payInfo .time {
position: relative;
color: #979797;
font-size: 25rpx;
top: 10rpx;
left: 30rpx;
}

.list .item .payFee {
margin: 20rpx 0 0 20rpx;
}

.list .item .payFee .highLight {
color: #fe725c;
}

.list .item .detail {
position: absolute;
right: 40rpx;
top: 50%;
width: 100rpx;
height: 40rpx;
color: #fff;
line-height: 40rpx;
font-size: 25rpx;
transform: translateY(-50%);
border-radius: 10rpx;
background-image: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
padding: 5rpx 10rpx 5rpx 10rpx;
}

.list .item .notice {
position: absolute;
right: 40rpx;
top: 25rpx;
top: 30rpx;
transform: translateY(-50%);
color: #ff0000;
}

Carregando…
Cancelar
Salvar