baodeng_xcx/pages/tj.vue

202 lines
4.8 KiB
Vue
Raw Permalink Normal View History

2023-12-05 16:45:28 +08:00
<template>
2024-01-24 11:55:35 +08:00
<view class="page">
2025-05-14 15:14:12 +08:00
<u-navbar :is-back="false" title="订单" :border-bottom="false" back-icon-color="000" :background="bgc" title-color='#fff' title-size='36'
height='36' id="navbar">
</u-navbar>
<view class="nav"></view>
<scroll-view class="list" @scrolltolower="handqixing" scroll-y refresher-enabled @refresherrefresh="onRefresh" :refresher-triggered="isRefreshing" refresher-default-style="white" v-if="orderlist.length != 0">
<view class="list_item" v-for="(item,index) in orderlist" :key="index" @click="btnxq(item.id)">
<view class="top">
<view class="">
充值类-爆灯充值
</view>
<view class="">
<text style="font-size: 26rpx;" v-if="item.status == 'FINISHED'">交易成功</text>
<text v-if="item.status == 'WAIT PAY'" style="color: #9F9F9F;font-size: 26rpx;">交易取消</text>
<text v-if="item.status == 'CANCELED'" style="color: #9F9F9F;font-size: 26rpx;">交易取消</text>
<text style="font-size: 26rpx;" v-if="item.status == 'REFUNDED'">交易成功</text>
2025-06-06 11:14:06 +08:00
<text style="font-size: 26rpx;color: #9F9F9F;" v-if="item.status == 'WAIT_PAY'">待支付</text>
2025-05-14 15:14:12 +08:00
</view>
2024-01-27 16:37:52 +08:00
</view>
2025-05-14 15:14:12 +08:00
<view class="bd">
<view class="lt">
<image src="https://api.ccttiot.com/smartmeter/img/static/ubGWMXEuBaNSGPLrcN7P" mode=""></image>
</view>
<view class="rt">
<view class="bai">
爆灯充值-{{item.suitNum}}
</view>
<view class="hui">
下单时间{{item.createTime}}
</view>
</view>
2024-01-27 16:37:52 +08:00
</view>
2025-05-14 15:14:12 +08:00
<view class="bot">
<view class="">
</view>
<view class="">
2025-06-06 11:14:06 +08:00
<text>金额{{item.payAmount}}</text>
2025-05-14 15:14:12 +08:00
</view>
</view>
</view>
<view class="wu">
没有更多订单了...
2024-01-27 16:37:52 +08:00
</view>
2025-05-14 15:14:12 +08:00
</scroll-view>
<view style="width: 480rpx;height: 373rpx;margin: auto;margin-top: 390rpx;" v-else>
<image src="https://api.ccttiot.com/smartmeter/img/static/uEiNJh8Rfurw9ORQzlit" mode="aspectFit"></image>
2024-01-27 16:37:52 +08:00
</view>
2023-12-05 16:45:28 +08:00
</view>
</template>
<script>
export default {
data() {
return {
2025-05-14 15:14:12 +08:00
bgc: {
backgroundColor: "#010000",
2024-03-25 19:46:07 +08:00
},
2025-05-14 15:14:12 +08:00
orderlist:[],
total:'',
pageNum:1,
isRefreshing: false
2024-01-23 19:15:52 +08:00
}
},
2024-03-25 19:46:07 +08:00
onShow() {
2025-05-14 15:14:12 +08:00
this.pageNum = 1
this.getlist()
2024-01-24 11:55:35 +08:00
},
2024-01-23 19:15:52 +08:00
methods: {
2025-05-14 15:14:12 +08:00
// 下拉刷新
onRefresh() {
this.isRefreshing = true
this.pageNum = 1
this.getlist()
setTimeout(() => {
this.isRefreshing = false
}, 1000)
2024-03-25 19:46:07 +08:00
},
2025-05-14 15:14:12 +08:00
getlist(){
this.$u.get(`/app/order?pageNum=${this.pageNum}&pageSize=20&`).then(res =>{
if(res.code == 200){
this.total = res.total
if(this.pageNum == 1){
this.orderlist = res.rows
this.pageNum++
}else{
this.orderlist = this.orderlist.concat(res.rows)
this.pageNum++
}
}else if(res.code == 401){
uni.showModal({
title: '提示',
content: '你还未登录,是否去登录?',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
uni.reLaunch({
url:'/pages/login/login'
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
})
2024-03-25 19:46:07 +08:00
},
2025-05-14 15:14:12 +08:00
// 上拉加载更多
handqixing(){
if(this.total > this.orderlist.length){
this.getlist()
}else{
console.log(11);
2024-01-27 16:37:52 +08:00
}
},
2025-05-14 15:14:12 +08:00
// 点击进入订单详情
btnxq(orderid){
uni.navigateTo({
url:'/pages/nearbystores/index?orderid=' + orderid
})
}
2024-01-23 19:15:52 +08:00
}
}
2023-12-05 16:45:28 +08:00
</script>
2024-01-24 11:55:35 +08:00
<style lang="scss">
page {
2025-05-14 15:14:12 +08:00
background-color: #111111;
2024-01-24 11:55:35 +08:00
}
2025-05-14 15:14:12 +08:00
.list{
width: 100%;
height: 86vh;
overflow: scroll;
.wu{
font-size: 24rpx;
color: #808080;
width: 100%;
text-align: center;
margin-top: 36rpx;
2024-01-24 11:55:35 +08:00
}
2025-05-14 15:14:12 +08:00
.list_item{
width: 702rpx;
height: 288rpx;
background: #010000;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin: auto;
margin-top: 26rpx;
padding: 22rpx 34rpx;
box-sizing: border-box;
.bot{
2024-01-27 16:37:52 +08:00
display: flex;
justify-content: space-between;
2025-05-14 15:14:12 +08:00
padding: 0 2rpx;
box-sizing: border-box;
font-size: 26rpx;
color: #9F9F9F;
text{
font-size: 30rpx;
color: #FFFFFF;
margin-left: 28rpx;
}
}
.bd{
display: flex;
2024-01-27 16:37:52 +08:00
align-items: center;
2025-05-14 15:14:12 +08:00
margin-top: 20rpx;
.lt{
image{
width: 122rpx;
height: 122rpx;
}
margin-right: 42rpx;
2024-01-27 16:37:52 +08:00
}
2025-05-14 15:14:12 +08:00
.rt{
.bai{
font-size: 26rpx;
color: #FFFFFF;
margin-top: 6rpx;
}
.hui{
font-size: 26rpx;
color: #9F9F9F;
margin-top: 10rpx;
}
2024-01-27 16:37:52 +08:00
}
}
2025-05-14 15:14:12 +08:00
.top{
display: flex;
justify-content: space-between;
font-size: 32rpx;
color: #FFFFFF;
}
2024-01-27 16:37:52 +08:00
}
2024-01-24 11:55:35 +08:00
}
2025-05-14 15:14:12 +08:00
.nav{
width: 100%;
height: 30rpx;
background-color: #010000;
}
2024-01-24 11:55:35 +08:00
</style>