Commit 10898caf by 程默

fix footer

parent 8c0359f5
......@@ -12,70 +12,54 @@ Component({
selectedColor: "#3cc51f",
list: [
],
mm: false,
mid: '',
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,
mm: mm
mid: 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&&params.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);
}
}
......
......@@ -7,16 +7,15 @@
<view
wx:for="{{list}}"
wx:if="{{item.show}}"
wx:key="index"
class="tab-bar-item {{(mmm==index&&componentData['styleSelectionNum']==1)?'isItem':''}}"
wx:key="index"
class="tab-bar-item {{(mid==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}}">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment