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
10898caf
Commit
10898caf
authored
May 08, 2021
by
程默
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix footer
parent
8c0359f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
40 deletions
+23
-40
static/nativeComponents/custom-tab-bar/index.js
+19
-35
static/nativeComponents/custom-tab-bar/index.wxml
+4
-5
No files found.
static/nativeComponents/custom-tab-bar/index.js
View file @
10898caf
...
...
@@ -12,70 +12,54 @@ Component({
selectedColor
:
"#3cc51f"
,
list
:
[
],
m
m
:
false
,
m
id
:
''
,
componentData
:
{},
show
:
true
,
mmm
:
false
,
mainColor
:
""
,
showFlag
:
"up"
,
cartNum
:
0
},
ready
()
{
if
(
app
.
themeColor
[
"--main-color"
]
!=
"#ffffff"
)
{
this
.
setData
({
mainColor
:
app
.
themeColor
[
"--main-color"
]
});
}
else
{
app
.
themeColorCallBack
=
res
=>
{
this
.
setData
({
mainColor
:
res
[
"--main-color"
]
});
};
}
// this.setData({
// mmm: Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1)
// });
},
attached
()
{
this
.
init
()
},
methods
:
{
init
()
{
if
(
app
.
themeColor
[
"--main-color"
]
!=
"#ffffff"
)
{
this
.
setData
({
mainColor
:
app
.
themeColor
[
"--main-color"
]
});
}
else
{
app
.
themeColorCallBack
=
res
=>
{
this
.
setData
({
mainColor
:
res
[
"--main-color"
]
});
};
}
//
let
that
=
this
;
if
(
app
.
globalData
.
footerVal
)
{
let
mm
=
Math
.
ceil
(
app
.
globalData
.
footerVal
.
componentData
.
list
.
length
/
2
-
1
)
==
that
.
data
.
selected
&&
app
.
globalData
.
footerVal
.
componentData
[
"styleSelectionNum"
]
==
1
;
let
mid
=
Math
.
ceil
(
app
.
globalData
.
footerVal
.
componentData
.
list
.
length
/
2
-
1
)
that
.
setData
({
componentData
:
app
.
globalData
.
footerVal
.
componentData
,
list
:
app
.
globalData
.
footerVal
.
componentData
.
list
,
m
m
:
mm
m
id
:
mid
});
}
else
{
app
.
footerCallBack
=
function
(
params
)
{
params
.
componentData
.
selectIconColor
=
app
.
globalData
.
footerVal
.
componentData
.
selectIconBackground
==
1
?
'val(--main-color)'
:
params
.
componentData
.
selectIconColor
let
mid
=
Math
.
ceil
(
params
.
componentData
.
list
.
length
/
2
-
1
)
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)
list
:
params
.
componentData
.
list
,
mid
:
mid
});
let
mm
=
Math
.
ceil
(
params
.
componentData
.
list
.
length
/
2
-
1
)
==
that
.
data
.
selected
&&
params
.
componentData
[
"styleSelectionNum"
]
==
1
;
};
}
this
.
setData
({
mm
:
Math
.
ceil
(
this
.
data
.
list
.
length
/
2
-
1
)
==
this
.
data
.
selected
&&
this
.
data
.
componentData
[
"styleSelectionNum"
]
==
1
});
},
switchTab
(
e
)
{
const
{
index
}
=
e
.
currentTarget
.
dataset
;
if
(
index
==
this
.
data
.
selected
)
return
if
(
index
==
this
.
data
.
selected
)
return
app
.
$themeToLink
(
this
.
data
.
list
[
index
][
"link"
],
1
);
}
}
...
...
static/nativeComponents/custom-tab-bar/index.wxml
View file @
10898caf
...
...
@@ -7,16 +7,15 @@
<view
wx:for="{{list}}"
wx:if="{{item.show}}"
wx:key="index"
class="tab-bar-item {{(m
mm
==index&&componentData['styleSelectionNum']==1)?'isItem':''}}"
wx:key="index"
class="tab-bar-item {{(m
id
==index&&componentData['styleSelectionNum']==1)?'isItem':''}}"
data-path="{{item.link}}"
data-index="{{index}}"
bindtap="switchTab"
>
<!-- &&componentData['styleSelectionNum']==1 -->
<!-- 图标 -->
<view class="item {{index == selected ? 'current' : ''}}">
<view>
<view
wx:if="{{componentData['contentFormNum']!=2}}"
>
<view wx:if="{{item.iconType==0||!item.iconType}}">
<view class="antt {{item.icon}}" style="font-size:{{componentData.defaultIcon==1 ? '36rpx' : (componentData.defaultIconSize*2 + 'rpx')}};color:{{index==selected?componentData.selectIconColor:componentData.defaultIconColor}}"></view>
</view>
...
...
@@ -29,7 +28,7 @@
</view>
</view>
<!-- 名称 -->
<view class="text" style="color: {{selected === index ? componentData.selectTextColor : componentData.defaultTextColor}};font-size:{{selected === index ? (componentData.selectText==1?10:componentData.selectionTextNum)*2 : (componentData.defaultText==1?10:componentData.defaultTextNum)*2}}rpx">
<view
wx:if="{{componentData['contentFormNum']!=3}}"
class="text" style="color: {{selected === index ? componentData.selectTextColor : componentData.defaultTextColor}};font-size:{{selected === index ? (componentData.selectText==1?10:componentData.selectionTextNum)*2 : (componentData.defaultText==1?10:componentData.defaultTextNum)*2}}rpx">
{{item.title}}</view>
<!-- 购物车商品数量 -->
<view class="isCart" wx:if="{{item.link&&item.link.link&&item.link.link=='/shopCart/shoppingCart'&&cartNum>0}}">
...
...
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