2022-06-08 15:48:09 +08:00
|
|
|
<template>
|
2024-05-23 23:39:19 +08:00
|
|
|
<!-- <web-view src="http://niunian.hk.fq99.top"></web-view> -->
|
|
|
|
|
<view class="loginPage">
|
|
|
|
|
<!-- <view class="barBox" :style="{'height':systemInfo.statusBarHeight+'px'}"> -->
|
|
|
|
|
<view class="barBox">
|
|
|
|
|
</view>
|
|
|
|
|
<view class="loginBox">
|
|
|
|
|
<view class="loginTitle">
|
|
|
|
|
<image class="loginLogo" src="@/static/login/logo.pic.jpg" mode="heightFix"></image>
|
|
|
|
|
智慧工地服务平台
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btns">
|
|
|
|
|
<view class="user feedback" @click="goto('user')">用户登录</view>
|
|
|
|
|
<view class="feedback personLocation" @click="gotoPersonLocation()">施工人员登录</view>
|
|
|
|
|
<!-- <view class="user feedback" @click="goto('user')">我是用户</view> -->
|
|
|
|
|
<!-- <view class="supplier feedback black" @click="goto('supplier')">我是供应商</view> -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <view class="bottomTitle" @click="showModal=true">
|
2024-04-22 17:36:17 +08:00
|
|
|
云服务器设置
|
|
|
|
|
</view> -->
|
2024-05-20 13:51:56 +08:00
|
|
|
<!-- <view class="modalBox" v-show="showModal">
|
2024-04-22 17:36:17 +08:00
|
|
|
<view class="modalContent">
|
|
|
|
|
<view class="modalTitle">
|
|
|
|
|
云服务器设置
|
|
|
|
|
<uni-icons @click="showModal=false" class="closeImg" type="closeempty" size="26"></uni-icons>
|
|
|
|
|
</view>
|
|
|
|
|
<form @submit="saveServerData">
|
|
|
|
|
<view class="uni-form-item">
|
|
|
|
|
<input class="uni-input" name="ipPort" v-model="ipPort"
|
|
|
|
|
placeholder="格式为http://127.0.0.1:8080" />
|
|
|
|
|
</view>
|
|
|
|
|
<button form-type="submit" type="primary" class="btn">保存</button>
|
|
|
|
|
</form>
|
|
|
|
|
</view>
|
|
|
|
|
</view> -->
|
2024-05-20 13:51:56 +08:00
|
|
|
</view>
|
2022-06-08 15:48:09 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-05-20 13:51:56 +08:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
import uniIcons from "@/components/uni-icons/uni-icons.vue"
|
2024-04-16 18:34:53 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
uniIcons
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2023-05-04 15:33:11 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
ipPort: '',
|
|
|
|
|
showModal: false,
|
|
|
|
|
systemInfo: {
|
|
|
|
|
statusBarHeight: 0
|
|
|
|
|
},
|
|
|
|
|
clientid: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
let _this = this;
|
|
|
|
|
// #ifdef APP-PLUS
|
|
|
|
|
// add:添加登录CID绑定功能 实现推送 2022年4月20日 10:47:41 罗劲章// add:添加登录CID绑定功能 实现推送 2022年4月20日 10:47:41 罗劲章
|
|
|
|
|
plus.push.getClientInfoAsync((info) => {
|
|
|
|
|
const clientid = info["clientid"];
|
|
|
|
|
console.log(clientid, "cidcidcidcidcid")
|
|
|
|
|
_this.clientid = clientid
|
2023-05-04 15:33:11 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
});
|
|
|
|
|
// #endif
|
|
|
|
|
if (uni.getStorageSync('userInfo')) {
|
|
|
|
|
let userInfo = JSON.parse(uni.getStorageSync('userInfo'));
|
|
|
|
|
let {
|
|
|
|
|
accountType
|
|
|
|
|
} = userInfo;
|
2024-05-23 23:39:19 +08:00
|
|
|
if (accountType) {
|
|
|
|
|
if (accountType == 5 || accountType == 6 || accountType == 10) {
|
|
|
|
|
// 判断是否点击的是消息通知
|
|
|
|
|
plus.push.addEventListener('click', function(msg) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pages/messageCenter/messageCenter'
|
|
|
|
|
})
|
|
|
|
|
}, false);
|
|
|
|
|
// 用户端
|
2024-05-20 13:51:56 +08:00
|
|
|
uni.reLaunch({
|
2024-05-23 23:39:19 +08:00
|
|
|
url: '/pages/projectEnd/projectIndex/projectIndex'
|
2024-05-20 13:51:56 +08:00
|
|
|
})
|
2024-05-23 23:39:19 +08:00
|
|
|
} else if (accountType == 11) {
|
|
|
|
|
// 供应商
|
|
|
|
|
let company = uni.getStorageSync("company");
|
|
|
|
|
if (company) {
|
|
|
|
|
// 判断用户登录时是否选中了组织
|
|
|
|
|
uni.reLaunch({
|
|
|
|
|
url: '/pages/supplier/supplier'
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
// 未选中代表新注册用户 只看查看资质
|
|
|
|
|
uni.reLaunch({
|
|
|
|
|
url: "/pages/supplier/qualifications/qualifications?isNull=1"
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
} else {
|
2024-05-23 23:39:19 +08:00
|
|
|
// 集团
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/projectManage/projectManage'
|
2024-05-20 13:51:56 +08:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-23 23:39:19 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.systemInfo = uni.getStorageSync('systemInfo')
|
|
|
|
|
uni.setStorageSync('language', 'zh_CN')
|
|
|
|
|
if (uni.getStorageSync('account')) {
|
|
|
|
|
this.account = uni.getStorageSync('account')
|
|
|
|
|
this.password = uni.getStorageSync('password')
|
|
|
|
|
}
|
|
|
|
|
if (uni.getStorageSync('ipPort')) {
|
|
|
|
|
this.ipPort = uni.getStorageSync('ipPort');
|
|
|
|
|
// let val={
|
|
|
|
|
// detail:{
|
|
|
|
|
// value:{
|
|
|
|
|
// account:this.account,
|
|
|
|
|
// password:this.password
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// this.formSubmit(val);
|
2024-04-16 18:34:53 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
} else {
|
|
|
|
|
// this.ipPort='183.95.84.54:9500'
|
|
|
|
|
// uni.setStorageSync('ipPort',this.ipPort)
|
|
|
|
|
}
|
2023-05-04 15:33:11 +08:00
|
|
|
|
2022-08-02 15:11:04 +08:00
|
|
|
|
2024-05-23 23:39:19 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
gotoPersonLocation() {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/personLocation/login/login`
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
goto(type) {
|
|
|
|
|
// 跳转用户和供应商注册页面 存储选择的类型
|
|
|
|
|
uni.setStorageSync("Type", type);
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/login/compatibleLogin?type=${type}`
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
saveServerData(e) {
|
|
|
|
|
// uni.setStorageSync('ipPort', e.detail.value.ipPort)
|
|
|
|
|
// Vue.prototype.url_config = uni.getStorageSync('ipPort') + '/'
|
|
|
|
|
// getApp().globalData.siteUrl = uni.getStorageSync('ipPort') + '/'
|
|
|
|
|
this.showModal = false
|
|
|
|
|
},
|
|
|
|
|
formSubmit(e) {
|
|
|
|
|
// console.log(e)
|
|
|
|
|
var json = {
|
|
|
|
|
account: e.detail.value.account,
|
|
|
|
|
password: e.detail.value.password,
|
|
|
|
|
clientId: this.clientid
|
|
|
|
|
}
|
2024-04-22 17:36:17 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
this.sendRequest({
|
|
|
|
|
url: "xmgl/base/login",
|
|
|
|
|
data: json,
|
|
|
|
|
method: "POST",
|
|
|
|
|
success: (res) => {
|
|
|
|
|
// #ifdef APP-PLUS
|
|
|
|
|
// add:添加登录CID绑定功能 实现推送 2022年4月20日 10:47:41 罗劲章// add:添加登录CID绑定功能 实现推送 2022年4月20日 10:47:41 罗劲章
|
|
|
|
|
plus.push.getClientInfoAsync((info) => {
|
|
|
|
|
const cid = info["clientid"];
|
|
|
|
|
// console.log(cid,"cidcidcidcidcid")
|
|
|
|
|
// const cid = "f4b3246189fc051c5875a35e198ca223";
|
|
|
|
|
const userId = res.result.userId;
|
|
|
|
|
const jsonParams = {
|
|
|
|
|
clientId: cid,
|
|
|
|
|
alias: userId
|
|
|
|
|
}
|
|
|
|
|
//触发绑定请求
|
|
|
|
|
this.sendRequest({
|
|
|
|
|
url: "xmgl/push/bindAlias", //替换掉后端彭定生的接口
|
|
|
|
|
data: jsonParams,
|
|
|
|
|
method: "POST",
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
// #endif
|
2024-04-22 17:36:17 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
uni.setStorageSync('account', e.detail.value.account);
|
|
|
|
|
uni.setStorageSync('password', e.detail.value.password);
|
|
|
|
|
uni.setStorageSync('userInfo', JSON.stringify(res.result));
|
|
|
|
|
if (res.result.accountType == 5 || res.result.accountType == 6 || res.result
|
|
|
|
|
.accountType == 10) {
|
|
|
|
|
if (res.result.styleType == 1) {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/projectEnd/projectIndex/projectIndex'
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/projectEnd/projectIndex/projectIndex'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// uni.redirectTo({
|
|
|
|
|
// url: '/pages/workstation/workstationIndex/workstationIndex'
|
|
|
|
|
// })
|
|
|
|
|
} else {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/projectManage/projectManage'
|
|
|
|
|
// url: '/pages/projectEnd/projectIndex/projectIndex'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-08 15:48:09 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2024-05-23 23:39:19 +08:00
|
|
|
.personLocation {
|
|
|
|
|
color: #1D49B2;
|
|
|
|
|
background-color: #EDF2FE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.loginPage {
|
|
|
|
|
position: relative;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
color: $uni-text-color;
|
|
|
|
|
background: url("@/static/WechatIMG15.jpg");
|
|
|
|
|
background-size: cover;
|
|
|
|
|
}
|
2022-06-08 15:48:09 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.feedback {
|
|
|
|
|
&:active {
|
|
|
|
|
position: relative;
|
|
|
|
|
overflow: hidden;
|
2024-04-16 18:34:53 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
&::after {
|
|
|
|
|
content: "";
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
background-color: rgba(255, 255, 255, .08);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-16 18:34:53 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
&.black {
|
|
|
|
|
&:active {
|
|
|
|
|
&::after {
|
|
|
|
|
background-color: rgba(0, 0, 0, .05);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-16 18:34:53 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.loginBox {
|
|
|
|
|
padding: 100px 0 0;
|
|
|
|
|
}
|
2022-06-08 15:48:09 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.loginTitle {
|
|
|
|
|
font-size: 30px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2024-04-16 18:34:53 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.loginLogo {
|
|
|
|
|
height: 60rpx;
|
|
|
|
|
width: auto;
|
|
|
|
|
margin-right: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-16 18:34:53 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.btns {
|
|
|
|
|
padding: 40rpx 30rpx;
|
|
|
|
|
position: fixed;
|
|
|
|
|
left: 20rpx;
|
|
|
|
|
right: 20rpx;
|
|
|
|
|
bottom: 15%;
|
2024-04-16 18:34:53 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
>view {
|
|
|
|
|
padding: 20rpx 0;
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin-top: 60rpx;
|
|
|
|
|
}
|
2024-04-16 18:34:53 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.user {
|
|
|
|
|
background-color: #5e81ee;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
2024-04-16 18:34:53 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.supplier {
|
|
|
|
|
background-color: #f7f8f9;
|
|
|
|
|
color: #333;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-08 15:48:09 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.uni-input {
|
|
|
|
|
border-bottom: 1px solid #ddd;
|
|
|
|
|
padding: 10px 15px;
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
margin-bottom: 25px;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
}
|
2022-06-08 15:48:09 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.btn {
|
|
|
|
|
margin-top: 40px;
|
|
|
|
|
}
|
2022-06-08 15:48:09 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.bottomTitle {
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 20px;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
}
|
2022-06-08 15:48:09 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.modalContent {
|
|
|
|
|
.uni-input {
|
|
|
|
|
border: 1px solid #ddd;
|
|
|
|
|
}
|
2022-06-08 15:48:09 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.btn {
|
|
|
|
|
margin-top: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-08 15:48:09 +08:00
|
|
|
|
2024-05-20 13:51:56 +08:00
|
|
|
.barBox {
|
|
|
|
|
background-color: #2a2b5b;
|
|
|
|
|
}
|
|
|
|
|
</style>
|