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
adc60526
Commit
adc60526
authored
Jul 22, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业用户
parent
3d48f618
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
24 deletions
+57
-24
src/components/common/GoodsFliters.vue
+36
-20
src/main.js
+12
-0
src/pages/login/index.vue
+3
-1
static/nativeComponents/GoodsList/index.js
+6
-3
No files found.
src/components/common/GoodsFliters.vue
View file @
adc60526
...
...
@@ -101,7 +101,7 @@
</div>
</div>
</div>
<div
class=
"list clearfix brand-wrap"
v-if=
"!hideBrandSelectFlag"
>
<div
class=
"list clearfix brand-wrap"
>
<div
class=
"tit"
>
<div
class=
"tit-title"
>
品牌
</div>
<div
...
...
@@ -214,6 +214,7 @@ export default {
GoodsSpecificationNameAndValuesListResponseDTO
:
[],
brandMore
:
false
,
brandList
:
[],
brandListCopy
:
[],
brandList2
:
[],
randomNumber
:
""
,
hideBrandSelectFlag
:
false
,
// 隐藏品牌筛选
...
...
@@ -232,7 +233,6 @@ export default {
},
},
created
()
{
this
.
getProductBrand
();
this
.
query_specification_name_and_values_list
();
},
mounted
()
{
...
...
@@ -244,10 +244,13 @@ export default {
},
methods
:
{
open
(
val
)
{
console
.
log
(
"筛选商品open"
);
console
.
log
(
"筛选商品open"
,
val
);
this
.
submitFliterVal
=
val
.
submitFliterVal
;
this
.
brandListCopy
=
val
.
filterBrand
;
this
.
randomNumber
=
val
.
randomNumber
;
this
.
hideBrandSelectFlag
=
val
.
hideBrandSelectFlag
;
console
.
log
(
this
.
submitFliterVal
,
'-------------this.submitFliterVal'
)
this
.
getProductBrand
();
this
.
show
=
true
;
},
close
()
{
...
...
@@ -290,7 +293,22 @@ export default {
res
.
data
.
data
.
list
.
forEach
(
item
=>
{
item
.
selectFlag
=
false
;
})
this
.
brandList
=
res
.
data
.
data
.
list
;
let
list
=
[];
if
(
this
.
brandListCopy
.
length
>
0
)
{
list
=
res
.
data
.
data
.
list
.
filter
(
item
=>
this
.
brandListCopy
.
includes
(
item
.
id
));
// 后面手动未选
console
.
log
(
this
.
submitFliterVal
.
brandIdList
,
'----------this.submitFliterVal.brandIdList'
)
let
list2
=
res
.
data
.
data
.
list
.
filter
(
item
=>
this
.
submitFliterVal
.
brandIdList
.
includes
(
item
.
id
));
this
.
submitFliterVal
.
brandActiveNameList
=
list2
.
map
(
item
=>
item
.
brandName
);
}
else
{
list
=
res
.
data
.
data
.
list
;
}
list
.
forEach
(
item
=>
{
if
(
this
.
submitFliterVal
.
brandIdList
.
includes
(
item
.
id
))
{
item
.
selectFlag
=
true
;
}
})
this
.
brandList
=
list
;
this
.
brandList2
=
this
.
brandList
.
slice
(
8
);
console
.
log
(
this
.
brandList
,
'---------brandList'
)
}
...
...
@@ -342,16 +360,14 @@ export default {
this
.
submitFliterVal
.
minPrice
=
""
;
this
.
submitFliterVal
.
maxPrice
=
""
;
this
.
submitFliterVal
.
attribute
=
[];
if
(
!
this
.
hideBrandSelectFlag
)
{
this
.
submitFliterVal
.
brandIdList
=
[];
this
.
submitFliterVal
.
brandActiveNameList
=
[];
this
.
brandList
.
forEach
(
item
=>
{
item
.
selectFlag
=
false
;
});
this
.
brandList2
.
forEach
(
item
=>
{
item
.
selectFlag
=
false
;
});
}
this
.
submitFliterVal
.
brandIdList
=
[];
this
.
submitFliterVal
.
brandActiveNameList
=
[];
this
.
brandList
.
forEach
(
item
=>
{
item
.
selectFlag
=
false
;
});
this
.
brandList2
.
forEach
(
item
=>
{
item
.
selectFlag
=
false
;
});
this
.
GoodsSpecificationNameAndValuesListResponseDTO
.
forEach
(
(
ele
)
=>
{
if
(
ele
.
specificationValueList
)
{
...
...
@@ -382,13 +398,13 @@ export default {
Toast
(
"最高价应大于最低价"
);
return
;
}
let
callbackObj
=
{
submitFliterVal
:
this
.
submitFliterVal
,
randomNumber
:
this
.
randomNumber
,
};
// 向外传值
console
.
log
(
callbackObj
,
'----callbackObj'
)
app
.
getFilterGoodsData
(
callbackObj
);
console
.
log
(
this
.
submitFliterVal
,
this
.
randomNumber
,
'-----------------确认submitFliterVal'
)
let
_this
=
this
;
app
.
getFilterGoodsData
({
submitFliterVal
:
_this
.
submitFliterVal
,
randomNumber
:
_this
.
randomNumber
,
});
this
.
show
=
false
;
},
},
...
...
src/main.js
View file @
adc60526
...
...
@@ -179,6 +179,18 @@ wx.onAppRoute(res => {
// 获取当前页面信息
let
currentPage
=
getCurrentPages
()
// let fromPath = currentPage[currentPage.length - 1].__displayReporter.showReferpagepath
let
whetherToForceLogin
=
mpApp
.
globalData
.
shopInfo
&&
mpApp
.
globalData
.
shopInfo
.
whetherToForceLogin
||
0
log
.
info
(
"wx.onAppRoute"
,
res
,
mpApp
.
globalData
.
shopInfo
,
whetherToForceLogin
,
wx
.
getStorageSync
(
'sessionid'
),
res
.
path
!=
"pages/login/main"
);
console
.
log
(
res
,
mpApp
.
globalData
.
shopInfo
,
whetherToForceLogin
,
wx
.
getStorageSync
(
'sessionid'
),
res
.
path
!=
"pages/login/main"
,
'---------wx.onAppRoute'
)
if
(
whetherToForceLogin
==
1
&&
!
wx
.
getStorageSync
(
'sessionid'
)
&&
res
.
path
!=
"pages/login/main"
)
{
let
backUrl
=
`/pages/home/main`
;
const
url
=
`/pages/login/main?back=
${
encodeURIComponent
(
backUrl
)}
&hideBack=1`
;
wx
.
navigateTo
({
url
:
url
});
}
new
Promise
((
resolve
)
=>
{
if
(
!
spokesmanId
)
{
// 获取当前分销员 id
...
...
src/pages/login/index.vue
View file @
adc60526
<
template
>
<div
class=
"domain"
>
<ThemeDataPlant
:pageCode=
"14"
></ThemeDataPlant>
<div
class=
"tabbar"
:style=
"
{'height' : tabbarHeight + 'px','padding-top':systemInfo.statusBarHeight + 'px'}" @click="back">
<div
class=
"tabbar"
v-if=
"hideBack == 0"
:style=
"
{'height' : tabbarHeight + 'px','padding-top':systemInfo.statusBarHeight + 'px'}" @click="back">
<div
class=
"tab-back"
>
<van-icon
name=
"arrow-left"
/>
</div>
...
...
@@ -145,6 +145,7 @@ export default {
tabbarHeight
:
0
,
pageInfo
:
{},
pageData
:
{},
hideBack
:
0
,
//0显示返回按钮 1隐藏
};
},
computed
:
{
...
...
@@ -198,6 +199,7 @@ export default {
this
.
backPath
=
options
.
back
;
}
}
this
.
hideBack
=
options
.
hideBack
==
1
?
1
:
0
if
(
options
.
params
)
{
this
.
defalutBackParams
=
serialize
(
options
.
params
);
this
.
backParams
=
this
.
defalutBackParams
;
...
...
static/nativeComponents/GoodsList/index.js
View file @
adc60526
...
...
@@ -62,8 +62,8 @@ const componentOptions = {
brandIdList
:
[],
//品牌
brandActiveNameList
:
[],
goodsSpecificationIds
:
[],
randomNumber
:
""
,
},
randomNumber
:
""
,
},
// 数据监听器
observers
:
{},
...
...
@@ -74,12 +74,16 @@ const componentOptions = {
let
_this
=
this
;
app
.
getFilterGoodsData
=
(
val
)
=>
{
if
(
val
.
randomNumber
!=
_this
.
data
.
randomNumber
)
return
;
console
.
log
(
val
,
'-------------------------77'
)
_this
.
setData
({
submitFliterVal
:
val
.
submitFliterVal
,
})
console
.
log
(
_this
.
data
.
submitFliterVal
,
'----------submitFliterVal'
)
_this
.
init
();
}
this
.
setData
({
"submitFliterVal.brandIdList"
:
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
datas
.
componentData
.
filterBrand
)),
})
this
.
init
();
},
moved
()
{},
...
...
@@ -143,6 +147,7 @@ const componentOptions = {
let
_this
=
this
;
app
.
openFilterGoods
({
submitFliterVal
:
_this
.
data
.
submitFliterVal
,
filterBrand
:
_this
.
data
.
datas
.
componentData
.
filterBrand
,
randomNumber
:
_this
.
data
.
randomNumber
,
hideBrandSelectFlag
:
_this
.
data
.
datas
.
componentData
.
filterBrand
.
length
>
0
?
true
:
false
,
});
...
...
@@ -161,7 +166,6 @@ const componentOptions = {
goodsSource
,
angleSignImg
,
titleIcon
,
filterBrand
}
=
this
.
data
.
datas
.
componentData
;
angleSignImg
=
DFSImg
(
angleSignImg
,
150
,
150
,
1
);
if
(
titleIcon
)
{
...
...
@@ -171,7 +175,6 @@ const componentOptions = {
"data.datas.componentData.angleSignImg"
:
angleSignImg
,
titleIcon
,
mainColor
:
app
.
themeColor
[
"--main-color"
],
"submitFliterVal.brandIdList"
:
filterBrand
,
randomNumber
:
random_string
(
6
),
});
console
.
log
(
this
.
data
.
titleIcon
,
"----------------------------68"
);
...
...
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