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.

476 lines
12 KiB

3 years ago
<template>
3 years ago
<page-meta :page-style="'overflow:'+(callshow?'hidden':'visible')"></page-meta>
2 months ago
<view class="containers">
<!-- #ifdef MP-WEIXIN -->
<privacy-popup ref="privacyComponent" @agree-privacy="onAgreePrivacy"
@reject-privacy="onRejectPrivacy"></privacy-popup>
2 years ago
<!-- #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>
2 months ago
</view>
<view @click='logout'>
<u--image :src="logo" width="280rpx" height="41rpx"></u--image>
1 month ago
<view class="logout label-with-en-inline">
<view>退出</view>
<view class="en-text">Logout</view>
</view>
3 years ago
</view>
3 years ago
3 years ago
</view>
<view class="search">
<view class="justify-between align-center">
1 month ago
<view class="label-with-en-inline">
<view>搜索</view>
<view class="en-text">Search</view>
</view>
3 years ago
<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">
1 month ago
<view v-for="(item, index) in iconList" :key="index">
3 years ago
<u--image @click="toUrl(item.isyy,item.url)" :src="item.src" width="145rpx" height="149rpx">
</u--image>
1 month ago
<view class="icontext label-with-en-inline">
<view>{{item.text}}</view>
<view class="en-text">{{item.textEn}}</view>
</view>
3 years ago
</view>
</view>
<view class="db">
1 month ago
<view class="label-with-en-inline">
<view>待办</view>
<view class="en-text">To Do</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>
1 month ago
<view class="label-with-en-inline">
<view>访问日期{{item.date}}{{ item.end_date?'至'+item.end_date:'' }}</view>
<view class="en-text">Visit Date: {{item.date}}{{ item.end_date?' to '+item.end_date:'' }}</view>
3 weeks ago
</view>
<view class="label-with-en-inline">
<view>访问时间{{item.time?item.time:''}}</view>
<view class="en-text">Visit Time: {{item.time?item.time:''}}</view>
1 month ago
</view>
3 weeks ago
<!-- <view class="label-with-en-inline">
<view>访问时段{{item.visit_time.start_time}}{{item.visit_time.end_time}}</view>
1 month ago
<view class="en-text">Visit Time: {{item.visit_time.start_time}} to {{item.visit_time.end_time}}</view>
3 weeks ago
</view> -->
3 years ago
</view>
</view>
<view class="dbinfo justify-left">
<view>
1 month ago
<view class="label-with-en-inline">
<view>被访人<text>{{item.accept_admin.name}}</text></view>
<view class="en-text">Host: <text>{{item.accept_admin.name}}</text></view>
</view>
<view class="label-with-en-inline">
<view>部门<text>{{item.accept_admin.department.name}}</text></view>
<view class="en-text">Department: <text>{{item.accept_admin.department.name}}</text></view>
</view>
<view class="label-with-en-inline">
<view>访问区域<text>{{item.visit_area.name}}</text></view>
<view class="en-text">Visit Area: <text>{{item.visit_area.name}}</text></view>
</view>
3 years ago
</view>
<view>
1 month ago
<view class="label-with-en-inline">
<view>拜访人<text>{{item.name}}</text></view>
<view class="en-text">Visitor: <text>{{item.name}}</text></view>
</view>
<view class="label-with-en-inline">
<view>电话{{item.mobile}}</view>
<view class="en-text">Phone: {{item.mobile}}</view>
</view>
<view v-if="item.type=='1'" class="label-with-en-inline">
<view>事由<text>{{item.reason}}</text></view>
<view class="en-text">Reason: <text>{{item.reason}}</text></view>
</view>
<view v-else-if="item.type=='3'" class="label-with-en-inline">
<view>车牌<text>{{item.plate}}</text></view>
<view class="en-text">License Plate: <text>{{item.plate}}</text></view>
</view>
3 years ago
</view>
2 months ago
</view>
<view class="company">
1 month ago
<view class="label-with-en-inline">
<view>拜访公司<text>{{item.company_name?item.company_name:''}}</text></view>
<view class="en-text">Company: <text>{{item.company_name?item.company_name:''}}</text></view>
2 months ago
</view>
3 years ago
</view>
<!-- <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>
</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">
1 month ago
<view class="label-with-en-inline">
<view>请选择邀约访客类型</view>
<view class="en-text">Please select visitor type</view>
</view>
3 years ago
<view class="justify-between">
1 month ago
<button @click="toForm(1)" class="button-with-en">
<view>普通访客</view>
3 weeks ago
<view class="en-text">General Visitor</view>
1 month ago
</button>
<button @click="toForm(2)" class="button-with-en">
<view>施工人员</view>
<view class="en-text">Construction Worker</view>
</button>
<button @click="toForm(3)" class="button-with-en">
3 weeks ago
<view>物流司机</view>
<view class="en-text">Logistics Driver</view>
1 month ago
</button>
3 years ago
</view>
</view>
</u-popup>
3 years ago
</view>
</template>
3 years ago
<script>
3 years ago
import '@/static/css/bd.css'
2 months ago
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue';
export default{
components: {
PrivacyPopup
2 years ago
},
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: '我的审核',
1 month ago
textEn: 'My Review',
3 years ago
url: "/pages/bd/record?type=mycheck"
3 years ago
},
{
src: require("../../static/img/bfjl.png"),
text: '被访记录',
1 month ago
textEn: 'Visit Records',
3 years ago
url: "/pages/bd/record?type=myrecord"
3 years ago
},
{
src: require("../../static/img/yy.png"),
text: '邀约',
1 month ago
textEn: 'Invite',
3 years ago
url: "/pages/bd/call",
isyy: true
3 years ago
},
{
src: require("../../static/img/dyyjl.png"),
text: '代邀约记录',
1 month ago
textEn: 'Invitation Records',
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({
1 month ago
title: '没有更多了 / No more data',
3 years ago
duration: 1000,
icon: 'none'
})
} else {
//否则,页码+1继续请求列表
this.select.page++
this.loadList()
}
3 years ago
},
2 months ago
methods: {
onAgreePrivacy() {
// 用户同意隐私政策
// 在这里添加您想要执行的代码
console.log('User agreed to the privacy policy');
},
onRejectPrivacy() {
// 用户拒绝隐私政策
// 在这里添加您想要执行的代码
console.log('User rejected the privacy policy');
2 years ago
},
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,
2 months ago
keyword: this.select.keyword,
is_auth:0,
9 months ago
my_audit:1
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({
1 month ago
title: '提示 / Notice',
content: '确认退出账号? / Confirm logout?',
3 years ago
success: function(res) {
2 months ago
if (res.confirm) {
uni.removeStorageSync('userInfo_BD_token')
uni.removeStorageSync('userInfo_Bd')
uni.redirectTo({
url: '/pages/index/index'
3 years ago
})
} 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 {
3 months ago
background-color: #4f607e;
3 years ago
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
}
2 months ago
.logout{
text-align: right;
font-size: 30rpx;
3 years ago
}
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;
3 months ago
background-color: #4f607e;
3 years ago
color: #fff
2 months ago
}
.company{
padding-bottom:30rpx;
margin-top:-10rpx;
}
.company text{
color: #8f9596;
3 years ago
}
1 month ago
.label-with-en-inline {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.en-text {
font-size: 20rpx;
color: #8f9596;
margin-top: 4rpx;
opacity: 0.8;
}
.button-with-en {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10rpx 20rpx;
}
.button-with-en .en-text {
font-size: 18rpx;
margin-top: 4rpx;
}
.popupVisit>view:last-child {
display: flex;
justify-content: space-between;
gap: 10rpx;
}
3 years ago
</style>