Commit eaf50798 by 姜雷

修改部分接口

parent 2766a416
import { baseFetch } from '.';
type ImageVcodePramas = {
effective?: number;
loginName: string;
codeNum?: number;
};
export const getImageVcode = (data: ImageVcodePramas) =>
baseFetch({
url: `/common/getCode?loginName=${data.loginName}&codeNum=4`,
method: 'POST',
data: data,
});
type VcodePramas = {
cellphone: string;
};
export const getVcode = (entity: VcodePramas) =>
baseFetch({
url: `/common/sendMsgCode?cellphone=${entity.cellphone}&codeNum=6`,
method: 'POST',
data: entity,
});
import { oldBaseFetch, baseFetch, ResponseDataEntity } from './index';
import { UserState } from '../store/rootReducers/userinfo';
type LoginPramas = {
code: string;
};
type LoginReponseData = {
register: boolean;
wxToken: string;
} & UserState;
export interface LoginReponse extends ResponseDataEntity<LoginReponseData> {
data: LoginReponseData;
}
export const login = (data: LoginPramas) =>
oldBaseFetch({
url: '/wx/api/user/login2',
data: data,
});
export const fetchValidateCode = () =>
oldBaseFetch({
url: '/wx/api/getValidateCode',
});
type ImageVcodePramas = {
effective?: number;
loginName: string;
codeNum?: number;
};
export const getImageVcode = (data: ImageVcodePramas) =>
baseFetch({
url: `/common/getCode?loginName=${data.loginName}&codeNum=4`,
method: 'POST',
data: data,
});
export const getVcode = entity =>
oldBaseFetch({
url: '/wx/api/getValidateCode',
method: 'POST',
data: entity,
});
type RegisiterPramas = {};
// type RegisiterReponseData = {};
export const fetchWxUserRegister = (entity: RegisiterPramas) =>
baseFetch({
url: '/dcxy/wechat/applet/register/',
method: 'POST',
data: entity,
});
...@@ -20,6 +20,9 @@ interface Modal { ...@@ -20,6 +20,9 @@ interface Modal {
class Modal extends Component { class Modal extends Component {
static externalClasses = ['body-class']; static externalClasses = ['body-class'];
static options = {
addGlobalClass: true,
};
static defaultProps = { static defaultProps = {
visiabled: false, visiabled: false,
title: '提示', title: '提示',
......
...@@ -19,6 +19,17 @@ ...@@ -19,6 +19,17 @@
border-radius: 12px; border-radius: 12px;
overflow: hidden; overflow: hidden;
} }
.mask {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
background-color: rgba(25, 25, 25, 0.2);
z-index: 99;
}
} }
.Vcode.Counting { .Vcode.Counting {
color: #999; color: #999;
......
import { ComponentClass } from 'react'; import { ComponentClass } from 'react';
import Taro, { Component } from '@tarojs/taro'; import Taro, { Component } from '@tarojs/taro';
import { View, Input, Canvas } from '@tarojs/components'; import { View, Input, Canvas } from '@tarojs/components';
import { getVcode, getImageVcode } from '../../api/wx'; import { getVcode, getImageVcode } from '../../api/vcode';
import Modal from '../Modal/Modal'; import Modal from '../Modal/Modal';
import './Vcode.scss'; import './Vcode.scss';
import { ResponseDataEntity } from 'src/api'; import { ResponseDataEntity } from 'src/api';
...@@ -66,7 +66,7 @@ class Vcode extends Component { ...@@ -66,7 +66,7 @@ class Vcode extends Component {
this.setState({ this.setState({
showImgBox: true, showImgBox: true,
}); });
this.renderImg(1234); // this.renderImg(1234);
} else { } else {
Taro.showToast({ Taro.showToast({
title: '输入正确的手机号', title: '输入正确的手机号',
...@@ -102,7 +102,7 @@ class Vcode extends Component { ...@@ -102,7 +102,7 @@ class Vcode extends Component {
const { cellphone } = this.props; const { cellphone } = this.props;
getVcode({ getVcode({
tel: cellphone, cellphone: cellphone,
}) })
.then(res => { .then(res => {
this.countStart(); this.countStart();
......
...@@ -31,7 +31,7 @@ class ResetPwd extends Component { ...@@ -31,7 +31,7 @@ class ResetPwd extends Component {
constructor(props: PageOwnProps) { constructor(props: PageOwnProps) {
super(props); super(props);
this.state = { this.state = {
cellphone: '18108096099', cellphone: '',
vcode: '', vcode: '',
pwd: '', pwd: '',
checkPwd: '', checkPwd: '',
...@@ -111,7 +111,14 @@ class ResetPwd extends Component { ...@@ -111,7 +111,14 @@ class ResetPwd extends Component {
} }
} }
render() { render() {
const { cellphone, vcode, showPwd, pwd,showCheckPwd, checkPwd } = this.state; const {
cellphone,
vcode,
showPwd,
pwd,
showCheckPwd,
checkPwd,
} = this.state;
return ( return (
<View className='ResetPwd'> <View className='ResetPwd'>
<ToastBox ref='ToastBox' /> <ToastBox ref='ToastBox' />
......
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