修复校验
This commit is contained in:
@@ -3,12 +3,12 @@
|
|||||||
* @Author: Zy
|
* @Author: Zy
|
||||||
* @Date: 2026-05-18 15:36:10
|
* @Date: 2026-05-18 15:36:10
|
||||||
* @LastEditor: Zy
|
* @LastEditor: Zy
|
||||||
* @LastEditTime: 2026-07-08 17:26:41
|
* @LastEditTime: 2026-07-20 14:29:10
|
||||||
*/
|
*/
|
||||||
let baseUrl = ''
|
let baseUrl = ''
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
baseUrl = 'http://192.168.1.222:8080' // 开发环境
|
baseUrl = 'http://192.168.1.6:8080' // 开发环境
|
||||||
} else {
|
} else {
|
||||||
baseUrl = 'https://wuyeapi.ckdzkj.com' // 生产环境
|
baseUrl = 'https://wuyeapi.ckdzkj.com' // 生产环境
|
||||||
// baseUrl = 'https://wuyeapi.bugtc.com' // 生产环境
|
// baseUrl = 'https://wuyeapi.bugtc.com' // 生产环境
|
||||||
|
|||||||
@@ -1,175 +1,175 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="privacy-mask" v-if="show" @click="handleMaskClick">
|
<view class="privacy-mask" v-if="show" @click="handleMaskClick">
|
||||||
<view class="privacy-popup" @click.stop>
|
<view class="privacy-popup" @click.stop>
|
||||||
<view class="popup-header">
|
<view class="popup-header">
|
||||||
<text class="popup-title">请先阅读并同意协议</text>
|
<text class="popup-title">请先阅读并同意协议</text>
|
||||||
<view class="popup-close" @click="handleClose">✕</view>
|
<view class="popup-close" @click="handleClose">✕</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view class="popup-body" scroll-y>
|
<scroll-view class="popup-body" scroll-y>
|
||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
<view class="section-text">
|
<view class="section-text">
|
||||||
我已仔细阅读并同意
|
我已仔细阅读并同意
|
||||||
<view class="privacy-link" >
|
<view class="privacy-link">
|
||||||
<text @click="goToUserAgreement">《用户协议》</text>和
|
<text @click="goToUserAgreement">《用户协议》</text>和
|
||||||
<text @click="goToPrivacy">《隐私政策》</text>
|
<text @click="goToPrivacy">《隐私政策》</text>
|
||||||
</view>
|
</view>
|
||||||
全部内容。
|
全部内容。
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view class="popup-footer">
|
<view class="popup-footer">
|
||||||
<button class="popup-btn disagree-btn" @click="handleDisagree">不同意</button>
|
<button class="popup-btn disagree-btn" @click="handleDisagree">不同意</button>
|
||||||
<button class="popup-btn agree-btn" @click="handleAgree">同意</button>
|
<button class="popup-btn agree-btn" @click="handleAgree">同意</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
defineProps({
|
defineProps({
|
||||||
show: {
|
show: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['agree', 'disagree', 'close', 'update:show'])
|
const emit = defineEmits(['agree', 'disagree', 'close', 'update:show'])
|
||||||
|
|
||||||
const handleAgree = () => {
|
const handleAgree = () => {
|
||||||
emit('agree')
|
emit('agree')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDisagree = () => {
|
const handleDisagree = () => {
|
||||||
emit('disagree')
|
emit('disagree')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
emit('close')
|
emit('close')
|
||||||
emit('update:show', false)
|
emit('update:show', false)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleMaskClick = () => {
|
const handleMaskClick = () => {
|
||||||
emit('close')
|
emit('close')
|
||||||
emit('update:show', false)
|
emit('update:show', false)
|
||||||
}
|
}
|
||||||
// 打开用户协议
|
// 打开用户协议
|
||||||
const goToUserAgreement = () => {
|
const goToUserAgreement = () => {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
window.open('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
window.open('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开隐私政策
|
// 打开隐私政策
|
||||||
const goToPrivacy = () => {
|
const goToPrivacy = () => {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler.html')
|
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler.html')
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
window.open('https://wuye.ckdzkj.com/parivw/butler.html')
|
window.open('https://wuye.ckdzkj.com/parivw/butler.html')
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.privacy-mask {
|
.privacy-mask {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba(0, 0, 0, 0.5);
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.privacy-popup {
|
.privacy-popup {
|
||||||
width: 640rpx;
|
width: 640rpx;
|
||||||
max-height: 80vh;
|
max-height: 80vh;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-header {
|
.popup-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 28rpx 30rpx 16rpx;
|
padding: 28rpx 30rpx 16rpx;
|
||||||
border-bottom: 1rpx solid #eee;
|
border-bottom: 1rpx solid #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-title {
|
.popup-title {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-close {
|
.popup-close {
|
||||||
width: 48rpx;
|
width: 48rpx;
|
||||||
height: 48rpx;
|
height: 48rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-body {
|
.popup-body {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 24rpx 30rpx;
|
padding: 24rpx 30rpx;
|
||||||
max-height: 50vh;
|
max-height: 50vh;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-content .section-text {
|
.popup-content .section-text {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
line-height: 1.8;
|
line-height: 1.8;
|
||||||
color: #666;
|
color: #666;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
}
|
}
|
||||||
|
|
||||||
.privacy-link {
|
.privacy-link {
|
||||||
color: #007aff;
|
color: #007aff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-footer {
|
.popup-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 20rpx 30rpx 30rpx;
|
padding: 20rpx 30rpx 30rpx;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
border-top: 1rpx solid #eee;
|
border-top: 1rpx solid #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-btn {
|
.popup-btn {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-btn::after {
|
.popup-btn::after {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.disagree-btn {
|
.disagree-btn {
|
||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agree-btn {
|
.agree-btn {
|
||||||
background: #007aff;
|
background: #007aff;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,154 +1,157 @@
|
|||||||
{
|
{
|
||||||
"name" : "花开管家",
|
"name": "花开管家",
|
||||||
"appid" : "__UNI__5F224F3",
|
"appid": "__UNI__5F224F3",
|
||||||
"description" : "智慧社区管家端,专为小区物业管理人员打造,支持多小区灵活切换管理。集成账号密码、手机号密码双重登录模式,内置忘记密码找回功能,保障账号安全。涵盖消息通知、日常巡检、故障报修、一键开门、工单流转、投诉处理等核心办公功能,物业人员可在线完成巡检打卡、问题上报、工单派发跟进、投诉对接处理等日常工作,同时支持查看个人上报记录、巡检历史,便捷修改账号信息与登录密码。高效简化社区物业办公流程,提升小区服务与管理效率,打造便捷智能的社区管理服务平台。",
|
"description": "智慧社区管家端,专为小区物业管理人员打造,支持多小区灵活切换管理。集成账号密码、手机号密码双重登录模式,内置忘记密码找回功能,保障账号安全。涵盖消息通知、日常巡检、故障报修、一键开门、工单流转、投诉处理等核心办公功能,物业人员可在线完成巡检打卡、问题上报、工单派发跟进、投诉对接处理等日常工作,同时支持查看个人上报记录、巡检历史,便捷修改账号信息与登录密码。高效简化社区物业办公流程,提升小区服务与管理效率,打造便捷智能的社区管理服务平台。",
|
||||||
"versionName" : "1.0.2",
|
"versionName": "1.0.2",
|
||||||
"versionCode" : 102,
|
"versionCode": 102,
|
||||||
"transformPx" : false,
|
"transformPx": false,
|
||||||
"app-plus" : {
|
"app-plus": {
|
||||||
"usingComponents" : true,
|
"usingComponents": true,
|
||||||
"nvueStyleCompiler" : "uni-app",
|
"nvueStyleCompiler": "uni-app",
|
||||||
"compilerVersion" : 3,
|
"compilerVersion": 3,
|
||||||
"splashscreen" : {
|
"splashscreen": {
|
||||||
"alwaysShowBeforeRender" : true,
|
"alwaysShowBeforeRender": true,
|
||||||
"waiting" : true,
|
"waiting": true,
|
||||||
"autoclose" : true,
|
"autoclose": true,
|
||||||
"delay" : 0,
|
"delay": 0,
|
||||||
"useOriginalMsgbox" : true
|
"useOriginalMsgbox": true
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"Camera": {},
|
||||||
|
"Push": {},
|
||||||
|
"Bluetooth": {},
|
||||||
|
"Barcode": {}
|
||||||
|
},
|
||||||
|
"distribute": {
|
||||||
|
"android": {
|
||||||
|
"permissions": [
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
|
],
|
||||||
|
"targetSdkVersion": 30
|
||||||
|
},
|
||||||
|
"ios": {
|
||||||
|
"dSYMs": false,
|
||||||
|
"privacyDescription": {
|
||||||
|
"NSPhotoLibraryUsageDescription": "需要访问手机相册,选取本地巡检记录照片、业主报修故障图、水电表二维码用于上传工单与巡检台账,仅读取当前业务所需图片,不会获取相册内其他无关照片。",
|
||||||
|
"NSPhotoLibraryAddUsageDescription": "需要相册写入权限,保存巡检凭证、报修工单至手机相册,方便线下核对查看,图片仅本地存储,不会上传至无关服务器。",
|
||||||
|
"NSCameraUsageDescription": "本应用需要使用相机,用于管家现场巡检拍摄点位记录、处理业主报修拍摄故障照片,扫描水电表二维码抄表,拍摄影像仅用于小区物业工单与巡检业务存档,不会私自留存、对外分享。",
|
||||||
|
"NSLocationWhenInUseUsageDescription": "",
|
||||||
|
"NSLocationAlwaysAndWhenInUseUsageDescription": "",
|
||||||
|
"NSBluetoothPeripheralUsageDescription": "需要蓝牙权限连接小区智能门禁,实现蓝牙一键开门通行,仅用于小区门禁解锁业务,不采集蓝牙设备信息。",
|
||||||
|
"NSBluetoothAlwaysUsageDescription": "本应用需要蓝牙权限,用于扫描、连接小区蓝牙门禁设备实现一键开门,仅和本小区门禁硬件建立通信,不会扫描、连接无关蓝牙设备。"
|
||||||
},
|
},
|
||||||
"modules" : {
|
"urltypes": [{
|
||||||
"Camera" : {},
|
"urlschemes": ["unionpaycashier"]
|
||||||
"Push" : {},
|
}],
|
||||||
"Bluetooth" : {},
|
"idfa": false
|
||||||
"Barcode" : {}
|
},
|
||||||
|
"sdkConfigs": {
|
||||||
|
"push": {
|
||||||
|
"unipush": {
|
||||||
|
"version": "2",
|
||||||
|
"offline": false,
|
||||||
|
"oppo": {},
|
||||||
|
"vivo": {},
|
||||||
|
"mi": {},
|
||||||
|
"meizu": {},
|
||||||
|
"honor": {},
|
||||||
|
"fcm": {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"distribute" : {
|
"geolocation": {
|
||||||
"android" : {
|
"system": {
|
||||||
"permissions" : [
|
"__platform__": ["ios", "android"]
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
}
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
|
||||||
],
|
|
||||||
"targetSdkVersion" : 30
|
|
||||||
},
|
|
||||||
"ios" : {
|
|
||||||
"dSYMs" : false,
|
|
||||||
"privacyDescription" : {
|
|
||||||
"NSPhotoLibraryUsageDescription" : "需要访问手机相册,选取本地巡检记录照片、业主报修故障图、水电表二维码用于上传工单与巡检台账,仅读取当前业务所需图片,不会获取相册内其他无关照片。",
|
|
||||||
"NSPhotoLibraryAddUsageDescription" : "需要相册写入权限,保存巡检凭证、报修工单至手机相册,方便线下核对查看,图片仅本地存储,不会上传至无关服务器。",
|
|
||||||
"NSCameraUsageDescription" : "本应用需要使用相机,用于管家现场巡检拍摄点位记录、处理业主报修拍摄故障照片,扫描水电表二维码抄表,拍摄影像仅用于小区物业工单与巡检业务存档,不会私自留存、对外分享。",
|
|
||||||
"NSLocationWhenInUseUsageDescription" : "",
|
|
||||||
"NSLocationAlwaysAndWhenInUseUsageDescription" : "",
|
|
||||||
"NSBluetoothPeripheralUsageDescription" : "需要蓝牙权限连接小区智能门禁,实现蓝牙一键开门通行,仅用于小区门禁解锁业务,不采集蓝牙设备信息。",
|
|
||||||
"NSBluetoothAlwaysUsageDescription" : "本应用需要蓝牙权限,用于扫描、连接小区蓝牙门禁设备实现一键开门,仅和本小区门禁硬件建立通信,不会扫描、连接无关蓝牙设备。"
|
|
||||||
},
|
|
||||||
"urltypes" : [
|
|
||||||
{
|
|
||||||
"urlschemes" : [ "unionpaycashier" ]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"idfa" : false
|
|
||||||
},
|
|
||||||
"sdkConfigs" : {
|
|
||||||
"push" : {
|
|
||||||
"unipush" : {
|
|
||||||
"version" : "2",
|
|
||||||
"offline" : false,
|
|
||||||
"oppo" : {},
|
|
||||||
"vivo" : {},
|
|
||||||
"mi" : {},
|
|
||||||
"meizu" : {},
|
|
||||||
"honor" : {},
|
|
||||||
"fcm" : {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"geolocation" : {
|
|
||||||
"system" : {
|
|
||||||
"__platform__" : [ "ios", "android" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"icons" : {
|
|
||||||
"android" : {
|
|
||||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
|
||||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
|
||||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
|
||||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
|
||||||
},
|
|
||||||
"ios" : {
|
|
||||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
|
||||||
"ipad" : {
|
|
||||||
"app" : "unpackage/res/icons/76x76.png",
|
|
||||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
|
||||||
"notification" : "unpackage/res/icons/20x20.png",
|
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
|
||||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
|
||||||
"settings" : "unpackage/res/icons/29x29.png",
|
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
|
||||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
|
||||||
},
|
|
||||||
"iphone" : {
|
|
||||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
|
||||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
|
||||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
|
||||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
|
||||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"quickapp" : {},
|
"icons": {
|
||||||
"mp-weixin" : {
|
"android": {
|
||||||
"appid" : "wx40625124315d2de1",
|
"hdpi": "unpackage/res/icons/72x72.png",
|
||||||
"usingComponents" : true,
|
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||||
"lazyCodeLoading" : "requiredComponents"
|
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||||
},
|
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||||
"mp-alipay" : {
|
},
|
||||||
"usingComponents" : true
|
"ios": {
|
||||||
},
|
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||||
"mp-baidu" : {
|
"ipad": {
|
||||||
"usingComponents" : true
|
"app": "unpackage/res/icons/76x76.png",
|
||||||
},
|
"app@2x": "unpackage/res/icons/152x152.png",
|
||||||
"mp-toutiao" : {
|
"notification": "unpackage/res/icons/20x20.png",
|
||||||
"usingComponents" : true
|
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||||
},
|
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||||
"uniStatistics" : {
|
"settings": "unpackage/res/icons/29x29.png",
|
||||||
"enable" : false
|
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||||
},
|
"spotlight": "unpackage/res/icons/40x40.png",
|
||||||
"vueVersion" : "3",
|
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||||
"locale" : "zh-Hans",
|
},
|
||||||
"fallbackLocale" : "zh-Hans",
|
"iphone": {
|
||||||
"app-harmony" : {
|
"app@2x": "unpackage/res/icons/120x120.png",
|
||||||
"distribute" : {
|
"app@3x": "unpackage/res/icons/180x180.png",
|
||||||
"bundleName" : "com.chengkong.property.butler",
|
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||||
"signingConfigs" : {
|
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||||
"release" : {
|
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||||
"certpath" : "C:/Users/admin/Desktop/AppStore/new_harmony/花开物业.cer",
|
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||||
"keyAlias" : "wuye",
|
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||||
"keyPassword" : "0000001ADF5A2ECBEA883B44816B2D1993792348DB36113109A8D6190B7BB0FA49FC807D9A4191B23E10",
|
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||||
"profile" : "C:/Users/admin/Desktop/AppStore/new_harmony/guanjiaRelease.p7b",
|
}
|
||||||
"signAlg" : "SHA256withECDSA",
|
|
||||||
"storeFile" : "C:/Users/admin/Desktop/AppStore/new_harmony/huakaiwuye.p12",
|
|
||||||
"storePassword" : "0000001AA46C978566364D5E371290888A2A18578BBB958BCACA8A64F023354E30EC33C84C8CC9515B38"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"quickapp": {},
|
||||||
|
"mp-weixin": {
|
||||||
|
"appid": "wx40625124315d2de1",
|
||||||
|
"usingComponents": true,
|
||||||
|
"lazyCodeLoading": "requiredComponents"
|
||||||
|
},
|
||||||
|
"mp-alipay": {
|
||||||
|
"usingComponents": true
|
||||||
|
},
|
||||||
|
"mp-baidu": {
|
||||||
|
"usingComponents": true
|
||||||
|
},
|
||||||
|
"mp-toutiao": {
|
||||||
|
"usingComponents": true
|
||||||
|
},
|
||||||
|
"uniStatistics": {
|
||||||
|
"enable": false
|
||||||
|
},
|
||||||
|
"vueVersion": "3",
|
||||||
|
"locale": "zh-Hans",
|
||||||
|
"fallbackLocale": "zh-Hans",
|
||||||
|
"app-harmony": {
|
||||||
|
"distribute": {
|
||||||
|
"bundleName": "com.chengkong.property.butler",
|
||||||
|
"signingConfigs": {
|
||||||
|
"release": {
|
||||||
|
"certpath": "C:/Users/admin/Desktop/AppStore/new_harmony/花开物业.cer",
|
||||||
|
"keyAlias": "wuye",
|
||||||
|
"keyPassword": "0000001ADF5A2ECBEA883B44816B2D1993792348DB36113109A8D6190B7BB0FA49FC807D9A4191B23E10",
|
||||||
|
"profile": "C:/Users/admin/Desktop/AppStore/new_harmony/guanjiaRelease.p7b",
|
||||||
|
"signAlg": "SHA256withECDSA",
|
||||||
|
"storeFile": "C:/Users/admin/Desktop/AppStore/new_harmony/huakaiwuye.p12",
|
||||||
|
"storePassword": "0000001AA46C978566364D5E371290888A2A18578BBB958BCACA8A64F023354E30EC33C84C8CC9515B38"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"h5": {
|
||||||
|
"devServer": {
|
||||||
|
"port": 5588
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,10 +71,11 @@
|
|||||||
>我已阅读并同意
|
>我已阅读并同意
|
||||||
<text class="agreePrivacy">《用户隐私政策》</text>
|
<text class="agreePrivacy">《用户隐私政策》</text>
|
||||||
</text> -->
|
</text> -->
|
||||||
<text class="agreement-text" >我已阅读并同意
|
<text class="agreement-text"
|
||||||
<text class="agreePrivacy" @click.stop="goToUserAgreement">《用户协议》</text>和
|
>我已阅读并同意
|
||||||
<text class="agreePrivacy" @click.stop="goToPrivacy">《隐私政策》</text>
|
<text class="agreePrivacy" @click.stop="goToUserAgreement">《用户协议》</text>和
|
||||||
</text>
|
<text class="agreePrivacy" @click.stop="goToPrivacy">《隐私政策》</text>
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 登录按钮 -->
|
<!-- 登录按钮 -->
|
||||||
@@ -87,7 +88,11 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 隐私协议弹窗 -->
|
<!-- 隐私协议弹窗 -->
|
||||||
<privacy-popup v-model:show="showPrivacyPopup" @agree="agreePrivacy" @disagree="disagreePrivacy" />
|
<privacy-popup
|
||||||
|
v-model:show="showPrivacyPopup"
|
||||||
|
@agree="agreePrivacy"
|
||||||
|
@disagree="disagreePrivacy"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -139,26 +144,25 @@ const checkForm = () => {
|
|||||||
const toggleAgreement = () => {
|
const toggleAgreement = () => {
|
||||||
agreeAgreement.value = !agreeAgreement.value
|
agreeAgreement.value = !agreeAgreement.value
|
||||||
}
|
}
|
||||||
// 打开用户协议
|
// 打开用户协议
|
||||||
const goToUserAgreement = () => {
|
const goToUserAgreement = () => {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
window.open('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
window.open('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开隐私政策
|
|
||||||
const goToPrivacy = () => {
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler.html')
|
|
||||||
// #endif
|
|
||||||
// #ifdef H5
|
|
||||||
window.open('https://wuye.ckdzkj.com/parivw/butler.html')
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// 打开隐私政策
|
||||||
|
const goToPrivacy = () => {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler.html')
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
window.open('https://wuye.ckdzkj.com/parivw/butler.html')
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
// 不同意隐私协议
|
// 不同意隐私协议
|
||||||
const disagreePrivacy = () => {
|
const disagreePrivacy = () => {
|
||||||
@@ -247,6 +251,7 @@ const handleLogin = () => {
|
|||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
uni.setStorageSync('token', res.data.token)
|
uni.setStorageSync('token', res.data.token)
|
||||||
|
uni.setStorageSync('userPermission', res.data.user.permissions)
|
||||||
// 存用户ID
|
// 存用户ID
|
||||||
if (res.data.user.userId) {
|
if (res.data.user.userId) {
|
||||||
uni.setStorageSync('userId', res.data.user.userId)
|
uni.setStorageSync('userId', res.data.user.userId)
|
||||||
|
|||||||
@@ -1,389 +1,408 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="login-page">
|
<view class="login-page">
|
||||||
<view class="status_bar"></view>
|
<view class="status_bar"></view>
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<view class="login-title">账号密码登录</view>
|
<view class="login-title">账号密码登录</view>
|
||||||
|
|
||||||
<!-- 手机号输入框 -->
|
<!-- 手机号输入框 -->
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<view class="input-icon">
|
<view class="input-icon">
|
||||||
<!-- <uni-icons type="phone" size="24" color="#999"></uni-icons> -->
|
<!-- <uni-icons type="phone" size="24" color="#999"></uni-icons> -->
|
||||||
<image src="https://wuyeadmin.bugtc.com/images/login/phone.png" mode=""
|
<image
|
||||||
style="height: 100%;width: 100%;"></image>
|
src="https://wuyeadmin.bugtc.com/images/login/phone.png"
|
||||||
</view>
|
mode=""
|
||||||
<uni-easyinput class="input-content" type="text" v-model="phoneNumber" placeholder="请输入帐号"
|
style="height: 100%; width: 100%"
|
||||||
:inputBorder="false" :placeholderStyle="placeholderStyle">
|
></image>
|
||||||
</uni-easyinput>
|
</view>
|
||||||
</view>
|
<uni-easyinput
|
||||||
|
class="input-content"
|
||||||
|
type="text"
|
||||||
|
v-model="phoneNumber"
|
||||||
|
placeholder="请输入帐号"
|
||||||
|
:inputBorder="false"
|
||||||
|
:placeholderStyle="placeholderStyle"
|
||||||
|
>
|
||||||
|
</uni-easyinput>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 密码输入框 -->
|
<!-- 密码输入框 -->
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<view class="input-icon">
|
<view class="input-icon">
|
||||||
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
||||||
<image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode=""
|
<image
|
||||||
style="height: 100%;width: 100%;"></image>
|
src="https://wuyeadmin.bugtc.com/images/login/password.png"
|
||||||
</view>
|
mode=""
|
||||||
<uni-easyinput class="input-content" type="password" v-model="password" placeholder="请输入6-16位密码"
|
style="height: 100%; width: 100%"
|
||||||
:inputBorder="false" :placeholderStyle="placeholderStyle">
|
></image>
|
||||||
</uni-easyinput>
|
</view>
|
||||||
|
<uni-easyinput
|
||||||
|
class="input-content"
|
||||||
|
type="password"
|
||||||
|
v-model="password"
|
||||||
|
placeholder="请输入6-16位密码"
|
||||||
|
:inputBorder="false"
|
||||||
|
:placeholderStyle="placeholderStyle"
|
||||||
|
>
|
||||||
|
</uni-easyinput>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
<!-- 记住密码 -->
|
||||||
|
<view class="remember-wrap" style="display: none">
|
||||||
|
<view class="remember-item" @click="toggleRemember">
|
||||||
|
<uni-icons type="checkbox-filled" size="18" color="#4D5DFA" v-if="rememberPwd"></uni-icons>
|
||||||
|
<uni-icons type="checkbox" size="18" color="#999" v-else></uni-icons>
|
||||||
|
<text class="remember-text">记住密码</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 记住密码 -->
|
<!-- 协议勾选 + 忘记密码 -->
|
||||||
<view class="remember-wrap" style="display: none;">
|
<view class="agreement-wrap">
|
||||||
<view class="remember-item" @click="toggleRemember">
|
<view class="agreement-item">
|
||||||
<uni-icons type="checkbox-filled" size="18" color="#4D5DFA" v-if="rememberPwd"></uni-icons>
|
<view @click="toggleAgreement">
|
||||||
<uni-icons type="checkbox" size="18" color="#999" v-else></uni-icons>
|
<uni-icons
|
||||||
<text class="remember-text">记住密码</text>
|
type="checkbox-filled"
|
||||||
</view>
|
size="24"
|
||||||
</view>
|
color="#4D5DFA"
|
||||||
|
v-if="agreeAgreement"
|
||||||
<!-- 协议勾选 + 忘记密码 -->
|
></uni-icons>
|
||||||
<view class="agreement-wrap">
|
<uni-icons type="checkbox" size="24" color="#999" v-else></uni-icons>
|
||||||
<view class="agreement-item">
|
</view>
|
||||||
<view @click="toggleAgreement">
|
<text class="agreement-text"
|
||||||
<uni-icons type="checkbox-filled" size="24" color="#4D5DFA" v-if="agreeAgreement"></uni-icons>
|
>我已阅读并同意
|
||||||
<uni-icons type="checkbox" size="24" color="#999" v-else></uni-icons>
|
<text class="agreePrivacy" @click.stop="goToUserAgreement">《用户协议》</text>和
|
||||||
</view>
|
<text class="agreePrivacy" @click.stop="goToPrivacy">《隐私政策》</text>
|
||||||
<text class="agreement-text" >我已阅读并同意
|
|
||||||
<text class="agreePrivacy" @click.stop="goToUserAgreement">《用户协议》</text>和
|
|
||||||
<text class="agreePrivacy" @click.stop="goToPrivacy">《隐私政策》</text>
|
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<navigator class="forget-pwd" url="/pageSubPack/loginSub/forget-pwd">忘记密码?</navigator>
|
<navigator class="forget-pwd" url="/pageSubPack/loginSub/forget-pwd">忘记密码?</navigator>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 登录按钮 -->
|
<!-- 登录按钮 -->
|
||||||
<button class="login-btn" @click="handleLogin">
|
<button class="login-btn" @click="handleLogin">登录</button>
|
||||||
登录
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<!-- 底部链接 -->
|
<!-- 底部链接 -->
|
||||||
<view class="bottom-link">
|
<view class="bottom-link">
|
||||||
<navigator class="link-item" url="/pageSubPack/loginSub/login">验证码登录</navigator>
|
<navigator class="link-item" url="/pageSubPack/loginSub/login">验证码登录</navigator>
|
||||||
<!-- <navigator class="link-item" url="/pageSubPack/loginSub/register-new-user">注册新用户</navigator> -->
|
<!-- <navigator class="link-item" url="/pageSubPack/loginSub/register-new-user">注册新用户</navigator> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 隐私协议弹窗 -->
|
<!-- 隐私协议弹窗 -->
|
||||||
<privacy-popup v-model:show="showPrivacyPopup" @agree="agreePrivacy" @disagree="disagreePrivacy" @close="showPrivacyPopup = false" />
|
<privacy-popup
|
||||||
|
v-model:show="showPrivacyPopup"
|
||||||
|
@agree="agreePrivacy"
|
||||||
|
@disagree="disagreePrivacy"
|
||||||
|
@close="showPrivacyPopup = false"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { ref, computed } from 'vue'
|
||||||
ref,
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
computed
|
import { getLoginPassword } from '../../api/api.js'
|
||||||
} from 'vue';
|
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
||||||
import {
|
|
||||||
onLoad
|
|
||||||
} from "@dcloudio/uni-app"
|
|
||||||
import {
|
|
||||||
getLoginPassword
|
|
||||||
} from '../../api/api.js'
|
|
||||||
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const phoneNumber = ref('');
|
const phoneNumber = ref('')
|
||||||
const password = ref('');
|
const password = ref('')
|
||||||
const agreeAgreement = ref(false); // 默认勾选
|
const agreeAgreement = ref(false) // 默认勾选
|
||||||
const rememberPwd = ref(false);
|
const rememberPwd = ref(false)
|
||||||
const placeholderStyle = ref('font-size:24rpx')
|
const placeholderStyle = ref('font-size:24rpx')
|
||||||
const showPrivacyPopup = ref(false)
|
const showPrivacyPopup = ref(false)
|
||||||
|
|
||||||
// 计算属性:是否可登录(帐号+密码+协议都满足)
|
// 计算属性:是否可登录(帐号+密码+协议都满足)
|
||||||
const canLogin = computed(() => {
|
const canLogin = computed(() => {
|
||||||
const phoneReg = /^[a-zA-Z0-9_-]{4,16}$/; // 4-16位
|
const phoneReg = /^[a-zA-Z0-9_-]{4,16}$/ // 4-16位
|
||||||
const pwdReg = /^.{6,16}$/; // 密码6-16位
|
const pwdReg = /^.{6,16}$/ // 密码6-16位
|
||||||
return phoneReg.test(phoneNumber.value) && pwdReg.test(password.value) && agreeAgreement.value;
|
return phoneReg.test(phoneNumber.value) && pwdReg.test(password.value) && agreeAgreement.value
|
||||||
});
|
})
|
||||||
|
|
||||||
// 切换协议勾选
|
// 切换协议勾选
|
||||||
const toggleAgreement = () => {
|
const toggleAgreement = () => {
|
||||||
agreeAgreement.value = !agreeAgreement.value;
|
agreeAgreement.value = !agreeAgreement.value
|
||||||
};
|
}
|
||||||
// 切换记住密码
|
// 切换记住密码
|
||||||
const toggleRemember = () => {
|
const toggleRemember = () => {
|
||||||
rememberPwd.value = !rememberPwd.value;
|
rememberPwd.value = !rememberPwd.value
|
||||||
};
|
}
|
||||||
|
|
||||||
// 打开用户协议
|
// 打开用户协议
|
||||||
const goToUserAgreement = () => {
|
const goToUserAgreement = () => {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
window.open('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
window.open('https://wuye.ckdzkj.com/parivw/butler_xieyi.html')
|
||||||
// #endif
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开隐私政策
|
||||||
|
const goToPrivacy = () => {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler.html')
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
window.open('https://wuye.ckdzkj.com/parivw/butler.html')
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开隐私协议弹窗
|
||||||
|
// const goToPrivacy = () => {
|
||||||
|
// showPrivacyPopup.value = true
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 不同意隐私协议
|
||||||
|
const disagreePrivacy = () => {
|
||||||
|
agreeAgreement.value = false
|
||||||
|
showPrivacyPopup.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查表单
|
||||||
|
const checkForm = () => {}
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
const savedPhone = uni.getStorageSync('rememberPhone')
|
||||||
|
const savedPwd = uni.getStorageSync('rememberPassword')
|
||||||
|
const savedRemember = uni.getStorageSync('rememberPwd')
|
||||||
|
if (savedPhone) phoneNumber.value = savedPhone
|
||||||
|
if (savedPwd) password.value = savedPwd
|
||||||
|
if (savedRemember) rememberPwd.value = savedRemember
|
||||||
|
})
|
||||||
|
|
||||||
|
// 登录逻辑
|
||||||
|
const handleLogin = () => {
|
||||||
|
if (!phoneNumber.value) {
|
||||||
|
uni.showToast({ title: '请输入账号', icon: 'none' })
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
if (phoneNumber.value.length < 4 || phoneNumber.value.length > 16) {
|
||||||
// 打开隐私政策
|
uni.showToast({ title: '账号长度需为 4-16 位', icon: 'none' })
|
||||||
const goToPrivacy = () => {
|
return
|
||||||
// #ifdef APP-PLUS
|
|
||||||
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/butler.html')
|
|
||||||
// #endif
|
|
||||||
// #ifdef H5
|
|
||||||
window.open('https://wuye.ckdzkj.com/parivw/butler.html')
|
|
||||||
// #endif
|
|
||||||
}
|
}
|
||||||
|
if (!password.value) {
|
||||||
// 打开隐私协议弹窗
|
uni.showToast({ title: '请输入密码', icon: 'none' })
|
||||||
// const goToPrivacy = () => {
|
return
|
||||||
// showPrivacyPopup.value = true
|
}
|
||||||
// }
|
if (password.value.length < 6) {
|
||||||
|
uni.showToast({ title: '密码至少输入 6 位', icon: 'none' })
|
||||||
|
return
|
||||||
// 不同意隐私协议
|
}
|
||||||
const disagreePrivacy = () => {
|
if (password.value.length > 16) {
|
||||||
agreeAgreement.value = false
|
uni.showToast({ title: '密码不能超过 16 位', icon: 'none' })
|
||||||
showPrivacyPopup.value = false
|
return
|
||||||
}
|
}
|
||||||
|
if (!agreeAgreement.value) {
|
||||||
// 检查表单
|
showPrivacyPopup.value = true
|
||||||
const checkForm = () => {};
|
return
|
||||||
|
}
|
||||||
|
uni.showLoading({ title: '登录中...', mask: true })
|
||||||
onLoad(() => {
|
const push_cid = uni.getStorageSync('push_cid')
|
||||||
const savedPhone = uni.getStorageSync('rememberPhone');
|
// console.log('登录cid',push_cid)
|
||||||
const savedPwd = uni.getStorageSync('rememberPassword');
|
let params = {
|
||||||
const savedRemember = uni.getStorageSync('rememberPwd');
|
username: phoneNumber.value,
|
||||||
if (savedPhone) phoneNumber.value = savedPhone;
|
password: password.value,
|
||||||
if (savedPwd) password.value = savedPwd;
|
cid: push_cid
|
||||||
if (savedRemember) rememberPwd.value = savedRemember;
|
}
|
||||||
});
|
getLoginPassword(params)
|
||||||
|
.then(res => {
|
||||||
// 登录逻辑
|
// console.log('33333',res)
|
||||||
const handleLogin = () => {
|
if (res.code === 200) {
|
||||||
if (!phoneNumber.value) {
|
uni.setStorageSync('token', res.data.token)
|
||||||
uni.showToast({ title: '请输入账号', icon: 'none' });
|
// 清掉上次账号的小区缓存,防止新账号显示旧小区
|
||||||
return;
|
uni.removeStorageSync('currentVillage')
|
||||||
|
// 存用户ID
|
||||||
|
// if(res.data) {
|
||||||
|
// // 存当前绑定的小区ID,0 表示未绑定
|
||||||
|
// // const currentVillageId = res.data.currentVillageId || 0;
|
||||||
|
// // uni.setStorageSync('currentVillageId', currentVillageId);
|
||||||
|
// }
|
||||||
|
uni.setStorageSync('userPermission', res.data.user.permissions)
|
||||||
|
uni.hideLoading()
|
||||||
|
if (rememberPwd.value) {
|
||||||
|
uni.setStorageSync('rememberPhone', phoneNumber.value)
|
||||||
|
uni.setStorageSync('rememberPassword', password.value)
|
||||||
|
uni.setStorageSync('rememberPwd', true)
|
||||||
|
} else {
|
||||||
|
uni.removeStorageSync('rememberPhone')
|
||||||
|
uni.removeStorageSync('rememberPassword')
|
||||||
|
uni.removeStorageSync('rememberPwd')
|
||||||
|
}
|
||||||
|
uni.showToast({ title: '登录成功', icon: 'success' })
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.switchTab(
|
||||||
|
{
|
||||||
|
url: '/pages/index/index'
|
||||||
|
},
|
||||||
|
1000
|
||||||
|
)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg, icon: 'error' })
|
||||||
}
|
}
|
||||||
if (phoneNumber.value.length < 4 || phoneNumber.value.length > 16) {
|
})
|
||||||
uni.showToast({ title: '账号长度需为 4-16 位', icon: 'none' });
|
.catch(err => {
|
||||||
return;
|
uni.showToast({
|
||||||
}
|
title: err.msg,
|
||||||
if (!password.value) {
|
icon: 'error'
|
||||||
uni.showToast({ title: '请输入密码', icon: 'none' });
|
})
|
||||||
return;
|
})
|
||||||
}
|
}
|
||||||
if (password.value.length < 6) {
|
|
||||||
uni.showToast({ title: '密码至少输入 6 位', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (password.value.length > 16) {
|
|
||||||
uni.showToast({ title: '密码不能超过 16 位', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(!agreeAgreement.value){
|
|
||||||
showPrivacyPopup.value = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
uni.showLoading({ title: '登录中...', mask: true });
|
|
||||||
const push_cid = uni.getStorageSync('push_cid')
|
|
||||||
// console.log('登录cid',push_cid)
|
|
||||||
let params = {
|
|
||||||
username:phoneNumber.value,
|
|
||||||
password:password.value,
|
|
||||||
cid:push_cid
|
|
||||||
}
|
|
||||||
getLoginPassword(params).then(res =>{
|
|
||||||
// console.log('33333',res)
|
|
||||||
if(res.code === 200){
|
|
||||||
uni.setStorageSync('token', res.data.token);
|
|
||||||
// 清掉上次账号的小区缓存,防止新账号显示旧小区
|
|
||||||
uni.removeStorageSync('currentVillage');
|
|
||||||
// 存用户ID
|
|
||||||
// if(res.data) {
|
|
||||||
// // 存当前绑定的小区ID,0 表示未绑定
|
|
||||||
// // const currentVillageId = res.data.currentVillageId || 0;
|
|
||||||
// // uni.setStorageSync('currentVillageId', currentVillageId);
|
|
||||||
// }
|
|
||||||
uni.hideLoading();
|
|
||||||
if (rememberPwd.value) {
|
|
||||||
uni.setStorageSync('rememberPhone', phoneNumber.value);
|
|
||||||
uni.setStorageSync('rememberPassword', password.value);
|
|
||||||
uni.setStorageSync('rememberPwd', true);
|
|
||||||
} else {
|
|
||||||
uni.removeStorageSync('rememberPhone');
|
|
||||||
uni.removeStorageSync('rememberPassword');
|
|
||||||
uni.removeStorageSync('rememberPwd');
|
|
||||||
}
|
|
||||||
uni.showToast({ title: '登录成功', icon: 'success' });
|
|
||||||
setTimeout(() =>{
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/index/index'
|
|
||||||
},1000);
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
uni.showToast({ title: res.msg, icon: 'error' });
|
|
||||||
}
|
|
||||||
|
|
||||||
}).catch(err => {
|
// 同意隐私协议(弹窗中点击同意 → 直接登录)
|
||||||
uni.showToast({
|
const agreePrivacy = () => {
|
||||||
title: err.msg,
|
agreeAgreement.value = true
|
||||||
icon: 'error'
|
showPrivacyPopup.value = false
|
||||||
});
|
handleLogin()
|
||||||
})
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// 同意隐私协议(弹窗中点击同意 → 直接登录)
|
|
||||||
const agreePrivacy = () => {
|
|
||||||
agreeAgreement.value = true
|
|
||||||
showPrivacyPopup.value = false
|
|
||||||
handleLogin()
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.login-page {
|
.login-page {
|
||||||
padding: 80rpx 40rpx 40rpx;
|
padding: 80rpx 40rpx 40rpx;
|
||||||
/* background-color: #f8f9fa; */
|
/* background-color: #f8f9fa; */
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF);
|
background: repeating-linear-gradient(180deg, #e2f0ff, #f6faff);
|
||||||
}
|
}
|
||||||
|
|
||||||
.status_bar {
|
.status_bar {
|
||||||
height: 160px;
|
height: 160px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-title {
|
.login-title {
|
||||||
font-size: 52rpx;
|
font-size: 52rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #333;
|
color: #333;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 142rpx;
|
margin-bottom: 142rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-item {
|
.input-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-icon {
|
.input-icon {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
width: 50rpx;
|
width: 50rpx;
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-content {
|
.input-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 清除 uni-easyinput 内部默认边距 */
|
/* 清除 uni-easyinput 内部默认边距 */
|
||||||
:deep(.uni-easyinput__content) {
|
:deep(.uni-easyinput__content) {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
min-height: auto !important;
|
min-height: auto !important;
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.uni-easyinput__content-input) {
|
:deep(.uni-easyinput__content-input) {
|
||||||
height: 60rpx !important;
|
height: 60rpx !important;
|
||||||
min-height: 60rpx !important;
|
min-height: 60rpx !important;
|
||||||
line-height: 60rpx !important;
|
line-height: 60rpx !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.remember-wrap {
|
.remember-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 20rpx 0 0 0;
|
margin: 20rpx 0 0 0;
|
||||||
padding: 0 10rpx;
|
padding: 0 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.remember-item {
|
.remember-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.remember-text {
|
.remember-text {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agreement-wrap {
|
.agreement-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 40rpx 0 28rpx 0;
|
margin: 40rpx 0 28rpx 0;
|
||||||
padding: 0 10rpx;
|
padding: 0 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agreement-item {
|
.agreement-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agreement-text {
|
.agreement-text {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
.agreePrivacy{
|
.agreePrivacy {
|
||||||
color: #4D5DFA;
|
color: #4d5dfa;
|
||||||
}
|
}
|
||||||
/* .agreePrivacy.active{
|
/* .agreePrivacy.active{
|
||||||
color: #4D5DFA;
|
color: #4D5DFA;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
.forget-pwd {
|
.forget-pwd {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-left: 16rpx;
|
margin-left: 16rpx;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-btn {
|
.login-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
line-height: 88rpx;
|
line-height: 88rpx;
|
||||||
background-color: #4D5DFA;
|
background-color: #4d5dfa;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-btn:disabled {
|
.login-btn:disabled {
|
||||||
background-color: #99c8ff;
|
background-color: #99c8ff;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
/* border-radius: 50px; */
|
/* border-radius: 50px; */
|
||||||
|
}
|
||||||
|
|
||||||
}
|
/* 禁用按钮边框 */
|
||||||
|
button:after {
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 禁用按钮边框 */
|
.bottom-link {
|
||||||
button:after {
|
display: flex;
|
||||||
border-radius: 8px;
|
justify-content: center;
|
||||||
}
|
padding: 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.bottom-link {
|
.link-item {
|
||||||
display: flex;
|
font-size: 28rpx;
|
||||||
justify-content: center;
|
color: #4d5dfa;
|
||||||
padding: 0 20rpx;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-item {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #4D5DFA;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -35,9 +35,7 @@
|
|||||||
|
|
||||||
<!-- 退出登录按钮 -->
|
<!-- 退出登录按钮 -->
|
||||||
<view class="logout-btn-wrap">
|
<view class="logout-btn-wrap">
|
||||||
<button class="logout-btn" @tap="handleLogout">
|
<button class="logout-btn" @tap="handleLogout">退出登录</button>
|
||||||
退出登录
|
|
||||||
</button>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -46,6 +44,7 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onShow } from '@dcloudio/uni-app'
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
import { logout, getSettingInfo } from '../../api/api.js'
|
import { logout, getSettingInfo } from '../../api/api.js'
|
||||||
|
import { clearPermList } from '../../utils/permissions.js'
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const phoneNumber = ref('') // 绑定手机号
|
const phoneNumber = ref('') // 绑定手机号
|
||||||
@@ -91,9 +90,9 @@ const goToModifyPassword = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 跳转到注销账号
|
// 跳转到注销账号
|
||||||
const goToDeleteAccount = () =>{
|
const goToDeleteAccount = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pageSubPack/setting/deleteAccount'
|
url: '/pageSubPack/setting/deleteAccount'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,19 +115,23 @@ const handleLogout = () => {
|
|||||||
const confirmLogout = () => {
|
const confirmLogout = () => {
|
||||||
uni.showLoading({ title: '退出中...' })
|
uni.showLoading({ title: '退出中...' })
|
||||||
|
|
||||||
logout().then(res => {
|
logout()
|
||||||
if (res.code === 200) {
|
.then(res => {
|
||||||
uni.clearStorageSync()
|
if (res.code === 200) {
|
||||||
uni.showToast({ title: '退出登录成功', icon: 'success' })
|
clearPermList()
|
||||||
uni.redirectTo({ url: '/pageSubPack/loginSub/pwd-login' })
|
uni.clearStorageSync()
|
||||||
} else {
|
uni.showToast({ title: '退出登录成功', icon: 'success' })
|
||||||
uni.showToast({ title: res.msg || '退出失败', icon: 'none' })
|
uni.redirectTo({ url: '/pageSubPack/loginSub/pwd-login' })
|
||||||
}
|
} else {
|
||||||
}).catch(() => {
|
uni.showToast({ title: res.msg || '退出失败', icon: 'none' })
|
||||||
uni.showToast({ title: '退出失败,请重试', icon: 'none' })
|
}
|
||||||
}).finally(() => {
|
})
|
||||||
uni.hideLoading()
|
.catch(() => {
|
||||||
})
|
uni.showToast({ title: '退出失败,请重试', icon: 'none' })
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,7 @@
|
|||||||
<view
|
<view
|
||||||
class="function-item"
|
class="function-item"
|
||||||
@tap="goToReplacement_record"
|
@tap="goToReplacement_record"
|
||||||
v-if="hasPermi('butler:,meter:replace')"
|
v-if="hasPermi('butler:meter:replace')"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
class="item-icon"
|
class="item-icon"
|
||||||
@@ -198,6 +198,7 @@ const pendingCount = ref(0) //待巡检
|
|||||||
const InspectedCount = ref(0) //已巡检
|
const InspectedCount = ref(0) //已巡检
|
||||||
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
|
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
|
||||||
|
|
||||||
|
console.log(hasPermi('butler:meter:replace'))
|
||||||
// =======方法=======
|
// =======方法=======
|
||||||
// 跳转小区
|
// 跳转小区
|
||||||
const navigateToPage = () => {
|
const navigateToPage = () => {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export function getPermList() {
|
|||||||
* 权限校验函数
|
* 权限校验函数
|
||||||
* @param perm 单个权限字符串 / 多个权限数组
|
* @param perm 单个权限字符串 / 多个权限数组
|
||||||
* @param mode or满足任一 / and全部满足,默认or
|
* @param mode or满足任一 / and全部满足,默认or
|
||||||
* @returns 是否拥有权限
|
* @returns 是否拥有权限 false 没有权限 true 有权限
|
||||||
*/
|
*/
|
||||||
export function hasPermi(perm, mode = 'or') {
|
export function hasPermi(perm, mode = 'or') {
|
||||||
const permList = getPermList()
|
const permList = getPermList()
|
||||||
@@ -23,6 +23,7 @@ export function hasPermi(perm, mode = 'or') {
|
|||||||
// 所有权限都要有
|
// 所有权限都要有
|
||||||
return checkArr.every(item => permList.includes(item))
|
return checkArr.every(item => permList.includes(item))
|
||||||
} else {
|
} else {
|
||||||
|
console.log(permList, checkArr)
|
||||||
// 有一个即可
|
// 有一个即可
|
||||||
return checkArr.some(item => permList.includes(item))
|
return checkArr.some(item => permList.includes(item))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user