订单列表加分页,操作指南对接扣

This commit is contained in:
Vinjor 2024-10-15 15:24:01 +08:00
parent 52cc6cd3c3
commit a7f4597468
5 changed files with 271 additions and 94 deletions

View File

@ -18,7 +18,9 @@
</view>
</view>
</uni-card>
<view style="text-align: center" v-if="activeList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
</view>
<view>
<!-- 输入框示例 -->

View File

@ -11,6 +11,8 @@
</view>
</view>
<view class="orderList">
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" bindscrolltolower="onReachBottom"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<view v-for="(item, index) in orderList" :key="index" class="orderItem">
<view class="line1">
<view class="orderNo">
@ -45,6 +47,7 @@
<view class="no-data" v-if="orderList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
</scroll-view>
</view>
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0" @change="popupChange">
@ -78,8 +81,6 @@ export default {
return {
payShow: false,
activeKey: 0,
pageNum: 1,
totalPages: 0,
imageUrl: '',
tabList: [{
id: 0,
@ -95,24 +96,18 @@ export default {
},
],
orderList: [],
pageNo: 1,
pageSize: 10,
total: 0,
//
isTriggered:false,
changeActive: false
}
},
onShow() {
onLoad() {
this.orderList = []
this.getList()
},
onReachBottom() {
if (this.pageNum >= this.totalPages) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
} else {
this.pageNum++
this.getList()
}
},
methods: {
formatTimestamp(timestamp) {
// Date
@ -127,10 +122,34 @@ export default {
//
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
/**
* 上滑加载数据
*/
onReachBottom() {
// *
if (this.pageNo * this.pageSize >= this.total) {
uni.$u.toast('没有更多数据了')
return
}
//+1,
this.pageNo++
//
this.getList()
},
/**
* 下拉刷新数据
*/
onRefresherrefresh(){
this.isTriggered = true
this.pageNo = 1
this.total = 0
this.messageList = []
this.getList()
},
async getList() {
let data = {
pageSize: 20,
pageNo: this.pageNum
pageSize: this.pageSize,
pageNo: this.pageNo
}
switch (this.activeKey) {
case 0:
@ -149,20 +168,29 @@ export default {
}
this.changeActive = false
await request({
url: '/userClient/order/page',
url: '/app-api/repair/order-info/page',
method: 'get',
params: data
params: data,
tenantIdFlag:false
}).then((res) => {
if (res.code === 200) {
this.orderList = this.orderList.concat(res.rows)
let total = res.total
this.totalPages = Math.ceil(total / this.pageSize);
// concat n
if (this.pageNo != 1) {
this.orderList = this.orderList.concat(res.data.records)
} else {
this.orderList = res.data.records
}
//
this.total = res.data.total
this.isTriggered = false
}
})
},
changeTabFun(id) {
this.activeKey = id
this.changeActive = true
this.pageNo = 1
this.total = 0
this.getList()
},
getStatus(status) {
@ -253,8 +281,8 @@ export default {
.body {
flex: 1;
height: 0;
padding: 24rpx 32rpx;
height: 100%;
padding: 0 32rpx;
overflow: auto;
}
@ -294,8 +322,10 @@ export default {
display: flex;
flex-direction: column;
row-gap: 20rpx;
height: calc(100% - 65px);
.orderItem {
margin-bottom:10rpx;
padding: 30rpx;
background: #FFFFFF;
border-radius: 12rpx 12rpx 12rpx 12rpx;

View File

@ -1,23 +1,31 @@
<template>
<view class="container">
<VNavigationBar background-color="rgba(0,0,0,0)" title-color="rgba(0,0,0,0)"></VNavigationBar>
<VNavigationBar title="操作指南" background-color="#fff" title-color="#333"></VNavigationBar>
<view class="body">
<view class="title">如何在小程序上下单车辆维修</view>
<view class="content"></view>
<view class="title">{{guideObj.title}}</view>
<rich-text style="width: 100%" :nodes="guideObj.content" />
<!-- <view class="content">{{guideObj.content}}</view>-->
</view>
</view>
</template>
<script>
import VNavigationBar from '@/components/VNavigationBar.vue'
import {getJSONData} from '@/utils/auth'
export default {
components: {
VNavigationBar
},
data() {
return {
guideObj:{
title:"",
content:"",
},
};
},
onLoad(){
this.guideObj = getJSONData("guideObj")
}
}
</script>
@ -41,6 +49,7 @@
.title {
text-align: center;
font-size: 20px;
}
}
}

View File

@ -2,27 +2,98 @@
<view class="container">
<v-navigation-bar title="操作指南" background-color="#fff" title-color="#333"></v-navigation-bar>
<view class="body">
<view @click="gotoDetail(item)" v-for="(item,index) in data" :key="index" class="guideItem">
<text class="guide_content">如何在小程序上下单车辆维修</text>
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" bindscrolltolower="onReachBottom"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<view @click="gotoDetail(item)" v-for="(item,index) in dataList" :key="index" class="guideItem">
<text class="guide_content">{{ item.title }}</text>
<image class="guideIcon" src="../../static/icons/homeInfoMore.png" mode="aspectFit"></image>
</view>
<view style="text-align: center" v-if="dataList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import VNavigationBar from '@/components/VNavigationBar.vue'
import request from "@/utils/request";
import {setJSONData} from '@/utils/auth'
export default {
components: {
VNavigationBar
},
data() {
return {
data: [{}, {}]
dataList: [],
pageNo: 1,
pageSize: 10,
total: 0,
//
isTriggered:false,
};
},
onLoad(){
this.getList()
},
methods: {
gotoDetail() {
/**
* 上滑加载数据
*/
onReachBottom() {
// *
if (this.pageNo * this.pageSize >= this.total) {
uni.$u.toast('没有更多数据了')
return
}
//+1,
this.pageNo++
//
this.getList()
},
/**
* 下拉刷新数据
*/
onRefresherrefresh(){
this.isTriggered = true
this.pageNo = 1
this.total = 0
this.dataList = []
this.getList()
},
/**
* 分页查询
*/
async getList(){
await request({
url: "/app-api/base/notice/pageList",
method: "GET",
params:{
pageNo:this.pageNo,
pageSize:this.pageSize,
type:3,
parentServer:"weixiu",
server:"wx"
},
tenantIdFlag:false
}).then((res) => {
// concat n
if (this.pageNo != 1) {
this.dataList = this.dataList.concat(res.data.records)
} else {
this.dataList = res.data.records
}
//
this.total = res.data.total
this.isTriggered = false
})
},
/**
* 查看详情页
*/
gotoDetail(item) {
setJSONData("guideObj",item)
uni.navigateTo({
url: '/pages/guideList/guideDetail'
})

View File

@ -3,6 +3,8 @@
<VNavigationBar background-color="#fff" title-color="#333" title="消息中心"></VNavigationBar>
<view class="body">
<view class="messageList">
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" bindscrolltolower="onReachBottom"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<view v-for="(item, index) in messageList" :key="index" class="messageItem">
<image class="messageIcon" src="../../static/icons/message-icon1.png" mode="aspectFit"></image>
<view class="messageContent">
@ -10,6 +12,10 @@
<view class="messageContent_content">节日快乐在这美好的时刻送上我最真挚的祝福愿你的每一天都充满阳光和欢笑每一步都走向成功和辉煌</view>
</view>
</view>
<view style="text-align: center" v-if="messageList.length==0">
<image class="" src="@/static/images/nothing.png"></image>
</view>
</scroll-view>
</view>
</view>
</view>
@ -24,9 +30,68 @@
},
data() {
return {
messageList: [{}, {}]
messageList: [{}, {}],
pageNo: 1,
pageSize: 10,
total: 0,
//
isTriggered:false,
};
},
onLoad(){
this.getList()
},
/**
* 上滑加载数据
*/
onReachBottom() {
// *
if (this.pageNo * this.pageSize >= this.total) {
uni.$u.toast('没有更多数据了')
return
}
//+1,
this.pageNo++
//
this.getList()
},
/**
* 下拉刷新数据
*/
onRefresherrefresh(){
this.isTriggered = true
this.pageNo = 1
this.total = 0
this.messageList = []
this.getList()
},
/**
* 分页查询
*/
async getList(){
// await request({
// url: "/app-api/base/notice/pageList",
// method: "GET",
// params:{
// pageNo:this.pageNo,
// pageSize:this.pageSize,
// type:3,
// parentServer:"weixiu",
// server:"wx"
// },
// tenantIdFlag:false
// }).then((res) => {
// // concat n
// if (this.pageNo != 1) {
// this.messageList = this.messageList.concat(res.data.records)
// } else {
// this.messageList = res.data.records
// }
// //
// this.total = res.data.total
// this.isTriggered = false
// })
},
}
</script>