123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <template>
- <view>
- <view class="main" v-if="list.length>0 && isLoaded">
- <view v-for="(item, index) in list" :key="index">
- <uni-card>
- <view>
- <view class="main-item">
- <view class="name-align-zlzgtzs">单位名称:</view>
- <view class="conts">{{ item.dwmc }}</view>
- </view>
- <view class="main-item">
- <view class="name-align-zlzgtzs">被检查单位:</view>
- <view class="conts">{{ item.bjcdw }}</view>
- </view>
- <view class="main-item">
- <view class="name-align-zlzgtzs">检查日期:</view>
- <view class="conts">{{ item.jcrq }}</view>
- </view>
- <view class="an-niu" @click.native="onClick(item.id)" link>
- <text class="detail">查看</text>
- </view>
- </view>
- </uni-card>
- </view>
- </view>
- <view v-else-if="list.length==0 && isLoaded" style="text-align: center;">
- <view class="text-gray" style="padding-top: 20px;">
- <img :src="tan90" alt="暂无数据" />
- </view>
- </view>
- <!-- 加载中 -->
- <isLodingModel></isLodingModel>
- </view>
- </template>
- <script>
- import {
- getZlgztzsPage
- } from '@/api/zlgztzs';
- import config from '@/config'
- const baseUrlImg = config.baseUrlImg
- export default {
- data() {
- return {
- tan90: `${baseUrlImg}/tan90.png`,
- list: [],
- isLoaded:false,
- loading:false,
- queryParams: {
- pageNo: 1,
- pageSize: 10
- },
- // 总条数
- total: 0,
- }
- },
- onShow() {
- this.list=[]
- this.getData()
- },
- watch: {
- loading: {
- handler(newLength, oldLength) {
- this.$modal.isLoadingModel(this.loading)
- },
- immediate: true
- }
- },
- methods: {
- getData() {
- this.loading = true
- getZlgztzsPage(this.queryParams).then(response => {
- this.isLoaded = true;
- this.list = [...this.list, ...response.data.list]
- this.loading = false
- // this.list = reponse.data.list
- })
- },
- onClick(val){
- this.isLoaded = false
- uni.navigateTo({
- url: `/pagesA/fire/zlgztzs/see_zlgztzs/see_zlgztzs?id=${val}`
- });
- }
- },
- // 触底的事件
- onReachBottom() {
- // 判断是否还有下一页数据
- if (this.queryParams.pageNo * this.queryParams.pageSize >= this.total)
- return uni.showToast({
- title: `数据加载完毕`
- });
- // 判断是否正在请求其它数据,如果是,则不发起额外的请求
- if (this.loading) return;
- this.queryParams.pageNo += 1;
- this.getData(this.queryParams.pageNo);
- },
- }
- </script>
- <style lang="scss" scope>
- body {
- background-color: #f5f7f9;
- }
-
- page {
- background-color: #f5f7f9 !important;
- }
-
- .uni-container {
- height: 100%;
- }
- /deep/.uni-card {
- box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
- border-radius: 30rpx;
- }
- .main {
- margin-left: 5%;
- margin-top: 30rpx;
- width: 90%;
- .main-item {
- display: flex;
- margin-bottom: 15rpx;
- color: #728f90;
- }
- }
- .an-niu {
- float: right;
- font-size: 10px;
- text-align: center;
- display: flex;
- color: #fff;
- margin-bottom:20rpx;
- .detail {
- width: 72px;
- height: 60rpx;
- border-radius: 30px;
- background-color: #f7c41e;
- margin-right: 20rpx;
- text-align: center;
- line-height: 60rpx;
- }
- }
- </style>
|