pref:移除多余代码
This commit is contained in:
@@ -44,7 +44,6 @@ export default {
|
||||
...config.app.window,
|
||||
},
|
||||
tabBar: {
|
||||
custom: true,
|
||||
list: [
|
||||
{pagePath: "pages/tabs/home", text: "首页"},
|
||||
{pagePath: "pages/tabs/mine", text: "我的"}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import React from "react";
|
||||
import less from './index.module.less';
|
||||
import Taro from "@tarojs/taro";
|
||||
import Flex from "@/components/Flex";
|
||||
import config from "@/config/config";
|
||||
import GcImage from "@/components/GcImage";
|
||||
|
||||
const CustomTabBar = ({tabIdx = 1}) => {
|
||||
|
||||
///////////////////////////////////////// 逻辑方法
|
||||
|
||||
/**
|
||||
* 切换tab
|
||||
* @param idx
|
||||
*/
|
||||
const switchTab = (idx) => {
|
||||
Taro.switchTab({url: config.app.tabbar.list[idx].url}).then(res => {
|
||||
|
||||
})
|
||||
};
|
||||
|
||||
///////////////////////////////////////// 页面渲染
|
||||
|
||||
return <Flex className={less.tabbar} style={{backgroundColor: config.app.tabbar?.bgColor || "blank"}}>
|
||||
{config.app.tabbar?.list?.map((item, idx) => {
|
||||
return <Flex
|
||||
direction={'column'} itemGrow={1} className={less.tab} key={item.id}
|
||||
justify={'center'} alignItems={'center'}
|
||||
onClick={() => switchTab(idx)}
|
||||
>
|
||||
<GcImage className={less.icn} src={tabIdx == item.id ? item.selectedIcon : item.icon}/>
|
||||
<Flex
|
||||
className={less.dot} style={{color: tabIdx == item.id ? item.selectedColor : item.color}}
|
||||
>{item.title}</Flex>
|
||||
</Flex>
|
||||
})}
|
||||
</Flex>
|
||||
};
|
||||
|
||||
export default CustomTabBar;
|
||||
@@ -1,31 +0,0 @@
|
||||
@import 'build_config/xihu/assets/less/constant.less';
|
||||
|
||||
.tabbar {
|
||||
width: 100vw;
|
||||
color: white;
|
||||
height: calc(130px + env(safe-area-inset-bottom));
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 100;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
|
||||
.tab {
|
||||
width: 0;
|
||||
padding: 24px;
|
||||
|
||||
.icn {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
.dot {
|
||||
margin-top: 4px;
|
||||
border-radius: 10px;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {View} from "@tarojs/components";
|
||||
Taro.options.html.transformElement = (el) => {
|
||||
|
||||
if (el.nodeName === "image") {
|
||||
const path = HttpUtils.imageUrl(el.props.src);
|
||||
const path = HttpUtils.getImageUrl(el.props.src);
|
||||
el.setAttribute("src", path);
|
||||
el.setAttribute("mode", "widthFix");
|
||||
}
|
||||
|
||||
@@ -2,5 +2,4 @@ export default {
|
||||
navigationBarTitleText: '',
|
||||
enablePullDownRefresh: true,
|
||||
enableShareAppMessage: true,
|
||||
navigationStyle: "custom",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user