6 changed files with 509 additions and 60 deletions
@ -0,0 +1,293 @@ |
|||||
|
<!--订单列表-列表--> |
||||
|
<template> |
||||
|
<view class="main_box"> |
||||
|
|
||||
|
<view class="main_section"> |
||||
|
<scroll-view |
||||
|
class="section_1" |
||||
|
scroll-y="true" |
||||
|
:lower-threshold="lowerThreshold" |
||||
|
@scrolltolower="loadMoreData" |
||||
|
style="height: 90vh;" |
||||
|
> |
||||
|
<view |
||||
|
class="item" |
||||
|
v-for="(v,k) in tableList" |
||||
|
:key="k" |
||||
|
> |
||||
|
<view class="top"> |
||||
|
<view class="title">订单状态</view> |
||||
|
<!-- <view class="btn" @click="downloadFile($util.img(v.file_data))">下载合同 <fui-icon name="arrowright" color="#A4ADB3" size="35"></fui-icon></view>--> |
||||
|
</view> |
||||
|
<view class="bottom"> |
||||
|
<view class="box"> |
||||
|
<view class="title">客户姓名:</view> |
||||
|
<view class="content">{{ v.resource_id_name }}</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="box"> |
||||
|
<view class="title">付款类型:</view> |
||||
|
<view class="content"> |
||||
|
{{ v.payment_type === 'cash' ? '现金支付' : v.payment_type === 'scan_code' ? '扫码支付' : '订阅支付' }} |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="box"> |
||||
|
<view class="title">订单金额:</view> |
||||
|
<view class="content">¥{{ v.order_amount }}</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="box"> |
||||
|
<view class="title">课程:</view> |
||||
|
<view class="content">{{ v.course_id_name }}</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="box"> |
||||
|
<view class="title">班级:</view> |
||||
|
<view class="content">{{ v.class_id_name }}</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="box"> |
||||
|
<view class="title">人员:</view> |
||||
|
<view class="content">{{ v.staff_id_name }}</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="box"> |
||||
|
<view class="title">支付时间:</view> |
||||
|
<view class="content">{{ v.payment_time }}</view> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import apiRoute from '@/api/apiRoute.js'; |
||||
|
import marketApi from '@/api/market.js'; |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
loading:false,//加载状态 |
||||
|
lowerThreshold: 100,//距离底部多远触发 |
||||
|
isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载 |
||||
|
|
||||
|
//筛选条件 |
||||
|
filteredData:{ |
||||
|
page:1,//当前页码 |
||||
|
limit:10,//每页返回数据条数 |
||||
|
total:10,//数据总条数 |
||||
|
resource_id:'',//客户资源表id |
||||
|
}, |
||||
|
tableList:[],//聊天数据列表 |
||||
|
} |
||||
|
}, |
||||
|
onLoad(options) { |
||||
|
this.filteredData.resource_id = options.resource_id//客户资源表id |
||||
|
}, |
||||
|
onShow(){ |
||||
|
this.init() |
||||
|
}, |
||||
|
//下拉刷新 |
||||
|
async onPullDownRefresh() { |
||||
|
//重置为第一页 |
||||
|
await this.resetFilteredData() |
||||
|
await this.getList() |
||||
|
}, |
||||
|
methods: { |
||||
|
//初始化 |
||||
|
async init(){ |
||||
|
await this.getList(); |
||||
|
}, |
||||
|
//加载更多(下一页) |
||||
|
loadMoreData() { |
||||
|
//判断是否加载 |
||||
|
if (!this.isReachedBottom) { |
||||
|
this.isReachedBottom = true;//设置为不可请求状态 |
||||
|
this.getList(); |
||||
|
} |
||||
|
}, |
||||
|
//重置为第一页 |
||||
|
async resetFilteredData() { |
||||
|
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 |
||||
|
|
||||
|
this.filteredData.page = 1//当前页码 |
||||
|
this.filteredData.limit = 10//每页返回数据条数 |
||||
|
this.filteredData.total = 10//数据总条数 |
||||
|
}, |
||||
|
|
||||
|
//获取合同列表 |
||||
|
async getList(){ |
||||
|
this.loading = true |
||||
|
|
||||
|
let params = {...this.filteredData} |
||||
|
|
||||
|
//判断是否还有数据 |
||||
|
if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) { |
||||
|
this.loading = false |
||||
|
uni.showToast({ |
||||
|
title: '暂无更多', |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
if(params.page == 1){ |
||||
|
this.tableList = [] |
||||
|
} |
||||
|
|
||||
|
let res = await apiRoute.xs_orderTableList(params)//获取订单那列表 |
||||
|
this.loading = false |
||||
|
this.isReachedBottom = false; |
||||
|
if (res.code != 1){ |
||||
|
uni.showToast({ |
||||
|
title: res.msg, |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
this.tableList = this.tableList.concat(res.data.data); // 使用 concat 方法 将新数据追加到数组中 |
||||
|
// this.tableList.unshift(...res.data.data); // 将新数据插入到数组头部 |
||||
|
|
||||
|
console.log('列表',this.tableList) |
||||
|
this.filteredData.total = res.data.total |
||||
|
this.filteredData.page++ |
||||
|
}, |
||||
|
|
||||
|
//跳转文章详情 |
||||
|
openViewArticleInfo(item) { |
||||
|
let id = item.id |
||||
|
let redirect = item.redirect//重定向地址 |
||||
|
uni.navigateTo({ |
||||
|
url: `/pages/common/article_info?id=${id}` |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
//下载文件 |
||||
|
async downloadFile(fileUrl) { |
||||
|
if (!fileUrl) { |
||||
|
this.$util.showToast({ |
||||
|
title: '暂无电子发票' |
||||
|
}); |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
uni.downloadFile({ |
||||
|
url: fileUrl, |
||||
|
success: function (res) { |
||||
|
console.log('下载成功'); |
||||
|
// uni.openDocument({ |
||||
|
// filePath: res.tempFilePath, |
||||
|
// fileType: 'pdf', |
||||
|
// success: function (res) { |
||||
|
// console.log('打开文档成功'); |
||||
|
// } |
||||
|
// }); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="less" scoped> |
||||
|
.main_box { |
||||
|
background: #292929; |
||||
|
} |
||||
|
|
||||
|
//自定义导航栏 |
||||
|
.navbar_section { |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
background: #29d3b4; |
||||
|
|
||||
|
.title { |
||||
|
padding: 20rpx 0; |
||||
|
font-size: 30rpx; |
||||
|
color: #315d55; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.main_section { |
||||
|
min-height: 100vh; |
||||
|
background: #292929 100%; |
||||
|
padding: 0 0rpx; |
||||
|
padding-top: 32rpx; |
||||
|
padding-bottom: 150rpx; |
||||
|
font-size: 28rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
gap: 20rpx; |
||||
|
|
||||
|
.section { |
||||
|
background-color: #434544; |
||||
|
padding: 40rpx 40rpx; |
||||
|
} |
||||
|
|
||||
|
.section_1{ |
||||
|
padding: 0 24rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.item{ |
||||
|
margin-bottom: 38rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
padding: 32rpx 24rpx; |
||||
|
border-radius: 14rpx; |
||||
|
background-color: #434544; |
||||
|
color: #fff; |
||||
|
.top{ |
||||
|
font-size: 28rpx; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
.title{ |
||||
|
font-size: 30rpx; |
||||
|
} |
||||
|
.btn{ |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
color: #29D3B4; |
||||
|
} |
||||
|
} |
||||
|
.bottom{ |
||||
|
font-size: 26rpx; |
||||
|
margin-top: 25rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
gap: 15rpx; |
||||
|
.box{ |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
.title{ |
||||
|
width: 180rpx; |
||||
|
} |
||||
|
.content{ |
||||
|
width: 100%; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
.describe { |
||||
|
color: #999999; |
||||
|
padding-left: 30rpx; |
||||
|
} |
||||
|
</style> |
||||
Loading…
Reference in new issue