订单列表加分页,操作指南对接扣
This commit is contained in:
parent
52cc6cd3c3
commit
a7f4597468
@ -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>
|
||||
<!-- 输入框示例 -->
|
||||
|
@ -11,40 +11,43 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderList">
|
||||
<view v-for="(item, index) in orderList" :key="index" class="orderItem">
|
||||
<view class="line1">
|
||||
<view class="orderNo">
|
||||
订单编号:{{ item.orderNo }}
|
||||
<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">
|
||||
订单编号:{{ item.orderNo }}
|
||||
</view>
|
||||
<text class="orderStatus" :class="['status_' + item.status]">
|
||||
{{ getStatus(item.orderStatus) }}
|
||||
</text>
|
||||
</view>
|
||||
<text class="orderStatus" :class="['status_' + item.status]">
|
||||
{{ getStatus(item.orderStatus) }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="orderInfo">
|
||||
<image class="orderInfoIcon" src="@/static/icons/Frame28.png" mode="aspectFit"></image>
|
||||
<text class="orderInfoText">{{ item.goodsTitle }}</text>
|
||||
</view>
|
||||
<view class="orderInfo">
|
||||
<image class="orderInfoIcon" src="@/static/icons/Frame27.png" mode="aspectFit"></image>
|
||||
<text class="orderInfoText">{{ item.tenantName || "蓝安-中鑫之宝" }}</text>
|
||||
</view>
|
||||
<view class="line2">
|
||||
<view>
|
||||
共计
|
||||
<text class="orderAmountUnit">¥</text>
|
||||
<text class="orderAmount">{{ item.payMoney }}</text>
|
||||
<view class="orderInfo">
|
||||
<image class="orderInfoIcon" src="@/static/icons/Frame28.png" mode="aspectFit"></image>
|
||||
<text class="orderInfoText">{{ item.goodsTitle }}</text>
|
||||
</view>
|
||||
<view class="orderInfo">
|
||||
<image class="orderInfoIcon" src="@/static/icons/Frame27.png" mode="aspectFit"></image>
|
||||
<text class="orderInfoText">{{ item.tenantName || "蓝安-中鑫之宝" }}</text>
|
||||
</view>
|
||||
<view class="line2">
|
||||
<view>
|
||||
共计
|
||||
<text class="orderAmountUnit">¥</text>
|
||||
<text class="orderAmount">{{ item.payMoney }}</text>
|
||||
</view>
|
||||
<text>{{ formatTimestamp(item.createTime) }}</text>
|
||||
</view>
|
||||
<view class="line3">
|
||||
<view v-if="item.orderStatus == '0'" @click="goPay(item)" class="showOrder">支付</view>
|
||||
<view v-if="item.goodsType == '2'" @click="gotoDetail(item)" class="showOrder">查看订单</view>
|
||||
<view @click="gotoEvaluate(item)" class="evaluate" v-if="item.orderStatus === '1' && !item.commentDesc">评价订单</view>
|
||||
</view>
|
||||
<text>{{ formatTimestamp(item.createTime) }}</text>
|
||||
</view>
|
||||
<view class="line3">
|
||||
<view v-if="item.orderStatus == '0'" @click="goPay(item)" class="showOrder">支付</view>
|
||||
<view v-if="item.goodsType == '2'" @click="gotoDetail(item)" class="showOrder">查看订单</view>
|
||||
<view @click="gotoEvaluate(item)" class="evaluate" v-if="item.orderStatus === '1' && !item.commentDesc">评价订单</view>
|
||||
<view class="no-data" v-if="orderList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
</view>
|
||||
<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;
|
||||
|
@ -1,24 +1,32 @@
|
||||
<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>
|
||||
|
||||
@ -34,13 +42,14 @@
|
||||
height: 0;
|
||||
margin: 32rpx;
|
||||
padding: 30rpx;
|
||||
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 20rpx;
|
||||
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
<image class="guideIcon" src="../../static/icons/homeInfoMore.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<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'
|
||||
})
|
||||
@ -35,36 +106,36 @@
|
||||
.container {
|
||||
background-color: #F3F5F7;
|
||||
height: 100%;
|
||||
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
.body {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
padding: 0 0 20rpx;
|
||||
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
.guideItem {
|
||||
margin: 20rpx 32rpx 0;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
column-gap: 10rpx;
|
||||
|
||||
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
|
||||
|
||||
.guide_content {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
|
||||
.guideIcon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
|
@ -1,18 +1,24 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<VNavigationBar background-color="#fff" title-color="#333" title="消息中心"></VNavigationBar>
|
||||
<view class="body">
|
||||
<view class="messageList">
|
||||
<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">
|
||||
<view class="messageTitle">系统通知</view>
|
||||
<view class="messageContent_content">节日快乐!在这美好的时刻,送上我最真挚的祝福:愿你的每一天都充满阳光和欢笑,每一步都走向成功和辉煌。</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="container">
|
||||
<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">
|
||||
<view class="messageTitle">系统通知</view>
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -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>
|
||||
|
||||
@ -49,12 +114,12 @@
|
||||
align-items: center;
|
||||
column-gap: 20rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
|
||||
|
||||
.messageIcon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
|
||||
.messageContent {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
@ -68,7 +133,7 @@
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #858BA0;
|
||||
|
||||
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
Loading…
Reference in New Issue
Block a user