Commit bbdd4f64 authored by GuanHua's avatar GuanHua

fix: 1.登录页面广告图排序问题;2.忘记密码的密码规则提示;3.隐藏登录页面第三方登录方式入口;4.购物车提交的订单,缺少发票信息问题

parent ea167965
......@@ -554,6 +554,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
let logisticsInfo = {}
setConfirmLoading(true)
const purchaseIds = []
let isInvoice = false
for (const item of selectOrderList) {
purchaseIds.push(item.id)
productIds.push(item.commodityUnitPrice.id)
......@@ -563,6 +564,11 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
hasLogistics = true
logisticsInfo = item.commodityUnitPrice.commodity.logistics
}
if(item.commodityUnitPrice.commodity.isInvoice) {
isInvoice = true
}
const buyCommodityInfo: any = {
id: item.commodityUnitPrice.id,
purchaseId: item.id,
......@@ -602,6 +608,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
supplyMembersId: selectItem.memberId,
supplyMembersRoleId: selectItem.memberRoleId,
shopId: storeId,
isInvoice,
orderList: [{
id: selectItem.id,
shopname: selectItem.shopname,
......
import React, { useState, Fragment } from 'react';
import React, { Fragment } from 'react';
import cx from 'classnames';
import { Row, Button, message } from 'antd';
import { Link, Helmet, history } from 'umi'
import { FormPage, RiskCheck } from 'god'
import { IFormControllers, IFormButtonTypes } from 'god/dist/src/form-page'
import './index.less'
import NiceForm from '@/components/NiceForm';
import { forgetPwdSchema } from './schema';
import { PATTERN_MAPS } from '@/constants/regExp';
......@@ -12,7 +9,8 @@ import { omit } from '@/utils';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { encryptedByAES } from '@/utils/cryptoAes';
import messages from '@/constants/responseCode';
import PasswordInput from './components/PasswordInput'
import './index.less'
const actions = createFormActions()
......@@ -46,8 +44,11 @@ const GetBack: React.FC = () => {
schema={forgetPwdSchema}
onSubmit={handleSubmit}
actions={actions}
components={{
PasswordInput,
}}
expressionScope={{
SubmitBtn
SubmitBtn,
}}
effects={($, { setFieldState, getFieldState }) => {
$('onFieldInputChange', 'account').subscribe(fieldState => {
......@@ -76,7 +77,7 @@ const GetBack: React.FC = () => {
if (PATTERN_MAPS.email.test(fieldState.value)) {
// 校验邮箱格式通过时, 需请求接口判断邮箱是否存在数据库
PublicApi.getMemberRegisterEmailCheck({
email: fieldState.value
email: encodeURI(fieldState.value)
}, { ctlType: 'none', useCache: true, ttl: 60 * 1000 }).then(({ code, data }) => {
if (code === 1000) {
setFieldState('account', state => {
......@@ -95,14 +96,14 @@ const GetBack: React.FC = () => {
const selfValue = fieldState.value
const otherName = selfName == 'password' ? 'confirmPassword' : 'password'
const otherValue = getFieldState(otherName, state => state.value)
setFieldState(otherName, state => {
if (selfValue && otherValue && selfValue !== otherValue) {
state.errors = ['两次密码输入不一致']
} else {
state.errors = ['']
}
})
setFieldState(selfName, state => {
// setFieldState(otherName, state => {
// if (selfValue && otherValue && selfValue !== otherValue) {
// state.errors = ['两次密码输入不一致']
// } else {
// state.errors = ['']
// }
// })
setFieldState('confirmPassword', state => {
if (selfValue && otherValue && selfValue !== otherValue) {
state.errors = ['两次密码输入不一致']
} else {
......
......@@ -34,15 +34,23 @@ const User: React.FC = () => {
fetchUseScene()
}, [])
const sortData = (data) => {
let result = []
if(data) {
result = data.sort((a, b) => b.sort > a.sort ? -1 : 1)
}
return result
}
const fetchUseScene = () => {
let param = {
const param: any = {
useScene: 1,
position: 1
}
//@ts-ignore
PublicApi.getManageContentImageFindAllByUseSceneAndPosition(param).then(res => {
if (res.code === 1000) {
setSceneList(res.data)
setSceneList(sortData(res.data))
}
})
}
......@@ -88,13 +96,13 @@ const User: React.FC = () => {
)
}
</div>
<Row className={'thirdLogin'} align='middle' justify='center'>
{/* <Row className={'thirdLogin'} align='middle' justify='center'>
<Col>其他方式登录
<a title="微登录"><img src={wechat} alt="微信登录" /></a>
<a title="QQ登录"><img src={qq} alt="QQ登录" /></a>
<a title="支付宝登录"><img src={alipay} alt="支付宝登录" /></a>
</Col>
</Row>
</Row> */}
</Col>
</Row>
</Fragment>
......
......@@ -114,10 +114,10 @@ const UserRegistry = () => {
}, [])
const fetchAgreement = () => {
const param = {
const param: any = {
columnType: 2
}
//@ts-ignore
PublicApi.getManageContentNoticeFindAllByColumnType(param).then(res => {
if (res.code === 1000) {
setAgreementList(res.data)
......@@ -187,7 +187,7 @@ const UserRegistry = () => {
maxTime: 60,
minTime: 0,
initText: '获取验证码',
onEnd: () => { },
onEnd: () => { console.log("end") },
decayRate: 1,
delay: 1 * 1000
})
......@@ -231,7 +231,7 @@ const UserRegistry = () => {
setSubStep(true)
}
}).catch(() => {
console.log()
}).finally(() => {
setSubmitLoading(false)
})
......@@ -306,7 +306,7 @@ const UserRegistry = () => {
smsCodeAfter: <Button disabled={isActive} style={{ minWidth: 110, marginLeft: 8 }} size='large' onClick={handleSendSMS}>{text}</Button>,
checkBoxChildren: <span style={{ fontSize: 12 }}>阅读并同意<span className='commonPickColor'>
{
agreementList && agreementList.map(item => (<a key={`aggreem_${item.id}`} href={`/user/agreement?id=${item.id}`} target="_blank">{item.title}</a>))
agreementList && agreementList.map(item => (<a key={`aggreem_${item.id}`} href={`/user/agreement?id=${item.id}`} target="_blank" rel="noreferrer">{item.title}</a>))
}
</span>
</span>,
......
......@@ -273,22 +273,31 @@ export const forgetPwdSchema: ISchema = {
},
password: {
type: 'string',
"x-rules": [
{
required: true,
message: '请输入密码'
},
{
pattern: PATTERN_MAPS.password,
message: '请输入正确的密码'
}
],
"x-component": 'PasswordInput',
"x-component-props": {
type: 'password',
placeholder: '请设置你的新密码',
size: 'large'
}
},
// password: {
// type: 'string',
// "x-rules": [
// {
// required: true,
// message: '请输入密码'
// },
// {
// pattern: PATTERN_MAPS.password,
// message: '请输入正确的密码'
// }
// ],
// "x-component-props": {
// type: 'password',
// placeholder: '请设置你的新密码',
// size: 'large'
// }
// },
confirmPassword: {
type: 'string',
"x-rules": [
......@@ -296,10 +305,10 @@ export const forgetPwdSchema: ISchema = {
required: true,
message: '请输入密码'
},
{
pattern: PATTERN_MAPS.password,
message: '请输入正确的密码'
}
// {
// pattern: PATTERN_MAPS.password,
// message: '请输入正确的密码'
// }
],
"x-component-props": {
type: 'password',
......
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