|
@@ -15,12 +15,15 @@
|
|
<view class="uni-container">
|
|
<view class="uni-container">
|
|
<uni-table>
|
|
<uni-table>
|
|
<uni-tr>
|
|
<uni-tr>
|
|
|
|
+ <uni-th width="80" align="center">地区</uni-th>
|
|
<uni-th width="80" align="center">名称</uni-th>
|
|
<uni-th width="80" align="center">名称</uni-th>
|
|
<uni-th width="80" align="center">类型</uni-th>
|
|
<uni-th width="80" align="center">类型</uni-th>
|
|
<uni-th width="80" align="center">价格</uni-th>
|
|
<uni-th width="80" align="center">价格</uni-th>
|
|
<uni-th width="100" align="center">时间</uni-th>
|
|
<uni-th width="100" align="center">时间</uni-th>
|
|
</uni-tr>
|
|
</uni-tr>
|
|
<uni-tr v-for="(item, index) in quotationsList" :key="index">
|
|
<uni-tr v-for="(item, index) in quotationsList" :key="index">
|
|
|
|
+ <uni-td align="center">{{ item.area+item.address }}
|
|
|
|
+ </uni-td>
|
|
<uni-td align="center">{{ item.productName }}
|
|
<uni-td align="center">{{ item.productName }}
|
|
</uni-td>
|
|
</uni-td>
|
|
<uni-td align="center">
|
|
<uni-td align="center">
|
|
@@ -32,6 +35,7 @@
|
|
</uni-td>
|
|
</uni-td>
|
|
</uni-tr>
|
|
</uni-tr>
|
|
</uni-table>
|
|
</uni-table>
|
|
|
|
+ <uni-load-more :status="status" :content-text="contentText"/>
|
|
<uni-fab ref="fab" :horizontal="right" :vertical="bottom"
|
|
<uni-fab ref="fab" :horizontal="right" :vertical="bottom"
|
|
@fabClick="fabClick()"/>
|
|
@fabClick="fabClick()"/>
|
|
</view>
|
|
</view>
|
|
@@ -64,31 +68,66 @@ export default {
|
|
],
|
|
],
|
|
//查询参数
|
|
//查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
- // pageNum: 1,
|
|
|
|
- // pageSize: 10,
|
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 15,
|
|
id: null,
|
|
id: null,
|
|
},
|
|
},
|
|
|
|
+ //加载更多
|
|
|
|
+ status: 'more',
|
|
|
|
+ contentText: {
|
|
|
|
+ contentdown: '查看更多',
|
|
|
|
+ contentrefresh: '加载中',
|
|
|
|
+ contentnomore: '没有更多'
|
|
|
|
+ },
|
|
|
|
+
|
|
//表单数据
|
|
//表单数据
|
|
form: {},
|
|
form: {},
|
|
imageList: []
|
|
imageList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- created() {
|
|
|
|
|
|
+ onPullDownRefresh() {
|
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
|
+ this.quotationsList = [];
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ //上拉加载
|
|
|
|
+ onReachBottom() {
|
|
|
|
+ if (this.status === 'noMore') {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.queryParams.pageNum++;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ onLoad() {
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getList(row) {
|
|
getList(row) {
|
|
// 这里是获取列表的方法
|
|
// 这里是获取列表的方法
|
|
- listQuotations().then(response => {
|
|
|
|
- this.quotationsList = response.rows.map(item => {
|
|
|
|
- let date = new Date(item.createTime);
|
|
|
|
- item.createTime = date.toLocaleDateString('zh-CN', {dateStyle: 'short'});
|
|
|
|
- return item;
|
|
|
|
- });
|
|
|
|
|
|
+ listQuotations(this.queryParams).then(response => {
|
|
|
|
+ if (this.queryParams.pageNum === 1) {
|
|
|
|
+ this.quotationsList = this.dataFormat(response.rows)
|
|
|
|
+ } else {
|
|
|
|
+ this.quotationsList = this.quotationsList.concat(this.dataFormat(response.rows));
|
|
|
|
+ }
|
|
|
|
+ // 判断是否还有更多数据
|
|
|
|
+ if (response.rows.length < this.queryParams.pageSize) {
|
|
|
|
+ this.status = 'noMore'; // 没有更多数据
|
|
|
|
+ } else {
|
|
|
|
+ this.status = 'more'; // 还有更多数据
|
|
|
|
+ }
|
|
});
|
|
});
|
|
//获取分类树的方法
|
|
//获取分类树的方法
|
|
listConfig().then(response => {
|
|
listConfig().then(response => {
|
|
- this.categories = response.data.quotations;
|
|
|
|
|
|
+ this.categories = response.data.quotations.filter(item => item.homeDisplay === "1");
|
|
|
|
+ });
|
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
|
+ },
|
|
|
|
+ dataFormat(rows) {
|
|
|
|
+ return rows.map(item => {
|
|
|
|
+ let date = new Date(item.createTime);
|
|
|
|
+ item.createTime = date.toLocaleDateString('zh-CN', {dateStyle: 'short'});
|
|
|
|
+ return item;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//根据分类id查询列表
|
|
//根据分类id查询列表
|
|
@@ -123,13 +162,16 @@ export default {
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
align-items: center;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
- padding: 0px 0;
|
|
|
|
|
|
+ padding: 0 0;
|
|
}
|
|
}
|
|
|
|
|
|
.image {
|
|
.image {
|
|
height: 100%;
|
|
height: 100%;
|
|
width: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
+.uni-container{
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
</style>
|