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
linweijiong
jinfa-platform
Commits
d1d458bc
Commit
d1d458bc
authored
Nov 25, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
8451a890
6db11ef2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
index.tsx
src/pages/lxMall/order/components/addInvoice/index.tsx
+3
-4
index.tsx
src/pages/shop/shopInfo/index.tsx
+20
-11
No files found.
src/pages/lxMall/order/components/addInvoice/index.tsx
View file @
d1d458bc
import
React
,
{
useState
,
useEffect
}
from
'react'
import
React
,
{
useState
}
from
'react'
import
{
Modal
}
from
'antd'
import
{
Modal
}
from
'antd'
import
{
import
{
SchemaForm
,
SchemaForm
,
SchemaMarkupField
as
Field
,
SchemaMarkupField
as
Field
,
createAsyncFormActions
,
createAsyncFormActions
,
FormEffectHooks
,
FormEffectHooks
createFormActions
}
from
'@formily/antd'
}
from
'@formily/antd'
import
{
Input
,
Switch
,
Select
,
FormMegaLayout
,
Radio
}
from
'@formily/antd-components'
import
{
Input
,
Switch
,
Select
,
FormMegaLayout
,
Radio
}
from
'@formily/antd-components'
import
styles
from
'./index.less'
import
styles
from
'./index.less'
...
@@ -33,7 +32,7 @@ const actions = createAsyncFormActions()
...
@@ -33,7 +32,7 @@ const actions = createAsyncFormActions()
const
AddInvoice
:
React
.
FC
<
AddAddressPropsType
>
=
(
props
)
=>
{
const
AddInvoice
:
React
.
FC
<
AddAddressPropsType
>
=
(
props
)
=>
{
const
{
visible
=
false
,
title
,
onOk
,
onCancel
,
editItem
,
type
}
=
props
const
{
visible
=
false
,
title
,
onOk
,
onCancel
,
editItem
,
type
}
=
props
const
[
state
,
setState
]
=
useState
({
editable
:
true
})
const
[
state
]
=
useState
({
editable
:
true
})
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
)
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
)
const
[
invoiceTitle
,
setInvoiceTitle
]
=
useState
<
string
>
(
"发票抬头"
)
const
[
invoiceTitle
,
setInvoiceTitle
]
=
useState
<
string
>
(
"发票抬头"
)
const
[
invoiceTitleTip
,
setInvoiceTitleTip
]
=
useState
<
string
>
(
"请输入发票抬头"
)
const
[
invoiceTitleTip
,
setInvoiceTitleTip
]
=
useState
<
string
>
(
"请输入发票抬头"
)
...
...
src/pages/shop/shopInfo/index.tsx
View file @
d1d458bc
...
@@ -12,6 +12,7 @@ import { GetTemplateShopFindShopResponse } from '@/services/TemplateApi'
...
@@ -12,6 +12,7 @@ import { GetTemplateShopFindShopResponse } from '@/services/TemplateApi'
import
copy
from
'copy-to-clipboard'
import
copy
from
'copy-to-clipboard'
import
cx
from
'classnames'
import
cx
from
'classnames'
import
styles
from
'./index.less'
import
styles
from
'./index.less'
import
{
getAuth
}
from
'@/utils/auth'
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
interface
ShopInfoPropsType
{
interface
ShopInfoPropsType
{
...
@@ -43,8 +44,11 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
...
@@ -43,8 +44,11 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
// 根据站点获取商城信息
// 根据站点获取商城信息
const
fetchAllShop
=
()
=>
{
const
fetchAllShop
=
()
=>
{
//@ts-ignore
const
param
:
any
=
{
PublicApi
.
getManageShopFindShopsBySiteId
({
siteId
,
type
:
1
}).
then
(
res
=>
{
siteId
,
type
:
1
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
setAllMallList
(
res
.
data
)
setAllMallList
(
res
.
data
)
}
}
...
@@ -55,7 +59,13 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
...
@@ -55,7 +59,13 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
* 获取店铺信息
* 获取店铺信息
*/
*/
const
fetchShopInfo
=
()
=>
{
const
fetchShopInfo
=
()
=>
{
PublicApi
.
getTemplateShopFindShop
().
then
(
res
=>
{
const
{
memberId
,
memberRoleId
}
=
getAuth
()
||
{}
const
param
:
any
=
{
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateShopFindShop
(
param
).
then
(
res
=>
{
const
data
=
res
.
data
const
data
=
res
.
data
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
setShopInfo
(
data
)
setShopInfo
(
data
)
...
@@ -91,7 +101,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
...
@@ -91,7 +101,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
}
}
const
handleAddNewCitySelect
=
(
item
:
any
)
=>
{
const
handleAddNewCitySelect
=
(
item
:
any
)
=>
{
le
t
temp
=
[...
selectCityData
]
cons
t
temp
=
[...
selectCityData
]
temp
.
push
(
item
)
temp
.
push
(
item
)
setSelectCityData
(
temp
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
form
.
setFieldsValue
({
...
@@ -135,8 +145,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
...
@@ -135,8 +145,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const
handleSave
=
(
e
:
any
)
=>
{
const
handleSave
=
(
e
:
any
)
=>
{
e
.
preventDefault
()
e
.
preventDefault
()
console
.
log
(
selectCityData
)
form
.
validateFields
().
then
((
value
:
any
)
=>
{
form
.
validateFields
().
then
(
value
=>
{
if
(
!
checkMemberShopAreas
(
value
.
memberShopAreas
))
{
if
(
!
checkMemberShopAreas
(
value
.
memberShopAreas
))
{
return
return
}
}
...
@@ -146,7 +155,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
...
@@ -146,7 +155,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
}
}
value
.
storeUrl
=
storeUrl
||
`
${
siteUrl
}
/shop`
value
.
storeUrl
=
storeUrl
||
`
${
siteUrl
}
/shop`
value
.
shopId
=
shopId
value
.
shopId
=
shopId
//@ts-ignore
PublicApi
.
postTemplateShopSaveShop
(
value
).
then
(
res
=>
{
PublicApi
.
postTemplateShopSaveShop
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
fetchShopInfo
()
fetchShopInfo
()
...
@@ -213,7 +222,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
...
@@ -213,7 +222,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
return
null
return
null
}
}
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
le
t
resUrl
=
getMallItemAndSetUrl
(
mallId
)
cons
t
resUrl
=
getMallItemAndSetUrl
(
mallId
)
setStoreUrl
(
resUrl
)
setStoreUrl
(
resUrl
)
}
else
{
}
else
{
setStoreUrl
(
null
)
setStoreUrl
(
null
)
...
@@ -223,7 +232,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
...
@@ -223,7 +232,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
let
result
=
""
console
.
log
(
mallId
,
allMallList
,
"mallId"
)
console
.
log
(
mallId
,
allMallList
,
"mallId"
)
le
t
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
cons
t
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
if
(
!
mallItem
)
{
return
""
return
""
}
}
...
@@ -259,7 +268,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
...
@@ -259,7 +268,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
return
null
return
null
}
}
if
(
shopId
&&
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
if
(
shopId
&&
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
le
t
resUrl
=
getMallItemAndSetUrl
(
shopId
)
cons
t
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
return
resUrl
?
(
<
div
className=
{
styles
.
shop_url
}
>
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前店铺链接:
</
span
>
<
span
>
当前店铺链接:
</
span
>
...
@@ -394,7 +403,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
...
@@ -394,7 +403,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
labelAlign=
"left"
labelAlign=
"left"
name=
"customerUrl"
name=
"customerUrl"
label=
{
<
RequireItem
label=
"客服链接"
/>
}
label=
{
<
RequireItem
label=
"客服链接"
/>
}
rules=
{
[{
pattern
:
/
(
http|ftp|https
)
:
\/\/[\w\-
_
]
+
(\.[\w\-
_
]
+
)
+
([\w\-
\.
,@?^=%&:
/
~
\+
#
]
*
[\w\-\@
?^=%&
/
~
\
+
#
])?
/
,
message
:
'请输入正确的客服链接'
}]
}
rules=
{
[{
pattern
:
/
(
http|ftp|https
)
:
\/\/[\w\-
_
]
+
(\.[\w\-
_
]
+
)
+
([\w\-
.,@?^=%&:
/
~+#
]
*
[\w\-
@?^=%&
/
~
+#
])?
/
,
message
:
'请输入正确的客服链接'
}]
}
>
>
<
Input
allowClear
className=
{
styles
.
form_item
}
/>
<
Input
allowClear
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
...
...
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