Commit d247759f authored by 喻天's avatar 喻天

fix: 节水主题一 修改

parent 54422316
Pipeline #71483 failed with stages
...@@ -16,8 +16,10 @@ import LoginAction from '../../login'; ...@@ -16,8 +16,10 @@ import LoginAction from '../../login';
import styles from './index.less'; import styles from './index.less';
import { defaultApp } from '@/micro'; import { defaultApp } from '@/micro';
import { log } from 'kit_utils'; import { log } from 'kit_utils';
let big='广州大.png' let big = '广州大.png'
let bigNew='' let bigNew = ''
let hasOnline = true
let slogan = '建桥宣传语.png'
class HuaNongLogin extends Component { class HuaNongLogin extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -36,17 +38,23 @@ class HuaNongLogin extends Component { ...@@ -36,17 +38,23 @@ class HuaNongLogin extends Component {
}; };
this.fromRef = React.createRef(); this.fromRef = React.createRef();
this.sliVerify = React.createRef(); this.sliVerify = React.createRef();
props.loginParams.map(v=>{ props.loginParams.map(v => {
let item= v.split('=') let item = v.split('=')
if(item.length>0){ if (item.length > 0) {
if(item[0]=='big'){ if (item[0] == 'big') {
big=item[1] big = item[1]
} }
if(item[0]=='bigNew'){ if (item[0] == 'bigNew') {
bigNew=item[1] bigNew = item[1]
} }
if (item[0] == 'slogan') {
slogan = item[1]
}
if (item[0] == 'hasOnline') {
hasOnline = item[1] == "true"
}
} }
}) })
} }
handleSubmit = values => { handleSubmit = values => {
const { action, type, autoLogin } = this.state; const { action, type, autoLogin } = this.state;
...@@ -54,33 +62,37 @@ class HuaNongLogin extends Component { ...@@ -54,33 +62,37 @@ class HuaNongLogin extends Component {
(type === 'Account' (type === 'Account'
? action.loginHandler(values.userName, values.password, null, autoLogin, this.sliVerify) ? action.loginHandler(values.userName, values.password, null, autoLogin, this.sliVerify)
: type === 'Mobile' : type === 'Mobile'
? action.phoneLoginFormHandler(values.mobile, values.captcha) ? action.phoneLoginFormHandler(values.mobile, values.captcha)
: null); : null);
this.setSubmitting(true); this.setSubmitting(true);
this.props.updateCurrentIndex(-1); this.props.updateCurrentIndex(-1);
//没取到0id 要给定时器 //没取到0id 要给定时器
if( window.gzTime){ if (window.gzTime) {
clearInterval( window.gzTime) clearInterval(window.gzTime)
}
if (hasOnline) {
setTimeout(() => {
appService
.getInOnLine({
UserID: globalConfig.userInfo.oid || globalConfig.userInfo.OID,
SatrtDate: this.getNowDate(),
Port: location.port,
Oid: this._createGuid(),
})
}, 10000)
window.gzTime = setInterval(() => {
appService
.getInOnLine({
UserID: globalConfig.userInfo.oid || globalConfig.userInfo.OID,
SatrtDate: this.getNowDate(),
Port: location.port,
Oid: this._createGuid(),
})
}, 180000)
} }
setTimeout(()=>{
appService
. getInOnLine({
UserID: globalConfig.userInfo.oid||globalConfig.userInfo.OID,
SatrtDate: this.getNowDate(),
Port: location.port,
Oid:this._createGuid(),
})
},10000)
window.gzTime= setInterval(()=>{
appService
. getInOnLine({
UserID: globalConfig.userInfo.oid||globalConfig.userInfo.OID,
SatrtDate: this.getNowDate(),
Port: location.port,
Oid:this._createGuid(),
})
},180000)
}; };
onActinoChange = action => { onActinoChange = action => {
...@@ -168,7 +180,7 @@ class HuaNongLogin extends Component { ...@@ -168,7 +180,7 @@ class HuaNongLogin extends Component {
clearTime() { clearTime() {
this.timeTimer && clearInterval(this.timeTimer); this.timeTimer && clearInterval(this.timeTimer);
} }
getNowDate () { getNowDate() {
var date = new Date(); var date = new Date();
var sign2 = ":"; var sign2 = ":";
var year = date.getFullYear() // 年 var year = date.getFullYear() // 年
...@@ -197,7 +209,7 @@ getNowDate () { ...@@ -197,7 +209,7 @@ getNowDate () {
} }
return year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds; return year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds;
} }
_createGuid() { _createGuid() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
.replace(/[xy]/g, function (c) { .replace(/[xy]/g, function (c) {
let r = (Math.random() * 16) | 0, let r = (Math.random() * 16) | 0,
...@@ -207,18 +219,20 @@ _createGuid() { ...@@ -207,18 +219,20 @@ _createGuid() {
.toUpperCase(); .toUpperCase();
} }
componentDidMount() { componentDidMount() {
console.log(this.props, this.props.global.logo, this.props.global.transformDevAssetsBaseURL('assets/images/广州/背景.png'));
console.log(this);
this.onActinoChange(this.state.action); this.onActinoChange(this.state.action);
this.getCurrentTime(this.showTime); this.getCurrentTime(this.showTime);
/* request(urlUtils.getUrl( /* request(urlUtils.getUrl(
"/PandaEnergy/GZshuiwuju" "/PandaEnergy/GZshuiwuju"
) + '/GuangZhou/InOnLine', { ) + '/GuangZhou/InOnLine', {
query: { query: {
UserID: _config.userInfo.OID, UserID: _config.userInfo.OID,
SatrtDate: SatrtDate, SatrtDate: SatrtDate,
Port: location.port, Port: location.port,
Oid, Oid,
} }
}) */ }) */
...@@ -230,13 +244,13 @@ _createGuid() { ...@@ -230,13 +244,13 @@ _createGuid() {
return ( return (
<HelmetProvider> <HelmetProvider>
<div className={styles.quota} style={{'background': `url(${bigNew?this.props.global.transformDevAssetsBaseURL(bigNew):require("@/assets/images/login/节水/"+big)}) no-repeat`}}> <div className={styles.quota} style={{ 'background': `url(${bigNew ? this.props.global.transformDevAssetsBaseURL(bigNew) : require("@/assets/images/login/节水/" + big)}) no-repeat` }}>
<div className={styles.head}> <div className={styles.head}>
<div className={styles.title}> <div className={styles.title}>
<img className={styles.imgs} src={this.props.global && this.props.global.transformDevAssetsBaseURL && this.props.global.transformDevAssetsBaseURL(this.props.global.logo)} alt="" /> <img className={styles.imgs} src={this.props.global && this.props.global.transformDevAssetsBaseURL && this.props.global.transformDevAssetsBaseURL(this.props.global.logo)} alt="" />
{/* <img src={require('@/assets/images/login/能源-定额/华农logo.png')} alt="" /> */} {/* <img src={require('@/assets/images/login/能源-定额/华农logo.png')} alt="" /> */}
<span>{this.props.global.title || this.state.title}</span> <span>{this.props.global.title || this.state.title}</span>
</div> </div>
<div className={styles.time_and_date}> <div className={styles.time_and_date}>
<div className={styles.time}>{this.state.time}</div> <div className={styles.time}>{this.state.time}</div>
<div className={styles.date}> <div className={styles.date}>
...@@ -248,7 +262,7 @@ _createGuid() { ...@@ -248,7 +262,7 @@ _createGuid() {
<div className={styles.wrap_content}> <div className={styles.wrap_content}>
<div className={styles.from}> <div className={styles.from}>
<div className={styles.slogan}> <div className={styles.slogan}>
<div className={styles.slogan_back} /> <div className={styles.slogan_back} style={{ background: `url(${this.props.global.transformDevAssetsBaseURL(slogan)}) center no-repeat` }} />
</div> </div>
<div className={styles.login}>{this.renderPlatform()}</div> <div className={styles.login}>{this.renderPlatform()}</div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment