Commit 9a30e8ce by zhanghaozhe

temp

parent 489fa285
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -422,6 +422,9 @@ Created by iconfont
<glyph glyph-name="play_hovericon" unicode="&#59011;" d="M512 896c282.763636 0 512-229.236364 512-512s-229.236364-512-512-512S0 101.236364 0 384 229.236364 896 512 896z m182.760727-552.680727a46.545455 46.545455 0 0 1 0 81.361454l-311.086545 172.846546A23.272727 23.272727 0 0 1 349.090909 577.163636v-386.327272a23.272727 23.272727 0 0 1 34.583273-20.363637l311.086545 172.846546z" horiz-adv-x="1024" />
<glyph glyph-name="gengduo" unicode="&#58960;" d="M511.616 883.328c-137.344 0-254.72-49.024-352.128-147.2C61.824 638.72 13.184 521.344 13.184 384c0-137.856 48.768-255.616 146.304-353.024 97.408-97.536 214.912-146.304 352.128-146.304 137.856 0 255.616 48.768 353.152 146.304 97.408 97.408 146.176 215.168 146.176 353.024 0 137.344-48.768 254.72-146.176 352.256C767.104 834.304 649.472 883.328 511.616 883.328zM198.528 696.96C285.312 783.744 389.76 827.136 511.616 827.136c122.496 0 227.072-43.392 313.856-130.176 86.784-86.144 130.176-190.464 130.176-312.96 0-122.496-43.392-227.072-130.176-313.856C738.688-16.768 633.984-60.16 511.616-60.16c-122.496 0-226.816 43.52-313.088 130.304C111.744 156.928 68.352 261.504 68.352 383.872c0 121.856 43.52 226.304 130.176 313.088z m469.12-313.088c0-14.208 4.736-26.496 14.336-36.608 10.112-9.472 22.016-14.336 35.712-14.336 13.568-0.128 26.496 5.12 36.096 14.72s14.848 22.528 14.72 36.096c-0.128 13.312-5.504 26.112-15.104 35.456-9.472 9.344-22.4 14.592-35.712 14.464-13.696 0-25.6-4.736-35.712-14.208-9.6-9.984-14.336-21.76-14.336-35.584z m-105.216 0c0 13.696-4.736 25.6-14.336 35.712-9.856 9.344-22.912 14.464-36.608 14.208-13.696 0-25.6-4.736-35.712-14.208-9.472-10.112-14.336-22.016-14.336-35.712 0-14.208 4.736-26.496 14.336-36.608 10.112-9.472 22.016-14.336 35.712-14.336 14.336 0 26.496 4.736 36.608 14.336 9.472 9.984 14.592 23.168 14.336 36.608z m-206.08 0c0 13.696-4.736 25.6-14.336 35.712-9.6 9.216-22.4 14.336-35.712 14.208-27.776 0-50.432-22.528-50.432-50.432 0-27.776 22.528-50.432 50.432-50.432 13.696 0 25.6 4.736 35.712 14.336 9.472 9.984 14.592 23.04 14.336 36.608z m0 0" horiz-adv-x="1024" />
</font>
......
import React, { PureComponent } from 'react';
import { browser } from "@/utils";
import './loginWays.scss'
import more from '../../icons/more.png'
class LoginWays extends PureComponent {
state = {
ways: this.props.loginWays
ways: browser.isWeixin ? this.props.loginWays.slice(0, 2) : this.props.loginWays.slice(0, 1)
}
componentDidMount() {
if (!browser.isWeixin) {
this.setState({
ways: this.state.ways.filter(item => item.text !== '微信')
ways: this.filterWays()
})
}
}
handleClick = text => {
this.props.onClick(text)
}
filterWays = () => {
return browser.isWeixin ? this.props.loginWays : this.state.ways.filter(item => item.id !== 'wechat')
}
showMore = () => {
this.setState({
ways: this.props.loginWays
})
}
render() {
return (
<div className="login-ways">
......@@ -31,12 +39,19 @@ class LoginWays extends PureComponent {
this.state.ways.map((item, index) => {
return (
<li key={index} onClick={this.handleClick.bind(this, item.text)}>
<img src={item.logo} alt=""/>
<img src={item.logo} alt={item.text}/>
<p>{item.text}</p>
</li>
)
})
}
{
this.state.ways.length !== this.props.loginWays.length &&
<li className={'more'} onClick={this.showMore}>
<img src={more} alt="更多"/>
<p>更多</p>
</li>
}
</ul>
</div>
);
......
import React, { Component } from 'react';
import './index.scss'
import Input from '../Input'
class InputWithCountryCodes extends Component {
render() {
return (
<div className={'input-with-country-codes'}>
<div className="country-codes">
<i className={'iconfont iconiconfront-69'}></i>
</div>
<Input/>
</div>
);
}
}
export default InputWithCountryCodes;
\ No newline at end of file
.input-with-country-codes{
.input-wrapper{
.input{
padding-left: 10px;
}
}
.country-codes{
font-size: 10px;
}
}
\ No newline at end of file
......@@ -11,10 +11,10 @@ import BindingTel from './bindingTel'
import { connect } from "react-redux";
import { compose } from "redux";
import account from './account.png'
import qq from './qq.png'
import sina from './sina.png'
import wechat from './wechat.png'
import account from './icons/account.png'
import qq from './icons/qq.png'
import sina from './icons/sina.png'
import wechat from './icons/wechat.png'
class Passport extends Component {
......@@ -31,23 +31,27 @@ class Passport extends Component {
loginWays: [
{
logo: account,
text: '账号登录'
text: '账号登录',
id: 'account'
},
{
logo: wechat,
text: '微信',
url: ''
url: '',
id: 'wechat'
},
{
logo: qq,
text: 'QQ',
url: `${API["passport-api"]}/mob/qqlogin?redirect_url=${this.redirectURL}`
url: `${API["passport-api"]}/mob/qqlogin?redirect_url=${this.redirectURL}`,
id: 'qq'
},
{
logo: sina,
text: '新浪',
url: `${API['passport-api']}/mob/sinalogin?redirect_url=${this.redirectURL}`
},
url: `${API['passport-api']}/mob/sinalogin?redirect_url=${this.redirectURL}`,
id: 'sina'
}
]
}
}
......@@ -68,10 +72,10 @@ class Passport extends Component {
let {history, location} = this.props
let {data} = this.props.user
if (data && Object.values(data).filter(item => !!item).length) {
if(history.action === 'POP' && history.length <= 3) {
if (history.action === 'POP' && history.length <= 3) {
history.push('/')
} else {
const { from } = location.state || {from: {pathname: '/', search: ''}};
const {from} = location.state || {from: {pathname: '/', search: ''}};
history.replace(from);
// history.go(-1)
}
......
import React, { Component } from 'react'
import './wechatLogin.scss'
import Input from "../common/Input"
// import Input from "../common/Input"
import Input from '../common/inputWithCountryCodes'
import LoginButton from '../common/LoginButton'
import LoginWays from '../common/LoginWays'
import Header from '../common/Header'
......
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