diff --git a/app.js b/app.js index f50a7b2..8abc9c5 100644 --- a/app.js +++ b/app.js @@ -6,7 +6,6 @@ */ import apis from "./apis/index" - const QQMapWX = require("./lib/qqmap-wx-jssdk.min.js"); App({ @@ -18,13 +17,6 @@ App({ //挂载api方法 wx.$api = apis - - //获取模版信息 - apis.publics.storeConfig({ - company_id: "17" - }).then(res=>{ - console.log(res) - }) }, globalData: { navAppInfo : { @@ -32,25 +24,6 @@ App({ envVersion : "trial", goodUrl : "/pages/goods/show?goodsId=", cardUrl : "/pages/card/index?cardid=" - }, - storeModule: { - selected : 0, - color : "#4e4f51", - selectedColor: "#0b0041", - list : [ - { - "pagePath": "/pages/mall/index", - "text": "商城", - "iconPath": "/static/tabbar/tabbar_icon_01.png", - "selectedIconPath": "/static/tabbar/tabbar_icon_show_01.png" - }, - { - "pagePath": "/pages/user/index", - "text": "我的", - "iconPath": "/static/tabbar/tabbar_icon_03.png", - "selectedIconPath": "/static/tabbar/tabbar_icon_show_03.png" - } - ] } } }) diff --git a/app.json b/app.json index 3e2a3e9..def57a9 100644 --- a/app.json +++ b/app.json @@ -40,6 +40,38 @@ "pages/home/projectSuccess/projectSuccess", "pages/home/activeSuccess/activeSuccess" ], + "tabBar": { + "list": [ + { + "pagePath": "pages/shortVideo/index", + "text": "视频", + "iconPath": "/static/tabbar/tabbar_icon_00.png", + "selectedIconPath": "/static/tabbar/tabbar_icon_show_00.png" + }, + { + "pagePath": "pages/mall/index", + "text": "商城", + "iconPath": "/static/tabbar/tabbar_icon_01.png", + "selectedIconPath": "/static/tabbar/tabbar_icon_show_01.png" + }, + { + "pagePath": "pages/ticket/index", + "text": "优惠", + "iconPath": "/static/tabbar/tabbar_icon_02.png", + "selectedIconPath": "/static/tabbar/tabbar_icon_show_02.png" + }, + { + "pagePath": "pages/user/index", + "text": "我的", + "iconPath": "/static/tabbar/tabbar_icon_03.png", + "selectedIconPath": "/static/tabbar/tabbar_icon_show_03.png" + } + ], + "selectedColor": "#0b0041", + "color": "#4e4f51", + "borderStyle": "white", + "custom": true + }, "window": { "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#fff", diff --git a/app.wxss b/app.wxss index 5405ed2..44b0430 100644 --- a/app.wxss +++ b/app.wxss @@ -5,11 +5,15 @@ * 碌碌无为枉半生,一朝惊醒万事空。 */ - page{ +page{ background-color: #f8f8f8; font-size: 30rpx; } +.tabBar{ + margin-bottom: calc(48px + env(safe-area-inset-bottom)); +} + /* * 文字截取 */ diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index 0ebe6e5..fb5dfeb 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -5,24 +5,31 @@ * 碌碌无为枉半生,一朝惊醒万事空。 */ +import { mall, video, ticket, user} from "../lib/tabBarData" + Component({ /** * 组件的初始数据 */ data: { - selected : getApp().globalData.storeModule.selected, - color : getApp().globalData.storeModule.color, - selectedColor: getApp().globalData.storeModule.selectedColor, - list : getApp().globalData.storeModule.list + selected : 0, + color : "#4e4f51", + selectedColor: "#0b0041", + list : [video, mall, ticket, user] }, /** * 生命周期函数 */ - pageLifetimes: { - show(){ - console.log("获取配置信息") - } + lifetimes:{ + // attached: ()=>{ + // //获取模版信息 + // wx.$api.publics.storeConfig({ + // company_id: "17" + // }).then(res=>{ + // console.log(res) + // }) + // } }, /** diff --git a/lib/tabBarData.js b/lib/tabBarData.js new file mode 100644 index 0000000..750f2ce --- /dev/null +++ b/lib/tabBarData.js @@ -0,0 +1,46 @@ + +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + */ + +// 商城 +const mall = { + "pagePath": "pages/mall/index", + "text": "商城", + "iconPath": "/static/tabbar/tabbar_icon_01.png", + "selectedIconPath": "/static/tabbar/tabbar_icon_show_01.png" +} + +// 短视频 +const video = { + "pagePath": "pages/shortVideo/index", + "text": "首页", + "iconPath": "/static/tabbar/tabbar_icon_00.png", + "selectedIconPath": "/static/tabbar/tabbar_icon_show_00.png" +} + +// 优惠券 +const ticket = { + "pagePath": "pages/ticket/index", + "text": "优惠", + "iconPath": "/static/tabbar/tabbar_icon_02.png", + "selectedIconPath": "/static/tabbar/tabbar_icon_show_02.png" +} + +// 我的 +const user = { + "pagePath": "pages/user/index", + "text": "我的", + "iconPath": "/static/tabbar/tabbar_icon_03.png", + "selectedIconPath": "/static/tabbar/tabbar_icon_show_03.png" +} + +export { + mall, + video, + ticket, + user +} +