[更新]更新动态tabBar
This commit is contained in:
27
app.js
27
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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
4
app.json
4
app.json
@@ -26,8 +26,8 @@
|
||||
"tabBar": {
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/mall/index",
|
||||
"text": "首页",
|
||||
"pagePath": "pages/shortVideo/index",
|
||||
"text": "视频",
|
||||
"iconPath": "/static/tabbar/tabbar_icon_00.png",
|
||||
"selectedIconPath": "/static/tabbar/tabbar_icon_show_00.png"
|
||||
},
|
||||
|
||||
4
app.wxss
4
app.wxss
@@ -10,6 +10,10 @@
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.tabBar{
|
||||
margin-bottom: calc(48px + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
/*
|
||||
* 文字截取
|
||||
*/
|
||||
|
||||
@@ -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)
|
||||
// })
|
||||
// }
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
46
lib/tabBarData.js
Normal file
46
lib/tabBarData.js
Normal file
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user