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
5c35035a
Commit
5c35035a
authored
Mar 29, 2021
by
程默
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
底部栏
parent
cf08618e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
29 deletions
+20
-29
src/pages/home/index.vue
+1
-2
static/nativeComponents/custom-tab-bar/index.js
+16
-25
static/nativeComponents/custom-tab-bar/index.json
+3
-1
static/nativeComponents/custom-tab-bar/index.wxml
+0
-1
No files found.
src/pages/home/index.vue
View file @
5c35035a
...
...
@@ -105,7 +105,6 @@
<apply-sucess-entry></apply-sucess-entry>
</div>
<!-- 底部栏 -->
{{
active
}}
<custom-tab-bar
class=
"custom-tab-bar"
:selected=
"active"
></custom-tab-bar>
</div>
</
template
>
...
...
@@ -382,7 +381,7 @@ export default {
})
},
scrolls
(
el
){
//
this.setFooterShow(el);
this
.
setFooterShow
(
el
);
if
(
this
.
pageData
)
{
for
(
let
i
=
0
;
i
<
this
.
pageData
.
length
;
i
++
)
{
const
element
=
this
.
pageData
[
i
]
...
...
static/nativeComponents/custom-tab-bar/index.js
View file @
5c35035a
const
app
=
getApp
();
Component
({
properties
:{
selected
:{
type
:
Number
,
default
:
-
1
properties
:
{
selected
:
{
type
:
Number
,
default
:
-
1
}
},
data
:
{
// selected: -1,
color
:
"#7A7E83"
,
selectedColor
:
"#3cc51f"
,
list
:
[
...
...
@@ -33,8 +33,7 @@ Component({
};
}
this
.
setData
({
mmm
:
Math
.
ceil
(
app
.
globalData
.
footerVal
.
componentData
.
list
.
length
/
2
-
1
),
selected
:
this
.
data
.
active
mmm
:
Math
.
ceil
(
app
.
globalData
.
footerVal
.
componentData
.
list
.
length
/
2
-
1
)
});
},
attached
()
{
...
...
@@ -46,7 +45,7 @@ Component({
if
(
app
.
globalData
.
footerVal
)
{
let
mm
=
Math
.
ceil
(
app
.
globalData
.
footerVal
.
componentData
.
list
.
length
/
2
-
1
)
==
that
.
data
.
selected
&&
that
.
data
.
selected
&&
app
.
globalData
.
footerVal
.
componentData
[
"styleSelectionNum"
]
==
1
;
that
.
setData
({
...
...
@@ -54,19 +53,17 @@ Component({
list
:
app
.
globalData
.
footerVal
.
componentData
.
list
,
mm
:
mm
});
console
.
log
(
this
.
data
.
list
,
1111111132333
)
}
else
{
app
.
footerCallBack
=
function
(
params
)
{
params
.
componentData
.
selectIconColor
=
app
.
globalData
.
footerVal
.
componentData
.
selectIconBackground
==
1
?
'val(--main-color)'
:
params
.
componentData
.
selectIconColor
app
.
footerCallBack
=
function
(
params
)
{
params
.
componentData
.
selectIconColor
=
app
.
globalData
.
footerVal
.
componentData
.
selectIconBackground
==
1
?
'val(--main-color)'
:
params
.
componentData
.
selectIconColor
that
.
setData
({
componentData
:
params
.
componentData
,
list
:
params
.
componentData
.
list
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&¶ms.componentData['styleSelectionNum']==1)
});
let
mm
=
Math
.
ceil
(
params
.
componentData
.
list
.
length
/
2
-
1
)
==
that
.
data
.
selected
&&
that
.
data
.
selected
&&
params
.
componentData
[
"styleSelectionNum"
]
==
1
;
};
}
...
...
@@ -78,19 +75,13 @@ Component({
},
switchTab
(
e
)
{
const
{
index
}
=
e
.
currentTarget
.
dataset
;
let
routes
=
getCurrentPages
();
let
currentPage
=
routes
[
routes
.
length
-
1
].
route
;
// 当前仅有首页使用
if
(
currentPage
==
'pages/home/main'
)
return
app
.
$themeToLink
(
this
.
data
.
list
[
index
][
"link"
],
1
);
},
toPage
(
data
,
index
)
{
// 跳转
if
(
data
.
link
==
"/"
)
{
wx
.
switchTab
({
url
:
"/pages/home/main"
});
}
else
{
wx
.
switchTab
({
url
:
`/pages/tabBar
${
index
}
/main`
});
}
}
}
});
static/nativeComponents/custom-tab-bar/index.json
View file @
5c35035a
{
"component"
:
true
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
static/nativeComponents/custom-tab-bar/index.wxml
View file @
5c35035a
...
...
@@ -13,7 +13,6 @@
data-index="{{index}}"
bindtap="switchTab"
>
<!-- {{index}}{{selected}}--{{Math.ceil(5/2-1)}}--{{mm}} -->
<!-- &&componentData['styleSelectionNum']==1 -->
<!-- 图标 -->
<view class="item {{index == selected ? 'current' : ''}}">
...
...
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