支付寶小程程底部tabBar定義方法
"tabBar": {
"textColor": "#515151",
"selectedColor": "#d81e06",
"backgroundColor": "#F5F5F9",
"items": [
{
"pagePath": "sdt_company/index/index",
"icon": "sdt_company/images/tabbar/icon_17.png",
"activeIcon": "sdt_company/images/tabbar/icon_13.png",
"name": "首頁"
},
{
"pagePath": "sdt_company/group/index",
"icon": "sdt_company/images/tabbar/icon_7.png",
"activeIcon": "sdt_company/images/tabbar/icon_3.png",
"name": "商品分類"
},
{
"pagePath": "sdt_company/cart/index",
"icon": "sdt_company/images/tabbar/icon_43.png",
"activeIcon": "sdt_company/images/tabbar/icon_39.png",
"name": "購物車"
},
{
"pagePath": "sdt_company/user/index",
"icon": "sdt_company/images/tabbar/icon_29.png",
"activeIcon": "sdt_company/images/tabbar/icon_25.png",
"name": "我的"
}
]
},
"tabBar": {
"color": "#515151",
"selectedColor": "#d81e06",
"backgroundColor":"#fff",
"list": [
{
"pagePath": "sdt_company/index/index",
"iconPath": "sdt_company/images/tabbar/icon_17.png",
"selectedIconPath": "sdt_company/images/tabbar/icon_13.png",
"text": "首頁"
},
{
"pagePath": "sdt_company/group/index",
"iconPath": "sdt_company/images/tabbar/icon_7.png",
"selectedIconPath": "sdt_company/images/tabbar/icon_3.png",
"text": "商品分類"
},
{
"pagePath": "sdt_company/cart/index",
"iconPath": "sdt_company/images/tabbar/icon_43.png",
"selectedIconPath": "sdt_company/images/tabbar/icon_39.png",
"text": "購物車"
},
{
"pagePath": "sdt_company/user/index",
"iconPath": "sdt_company/images/tabbar/icon_29.png",
"selectedIconPath": "sdt_company/images/tabbar/icon_25.png",
"text": "我的"
}
]
},
從定義方法實現看出,tabBar健值支付寶“items”,微信是“list”, 還有
支付寶小程序每一個item鍵名:
"pagePath" "icon" "activeIcon" "name"
"pagePath" "iconPath" "selectedIconPath" "text"
,最後默認顏色支付寶為textColor,微信的是color
在處理方法式基本一樣,假如我們是三方代開放服務商,就需要在ext.json開啟"extEnable":true,這一項即可,這樣做出來的小程序在發佈上線的三方應用,就支持支付寶和微信所有商戶接入服務商的小程序產品上面(使接入的商戶都有我們給他們開發的獨立小程序產品在支付寶和微信兩大平臺上運行)。
閱讀更多 創業老男孩 的文章