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
b0dedd51
Commit
b0dedd51
authored
Oct 19, 2021
by
前端-黄佳鑫
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
1b2dbe82
46e3ee71
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
100 additions
and
77 deletions
+100
-77
environment.ts
src/constants/environment.ts
+1
-1
index.tsx
src/pages/editor/ownMallEdit/index.tsx
+17
-16
preview.tsx
src/pages/editor/ownMallEdit/preview.tsx
+17
-16
index.tsx
src/pages/ownMall/ownMallManager/ownMallAboutUs/index.tsx
+6
-7
priceSetting.tsx
...ages/priceManage/priceStrategy/component/priceSetting.tsx
+32
-32
index.tsx
...ty/marketingActivitiesManagement/activePage/add/index.tsx
+1
-1
ScanLoginWrap.tsx
src/pages/user/components/ScanLoginWrap.tsx
+26
-4
No files found.
src/constants/environment.ts
View file @
b0dedd51
...
...
@@ -29,7 +29,7 @@ export const environmentList = [
value
:
H5
,
},
{
label
:
'
APPLETS
'
,
label
:
'
小程序
'
,
value
:
APPLETS
,
},
{
...
...
src/pages/editor/ownMallEdit/index.tsx
View file @
b0dedd51
...
...
@@ -140,22 +140,23 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
})
}
// const getCategoryTree = () => {
// return new Promise((resolve) => {
// const param: any = {
// templateId: id,
// categoryId,
// memberId,
// roleId: memberRoleId
// }
const
getCategoryTree
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
const
param
:
any
=
{
memberId
,
}
const
headers
:
any
=
{
shopId
}
// PublicApi.getTemplateAdornWebSelfMemberCategoryAdorn(param
).then(res => {
//
if (res.code === 1000) {
//
resolve(res.data)
//
}
//
})
//
})
//
}
PublicApi
.
getSearchShopSelfGetCustomerCategoryTree
(
param
,
{
headers
}
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
})
}
const
fetchNewByLabel
=
(
label
:
string
)
=>
{
// 1-头条文章 2-轮播新闻 3-图片新闻 4-推荐阅读
...
...
@@ -186,7 +187,7 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
mainNavConfig
[
mainNavConfig
.
key
].
props
.
menuData
=
getDefaultMenuData
(
mallPath
,
memberId
);
}
mainNavConfig
[
mainNavConfig
.
key
].
props
.
type
=
LAYOUT_TYPE
.
shop
mainNavConfig
[
mainNavConfig
.
key
].
props
.
categoryList
=
[]
mainNavConfig
[
mainNavConfig
.
key
].
props
.
categoryList
=
await
getCategoryTree
()
// 一号位广告
oneBannerConfig
[
oneBannerConfig
.
key
].
props
.
advertList
=
await
findAdvertsByType
(
1
)
...
...
src/pages/editor/ownMallEdit/preview.tsx
View file @
b0dedd51
...
...
@@ -139,22 +139,23 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
})
}
// const getCategoryTree = () => {
// return new Promise((resolve) => {
// const param: any = {
// templateId: id,
// categoryId,
// memberId,
// roleId: memberRoleId
// }
const
getCategoryTree
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
const
param
:
any
=
{
memberId
,
}
const
headers
:
any
=
{
shopId
}
// PublicApi.getTemplateAdornWebSelfMemberCategoryAdorn(param
).then(res => {
//
if (res.code === 1000) {
//
resolve(res.data)
//
}
//
})
//
})
//
}
PublicApi
.
getSearchShopSelfGetCustomerCategoryTree
(
param
,
{
headers
}
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
})
}
const
fetchNewByLabel
=
(
label
:
string
)
=>
{
// 1-头条文章 2-轮播新闻 3-图片新闻 4-推荐阅读
...
...
@@ -180,7 +181,7 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
mainNavConfig
[
mainNavConfig
.
key
].
props
.
menuData
=
menuData
;
}
mainNavConfig
[
mainNavConfig
.
key
].
props
.
type
=
LAYOUT_TYPE
.
shop
mainNavConfig
[
mainNavConfig
.
key
].
props
.
categoryList
=
[]
mainNavConfig
[
mainNavConfig
.
key
].
props
.
categoryList
=
await
getCategoryTree
()
// 一号位广告
oneBannerConfig
[
oneBannerConfig
.
key
].
props
.
advertList
=
await
findAdvertsByType
(
1
)
...
...
src/pages/ownMall/ownMallManager/ownMallAboutUs/index.tsx
View file @
b0dedd51
...
...
@@ -51,10 +51,10 @@ const OwnMallAboutUs = () => {
const
[
saveLoading
,
setSaveLoading
]
=
useState
<
boolean
>
(
false
)
const
[
isFormChange
,
setIsFormChange
]
=
useState
<
boolean
>
(
false
)
const
[
albumUrls
,
setAlbumUrls
]
=
useState
<
any
[]
>
([])
const
[
albumUrls
,
setAlbumUrls
]
=
useState
<
any
[]
>
([])
const
[
allMallList
,
setAllMallList
]
=
useState
<
any
[]
>
([])
const
[
selectCityData
,
setSelectCityData
]
=
useState
<
any
>
([
defaultCityData
])
const
[
mallUrl
,
setMallUrl
]
=
useState
<
string
>
()
const
[
mallUrl
,
setMallUrl
]
=
useState
<
string
>
()
const
getAlbumUrls
=
(
data
)
=>
{
setAlbumUrls
(
data
);
...
...
@@ -151,9 +151,9 @@ const OwnMallAboutUs = () => {
if
(
code
===
1000
&&
data
)
{
const
{
albumName
,
albumUrl
,
honorPics
,
workshopPics
,
...
rest
}
=
data
const
newAlbumUrls
=
albumName
&&
albumUrl
?
[{
name
:
albumName
,
url
:
albumUrl
}]
:
[]
workshopImgRef
.
current
.
setData
(
workshopPics
)
honorImgRef
.
current
.
setData
(
honorPics
)
workshopImgRef
.
current
?
.
setData
(
workshopPics
)
honorImgRef
.
current
?
.
setData
(
honorPics
)
form
.
setFieldsValue
({
...
rest
,
albumUrls
:
newAlbumUrls
...
...
@@ -272,4 +272,4 @@ const OwnMallAboutUs = () => {
)
}
export
default
observer
(
OwnMallAboutUs
)
\ No newline at end of file
export
default
observer
(
OwnMallAboutUs
)
src/pages/priceManage/priceStrategy/component/priceSetting.tsx
View file @
b0dedd51
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
{
ISchemaFormActions
,
ISchema
,
FormEffectHooks
}
from
'@formily/antd'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
...
...
@@ -27,8 +27,8 @@ export interface PriceSettingProps {
formSubmit
?(
values
),
}
const
PriceSetting
:
React
.
FC
<
PriceSettingProps
>
=
(
props
)
=>
{
const
{
addSchemaAction
,
schema
,
formSubmit
,
onFieldChange
=
()
=>
{}
}
=
props
const
PriceSetting
:
React
.
FC
<
PriceSettingProps
>
=
(
props
)
=>
{
const
{
addSchemaAction
,
schema
,
formSubmit
,
onFieldChange
=
()
=>
{
}
}
=
props
const
priceRef
=
useRef
<
any
>
({})
const
productRef
=
useRef
<
any
>
({})
const
memberRef
=
useRef
<
any
>
({})
...
...
@@ -48,8 +48,8 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
}
=
usePageStatus
()
useEffect
(()
=>
{
if
(
id
)
{
PublicApi
.
getProductCommodityGetUnitPriceStrategy
({
id
}).
then
(
res
=>
{
if
(
id
)
{
PublicApi
.
getProductCommodityGetUnitPriceStrategy
({
id
}).
then
(
res
=>
{
const
{
initValue
}
=
transformDataForNiceForm
(
res
.
data
,
addSchemaAction
)
setInitialFormValue
(
initValue
)
dataRef
.
current
=
initValue
...
...
@@ -68,7 +68,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
addSchemaAction
.
setFieldState
(
'commodityMemberList'
,
state
=>
{
state
.
isDelete
=
true
})
if
(
pageStatus
===
PageStatus
.
EDIT
)
{
if
(
pageStatus
===
PageStatus
.
EDIT
)
{
let
hasMember
=
memberRef
.
current
.
rowSelectionCtl
.
selectRow
memberRef
.
current
.
rowSelectionCtl
.
setSelectRow
(
hasMember
.
filter
(
item
=>
item
.
memberId
!=
reocrd
.
memberId
))
}
...
...
@@ -93,7 +93,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
const
handleSetProductPrice
=
(
record
:
any
)
=>
{
console
.
log
(
record
,
'record'
)
if
(
record
?.
id
)
{
if
(
record
?.
id
)
{
priceRef
.
current
.
setVisible
(
true
)
priceRef
.
current
.
setCurrentSetPriceRow
(
record
)
}
...
...
@@ -125,27 +125,27 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
}
const
searchMember
=
(
value
)
=>
{
if
(
!
value
)
{
if
(
!
value
)
{
addSchemaAction
.
setFieldValue
(
"commodityMemberList"
,
addSchemaAction
.
getFieldState
(
"commodityMemberList"
)[
"dataSource"
])
return
;
return
;
}
let
commodityMemberList
=
addSchemaAction
.
getFieldValue
(
"commodityMemberList"
).
filter
(
item
=>
item
.
name
.
indexOf
(
value
)
!==
-
1
)
addSchemaAction
.
setFieldValue
(
"commodityMemberList"
,
commodityMemberList
)
}
/**
* 生成价格设置 table 和会员 column
* @param pId 商品id
* @param ctx action
* @param priceType 价格类型(可选)1现货2询价
*/
/**
* 生成价格设置 table 和会员 column
* @param pId 商品id
* @param ctx action
* @param priceType 价格类型(可选)1现货2询价
*/
const
producePriceTableMemerColumn
=
async
(
pId
,
ctx
,
priceType
?)
=>
{
const
res
=
await
PublicApi
.
getProductCommodityGetCommodityUnitPrice
({
id
:
pId
,})
const
res
=
await
PublicApi
.
getProductCommodityGetCommodityUnitPrice
({
id
:
pId
,
})
// 填充价格设置table(编辑采用initValue数据)
let
source
=
pageStatus
===
PageStatus
.
ADD
?
res
.
data
:
dataRef
.
current
[
"memberUnitPriceList"
]
const
{
columsUnit
,
tableUnitData
}
=
constructTableData
(
source
,
ctx
,
pageStatus
)
const
{
columsUnit
,
tableUnitData
}
=
constructTableData
(
source
,
ctx
,
pageStatus
)
ctx
.
setFieldState
(
"memberUnitPriceList"
,
state
=>
{
state
.
dataSource
=
source
// 存源数据
priceType
!==
2
?
columsUnit
.
push
({
...
...
@@ -154,8 +154,8 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
align
:
'center'
,
render
:
(
_i
,
_r
)
=>
<
Button
disabled=
{
pageStatus
===
PageStatus
.
PREVIEW
}
type=
'link'
onClick=
{
()
=>
handleSetProductPrice
(
_r
)
}
>
设置价格
</
Button
>
})
:
columsUnit
.
pop
()
:
columsUnit
.
pop
()
state
.
props
[
"x-component-props"
].
columns
=
columsUnit
})
ctx
.
setFieldValue
(
"memberUnitPriceList"
,
priceType
===
2
?
tableUnitData
.
map
(
item
=>
{
delete
item
[
"单价"
];
return
item
})
:
tableUnitData
)
...
...
@@ -164,7 +164,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
// 填充适用会员table
ctx
.
setFieldState
(
"commodityMemberList"
,
state
=>
{
memberColumns
[
memberColumns
.
length
-
1
].
render
=
(
text
,
record
)
=>
{
memberColumns
[
memberColumns
.
length
-
1
].
render
=
(
text
,
record
)
=>
{
return
<
Button
disabled=
{
pageStatus
===
PageStatus
.
PREVIEW
}
type=
'link'
onClick=
{
()
=>
handleDeleteMemberTable
(
record
)
}
>
删除
</
Button
>
}
state
.
props
[
"x-component-props"
].
columns
=
memberColumns
...
...
@@ -173,21 +173,21 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
// 新增会员
const
tableAddMemberButton
=
pageStatus
!==
PageStatus
.
PREVIEW
&&
<>
<
p
style=
{
{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
flexWrap
:
'wrap'
}
}
>
<
p
style=
{
{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
flexWrap
:
'wrap'
}
}
>
<
Search
placeholder=
"会员名称"
onSearch=
{
value
=>
searchMember
(
value
)
}
style=
{
{
width
:
256
}
}
/>
</
p
>
<
Button
style=
{
{
marginBottom
:
16
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
handleAddMemberBtn
}
type=
'dashed'
>
选择指定会员
</
Button
>
<
Button
style=
{
{
marginBottom
:
16
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
handleAddMemberBtn
}
type=
'dashed'
>
选择指定会员
</
Button
>
</>
// 批量设置价格按钮
const
batchPriceButton
=
pageStatus
!==
PageStatus
.
PREVIEW
&&
priceType
!==
2
&&
<
Button
type=
"text"
onClick=
{
clickBatchSetPrice
}
style=
{
{
marginBottom
:
12
,
float
:
"right"
}
}
><
SettingOutlined
/>
批量设置价格
</
Button
>
const
batchPriceButton
=
pageStatus
!==
PageStatus
.
PREVIEW
&&
priceType
!==
2
&&
<
Button
type=
"text"
onClick=
{
clickBatchSetPrice
}
style=
{
{
marginBottom
:
12
,
float
:
"right"
}
}
><
SettingOutlined
/>
批量设置价格
</
Button
>
// 选择商品
const
connectProduct
=
pageStatus
===
PageStatus
.
ADD
&&
<
div
className=
'connectBtn'
onClick=
{
handleAddProductBtn
}
><
LinkOutlined
style=
{
{
marginRight
:
4
}
}
/>
选择
</
div
>
const
connectProduct
=
pageStatus
===
PageStatus
.
ADD
&&
<
div
className=
'connectBtn'
onClick=
{
handleAddProductBtn
}
><
LinkOutlined
style=
{
{
marginRight
:
4
}
}
/>
选择
</
div
>
const
questionNameLabel
=
<>
价格策略名称
...
...
@@ -232,16 +232,16 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
// state.dataSource = pageStatus === PageStatus.PREVIEW ?
// GlobalConfig.web.shopInfo.filter(v => v.id === parentState.value && state.value.includes(v.id))
// :
state
.
dataSource
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
id
===
parentState
.
value
)
state
.
dataSource
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
v
.
id
===
parentState
.
value
)
if
(
pageStatus
===
PageStatus
.
EDIT
)
{
state
.
props
[
'x-component-props'
].
disabled
=
true
;
}
if
(
pageStatus
===
PageStatus
.
EDIT
)
{
state
.
props
[
'x-component-props'
].
disabled
=
true
;
}
})
ctx
.
setFieldState
(
'priceType'
,
state
=>
{
if
(
pageStatus
===
PageStatus
.
EDIT
)
{
state
.
props
[
'x-component-props'
].
disabled
=
true
;
}
if
(
pageStatus
===
PageStatus
.
EDIT
)
{
state
.
props
[
'x-component-props'
].
disabled
=
true
;
}
});
}
})
...
...
@@ -254,7 +254,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
$
(
"onFieldValueChange"
,
"priceType"
).
subscribe
(
parentState
=>
{
let
pId
=
ctx
.
getFieldValue
(
"productId"
)
if
(
pId
)
{
if
(
pId
)
{
producePriceTableMemerColumn
(
pId
,
ctx
,
parentState
.
value
)
}
setPriceType
(
parentState
.
value
)
...
...
src/pages/transaction/marketingAbility/marketingActivitiesManagement/activePage/add/index.tsx
View file @
b0dedd51
...
...
@@ -138,7 +138,7 @@ const Add = () => {
},
[
initialValue
]);
const
fetchMallData
=
async
(
params
:
{
siteId
:
string
,
environment
:
string
})
=>
{
const
{
code
,
data
}
=
await
PublicApi
.
getManageShopFindShopsBySiteIdAndEnvironment
(
params
);
const
{
code
,
data
}
=
await
PublicApi
.
postManageWebShopWebAll
(
params
as
any
,
{
ctlType
:
'none'
}
);
if
(
code
===
1000
)
{
return
data
.
map
((
_item
)
=>
{
return
{
...
...
src/pages/user/components/ScanLoginWrap.tsx
View file @
b0dedd51
...
...
@@ -16,17 +16,36 @@ const ScanLoginWrap: React.FC = () => {
time
-=
2
;
console
.
log
(
time
);
timer
.
current
=
setTimeout
(()
=>
{
loginInfo
(
authCode
)
const
code
=
getUrlParam
(
authCode
,
'authCode'
);
loginInfo
(
code
)
hanleCountdown
(
authCode
);
},
2000
);
return
;
}
else
{
AuthCode
();
time
=
60
*
5
;
}
}
const
getUrlParam
=
(
url
:
string
,
name
:
string
)
=>
{
const
paraString
:
any
=
url
.
substring
(
url
.
indexOf
(
"?"
)
+
1
,
url
.
length
).
split
(
"&"
);
const
paraObj
:
any
=
{};
let
j
:
any
;
// eslint-disable-next-line no-cond-assign
// eslint-disable-next-line no-plusplus
for
(
let
i
=
0
;
j
=
paraString
[
i
];
i
++
)
{
paraObj
[
j
.
substring
(
0
,
j
.
indexOf
(
"="
)).
toLowerCase
()]
=
j
.
substring
(
j
.
indexOf
(
"="
)
+
1
,
j
.
length
);
}
const
returnValue
:
any
=
paraObj
[
name
.
toLowerCase
()];
if
(
typeof
(
returnValue
)
===
"undefined"
)
{
return
""
;
}
return
returnValue
;
}
const
AuthCode
=
()
=>
{
PublicApi
.
postMemberAuthCode
({},
{
ctlType
:
'none'
}).
then
(
res
=>
{
hanleCountdown
(
res
.
data
.
authCode
);
QRCode
.
toDataURL
(
res
.
data
.
authCode
).
then
((
url
:
any
)
=>
{
// /member/login/authUrl
PublicApi
.
postMemberLoginAuthUrl
({},
{
ctlType
:
'none'
}).
then
(
res
=>
{
hanleCountdown
(
res
.
data
.
authUrl
);
QRCode
.
toDataURL
(
res
.
data
.
authUrl
).
then
((
url
:
any
)
=>
{
setQrCode
(
url
)
console
.
log
(
url
)
})
...
...
@@ -53,6 +72,9 @@ const ScanLoginWrap: React.FC = () => {
}
else
{
window
.
location
.
replace
(
'/memberCenter/home'
)
}
console
.
log
(
redirect
,
'redirect'
)
clearTimeout
(
timer
.
current
)
timer
.
current
=
null
}
})
}
...
...
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