fix: BUG修改
This commit is contained in:
parent
c290437d2c
commit
034619ac87
@ -1,24 +1,24 @@
|
||||
<template>
|
||||
<!-- <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="user feedback" @click="goto('user')">我是用户</view> -->
|
||||
<!-- <view class="supplier feedback black" @click="goto('supplier')">我是供应商</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="bottomTitle" @click="showModal=true">
|
||||
<!-- <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="user feedback" @click="goto('user')">我是用户</view> -->
|
||||
<!-- <view class="supplier feedback black" @click="goto('supplier')">我是供应商</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="bottomTitle" @click="showModal=true">
|
||||
云服务器设置
|
||||
</view> -->
|
||||
<!-- <view class="modalBox" v-show="showModal">
|
||||
<!-- <view class="modalBox" v-show="showModal">
|
||||
<view class="modalContent">
|
||||
<view class="modalTitle">
|
||||
云服务器设置
|
||||
@ -33,288 +33,289 @@
|
||||
</form>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import uniIcons from "@/components/uni-icons/uni-icons.vue"
|
||||
import Vue from 'vue'
|
||||
import uniIcons from "@/components/uni-icons/uni-icons.vue"
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniIcons
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
export default {
|
||||
components: {
|
||||
uniIcons
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
});
|
||||
plus.push.addEventListener('click', function(msg) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/messageCenter/messageCenter'
|
||||
})
|
||||
}, false);
|
||||
// #endif
|
||||
if (uni.getStorageSync('userInfo')) {
|
||||
let userInfo = JSON.parse(uni.getStorageSync('userInfo'));
|
||||
let {
|
||||
accountType
|
||||
} = userInfo;
|
||||
if (accountType == 5 || accountType == 6 || accountType == 10) {
|
||||
// 用户端
|
||||
uni.reLaunch({
|
||||
url: '/pages/projectEnd/projectIndex/projectIndex'
|
||||
})
|
||||
} 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"
|
||||
})
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
if (uni.getStorageSync('userInfo')) {
|
||||
let userInfo = JSON.parse(uni.getStorageSync('userInfo'));
|
||||
let {
|
||||
accountType
|
||||
} = userInfo;
|
||||
if (accountType == 5 || accountType == 6 || accountType == 10) {
|
||||
// 判断是否点击的是消息通知
|
||||
plus.push.addEventListener('click', function(msg) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/messageCenter/messageCenter'
|
||||
})
|
||||
}, false);
|
||||
// 用户端
|
||||
uni.reLaunch({
|
||||
url: '/pages/projectEnd/projectIndex/projectIndex'
|
||||
})
|
||||
} 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"
|
||||
})
|
||||
}
|
||||
|
||||
} else {
|
||||
// 集团
|
||||
uni.redirectTo({
|
||||
url: '/pages/projectManage/projectManage'
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
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);
|
||||
} else {
|
||||
// 集团
|
||||
uni.redirectTo({
|
||||
url: '/pages/projectManage/projectManage'
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
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);
|
||||
|
||||
} else {
|
||||
// this.ipPort='183.95.84.54:9500'
|
||||
// uni.setStorageSync('ipPort',this.ipPort)
|
||||
}
|
||||
} else {
|
||||
// this.ipPort='183.95.84.54:9500'
|
||||
// uni.setStorageSync('ipPort',this.ipPort)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
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
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
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'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
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'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.loginPage {
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
color: $uni-text-color;
|
||||
background: url("@/static/WechatIMG15.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
.loginPage {
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
color: $uni-text-color;
|
||||
background: url("@/static/WechatIMG15.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.feedback {
|
||||
&:active {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.feedback {
|
||||
&:active {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(255, 255, 255, .08);
|
||||
}
|
||||
}
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(255, 255, 255, .08);
|
||||
}
|
||||
}
|
||||
|
||||
&.black {
|
||||
&:active {
|
||||
&::after {
|
||||
background-color: rgba(0, 0, 0, .05);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.black {
|
||||
&:active {
|
||||
&::after {
|
||||
background-color: rgba(0, 0, 0, .05);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loginBox {
|
||||
padding: 100px 0 0;
|
||||
}
|
||||
.loginBox {
|
||||
padding: 100px 0 0;
|
||||
}
|
||||
|
||||
.loginTitle {
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.loginTitle {
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.loginLogo {
|
||||
height: 60rpx;
|
||||
width: auto;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
.loginLogo {
|
||||
height: 60rpx;
|
||||
width: auto;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btns {
|
||||
padding: 40rpx 30rpx;
|
||||
position: fixed;
|
||||
left: 20rpx;
|
||||
right: 20rpx;
|
||||
bottom: 15%;
|
||||
.btns {
|
||||
padding: 40rpx 30rpx;
|
||||
position: fixed;
|
||||
left: 20rpx;
|
||||
right: 20rpx;
|
||||
bottom: 15%;
|
||||
|
||||
> view {
|
||||
padding: 20rpx 0;
|
||||
border-radius: 8rpx;
|
||||
text-align: center;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
>view {
|
||||
padding: 20rpx 0;
|
||||
border-radius: 8rpx;
|
||||
text-align: center;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
|
||||
.user {
|
||||
background-color: #5e81ee;
|
||||
color: #fff;
|
||||
}
|
||||
.user {
|
||||
background-color: #5e81ee;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.supplier {
|
||||
background-color: #f7f8f9;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
.supplier {
|
||||
background-color: #f7f8f9;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.uni-input {
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 10px 15px;
|
||||
border-radius: 3px;
|
||||
margin-bottom: 25px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.uni-input {
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 10px 15px;
|
||||
border-radius: 3px;
|
||||
margin-bottom: 25px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: 40px;
|
||||
}
|
||||
.btn {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.bottomTitle {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 15px;
|
||||
}
|
||||
.bottomTitle {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.modalContent {
|
||||
.uni-input {
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.modalContent {
|
||||
.uni-input {
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.barBox {
|
||||
background-color: #2a2b5b;
|
||||
}
|
||||
</style>
|
||||
.barBox {
|
||||
background-color: #2a2b5b;
|
||||
}
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user