|
@@ -12,8 +12,8 @@
|
|
|
<image class="title-icon" src="/static/images/person.png" mode="aspectFit"></image>
|
|
<image class="title-icon" src="/static/images/person.png" mode="aspectFit"></image>
|
|
|
对接人信息
|
|
对接人信息
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="mar-b-16" >
|
|
|
|
|
- <text class="label" >所属部门:</text>
|
|
|
|
|
|
|
+ <view class="mar-b-16">
|
|
|
|
|
+ <text class="label">所属部门:</text>
|
|
|
<view class="select-wrapper">
|
|
<view class="select-wrapper">
|
|
|
<!-- 调试信息 -->
|
|
<!-- 调试信息 -->
|
|
|
<uni-data-select v-model="formData.departmentId" :localdata="departmentOptions"
|
|
<uni-data-select v-model="formData.departmentId" :localdata="departmentOptions"
|
|
@@ -135,64 +135,24 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 提交成功弹框 -->
|
|
<!-- 提交成功弹框 -->
|
|
|
-<!-- <uni-popup ref="successPopup" type="center" :mask-click="false">-->
|
|
|
|
|
-<!-- <view class="success-popup">-->
|
|
|
|
|
-<!-- <view class="popup-content">-->
|
|
|
|
|
-<!-- <view class="success-icon">-->
|
|
|
|
|
-<!-- <uni-icons type="checkmarkempty" size="60" color="#52c41a"></uni-icons>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
-<!-- <view class="popup-title">申请提交成功</view>-->
|
|
|
|
|
-<!-- <view class="popup-message">您的申请已成功提交,请关注公众号即时查询审核结果</view>-->
|
|
|
|
|
-<!-- <view class="popup-buttons">-->
|
|
|
|
|
-<!-- <button class="cancel-btn" @click="closeSuccessPopup">取消</button>-->
|
|
|
|
|
-<!-- <button class="follow-btn" @click="showQRCode">关注</button>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
-<!-- </uni-popup>-->
|
|
|
|
|
-
|
|
|
|
|
- <!-- 二维码弹框 -->
|
|
|
|
|
-<!-- <uni-popup ref="qrcodePopup" type="center" :mask-click="false">-->
|
|
|
|
|
-<!-- <view class="qrcode-popup">-->
|
|
|
|
|
-<!-- <view class="qrcode-content">-->
|
|
|
|
|
-<!-- <view class="qrcode-title">扫描二维码关注公众号</view>-->
|
|
|
|
|
-<!-- <view class="qrcode-image" @click="previewQRCode">-->
|
|
|
|
|
-<!-- <image src="/static/images/qrcode.png" mode="aspectFit"></image>-->
|
|
|
|
|
-<!-- <view class="preview-tip">-->
|
|
|
|
|
-<!-- <uni-icons type="search" size="16" color="#fff"></uni-icons>-->
|
|
|
|
|
-<!-- <text>点击查看大图</text>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
-<!-- <view class="qrcode-tip">扫描上方二维码,关注公众号获取审核结果</view>-->
|
|
|
|
|
-<!-- <button class="qrcode-close-btn" @click="closeQRCode">我知道了</button>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
-<!-- </uni-popup>-->
|
|
|
|
|
-
|
|
|
|
|
- <uni-popup ref="successPopup" type="bottom" :mask-click="false">
|
|
|
|
|
-<!-- <view style="height: 100%;width: 100%;background-color: #fff;">-->
|
|
|
|
|
-<!-- <button>授权登录</button>-->
|
|
|
|
|
-<!-- <text style="font-size: 24rpx;color: rgba(41,44,53,0.6);line-height: 1.5;">-->
|
|
|
|
|
-<!-- 登录即代表您已同意-->
|
|
|
|
|
-<!-- <text style="color: #FF5B05;text-decoration: none;" @tap="goToPrivacy">《隐私政策》</text>-->
|
|
|
|
|
-<!-- 和-->
|
|
|
|
|
-<!-- <text style="color: #FF5B05;text-decoration: none;" @tap="goToService">《服务协议》</text>-->
|
|
|
|
|
-<!-- </text>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
- <view class="auth-popup">
|
|
|
|
|
-
|
|
|
|
|
- <view >
|
|
|
|
|
- <button class="login-btn" @tap="handleLogin">授权登录</button>
|
|
|
|
|
- <view class="agreement-text">
|
|
|
|
|
- 登录即代表您已同意
|
|
|
|
|
- <text class="agreement-link" @tap="goToPrivacy">《隐私政策》</text>
|
|
|
|
|
- 和
|
|
|
|
|
- <text class="agreement-link" @tap="goToService">《服务协议》</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- </uni-popup>
|
|
|
|
|
|
|
+ <!-- <uni-popup ref="successPopup" type="center" :mask-click="false">-->
|
|
|
|
|
+ <!-- <view class="success-popup">-->
|
|
|
|
|
+ <!-- <view class="popup-content">-->
|
|
|
|
|
+ <!-- <view class="success-icon">-->
|
|
|
|
|
+ <!-- <uni-icons type="checkmarkempty" size="60" color="#52c41a"></uni-icons>-->
|
|
|
|
|
+ <!-- </view>-->
|
|
|
|
|
+ <!-- <view class="popup-title">申请提交成功</view>-->
|
|
|
|
|
+ <!-- <view class="popup-message">您的申请已成功提交,请关注公众号即时查询审核结果</view>-->
|
|
|
|
|
+ <!-- <view class="popup-buttons">-->
|
|
|
|
|
+ <!-- <button class="cancel-btn" @click="closeSuccessPopup">取消</button>-->
|
|
|
|
|
+ <!-- <button class="follow-btn" @click="showQRCode">关注</button>-->
|
|
|
|
|
+ <!-- </view>-->
|
|
|
|
|
+ <!-- </view>-->
|
|
|
|
|
+ <!-- </view>-->
|
|
|
|
|
+ <!-- </uni-popup>-->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 授权登录组件 -->
|
|
|
|
|
+ <auth-login-popup ref="authLoginPopup" @success="onLoginSuccess" @close="onLoginClose"></auth-login-popup>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -202,12 +162,16 @@
|
|
|
<script>
|
|
<script>
|
|
|
import user from '../../store/modules/user';
|
|
import user from '../../store/modules/user';
|
|
|
import {
|
|
import {
|
|
|
-
|
|
|
|
|
getDept,
|
|
getDept,
|
|
|
selectUser,
|
|
selectUser,
|
|
|
addVisit
|
|
addVisit
|
|
|
} from '@/config/api.js';
|
|
} from '@/config/api.js';
|
|
|
|
|
+ import AuthLoginPopup from '@/components/auth-login-popup/auth-login-popup.vue';
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ AuthLoginPopup
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
type: '', // 从上一页传递过来的参数
|
|
type: '', // 从上一页传递过来的参数
|
|
@@ -236,7 +200,7 @@
|
|
|
// 部门选项(格式化为uni-data-select所需格式)
|
|
// 部门选项(格式化为uni-data-select所需格式)
|
|
|
departmentOptions: [],
|
|
departmentOptions: [],
|
|
|
// 员工选项
|
|
// 员工选项
|
|
|
- employeeOptions: [],
|
|
|
|
|
|
|
+ employeeOptions: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
@@ -253,7 +217,8 @@
|
|
|
onReady() {
|
|
onReady() {
|
|
|
// 页面渲染完成后再次获取,确保准确
|
|
// 页面渲染完成后再次获取,确保准确
|
|
|
this.getTabbarHeight()
|
|
this.getTabbarHeight()
|
|
|
- this.$refs.successPopup.open()
|
|
|
|
|
|
|
+ // 打开授权登录弹窗
|
|
|
|
|
+ this.$refs.authLoginPopup.open()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 获取tabbar高度
|
|
// 获取tabbar高度
|
|
@@ -569,7 +534,7 @@
|
|
|
// 构建提交数据
|
|
// 构建提交数据
|
|
|
const submitData = {
|
|
const submitData = {
|
|
|
visitDate: this.formData.visitTime, // 访问时间
|
|
visitDate: this.formData.visitTime, // 访问时间
|
|
|
- // userId: this.user?.id || '', // 员工id
|
|
|
|
|
|
|
+ userId: this.formData.employeeId, // 员工id(从选择的员工中获取user_id)
|
|
|
empName: this.formData.employeeName, // 访问部门人(员工姓名)
|
|
empName: this.formData.employeeName, // 访问部门人(员工姓名)
|
|
|
visDept: this.formData.visitorCompany, // 访客单位
|
|
visDept: this.formData.visitorCompany, // 访客单位
|
|
|
visitPerson: this.formData.visitorName, // 访客姓名
|
|
visitPerson: this.formData.visitorName, // 访客姓名
|
|
@@ -586,12 +551,27 @@
|
|
|
const response = await addVisit(submitData);
|
|
const response = await addVisit(submitData);
|
|
|
console.log('提交成功:', response);
|
|
console.log('提交成功:', response);
|
|
|
|
|
|
|
|
- // 显示提交成功弹框
|
|
|
|
|
- this.$refs.successPopup.open();
|
|
|
|
|
|
|
+ // 检查返回结果
|
|
|
|
|
+ if (response && response.code === 200) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: response.msg || '提交成功',
|
|
|
|
|
+ icon: 'success',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ // 延迟返回上一页
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ uni.navigateBack();
|
|
|
|
|
+ }, 2000);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: response.msg || '提交失败,请重试',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('提交失败:', error);
|
|
console.error('提交失败:', error);
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: '提交失败,请重试',
|
|
|
|
|
|
|
+ title: error.msg || '提交失败,请重试',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -638,6 +618,18 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ // 登录成功回调
|
|
|
|
|
+ onLoginSuccess(userInfo) {
|
|
|
|
|
+ console.log('登录成功,用户信息:', userInfo);
|
|
|
|
|
+ // 更新当前页面的用户信息
|
|
|
|
|
+ this.user = userInfo;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 登录弹窗关闭回调
|
|
|
|
|
+ onLoginClose() {
|
|
|
|
|
+ console.log('用户关闭了登录弹窗');
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -788,7 +780,7 @@
|
|
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
|
|
z-index: 10;
|
|
z-index: 10;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
&:active {
|
|
&:active {
|
|
|
opacity: 0.7;
|
|
opacity: 0.7;
|
|
|
transform: scale(0.95);
|
|
transform: scale(0.95);
|
|
@@ -1008,41 +1000,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- .auth-popup {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- background-color: #fff;
|
|
|
|
|
- border-radius: 24rpx;
|
|
|
|
|
- padding: 60rpx 40rpx 50rpx;
|
|
|
|
|
- box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.1);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- .login-btn {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 88rpx;
|
|
|
|
|
- background-color: #FF5B05;
|
|
|
|
|
- color: white;
|
|
|
|
|
- border: none;
|
|
|
|
|
- border-radius: 44rpx;
|
|
|
|
|
- font-size: 32rpx;
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- margin-bottom: 40rpx;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .login-btn:after {
|
|
|
|
|
- border: none;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .agreement-text {
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- color: rgba(41, 44, 53, 0.6);
|
|
|
|
|
- line-height: 36rpx;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .agreement-link {
|
|
|
|
|
- color: #FF5B05;
|
|
|
|
|
- text-decoration: none;
|
|
|
|
|
- }
|
|
|
|
|
</style>
|
|
</style>
|