[更新]更新动态tabBar
This commit is contained in:
27
app.js
27
app.js
@@ -6,7 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import apis from "./apis/index"
|
import apis from "./apis/index"
|
||||||
|
|
||||||
const QQMapWX = require("./lib/qqmap-wx-jssdk.min.js");
|
const QQMapWX = require("./lib/qqmap-wx-jssdk.min.js");
|
||||||
|
|
||||||
App({
|
App({
|
||||||
@@ -18,13 +17,6 @@ App({
|
|||||||
|
|
||||||
//挂载api方法
|
//挂载api方法
|
||||||
wx.$api = apis
|
wx.$api = apis
|
||||||
|
|
||||||
//获取模版信息
|
|
||||||
apis.publics.storeConfig({
|
|
||||||
company_id: "17"
|
|
||||||
}).then(res=>{
|
|
||||||
console.log(res)
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
globalData: {
|
globalData: {
|
||||||
navAppInfo : {
|
navAppInfo : {
|
||||||
@@ -32,25 +24,6 @@ App({
|
|||||||
envVersion : "trial",
|
envVersion : "trial",
|
||||||
goodUrl : "/pages/goods/show?goodsId=",
|
goodUrl : "/pages/goods/show?goodsId=",
|
||||||
cardUrl : "/pages/card/index?cardid="
|
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": {
|
"tabBar": {
|
||||||
"list": [
|
"list": [
|
||||||
{
|
{
|
||||||
"pagePath": "pages/mall/index",
|
"pagePath": "pages/shortVideo/index",
|
||||||
"text": "首页",
|
"text": "视频",
|
||||||
"iconPath": "/static/tabbar/tabbar_icon_00.png",
|
"iconPath": "/static/tabbar/tabbar_icon_00.png",
|
||||||
"selectedIconPath": "/static/tabbar/tabbar_icon_show_00.png"
|
"selectedIconPath": "/static/tabbar/tabbar_icon_show_00.png"
|
||||||
},
|
},
|
||||||
|
|||||||
4
app.wxss
4
app.wxss
@@ -10,6 +10,10 @@
|
|||||||
font-size: 30rpx;
|
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({
|
Component({
|
||||||
/**
|
/**
|
||||||
* 组件的初始数据
|
* 组件的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
selected : getApp().globalData.storeModule.selected,
|
selected : 0,
|
||||||
color : getApp().globalData.storeModule.color,
|
color : "#4e4f51",
|
||||||
selectedColor: getApp().globalData.storeModule.selectedColor,
|
selectedColor: "#0b0041",
|
||||||
list : getApp().globalData.storeModule.list
|
list : [video, mall, ticket, user]
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数
|
* 生命周期函数
|
||||||
*/
|
*/
|
||||||
pageLifetimes: {
|
lifetimes:{
|
||||||
show(){
|
// attached: ()=>{
|
||||||
console.log("获取配置信息")
|
// //获取模版信息
|
||||||
}
|
// 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