| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <template>
- <view class="container">
- <u-popup v-model="detailShow" mode="center" width="650" :closeable="true" border-radius="10">
- <view style="padding: 60rpx 5rpx 10rpx;">
- <u-cell-group >
- <u-cell-item :icon-style="iconStyle" :border-top="false" :arrow="false" icon="account-fill" title="访客姓名:" :value="detailData.guestName"></u-cell-item>
- <u-cell-item :icon-style="iconStyle" :arrow="false" icon="bookmark-fill" title="身份证号:" :value="detailData.guestIdcard"></u-cell-item>
- <u-cell-item :icon-style="iconStyle" :arrow="false" icon="phone-fill" title="手机号:" :value="detailData.guestTel"></u-cell-item>
- <u-cell-item :icon-style="iconStyle" :arrow="false" icon="map-fill" title="访问区域:" :value="detailData.guestPosition"></u-cell-item>
- <u-cell-item :icon-style="iconStyle" :arrow="false" icon="clock-fill" title="访问时间:" :value="detailData.guestTime"></u-cell-item>
- <u-cell-item :icon-style="iconStyle" :arrow="false" icon="plus-people-fill" title="接待人:" :value="detailData.userName"></u-cell-item>
- <u-cell-item :icon-style="iconStyle" :border-bottom="false" :arrow="false" icon="error-circle-fill" title="访问目的:" :value="detailData.guestReason"></u-cell-item>
- </u-cell-group>
- </view>
- </u-popup>
- <u-modal cancel-text="重置" cancel-color="#000000" @cancel="filterReset" :show-cancel-button="true" @confirm="filterConfirm" title="筛选" :mask-close-able="true" v-model="filterShow" >
- <view class="slot-content" style="margin: 20rpx;">
- <u-form label-width="150" ref="uForm">
- <u-form-item label="主键id" v-if="!$isEmpty(params.id)"><u-input v-model="params.id" disabled /></u-form-item>
- <u-form-item label="访客姓名"><u-input v-model="params.guestName" /></u-form-item>
- <u-form-item :border-bottom="false" label="手机号"><u-input v-model="params.guestTel" type="number" /></u-form-item>
- </u-form>
- </view>
- </u-modal>
- <view class="tabs flex flex-direction">
- <view class="flex">
- <scroll-view scroll-x class="bg-white nav" >
- <view class="flex text-center">
- <view class="cu-item flex-sub" :class="index==current?'text-blue text-xl text-bold ':'text-lg'" v-for="(item,index) in tabs" :key="index" @tap="tabChange(index)" >
- {{item.name}}
- </view>
- </view>
- </scroll-view>
- <view class="flex justify-center align-center padding-right-20" style="flex: 10%;" @click="show">
- <text class="cuIcon-filter " style="font-size: 40rpx;"></text>
- <u-badge size="mini" type="error" :count="filterCount"></u-badge>
- </view>
- </view>
- </view>
- <view style="height: 100%;">
- <swiper style="height: 100%;" :current="current" @change="swiperChange"
- @animationfinish="animationfinish">
- <swiper-item v-for="(item, index) in tabs" :key="index">
- <scroll-view scroll-y style="height: 100%;">
- <item @test="showDetail" ref="mescrollItem" :params="params" :i="index" :item="item" :type="current"></item>
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </view>
- </template>
- <script>
- import item from "./item.vue"
- export default {
- components: {
- item
- },
- data() {
- return {
- iconStyle:{
- color:"#59a5f0"
- },
-
- detailShow:false,
- detailData:{},
-
- filterCount:0,
- filterShow:false,
- params:{},
-
- current: 0,
- swiperCurrent:0,
- tabs: [
- {
- name: '全部',
- value:-1
- },
- {
- name: '待审核',
- value:0
- },
- {
- name: '已通过',
- value:1
- },
- {
- name:'未通过',
- value:2
- }
- ],
- }
- },
- onShow(){
-
- },
- onLoad(options) {
- this.params.id=options.id
- this.getFilterCount()
- },
- methods:{
- /**显示详情
- * @param {Object} item
- */
- showDetail(item){
- this.detailShow=true
- this.detailData=item
- },
- /**
- * 显示筛选弹窗
- */
- show(){
- this.filterShow=true
- },
- /**
- * 筛选
- */
- filterConfirm(){
- this.$nextTick(() => {
- this.refreshMescroll()
- })
- this.getFilterCount()
-
- },
- /**
- * 计算筛选的数量
- */
- getFilterCount(){
- let n=0
- if (!this.$isEmpty(this.params.id)) {
- n++
- }
- if (!this.$isEmpty(this.params.guestName)) {
- n++
- }
- if (!this.$isEmpty(this.params.guestTel)) {
- n++
- }
- this.filterCount=n
- },
- /**
- * 重置筛选项
- */
- filterReset(){
- this.filterCount=0
- this.params={}
- this.$nextTick(() => {
- this.refreshMescroll()
- })
- },
- /**
- * 刷新列表
- */
- refreshMescroll(){
- let curMescroll = this.getMescroll(this.current)
- curMescroll && curMescroll.resetUpScroll()
- },
- /**
- * 获取Mescroll对象
- * @param {Object} i
- */
- getMescroll(i){
- let mescrollItems = this.$refs.mescrollItem;
- if(mescrollItems){
- let item = mescrollItems[i]
- if(item) return item.mescroll
- }
- return null
- },
-
- tabChange(index) {
- this.current = index
- },
- swiperChange(e) {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 0
- });
- this.current = e.detail.current
- },
- animationfinish({detail: { current }}) {
- this.swiperCurrent = current;
- this.current = current;
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .text-blue{
- color: #59a5f0;
- }
- .text-xl{
- font-size: 34rpx;
- }
- .container {
- height: calc(100vh);
- background-color: #F6F6F6;
- padding: 78rpx 0rpx 0rpx;
- .tabs {
- position: fixed;
- top: -10rpx;
- left: 0;
- width: 100%;
- background-color: #FFFFFF;
- box-sizing: border-box;
- z-index: 3;
- }
- }
- </style>
|