Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
2e7ef061
Commit
2e7ef061
authored
Oct 13, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
dca2278f
4da6bc54
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
111 additions
and
137 deletions
+111
-137
index.ts
config/routes/index.ts
+1
-1
Phone.tsx
src/components/NiceForm/components/Phone.tsx
+36
-2
constants.tsx
src/pages/transaction/marketingAbility/common/constants.tsx
+1
-1
columns_1.tsx
...bility/components/productListLayout/columns/columns_1.tsx
+3
-12
columns_2.tsx
...bility/components/productListLayout/columns/columns_2.tsx
+8
-20
columns_3.tsx
...bility/components/productListLayout/columns/columns_3.tsx
+8
-21
columns_4.tsx
...bility/components/productListLayout/columns/columns_4.tsx
+3
-12
columns_5.tsx
...bility/components/productListLayout/columns/columns_5.tsx
+3
-12
columns_6.tsx
...bility/components/productListLayout/columns/columns_6.tsx
+3
-12
columns_7.tsx
...bility/components/productListLayout/columns/columns_7.tsx
+3
-12
columns_8.tsx
...bility/components/productListLayout/columns/columns_8.tsx
+3
-12
index.tsx
...n/marketingAbility/components/productListLayout/index.tsx
+1
-1
add.tsx
.../marketingAbility/paltformSign/readySubmitExamine/add.tsx
+16
-0
index.tsx
...gement/readySubmitExamine/components/shopLayout/index.tsx
+4
-1
register.tsx
src/pages/user/register.tsx
+18
-18
No files found.
config/routes/index.ts
View file @
2e7ef061
...
...
@@ -79,7 +79,7 @@ const memberCenterRoute = {
// ProcurementRoute,
// // 合同能力
// contracRoute,
AuthConfigRoute
,
//
AuthConfigRoute,
// MemberRoute,
// HandlingRoute,
// PayandSettleRoute,
...
...
src/components/NiceForm/components/Phone.tsx
View file @
2e7ef061
...
...
@@ -11,6 +11,10 @@ const FLAG_SIZE = 60
const
IMG_WIDTH
=
352
const
IMG_HEIGHT
=
180
// 国家前缀 暂时写死
const
prefixCode
=
'+86'
const
Phone
=
(
props
)
=>
{
const
{
value
,
form
,
schema
}
=
props
const
{
text
,
isActive
,
start
}
=
useCountDown
({
...
...
@@ -18,6 +22,7 @@ const Phone = (props) => {
minTime
:
0
,
initText
:
'获取验证码'
,
onEnd
:
()
=>
{
instanceRef
.
current
.
canIUseSms
=
false
form
.
setFieldState
(
'phone'
,
state
=>
{
state
.
smsLoading
=
instanceRef
.
current
.
canIUseSms
})
...
...
@@ -74,10 +79,39 @@ const Phone = (props) => {
}
},
[
isShowValidate
,
isActive
])
const
validatePhoneRequest
=
async
()
=>
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
try
{
const
{
code
}
=
await
PublicApi
.
getMemberRegisterPhoneCheck
({
countryCode
:
prefixCode
,
phone
:
form
.
getFieldValue
(
'phone'
)
},
{
ctlType
:
'none'
,
useCache
:
true
,
ttl
:
60
*
1000
})
if
(
code
!==
1000
)
{
form
.
setFieldState
(
'phone'
,
state
=>
{
state
.
errors
=
[
'手机号已存在'
]
resolve
(
false
)
godEvent
.
emit
(
'SHOW_PHONE_VALIDATE'
,
false
)
})
}
else
{
resolve
(
true
)
}
}
catch
(
err
)
{
console
.
log
(
err
)
resolve
(
false
)
}
})
}
const
handleClickSms
=
async
()
=>
{
const
validateState
=
await
form
.
validate
(
'phone'
)
// 注册页手机号字段
const
validatePhoneState
=
await
form
.
validate
(
'phone'
)
// 忘记密码 手机号或邮箱字段
const
validateAccountState
=
await
form
.
validate
(
'account'
)
const
phoneAsyncValidate
=
await
validatePhoneRequest
()
// 手机号未通过校验
if
(
validate
State
.
errors
>
0
)
{
if
(
validate
PhoneState
.
errors
>
0
||
validateAccountState
.
errors
>
0
||
!
phoneAsyncValidate
)
{
return
false
}
...
...
src/pages/transaction/marketingAbility/common/constants.tsx
View file @
2e7ef061
...
...
@@ -191,7 +191,7 @@ export const GeneralEffect = (int, data) => {
col
:
[
{
label
:
'优惠规则'
,
extra
:
<
Space
direction=
'vertical'
>
{
data
.
ladder
BO
List
.
map
(
item
=>
(<
div
>
{
`满 ${item.discount} 件, 打 ${item.num} 折`
}
</
div
>))
}
{
data
.
ladderList
.
map
(
item
=>
(<
div
>
{
`满 ${item.discount} 件, 打 ${item.num} 折`
}
</
div
>))
}
</
Space
>
},
{
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_1.tsx
View file @
2e7ef061
...
...
@@ -13,20 +13,11 @@ const columns_1 = ({
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
}
}
return
_item
})
params
[
index
][
name
]
=
Number
(
value
);
form
.
setFieldsValue
({
'productList'
:
newData
'productList'
:
params
})
setDataSource
(
newData
)
setDataSource
(
params
)
}
return
(
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_2.tsx
View file @
2e7ef061
...
...
@@ -16,28 +16,16 @@ const columns_2 = ({
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
if
(
name
===
'plummetPrice'
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
),
'activityPrice'
:
sumTotal
(
_item
.
price
,
value
)
}
}
else
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
}
}
}
return
_item
})
if
(
name
===
'plummetPrice'
)
{
params
[
index
][
name
]
=
Number
(
value
);
params
[
index
][
'activityPrice'
]
=
sumTotal
(
params
[
index
][
'price'
],
value
);
}
else
{
params
[
index
][
name
]
=
Number
(
value
);
}
form
.
setFieldsValue
({
'productList'
:
newData
'productList'
:
params
})
setDataSource
(
newData
)
setDataSource
(
params
)
}
return
(
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_3.tsx
View file @
2e7ef061
...
...
@@ -13,29 +13,16 @@ const columns_3 = ({
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
if
(
name
===
'discount'
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
),
'activityPrice'
:
Number
(
_item
.
price
)
*
(
Number
(
value
))
/
100
,
}
}
else
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
}
}
}
return
_item
})
if
(
name
===
'discount'
)
{
params
[
index
][
name
]
=
Number
(
value
);
params
[
index
][
'activityPrice'
]
=
Number
(
params
[
index
][
'price'
])
*
(
Number
(
value
))
/
100
;
}
else
{
params
[
index
][
name
]
=
Number
(
value
);
}
form
.
setFieldsValue
({
'productList'
:
newData
'productList'
:
params
})
setDataSource
(
newData
)
setDataSource
(
params
)
}
return
(
[
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_4.tsx
View file @
2e7ef061
...
...
@@ -14,20 +14,11 @@ const columns_4 = ({
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
}
}
return
_item
})
params
[
index
][
name
]
=
Number
(
value
);
form
.
setFieldsValue
({
'productList'
:
newData
'productList'
:
params
})
setDataSource
(
newData
)
setDataSource
(
params
)
}
return
(
[
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_5.tsx
View file @
2e7ef061
...
...
@@ -12,20 +12,11 @@ const columns_5 = ({
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
}
}
return
_item
})
params
[
index
][
name
]
=
Number
(
value
);
form
.
setFieldsValue
({
'productList'
:
newData
'productList'
:
params
})
setDataSource
(
newData
)
setDataSource
(
params
)
}
return
(
[
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_6.tsx
View file @
2e7ef061
...
...
@@ -13,20 +13,11 @@ const columns_6 = ({
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
}
}
return
_item
})
params
[
index
][
name
]
=
Number
(
value
);
form
.
setFieldsValue
({
'productList'
:
newData
'productList'
:
params
})
setDataSource
(
newData
)
setDataSource
(
params
)
}
return
(
[
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_7.tsx
View file @
2e7ef061
...
...
@@ -13,20 +13,11 @@ const columns_7 = ({
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
}
}
return
_item
})
params
[
index
][
name
]
=
Number
(
value
);
form
.
setFieldsValue
({
'productList'
:
newData
'productList'
:
params
})
setDataSource
(
newData
)
setDataSource
(
params
)
}
return
(
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_8.tsx
View file @
2e7ef061
...
...
@@ -12,20 +12,11 @@ const columns_8 = ({
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
}
}
return
_item
})
params
[
index
][
name
]
=
Number
(
value
);
form
.
setFieldsValue
({
'productList'
:
newData
'productList'
:
params
})
setDataSource
(
newData
)
setDataSource
(
params
)
}
return
(
[
...
...
src/pages/transaction/marketingAbility/components/productListLayout/index.tsx
View file @
2e7ef061
...
...
@@ -9,6 +9,7 @@ import CollocationLayout from '@/pages/transaction/marketingAbility/components/c
import
{
remindLayout
,
RemindLayoutProps
}
from
'@/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/productListLayout/remind'
;
import
CouponsListLayout
from
'@/pages/transaction/marketingAbility/components/couponsListLayout'
;
import
{
number
}
from
'yargs'
;
import
{
PublicApi
}
from
'@/services/api'
;
type
optionProps
=
{
/** key */
...
...
@@ -185,7 +186,6 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
setDataSource
(
fields
)
}
return
(
<
CardLayout
id=
"productListLayout"
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/add.tsx
View file @
2e7ef061
...
...
@@ -199,6 +199,22 @@ const DetialLayout = () => {
})
}
// useEffect(() => {
// if (!isEmpty(dataSource)) {
// PublicApi.postMarketingPlatformActivitySignupGetFilterSkuId({
// activityType: dataSource.activityType,
// activityDefinedBO: dataSource.activityDefined.allowActivity,
// startTime: dataSource.startTime,
// endTime: dataSource.endTime,
// }, { ctlType: 'none' }).then(res => {
// if (res.code !== 1000) {
// return
// }
// console.log(res.data)
// })
// }
// }, [dataSource])
return
(
<
Context
.
Provider
value=
{
dataSource
}
>
<
PeripheralLayout
...
...
src/pages/transaction/marketingAbility/selfManagement/readySubmitExamine/components/shopLayout/index.tsx
View file @
2e7ef061
...
...
@@ -5,6 +5,7 @@ import CardLayout from '../card';
import
style
from
'./index.less'
;
import
{
isEmpty
}
from
'lodash'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
type
ShopItem
=
{
describe
?:
string
...
...
@@ -31,7 +32,7 @@ const ShopLayout: React.FC<shopListProps> = (props: any) => {
const
[
mallList
,
setMallList
]
=
useState
<
ShopItem
[]
>
([]);
useEffect
(()
=>
{
PublicApi
.
getManageShopFindByMemberType
(
).
then
(
res
=>
{
PublicApi
.
postManageWebShopWebAll
({
siteId
:
GlobalConfig
.
global
.
siteInfo
.
id
.
toString
(),
hasMemberType
:
1
},
{
ctlType
:
'none'
}
).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
...
...
@@ -69,6 +70,8 @@ const ShopLayout: React.FC<shopListProps> = (props: any) => {
console
.
log
(
onSetShopList
,
mallList
)
},
[
onSetShopList
])
return
(
<
CardLayout
id=
"shopLayout"
...
...
src/pages/user/register.tsx
View file @
2e7ef061
...
...
@@ -48,24 +48,24 @@ const useLinkageValidateEffects = () => {
})
})
onFieldValidateEnd$
(
'phone'
).
subscribe
(
fieldState
=>
{
if
(
fieldState
.
valid
&&
!
fieldState
.
smsLoading
)
{
// 校验手机号格式通过时, 需请求接口判断手机号是否存在数据库
PublicApi
.
getMemberRegisterPhoneCheck
({
countryCode
:
prefixCode
,
phone
:
fieldState
.
value
},
{
ctlType
:
'none'
,
useCache
:
true
,
ttl
:
60
*
1000
}).
then
(({
code
,
data
})
=>
{
if
(
code
!==
1000
)
{
setFieldState
(
'phone'
,
state
=>
{
state
.
errors
=
[
'手机号已存在'
]
eventEmitter
.
emit
(
'SHOW_PHONE_VALIDATE'
,
false
)
})
}
else
{
eventEmitter
.
emit
(
'SHOW_PHONE_VALIDATE'
,
true
)
}
})
}
else
{
eventEmitter
.
emit
(
'SHOW_PHONE_VALIDATE'
,
false
)
}
//
if (fieldState.valid && !fieldState.smsLoading) {
//
// 校验手机号格式通过时, 需请求接口判断手机号是否存在数据库
//
PublicApi.getMemberRegisterPhoneCheck({
//
countryCode: prefixCode,
//
phone: fieldState.value
//
}, { ctlType: 'none', useCache: true, ttl: 60 * 1000 }).then(({ code, data }) => {
//
if (code !== 1000) {
//
setFieldState('phone', state => {
//
state.errors = ['手机号已存在']
//
eventEmitter.emit('SHOW_PHONE_VALIDATE', false)
//
})
//
} else {
//
eventEmitter.emit('SHOW_PHONE_VALIDATE', true)
//
}
//
})
//
} else {
//
eventEmitter.emit('SHOW_PHONE_VALIDATE', false)
//
}
})
onFieldValueChange$
(
'*(confirmPassword)'
).
subscribe
(
fieldState
=>
{
const
selfValue
=
fieldState
.
value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment