12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <template>
- <view class="container intemal-container">
- <view class="global_card_content content-ul" v-for="item in collectList" :key="item.ProductInteriorId" @click="goDetail(item)">
- <view class="li-title global_title">{{ item.Title }}</view>
- <view class="li-tiem">{{ item.PublishTime }}</view>
- </view>
- <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="page_no > 1" />
- <Loading />
- </view>
- </template>
- <script>
- import { Reports } from "@/config/api.js";
- export default {
- data() {
- return {
- page_no: 1,
- pageSize: 10,
- status: "loadmore",
- refresh: false, //正在下拉
- loadText: {
- loadmore: "上拉加载更多",
- loading: "加载中",
- nomore: "已经到底了",
- },
- collectList: [],
- };
- },
- methods: {
- // 获取列表数据
- async getList() {
- const res = await Reports.getProductInteriorList({
- PageSize: this.pageSize,
- CurrentIndex: this.page_no,
- });
- if (res.Ret === 200) {
- this.status = res.Data.Paging.IsEnd ? "nomore" : "loadmore";
- this.collectList = this.page_no == 1 ? res.Data.List || [] : this.collectList.concat(res.Data.List);
- if (this.refresh) {
- wx.stopPullDownRefresh();
- }
- }
- },
- // 去往详情
- goDetail(item) {
- uni.navigateTo({
- url: "/reportPages/internalDetials/internalDetials?id=" + item.ProductInteriorId,
- });
- },
- },
- onLoad() {
- this.getList();
- },
- // 下拉刷新
- onPullDownRefresh() {
- this.page_no = 1;
- this.refresh = true;
- this.getList();
- },
- // 下滑触底
- onReachBottom() {
- if (this.status == "nomore") return;
- this.page_no++;
- this.getList();
- this.status = "loading";
- },
- };
- </script>
- <style lang="scss" scoped>
- .intemal-container {
- padding: 30rpx;
- background-color: $uni-bg-color;
- .content-ul {
- border-top: 4rpx solid #376cbb;
- padding: 20rpx;
- margin-bottom: 20rpx;
- background-color: #fff;
- .li-tiem {
- padding-top: 17rpx;
- font-size: 22rpx;
- line-height: 39rpx;
- color: #999;
- }
- }
- }
- </style>
|