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
4e8c822d
Commit
4e8c822d
authored
Nov 30, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:1.跳转到接单页面链接错误;2.跳转到找现货筛选错误3.询价商品未选择属性时提示
parent
a5fc35ff
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
50 deletions
+55
-50
index.tsx
src/pages/editor/shopEdit/index.tsx
+5
-1
index.tsx
src/pages/lxMall/commodity/index.tsx
+1
-1
index.tsx
...ents/ProductDescription/components/Introduction/index.tsx
+0
-3
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+18
-12
index.tsx
src/pages/lxMall/components/QuickNav/index.tsx
+2
-2
index.tsx
src/pages/preview/shopPreview/index.tsx
+5
-1
index.ts
src/store/filter/index.ts
+24
-30
No files found.
src/pages/editor/shopEdit/index.tsx
View file @
4e8c822d
...
@@ -126,7 +126,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
@@ -126,7 +126,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
*/
*/
const
fetchShopInfo
=
()
=>
{
const
fetchShopInfo
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
PublicApi
.
getTemplateShopFindShop
().
then
(
res
=>
{
const
param
:
any
=
{
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateShopFindShop
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
...
src/pages/lxMall/commodity/index.tsx
View file @
4e8c822d
...
@@ -78,7 +78,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
...
@@ -78,7 +78,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
}
}
if
(
priceType
)
{
if
(
priceType
)
{
onFilter
({
onFilter
({
key
:
priceType
,
key
:
Number
(
priceType
)
,
title
:
Number
(
priceType
)
===
1
?
'只看现价商品'
:
'只看询价商品'
,
title
:
Number
(
priceType
)
===
1
?
'只看现价商品'
:
'只看询价商品'
,
type
:
FILTER_TYPE
.
commodityType
,
type
:
FILTER_TYPE
.
commodityType
,
})
})
...
...
src/pages/lxMall/commodityDetail/components/ProductDescription/components/Introduction/index.tsx
View file @
4e8c822d
...
@@ -21,9 +21,6 @@ const Introduction: React.FC<IntroductionPropsType> = (props) => {
...
@@ -21,9 +21,6 @@ const Introduction: React.FC<IntroductionPropsType> = (props) => {
}
}
},
[])
},
[])
useEffect
(()
=>
{
},
[
commodityTemplateInfo
])
const
renderIntroduction
=
()
=>
{
const
renderIntroduction
=
()
=>
{
const
templateName
=
commodityTemplateInfo
?
commodityTemplateInfo
.
fileName
||
'science'
:
'science'
const
templateName
=
commodityTemplateInfo
?
commodityTemplateInfo
.
fileName
||
'science'
:
'science'
switch
(
templateName
)
{
switch
(
templateName
)
{
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
4e8c822d
...
@@ -87,8 +87,8 @@ const CommodityDetail = (props) => {
...
@@ -87,8 +87,8 @@ const CommodityDetail = (props) => {
/**
/**
* 获取”买家还在看“商品列表
* 获取”买家还在看“商品列表
* @param categoryId
* @param categoryId
* @param priceType
* @param priceType
*/
*/
const
fetchCommonCategoryCommodityList
=
(
categoryId
:
number
,
priceType
:
number
)
=>
{
const
fetchCommonCategoryCommodityList
=
(
categoryId
:
number
,
priceType
:
number
)
=>
{
const
param
:
any
=
{
const
param
:
any
=
{
...
@@ -272,8 +272,8 @@ const CommodityDetail = (props) => {
...
@@ -272,8 +272,8 @@ const CommodityDetail = (props) => {
/**
/**
* 获取会员权益参数
* 获取会员权益参数
* @param memberId
* @param memberId
* @param memberRoleId
* @param memberRoleId
*/
*/
const
getMemberCredit
=
(
memberId
,
memberRoleId
)
=>
{
const
getMemberCredit
=
(
memberId
,
memberRoleId
)
=>
{
const
param
=
{
const
param
=
{
...
@@ -351,7 +351,7 @@ const CommodityDetail = (props) => {
...
@@ -351,7 +351,7 @@ const CommodityDetail = (props) => {
message
.
info
(
"购买数量不能低于最小购买量"
)
message
.
info
(
"购买数量不能低于最小购买量"
)
return
return
}
}
if
(
clickFlag
)
{
if
(
clickFlag
)
{
clickFlag
=
false
clickFlag
=
false
const
param
:
any
=
{
const
param
:
any
=
{
...
@@ -519,7 +519,7 @@ const CommodityDetail = (props) => {
...
@@ -519,7 +519,7 @@ const CommodityDetail = (props) => {
orderList
:
[
buyCommodityInfo
]
orderList
:
[
buyCommodityInfo
]
}]
}]
}
}
updateOrderInfo
(
buyOrderInfo
,
sessionKey
).
then
(()
=>
{
updateOrderInfo
(
buyOrderInfo
,
sessionKey
).
then
(()
=>
{
if
(
res
.
data
)
{
if
(
res
.
data
)
{
window
.
location
.
href
=
getOrderLink
(
sessionKey
,
priceType
)
window
.
location
.
href
=
getOrderLink
(
sessionKey
,
priceType
)
...
@@ -541,7 +541,13 @@ const CommodityDetail = (props) => {
...
@@ -541,7 +541,13 @@ const CommodityDetail = (props) => {
if
(
!
checkoutUserInfo
())
{
if
(
!
checkoutUserInfo
())
{
return
return
}
}
if
(
!
selectCommodityId
)
{
message
.
destroy
()
message
.
info
(
"请选择商品属性"
)
return
}
const
values
:
Array
<
any
>
[]
=
[];
const
values
:
Array
<
any
>
[]
=
[];
attrAndValList
.
attributeAndValueList
.
forEach
((
item
:
any
,
i
:
number
)
=>
{
attrAndValList
.
attributeAndValueList
.
forEach
((
item
:
any
,
i
:
number
)
=>
{
values
.
push
(
item
.
customerAttributeValue
.
value
);
values
.
push
(
item
.
customerAttributeValue
.
value
);
...
@@ -595,8 +601,8 @@ const CommodityDetail = (props) => {
...
@@ -595,8 +601,8 @@ const CommodityDetail = (props) => {
/**
/**
* 去除重复的图片
* 去除重复的图片
* @param list
* @param list
* @param addList
* @param addList
*/
*/
const
deleteRepeatImg
=
(
list
,
addList
)
=>
{
const
deleteRepeatImg
=
(
list
,
addList
)
=>
{
const
result
=
[...
list
]
const
result
=
[...
list
]
...
@@ -610,7 +616,7 @@ const CommodityDetail = (props) => {
...
@@ -610,7 +616,7 @@ const CommodityDetail = (props) => {
/**
/**
* 初始化商品详情数据
* 初始化商品详情数据
* @param unitPricePicList
* @param unitPricePicList
*/
*/
const
initAttributeAndValueList
=
(
dataInfo
:
any
)
=>
{
const
initAttributeAndValueList
=
(
dataInfo
:
any
)
=>
{
const
unitPricePicList
=
dataInfo
?.
unitPricePicList
const
unitPricePicList
=
dataInfo
?.
unitPricePicList
...
@@ -683,7 +689,7 @@ const CommodityDetail = (props) => {
...
@@ -683,7 +689,7 @@ const CommodityDetail = (props) => {
/**
/**
* 对阶梯价格进行从大到小的排序
* 对阶梯价格进行从大到小的排序
* @param priceObj
* @param priceObj
*/
*/
const
sortUnitPrice
=
(
priceObj
)
=>
{
const
sortUnitPrice
=
(
priceObj
)
=>
{
if
(
!
priceObj
)
{
if
(
!
priceObj
)
{
...
@@ -737,7 +743,7 @@ const CommodityDetail = (props) => {
...
@@ -737,7 +743,7 @@ const CommodityDetail = (props) => {
/**
/**
* 判断数组中是否存在该数据
* 判断数组中是否存在该数据
* @param list
* @param list
* @param attrId
* @param attrId
*/
*/
const
judgeAttrInList
=
(
list
,
attrId
)
=>
{
const
judgeAttrInList
=
(
list
,
attrId
)
=>
{
return
list
.
some
(
item
=>
item
.
customerAttribute
.
id
===
attrId
)
return
list
.
some
(
item
=>
item
.
customerAttribute
.
id
===
attrId
)
...
...
src/pages/lxMall/components/QuickNav/index.tsx
View file @
4e8c822d
...
@@ -41,7 +41,7 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
...
@@ -41,7 +41,7 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
icon
:
require
(
'@/assets/mallHomeIcon/offer_icon.png'
)
icon
:
require
(
'@/assets/mallHomeIcon/offer_icon.png'
)
},
},
{
{
path
:
'/memberCenter/tranactionAbility/saleOrder'
,
path
:
'/memberCenter/tranactionAbility/saleOrder
/orderList
'
,
title
:
'接单'
,
title
:
'接单'
,
icon
:
require
(
'@/assets/mallHomeIcon/order_icon.png'
)
icon
:
require
(
'@/assets/mallHomeIcon/order_icon.png'
)
},
},
...
@@ -103,7 +103,7 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
...
@@ -103,7 +103,7 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
const
getRoleName
=
()
=>
{
const
getRoleName
=
()
=>
{
let
result
=
""
let
result
=
""
if
(
userInfo
&&
userInfo
.
roles
)
{
if
(
userInfo
&&
userInfo
.
roles
)
{
for
(
le
t
item
of
userInfo
.
roles
)
{
for
(
cons
t
item
of
userInfo
.
roles
)
{
if
(
item
.
memberRoleId
===
userInfo
.
memberRoleId
)
{
if
(
item
.
memberRoleId
===
userInfo
.
memberRoleId
)
{
result
=
item
.
memberRoleName
result
=
item
.
memberRoleName
}
}
...
...
src/pages/preview/shopPreview/index.tsx
View file @
4e8c822d
...
@@ -129,7 +129,11 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -129,7 +129,11 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
*/
*/
const
fetchShopInfo
=
()
=>
{
const
fetchShopInfo
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
PublicApi
.
getTemplateShopFindShop
().
then
(
res
=>
{
const
param
:
any
=
{
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateShopFindShop
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
...
src/store/filter/index.ts
View file @
4e8c822d
...
@@ -2,13 +2,13 @@ import { action, observable, runInAction } from 'mobx'
...
@@ -2,13 +2,13 @@ import { action, observable, runInAction } from 'mobx'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
import
{
FILTER_TYPE
}
from
'@/constants'
import
{
FILTER_TYPE
}
from
'@/constants'
interface
f
ilterValueType
{
interface
F
ilterValueType
{
key
:
string
|
string
[];
key
:
string
|
string
[]
|
number
;
title
:
string
;
title
:
string
;
type
:
FILTER_TYPE
;
type
:
FILTER_TYPE
;
}
}
interface
f
ilterQuery
{
interface
F
ilterQuery
{
current
:
number
;
current
:
number
;
pageSize
:
number
;
pageSize
:
number
;
name
?:
string
;
name
?:
string
;
...
@@ -31,7 +31,7 @@ const styleOptions = [
...
@@ -31,7 +31,7 @@ const styleOptions = [
const
getItemText
=
(
key
:
number
)
=>
{
const
getItemText
=
(
key
:
number
)
=>
{
let
result
=
""
let
result
=
""
for
(
le
t
item
of
styleOptions
)
{
for
(
cons
t
item
of
styleOptions
)
{
if
(
item
.
value
===
key
)
{
if
(
item
.
value
===
key
)
{
result
=
item
.
label
result
=
item
.
label
}
}
...
@@ -61,20 +61,20 @@ class FilterStore {
...
@@ -61,20 +61,20 @@ class FilterStore {
* 筛选条件列表
* 筛选条件列表
*/
*/
@
observable
filterList
=
[]
@
observable
filterList
=
[]
@
observable
filterUpdate
:
boolean
=
false
@
observable
filterUpdate
=
false
@
observable
filterParam
:
f
ilterQuery
|
{}
=
{}
@
observable
filterParam
:
F
ilterQuery
|
{}
=
{}
@
observable
commonlyUseFilter
:
any
=
[]
// 常用筛选项
@
observable
commonlyUseFilter
:
any
=
[]
// 常用筛选项
@
observable
commonlyUseFilterId
=
null
@
observable
commonlyUseFilterId
=
null
/**
/**
* 筛选
* 筛选
* @param filterValue
* @param filterValue
*/
*/
@
action
.
bound
@
action
.
bound
public
onFilter
=
(
filterValue
:
f
ilterValueType
)
=>
{
public
onFilter
=
(
filterValue
:
F
ilterValueType
)
=>
{
le
t
filteState
=
this
.
filterList
.
some
(
item
=>
item
.
type
===
filterValue
.
type
)
cons
t
filteState
=
this
.
filterList
.
some
(
item
=>
item
.
type
===
filterValue
.
type
)
let
tempFilterList
=
[...
this
.
filterList
]
let
tempFilterList
=
[...
this
.
filterList
]
if
(
filteState
)
{
if
(
filteState
)
{
if
(
!
filterValue
.
key
||
filterValue
.
key
.
length
===
0
)
{
if
(
!
filterValue
.
key
)
{
tempFilterList
=
tempFilterList
.
filter
(
item
=>
{
tempFilterList
=
tempFilterList
.
filter
(
item
=>
{
if
(
item
.
type
===
filterValue
.
type
)
{
if
(
item
.
type
===
filterValue
.
type
)
{
return
item
.
key
===
filterValue
.
key
return
item
.
key
===
filterValue
.
key
...
@@ -110,7 +110,7 @@ class FilterStore {
...
@@ -110,7 +110,7 @@ class FilterStore {
/**
/**
* 删除筛选选项
* 删除筛选选项
* @param key
* @param key
* @param type
* @param type
*/
*/
@
action
.
bound
@
action
.
bound
public
onDeleteFilterItem
=
(
key
:
string
,
type
:
FILTER_TYPE
)
=>
{
public
onDeleteFilterItem
=
(
key
:
string
,
type
:
FILTER_TYPE
)
=>
{
...
@@ -128,19 +128,16 @@ class FilterStore {
...
@@ -128,19 +128,16 @@ class FilterStore {
/**
/**
* 筛选条件修改
* 筛选条件修改
* @param newFilterList
* @param newFilterList
*/
*/
@
action
.
bound
@
action
.
bound
public
onFilterParamChange
=
(
newFilterList
:
any
)
=>
{
public
onFilterParamChange
=
(
newFilterList
:
any
)
=>
{
le
t
tempFilterParam
:
any
=
{}
cons
t
tempFilterParam
:
any
=
{}
for
(
le
t
filterItem
of
newFilterList
)
{
for
(
cons
t
filterItem
of
newFilterList
)
{
switch
(
filterItem
.
type
)
{
switch
(
filterItem
.
type
)
{
case
FILTER_TYPE
.
category
:
case
FILTER_TYPE
.
category
:
tempFilterParam
.
categoryId
=
Number
(
filterItem
.
key
[
0
])
tempFilterParam
.
categoryId
=
Number
(
filterItem
.
key
[
0
])
break
break
case
FILTER_TYPE
.
brand
:
tempFilterParam
.
brandId
=
filterItem
.
key
break
case
FILTER_TYPE
.
commodityType
:
case
FILTER_TYPE
.
commodityType
:
tempFilterParam
.
priceTypeList
=
[
filterItem
.
key
]
tempFilterParam
.
priceTypeList
=
[
filterItem
.
key
]
break
break
...
@@ -197,9 +194,9 @@ class FilterStore {
...
@@ -197,9 +194,9 @@ class FilterStore {
@
action
.
bound
@
action
.
bound
public
async
saveCommonlyUsedFilter
(
name
:
string
)
{
public
async
saveCommonlyUsedFilter
(
name
:
string
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
le
t
tempFilterParam
:
any
=
{}
cons
t
tempFilterParam
:
any
=
{}
tempFilterParam
.
name
=
name
tempFilterParam
.
name
=
name
for
(
le
t
filterItem
of
this
.
filterList
)
{
for
(
cons
t
filterItem
of
this
.
filterList
)
{
switch
(
filterItem
.
type
)
{
switch
(
filterItem
.
type
)
{
case
FILTER_TYPE
.
category
:
case
FILTER_TYPE
.
category
:
tempFilterParam
.
customerCategoryId
=
filterItem
.
key
[
0
]
tempFilterParam
.
customerCategoryId
=
filterItem
.
key
[
0
]
...
@@ -218,9 +215,6 @@ class FilterStore {
...
@@ -218,9 +215,6 @@ class FilterStore {
case
FILTER_TYPE
.
maxPrice
:
case
FILTER_TYPE
.
maxPrice
:
tempFilterParam
.
max
=
filterItem
.
key
tempFilterParam
.
max
=
filterItem
.
key
break
break
case
FILTER_TYPE
.
brand
:
tempFilterParam
.
brandId
=
filterItem
.
key
break
case
FILTER_TYPE
.
province
:
case
FILTER_TYPE
.
province
:
tempFilterParam
.
provinceCode
=
filterItem
.
key
tempFilterParam
.
provinceCode
=
filterItem
.
key
tempFilterParam
.
provinceName
=
filterItem
.
title
tempFilterParam
.
provinceName
=
filterItem
.
title
...
@@ -254,7 +248,7 @@ class FilterStore {
...
@@ -254,7 +248,7 @@ class FilterStore {
*/
*/
@
action
.
bound
@
action
.
bound
public
async
getCommonlyUsedFilterList
()
{
public
async
getCommonlyUsedFilterList
()
{
le
t
param
:
any
=
{
cons
t
param
:
any
=
{
current
:
1
,
current
:
1
,
pageSize
:
50
,
pageSize
:
50
,
}
}
...
@@ -272,7 +266,6 @@ class FilterStore {
...
@@ -272,7 +266,6 @@ class FilterStore {
@
action
.
bound
@
action
.
bound
public
async
deleteCommonlyUsedFilterItem
(
id
:
number
)
{
public
async
deleteCommonlyUsedFilterItem
(
id
:
number
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
//@ts-ignore
PublicApi
.
postSearchShopOftenSelectDeleteOftenSelect
({
id
}).
then
(
res
=>
{
PublicApi
.
postSearchShopOftenSelectDeleteOftenSelect
({
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
this
.
getCommonlyUsedFilterList
()
this
.
getCommonlyUsedFilterList
()
...
@@ -294,12 +287,14 @@ class FilterStore {
...
@@ -294,12 +287,14 @@ class FilterStore {
}
else
{
}
else
{
this
.
commonlyUseFilterId
=
id
this
.
commonlyUseFilterId
=
id
}
}
//@ts-ignore
const
param
:
any
=
{
const
res
=
await
PublicApi
.
getSearchShopOftenSelectGetOftenSelect
({
id
})
id
}
const
res
=
await
PublicApi
.
getSearchShopOftenSelectGetOftenSelect
(
param
)
runInAction
(()
=>
{
runInAction
(()
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
const
data
=
res
.
data
const
data
=
res
.
data
le
t
tempFilter
=
[]
cons
t
tempFilter
=
[]
if
(
data
.
customerCategoryId
&&
data
.
customerCategoryName
)
{
if
(
data
.
customerCategoryId
&&
data
.
customerCategoryName
)
{
tempFilter
.
push
({
tempFilter
.
push
({
type
:
FILTER_TYPE
.
category
,
type
:
FILTER_TYPE
.
category
,
...
@@ -351,7 +346,7 @@ class FilterStore {
...
@@ -351,7 +346,7 @@ class FilterStore {
})
})
}
}
if
(
data
.
customerAttributeList
)
{
if
(
data
.
customerAttributeList
)
{
le
t
newCustomerAttributeList
=
data
.
customerAttributeList
.
map
(
item
=>
{
cons
t
newCustomerAttributeList
=
data
.
customerAttributeList
.
map
(
item
=>
{
return
{
return
{
customerAttributeId
:
item
.
id
,
customerAttributeId
:
item
.
id
,
customerAttributeName
:
item
.
name
,
customerAttributeName
:
item
.
name
,
...
@@ -374,4 +369,4 @@ class FilterStore {
...
@@ -374,4 +369,4 @@ class FilterStore {
}
}
export
default
FilterStore
export
default
FilterStore
\ No newline at end of file
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