访客页面 退出登录
This commit is contained in:
parent
8d6c55007e
commit
f259275adb
@ -9,6 +9,9 @@ const install = (Vue, vm) => {
|
|||||||
|
|
||||||
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
||||||
vm.$u.api = {
|
vm.$u.api = {
|
||||||
|
//获取单位列表
|
||||||
|
getUnits:(params = {}) => vm.$u.get(config.adminPath+'/property/enum-fetcher/enum-values/getUnit',params),
|
||||||
|
|
||||||
getcode:(params= {}) => vm.$u.post(config.adminPath+'/property/visitorManagement/getcode',params),
|
getcode:(params= {}) => vm.$u.post(config.adminPath+'/property/visitorManagement/getcode',params),
|
||||||
spfk:(params= {}) => vm.$u.put(config.adminPath+'/property/visitorManagement',params),
|
spfk:(params= {}) => vm.$u.put(config.adminPath+'/property/visitorManagement',params),
|
||||||
fklist:(params = {}) => vm.$u.get(config.adminPath+'/property/visitorManagement/list',params),
|
fklist:(params = {}) => vm.$u.get(config.adminPath+'/property/visitorManagement/list',params),
|
||||||
|
@ -64,8 +64,17 @@
|
|||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">被访单位</text>
|
<text class="label">被访单位</text>
|
||||||
<view class="input-wrapper">
|
<view class="select-wrapper" :class="{active: showUnitDialog}" @click.stop="showUnitDialog = true">
|
||||||
<input type="text" placeholder="请输入被访单位名称" v-model="formData.interviewedUnit" />
|
<text>{{ interviewedUnitLabel || '请选择被访单位' }}</text>
|
||||||
|
<image class="filter-img" src="/static/ic_down_arrow_g.png" />
|
||||||
|
<view v-if="showUnitDialog" class="dropdown">
|
||||||
|
<view class="dropdown-list">
|
||||||
|
<view v-for="(item, index) in unitList" :key="index" class="dropdown-item"
|
||||||
|
@click.stop="selectInterviewedUnit(item)">
|
||||||
|
{{ item.name }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -138,6 +147,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<view class="face-tip-wrapper">
|
||||||
|
<text class="face-tip">请确保无遮挡、光线明亮、正脸拍摄</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- <view class="form-item">
|
<!-- <view class="form-item">
|
||||||
<text class="label">预约状态</text>
|
<text class="label">预约状态</text>
|
||||||
@ -197,10 +211,20 @@
|
|||||||
3: '已完成'
|
3: '已完成'
|
||||||
},
|
},
|
||||||
typeList: ['业务洽谈', '会议参与', '面试应聘', '技术支持', '办事咨询', '调研考察'],
|
typeList: ['业务洽谈', '会议参与', '面试应聘', '技术支持', '办事咨询', '调研考察'],
|
||||||
showTypeDialog: false
|
showTypeDialog: false,
|
||||||
|
showUnitDialog: false,
|
||||||
|
unitList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
interviewedUnitLabel() {
|
||||||
|
if (!this.formData.interviewedUnit) return '';
|
||||||
|
const unit = this.unitList.find(item => item.value === this.formData.interviewedUnit);
|
||||||
|
return unit ? unit.name : '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
this.getUnits()
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.screen.lockOrientation('default');
|
plus.screen.lockOrientation('default');
|
||||||
// #endif
|
// #endif
|
||||||
@ -211,15 +235,28 @@
|
|||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async getUnits() {
|
||||||
|
console.log("t1","11111")
|
||||||
|
let res = await this.$u.api.getUnits();
|
||||||
|
if (res.code == '200') {
|
||||||
|
this.unitList = res.data;
|
||||||
|
}
|
||||||
|
},
|
||||||
// 添加选择拜访事由方法
|
// 添加选择拜访事由方法
|
||||||
selectVisitingReason(reason) {
|
selectVisitingReason(reason) {
|
||||||
this.formData.visitingReason = reason;
|
this.formData.visitingReason = reason;
|
||||||
this.showTypeDialog = false;
|
this.showTypeDialog = false;
|
||||||
},
|
},
|
||||||
|
// 添加选择被访单位方法
|
||||||
|
selectInterviewedUnit(unit) {
|
||||||
|
this.formData.interviewedUnit = unit.value;
|
||||||
|
this.showUnitDialog = false;
|
||||||
|
},
|
||||||
|
|
||||||
// 点击外部关闭下拉菜单
|
// 点击外部关闭下拉菜单
|
||||||
handleClickOutside() {
|
handleClickOutside() {
|
||||||
this.showTypeDialog = false;
|
this.showTypeDialog = false;
|
||||||
|
this.showUnitDialog = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理日期时间选择
|
// 处理日期时间选择
|
||||||
@ -807,4 +844,14 @@
|
|||||||
.dropdown-item:hover {
|
.dropdown-item:hover {
|
||||||
background-color: #f5f7fa;
|
background-color: #f5f7fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.face-tip-wrapper {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 108px; /* 与label宽度和margin一致 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.face-tip {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -46,6 +46,9 @@
|
|||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="button-wrapper">
|
||||||
|
<button class="logout-btn" @click="logout">退出登录</button>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -74,17 +77,23 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
this.$u.api.logout().then(res => {
|
// 清除用户信息并返回登录页
|
||||||
this.$u.toast(res.msg);
|
this.$u.vuex('vuex_user', {});
|
||||||
if (res.code == '200' || res.code == '401') {
|
this.$u.vuex('vuex_token', '');
|
||||||
let self = this;
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/sys/login/index'
|
url: '/pages/sys/login/index'
|
||||||
});
|
});
|
||||||
}, 500);
|
// this.$u.api.logout().then(res => {
|
||||||
}
|
// this.$u.toast(res.msg);
|
||||||
});
|
// if (res.code == '200' || res.code == '401') {
|
||||||
|
// let self = this;
|
||||||
|
// setTimeout(() => {
|
||||||
|
// uni.reLaunch({
|
||||||
|
// url: '/pages/sys/login/index'
|
||||||
|
// });
|
||||||
|
// }, 500);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
upgrade(){
|
upgrade(){
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
@ -117,8 +126,12 @@ export default {
|
|||||||
page {
|
page {
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
.button-wrapper {
|
||||||
|
padding: 80rpx 0;
|
||||||
|
}
|
||||||
.wrap .u-cell-box .u-cell_title{
|
.wrap .u-cell-box .u-cell_title{
|
||||||
color:#202328;
|
color:#202328;
|
||||||
|
margin-bottom: 80rpx;
|
||||||
}
|
}
|
||||||
.sign-in-images{
|
.sign-in-images{
|
||||||
width: 125rpx;
|
width: 125rpx;
|
||||||
@ -131,4 +144,18 @@ page {
|
|||||||
height:50rpx;
|
height:50rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.logout-btn {
|
||||||
|
width: 80vw;
|
||||||
|
height: 80rpx;
|
||||||
|
background: #0090FF;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
border: none;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
display: block;
|
||||||
|
box-shadow: 0 18rpx 24rpx rgba(0, 0, 0, 0.18);
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user