You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

381 lines
9.1 KiB

3 years ago
<template>
3 years ago
<page-meta :page-style="'overflow:'+(callshow?'hidden':'visible')"></page-meta>
2 years ago
<view class="containers">
<!-- #ifdef MP-WEIXIN -->
<privacy-popup ref="privacyComponent" @agree-privacy="onAgreePrivacy"
@reject-privacy="onRejectPrivacy"></privacy-popup>
<!-- #endif -->
3 years ago
<view class="top">
<view class="toplogo justify-between align-center">
<view>
<view class="fs50">
3 years ago
Hi ~ {{userName}}
3 years ago
</view>
<view>
3 years ago
{{userEmail}}
3 years ago
</view>
3 years ago
</view>
<view @click='logout'>
<u--image :src="logo" width="164rpx" height="65rpx"></u--image>
<view class="logout" >退出</view>
3 years ago
</view>
3 years ago
3 years ago
</view>
<view class="search">
<view class="justify-between align-center">
<view>搜索</view>
<u--image :src="searchlogo" width="30rpx" height="27rpx"></u--image>
</view>
<view>
<u--input @confirm="searchList" placeholder=" " prefixIcon="search"
prefixIconStyle="font-size: 22px;color: #c3c9c9">
</u--input>
</view>
</view>
</view>
<view class="mine">
<view class="mineicon justify-between align-center">
<view v-for="item in iconList">
3 years ago
<u--image @click="toUrl(item.isyy,item.url)" :src="item.src" width="145rpx" height="149rpx">
</u--image>
3 years ago
<view class="icontext">{{item.text}}</view>
</view>
</view>
<view class="db">
<view>待办</view>
3 years ago
3 years ago
<view class="dblist">
<view>
3 years ago
<view v-for="(item, index) in list" :key="index">
<view class="dbitem" @click="toDetail(item.id)">
<text class="dbtype">{{item.type_text}}</text>
<view class="dbstatus bm">
<view>{{item.audit_status_text}}</view>
<view>
<text style="margin-right:10px">访问时间{{item.date}}</text>
<text>{{item.visit_time.start_time}}{{item.visit_time.end_time}}</text>
</view>
</view>
<view class="dbinfo justify-left">
<view>
3 years ago
<view>被访人<text>{{item.accept_admin.name}}</text></view>
<view>部门<text>{{item.accept_admin.department.name}}</text></view>
<view>访问区域<text>{{item.visit_area.name}}</text></view>
3 years ago
</view>
<view>
3 years ago
<view>拜访人<text>{{item.name}}</text></view>
3 years ago
<view>电话{{item.mobile}}</view>
3 years ago
<view v-if="item.type=='1'"><text>{{item.reason}}</text></view>
3 years ago
<view v-else-if="item.type=='3'">车牌<text>{{item.plate}}</text></view>
</view>
2 years ago
</view>
<view class="company">
<view>
拜访公司<text>{{item.company_name?item.company_name:''}}</text>
</view>
3 years ago
</view>
3 years ago
<view class="dblong">
3 years ago
<view>长期访客申请<text>{{item.long_time==0?'否':'是'}}</text></view>
2 years ago
<text v-if="item.long_time==1">访{{item.start_date?item.start_date:''}} {{item.end_date?item.end_date:''}}</text>
3 years ago
</view>
3 years ago
</view>
</view>
</view>
3 years ago
<view v-if="isEmpty">
<u-empty mode="data">
</u-empty>
</view>
3 years ago
</view>
</view>
</view>
3 years ago
<!-- 弹出选择 访客类型 -->
<u-popup :show="callshow" mode="center" @close="callshow=false">
<view class="popupVisit">
<view>请选择邀约访客类型</view>
<view class="justify-between">
<button @click="toForm(1)">访</button>
<button @click="toForm(2)">访</button>
<button @click="toForm(3)"></button>
</view>
</view>
</u-popup>
3 years ago
</view>
</template>
3 years ago
<script>
3 years ago
import '@/static/css/bd.css'
2 years ago
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue';
export default{
components: {
PrivacyPopup
},
3 years ago
data() {
return {
3 years ago
userName: "",
userEmail: "",
3 years ago
logo: require("../../static/img/logo.png"),
searchlogo: require("../../static/img/search.png"),
iconList: [{
src: require("../../static/img/wdsh.png"),
text: '我的审核',
3 years ago
url: "/pages/bd/record?type=mycheck"
3 years ago
},
{
src: require("../../static/img/bfjl.png"),
text: '被访记录',
3 years ago
url: "/pages/bd/record?type=myrecord"
3 years ago
},
{
src: require("../../static/img/yy.png"),
text: '邀约',
3 years ago
url: "/pages/bd/call",
isyy: true
3 years ago
},
{
src: require("../../static/img/dyyjl.png"),
text: '代邀约记录',
3 years ago
url: "/pages/bd/record?type=call"
3 years ago
}
3 years ago
],
list: [],
select: {
page: 1,
page_size: 5,
3 years ago
total: 0,
audit_status: 0,
keyword: ""
},
3 years ago
isEmpty: false,
callshow: false
3 years ago
}
},
onLoad() {
3 years ago
this.getBdInfo()
this.loadList()
},
onPullDownRefresh() {
this.select.page = 1
this.loadList()
uni.stopPullDownRefresh();
},
//上拉加载
onReachBottom() {
//当当前列表数据长度>=数据总长度时
if (this.list.length >= this.select.total) {
//提示
uni.showToast({
title: '没有更多了',
duration: 1000,
icon: 'none'
})
} else {
//否则,页码+1继续请求列表
this.select.page++
this.loadList()
}
3 years ago
},
2 years ago
methods: {
onAgreePrivacy() {
// 用户同意隐私政策
// 在这里添加您想要执行的代码
console.log('User agreed to the privacy policy');
},
onRejectPrivacy() {
// 用户拒绝隐私政策
// 在这里添加您想要执行的代码
console.log('User rejected the privacy policy');
},
3 years ago
toForm(type) {
uni.navigateTo({
url: "/pages/visit/addrecord?iscall=call&type=" + type
})
3 years ago
},
toUrl(isyy, url) {
if (isyy) {
this.callshow = true
} else {
uni.navigateTo({
url: url
})
}
3 years ago
},
toDetail(id) {
uni.navigateTo({
3 years ago
url: '/pages/bd/bddetail?id=' + id
3 years ago
})
3 years ago
},
3 years ago
getBdInfo() {
3 years ago
let that = this
let userInfo_bd = uni.getStorageSync('userInfo_Bd')
if (userInfo_bd) {
that.userName = userInfo_bd.name
that.userEmail = userInfo_bd.email ? userInfo_bd.email : ''
return
3 years ago
}
3 years ago
},
loadList() {
let that = this
this.util.request({
api: '/api/admin/visit/index',
method: "get",
3 years ago
requestType: 'bd',
3 years ago
data: {
page: this.select.page,
3 years ago
page_size: this.select.page_size,
audit_status: this.select.audit_status,
keyword: this.select.keyword
3 years ago
},
3 years ago
utilSuccess: function(res) {
that.isEmpty = res.total == 0;
3 years ago
if (that.select.page == 1) {
that.list = res.data
} else {
that.list.push(...res.data)
}
that.select.total = res.total
},
utilFail: function(res) {
uni.showToast({
3 years ago
title: res,
3 years ago
duration: 2000,
3 years ago
icon: 'none',
3 years ago
})
3 years ago
setTimeout(function() {
uni.removeStorageSync('userInfo_BD_token')
uni.removeStorageSync('userInfo_Bd')
uni.redirectTo({
url: '/pages/index/index'
})
}, 2000)
3 years ago
}
})
},
3 years ago
searchList(val) {
this.select.keyword = val
this.select.page = 1
this.loadList()
3 years ago
},
3 years ago
logout() {
uni.showModal({
title: '提示',
content: '确认退出账号?',
success: function(res) {
if (res.confirm) {
uni.removeStorageSync('userInfo_BD_token')
uni.removeStorageSync('userInfo_Bd')
uni.redirectTo({
url: '/pages/index/index'
})
} else if (res.cancel) {
}
}
});
}
3 years ago
// scrolltolower(){},
3 years ago
}
}
</script>
<style scoped>
.containers {
background-color: #eceefe;
min-height: 100vh;
/* padding: 0 40rpx;
padding-bottom:20px; */
}
.toplogo {
background-color: #044ed7;
padding: 40rpx 30rpx;
padding-bottom: 130rpx;
color: #fff;
font-size: 24rpx;
}
.fs50 {
font-size: 50rpx
}
.search {
margin: 40rpx 20rpx;
margin-top: -90rpx;
padding: 30rpx 30rpx;
background-color: #fff;
border-radius: 30rpx;
}
.search>view:first-child {
font-size: 30rpx;
color: #8f9596;
padding: 0 20rpx 15rpx 40rpx
}
/deep/ .search>view:last-child .u-input {
border-radius: 20rpx !important;
background-color: #eceefe;
border: none;
padding-top: 0px !important;
padding-bottom: 0px !important;
padding-left: 0px !important;
padding-right: 0px !important;
padding: 20rpx !important;
}
.mine {
padding: 40rpx 30rpx;
padding-top: 0;
}
.mine .mineicon {
font-size: 24rpx;
}
.mine .icontext {
text-align: center;
margin-top: 15rpx
3 years ago
}
3 years ago
.logout{
text-align: right;
font-size: 30rpx;
}
3 years ago
/deep/ .u-empty {
min-height: 30vh;
}
3 years ago
/deep/ .u-popup__content {
width: 80%;
background: #fff;
3 years ago
padding: 47rpx;
text-align: center;
}
.popupVisit>view:first-child {
margin-bottom: 20rpx
3 years ago
}
3 years ago
.popupVisit>view button {
padding: 0 20rpx;
background-color: #044ed7;
color: #fff
2 years ago
}
.company{
padding-bottom:30rpx;
margin-top:-10rpx;
}
.company text{
color: #8f9596;
3 years ago
}
3 years ago
</style>