<template>
|
<view class="container">
|
<u-sticky>
|
<view class="tabsAndSearch">
|
<view class="tabs">
|
<u-tabs :list="tabsList" @click="tabClick" :scrollable="false"></u-tabs>
|
</view>
|
<view class="search">
|
<u-search placeholder="请输入场所名称" v-model="iptContext" :clearabled="true" :showAction="true"
|
:animation="true" @change="keyWordChange" @search="searchConfirm" @clear="clearConfirm"></u-search>
|
</view>
|
</view>
|
</u-sticky>
|
<view class="info-box">
|
<view class="records-card" v-for="(records, index) in recordsData" :key="records.id"
|
@click="pushPage(records)">
|
<view class="title">
|
<text>{{ records.placeName }}</text>
|
<text>{{ records.createTime }}</text>
|
</view>
|
<view class="info">
|
<view class="charge-man">
|
<text>场所负责人:</text>
|
<text>{{ records.username || '未完善' }}</text>
|
</view>
|
<view class="phone">
|
<text>手机号:</text>
|
<text>{{ records.phone || '未完善' }}</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
<u-loadmore :status="status" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line />
|
</view>
|
</template>
|
|
<script>
|
import {
|
getLocationRecord
|
} from '@/api/place/place.js'
|
export default {
|
data() {
|
return {
|
tabsList: [{
|
type: 0,
|
name: '全部'
|
},
|
{
|
type: 1,
|
name: '待完善'
|
},
|
{
|
type: 2,
|
name: '已完善'
|
}
|
],
|
recordsData: [],
|
iptContext: '',
|
pagingParams: {
|
current: 1,
|
size: 10
|
},
|
tabsType: 1,
|
status: 'nomore',
|
currentRole: {}
|
}
|
},
|
onShow() {
|
this.recordsData = []
|
this.currentRole = uni.getStorageSync('activeRole')
|
this.getrRecordList()
|
},
|
onReachBottom() {
|
this.pagingParams.current++
|
this.getrRecordList()
|
},
|
methods: {
|
async getrRecordList(placeName = this.iptContext, isPerfect = this.tabsType) {
|
this.status = 'loadmore'
|
const { roleName } = this.currentRole
|
console.log(this.currentRole);
|
const {
|
code,
|
data: {
|
records
|
}
|
} = await getLocationRecord({
|
placeName,
|
isPerfect,
|
roleName,
|
...this.pagingParams
|
})
|
if (code !== 200) {
|
this.$u.func.showToast({
|
title: "获取数据失败",
|
icon: "error"
|
})
|
return
|
}
|
this.recordsData = [...this.recordsData, ...records]
|
this.status = 'nomore'
|
},
|
tabClick({
|
type
|
}) {
|
this.pagingParams = {
|
current: 1,
|
size: 10
|
}
|
this.recordsData = []
|
this.tabsType = type
|
this.getrRecordList(this.iptContext, this.tabsType)
|
},
|
searchConfirm() {
|
this.recordsData = []
|
this.pagingParams = {
|
current: 1,
|
size: 10
|
}
|
this.getrRecordList(this.iptContext, this.tabsType)
|
},
|
clearConfirm() {
|
this.iptContext = ''
|
this.searchConfirm()
|
},
|
pushPage({ id }) {
|
if (!id) {
|
uni.showToast({
|
title: "关键参数为空",
|
icon: "error"
|
})
|
return
|
}
|
let url = "/subPackage/workbench/views/cscj?id=" + id + "&type=1"
|
this.$u.func.globalNavigator(url)
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
page {
|
background-color: #f6f6f6;
|
}
|
|
.tabsAndSearch {
|
background-color: #fff;
|
|
.tabs {}
|
|
.search {
|
padding: 20rpx 70rpx;
|
|
.search-ipt {
|
border: 0;
|
border-radius: 9999rpx;
|
background-color: #f6f6f6;
|
}
|
}
|
|
}
|
|
.info-box {
|
padding: 20rpx 30rpx;
|
background-color: #f6f6f6;
|
.records-card {
|
background: #fff;
|
padding: 30rpx;
|
border-radius: 10rpx;
|
margin-bottom: 20rpx;
|
|
.title {
|
line-height: 70rpx;
|
display: flex;
|
font-size: 35rpx;
|
display: flex;
|
justify-content: space-between;
|
border-bottom: 1rpx solid #f6f6f6;
|
|
text {
|
&:nth-child(1) {
|
font-weight: 700;
|
}
|
|
&:nth-child(2) {
|
font-size: 27rpx;
|
color: #999999;
|
}
|
}
|
}
|
|
.charge-man,
|
.phone {
|
display: flex;
|
justify-content: space-between;
|
font-weight: 30rpx;
|
color: #717171;
|
margin-top: 25rpx;
|
font-size: 30rpx;
|
}
|
|
&:last-child {
|
margin-bottom: 20rpx;
|
}
|
}
|
}
|
</style>
|