Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
51388ed6
Commit
51388ed6
authored
Sep 20, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品服务接口加参数
parent
fe0771ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
src/components/common/GoodsFliters.vue
+8
-0
static/nativeComponents/GoodsList/index.js
+13
-4
No files found.
src/components/common/GoodsFliters.vue
View file @
51388ed6
...
@@ -375,6 +375,7 @@ export default {
...
@@ -375,6 +375,7 @@ export default {
brandMore
:
false
,
brandMore
:
false
,
brandList
:
[],
brandList
:
[],
brandListCopy
:
[],
brandListCopy
:
[],
terminalProductIds
:
[],
specifications
:
[],
specifications
:
[],
randomNumber
:
""
,
randomNumber
:
""
,
hideBrandSelectFlag
:
false
,
// 隐藏品牌筛选
hideBrandSelectFlag
:
false
,
// 隐藏品牌筛选
...
@@ -428,6 +429,7 @@ export default {
...
@@ -428,6 +429,7 @@ export default {
this
.
submitFliterVal
=
val
.
submitFliterVal
;
this
.
submitFliterVal
=
val
.
submitFliterVal
;
this
.
categoryId
=
val
.
categoryId
;
this
.
categoryId
=
val
.
categoryId
;
this
.
brandListCopy
=
val
.
filterBrand
;
this
.
brandListCopy
=
val
.
filterBrand
;
this
.
terminalProductIds
=
val
.
terminalProductIds
;
this
.
randomNumber
=
val
.
randomNumber
;
this
.
randomNumber
=
val
.
randomNumber
;
this
.
hideBrandSelectFlag
=
val
.
hideBrandSelectFlag
;
this
.
hideBrandSelectFlag
=
val
.
hideBrandSelectFlag
;
console
.
log
(
this
.
submitFliterVal
,
'-------------this.submitFliterVal'
)
console
.
log
(
this
.
submitFliterVal
,
'-------------this.submitFliterVal'
)
...
@@ -472,6 +474,11 @@ export default {
...
@@ -472,6 +474,11 @@ export default {
let
query
=
{
let
query
=
{
filterFieldsShowFlag
:
1
,
filterFieldsShowFlag
:
1
,
}
}
if
(
this
.
sourceType
==
1
)
{
query
.
categoryId
=
this
.
categoryId
;
query
.
brandIdList
=
this
.
brandListCopy
;
query
.
terminalProductIds
=
this
.
terminalProductIds
;
}
goodsApi
.
query_product_attribute_values_list
(
query
).
then
(
res
=>
{
goodsApi
.
query_product_attribute_values_list
(
query
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
"200"
&&
res
.
data
.
data
&&
res
.
data
.
data
.
length
){
if
(
res
.
data
.
code
==
"200"
&&
res
.
data
.
data
&&
res
.
data
.
data
.
length
){
this
.
attributeList
=
res
.
data
.
data
||
[];
this
.
attributeList
=
res
.
data
.
data
||
[];
...
@@ -631,6 +638,7 @@ export default {
...
@@ -631,6 +638,7 @@ export default {
this
.
submitFliterVal
.
brandActiveNameList
=
[];
this
.
submitFliterVal
.
brandActiveNameList
=
[];
this
.
submitFliterVal
.
categoryIdList
=
[];
this
.
submitFliterVal
.
categoryIdList
=
[];
this
.
submitFliterVal
.
goodsSpecificationIds
=
[];
this
.
submitFliterVal
.
goodsSpecificationIds
=
[];
this
.
submitFliterVal
.
productAttributeIds
=
[];
this
.
brandList
.
forEach
(
item
=>
{
this
.
brandList
.
forEach
(
item
=>
{
item
.
selectFlag
=
false
;
item
.
selectFlag
=
false
;
});
});
...
...
static/nativeComponents/GoodsList/index.js
View file @
51388ed6
...
@@ -73,8 +73,11 @@ const componentOptions = {
...
@@ -73,8 +73,11 @@ const componentOptions = {
observers
:
{},
observers
:
{},
// 组件生命周期
// 组件生命周期
lifetimes
:
{
lifetimes
:
{
created
()
{},
created
()
{
console
.
log
(
"--goodsList-created"
)
},
ready
()
{
ready
()
{
console
.
log
(
"--goodsList-ready"
)
let
_this
=
this
;
let
_this
=
this
;
let
{
clientHeight
}
=
this
.
data
;
let
{
clientHeight
}
=
this
.
data
;
wx
.
getSystemInfo
({
wx
.
getSystemInfo
({
...
@@ -117,6 +120,7 @@ const componentOptions = {
...
@@ -117,6 +120,7 @@ const componentOptions = {
pageLifetimes
:
{
pageLifetimes
:
{
// 页面被展示
// 页面被展示
show
()
{
show
()
{
console
.
log
(
"--goodsList-show"
)
const
{
isPageHidden
}
=
this
.
data
;
const
{
isPageHidden
}
=
this
.
data
;
// show事件发生前,页面不是处于隐藏状态时
// show事件发生前,页面不是处于隐藏状态时
...
@@ -153,12 +157,17 @@ const componentOptions = {
...
@@ -153,12 +157,17 @@ const componentOptions = {
let
{
item
}
=
e
.
currentTarget
.
dataset
;
let
{
item
}
=
e
.
currentTarget
.
dataset
;
let
{
filterPriceType
,
filterType
}
=
this
.
data
;
let
{
filterPriceType
,
filterType
}
=
this
.
data
;
if
(
item
==
99
)
{
if
(
item
==
99
)
{
// 展示筛选弹窗
let
_this
=
this
;
let
_this
=
this
;
// 商品产品详情
let
terminalProductIds
=
_this
.
data
.
datas
.
componentData
.
goodsList
.
map
(
element
=>
{
return
element
.
terminalProductId
;
});
// 展示筛选弹窗
app
.
openFilterGoods
({
app
.
openFilterGoods
({
submitFliterVal
:
_this
.
data
.
submitFliterVal
,
submitFliterVal
:
_this
.
data
.
submitFliterVal
,
categoryId
:
_this
.
data
.
datas
.
componentData
.
goodsSource
==
"classify"
?
_this
.
data
.
datas
.
componentData
.
categoryId
:
""
,
categoryId
:
_this
.
data
.
datas
.
componentData
.
goodsSource
==
"classify"
?
_this
.
data
.
datas
.
componentData
.
categoryId
:
""
,
filterBrand
:
_this
.
data
.
datas
.
componentData
.
filterBrand
,
filterBrand
:
_this
.
data
.
datas
.
componentData
.
filterBrand
,
terminalProductIds
,
randomNumber
:
_this
.
data
.
randomNumber
,
randomNumber
:
_this
.
data
.
randomNumber
,
hideBrandSelectFlag
:
_this
.
data
.
datas
.
componentData
.
filterBrand
.
length
>
0
?
true
:
false
,
hideBrandSelectFlag
:
_this
.
data
.
datas
.
componentData
.
filterBrand
.
length
>
0
?
true
:
false
,
sourceType
:
1
,
sourceType
:
1
,
...
@@ -423,9 +432,9 @@ const componentOptions = {
...
@@ -423,9 +432,9 @@ const componentOptions = {
let
pageGoodsList
=
this
.
getStorageSync
(
'pageGoodsList'
)
||
[]
let
pageGoodsList
=
this
.
getStorageSync
(
'pageGoodsList'
)
||
[]
if
(
flag
)
{
if
(
flag
)
{
pageGoodsList
[
that
.
data
.
goodsListIndex
]
.
push
(...
goodsList
)
pageGoodsList
[
that
.
data
.
goodsListIndex
]
=
goodsList
;
}
else
{
}
else
{
pageGoodsList
[
that
.
data
.
datasIndex
]
.
push
(...
goodsList
)
pageGoodsList
[
that
.
data
.
datasIndex
]
=
goodsList
;
console
.
log
(
pageGoodsList
[
that
.
data
.
datasIndex
],
'--pageGoodsList[that.data.datasIndex]'
)
console
.
log
(
pageGoodsList
[
that
.
data
.
datasIndex
],
'--pageGoodsList[that.data.datasIndex]'
)
}
}
this
.
setStorageSync
(
'pageGoodsList'
,
pageGoodsList
);
this
.
setStorageSync
(
'pageGoodsList'
,
pageGoodsList
);
...
...
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