diff --git a/apis/interfaces/public.js b/apis/interfaces/public.js index 2a2691a..4e6193e 100644 --- a/apis/interfaces/public.js +++ b/apis/interfaces/public.js @@ -6,8 +6,10 @@ import {req} from "../request" const richText = (key) => req({url: "single/" + key, data: {key: "string"}}) //富文本 const getStatus = (key) => req({url: "ajax/status/" + key}) //状态查询 +const storeConfig = (data) => req({url: "wechat/mini/myComponents", data: data}) //企业工具模块配置 export default({ richText, - getStatus + getStatus, + storeConfig }) diff --git a/app.js b/app.js index ab685c2..f50a7b2 100644 --- a/app.js +++ b/app.js @@ -18,6 +18,13 @@ App({ //挂载api方法 wx.$api = apis + + //获取模版信息 + apis.publics.storeConfig({ + company_id: "17" + }).then(res=>{ + console.log(res) + }) }, globalData: { navAppInfo : { @@ -25,6 +32,25 @@ 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 4c76a63..4924994 100644 --- a/app.json +++ b/app.json @@ -23,6 +23,38 @@ "pages/home/projectSuccess/projectSuccess", "pages/home/activeSuccess/activeSuccess" ], + "tabBar": { + "list": [ + { + "pagePath": "pages/mall/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/custom-tab-bar/index.js b/custom-tab-bar/index.js new file mode 100644 index 0000000..0ebe6e5 --- /dev/null +++ b/custom-tab-bar/index.js @@ -0,0 +1,43 @@ + +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + */ + +Component({ + /** + * 组件的初始数据 + */ + data: { + selected : getApp().globalData.storeModule.selected, + color : getApp().globalData.storeModule.color, + selectedColor: getApp().globalData.storeModule.selectedColor, + list : getApp().globalData.storeModule.list + }, + + /** + * 生命周期函数 + */ + pageLifetimes: { + show(){ + console.log("获取配置信息") + } + }, + + /** + * 组件的方法列表 + */ + methods: { + switchTab(e) { + const data = e.currentTarget.dataset + const url = data.path + wx.switchTab({ + url + }) + this.setData({ + selected: data.index + }) + } + } +}) \ No newline at end of file diff --git a/custom-tab-bar/index.json b/custom-tab-bar/index.json new file mode 100644 index 0000000..fba482a --- /dev/null +++ b/custom-tab-bar/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/custom-tab-bar/index.wxml b/custom-tab-bar/index.wxml new file mode 100644 index 0000000..e54d25a --- /dev/null +++ b/custom-tab-bar/index.wxml @@ -0,0 +1,9 @@ + + + + + + {{item.text}} + + diff --git a/custom-tab-bar/index.wxss b/custom-tab-bar/index.wxss new file mode 100644 index 0000000..fe6d9b7 --- /dev/null +++ b/custom-tab-bar/index.wxss @@ -0,0 +1,44 @@ + +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + */ + +.tab-bar { + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: 48px; + background: white; + display: flex; + padding-bottom: env(safe-area-inset-bottom); +} + +.tab-bar-border { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 1px; + transform: scaleY(0.5); +} + +.tab-bar-item { + flex: 1; + text-align: center; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} + +.tab-bar-item cover-image { + width: 24px; + height: 24px; +} + +.tab-bar-item cover-view { + font-size: 10px; +} diff --git a/static/tabbar/tabbar_icon_00.png b/static/tabbar/tabbar_icon_00.png new file mode 100644 index 0000000..fc32af0 Binary files /dev/null and b/static/tabbar/tabbar_icon_00.png differ diff --git a/static/tabbar/tabbar_icon_01.png b/static/tabbar/tabbar_icon_01.png new file mode 100644 index 0000000..416bb50 Binary files /dev/null and b/static/tabbar/tabbar_icon_01.png differ diff --git a/static/tabbar/tabbar_icon_02.png b/static/tabbar/tabbar_icon_02.png new file mode 100644 index 0000000..89d01a3 Binary files /dev/null and b/static/tabbar/tabbar_icon_02.png differ diff --git a/static/tabbar/tabbar_icon_03.png b/static/tabbar/tabbar_icon_03.png new file mode 100644 index 0000000..840eb03 Binary files /dev/null and b/static/tabbar/tabbar_icon_03.png differ diff --git a/static/tabbar/tabbar_icon_show_00.png b/static/tabbar/tabbar_icon_show_00.png new file mode 100644 index 0000000..64cdf86 Binary files /dev/null and b/static/tabbar/tabbar_icon_show_00.png differ diff --git a/static/tabbar/tabbar_icon_show_01.png b/static/tabbar/tabbar_icon_show_01.png new file mode 100644 index 0000000..1869c20 Binary files /dev/null and b/static/tabbar/tabbar_icon_show_01.png differ diff --git a/static/tabbar/tabbar_icon_show_02.png b/static/tabbar/tabbar_icon_show_02.png new file mode 100644 index 0000000..8479352 Binary files /dev/null and b/static/tabbar/tabbar_icon_show_02.png differ diff --git a/static/tabbar/tabbar_icon_show_03.png b/static/tabbar/tabbar_icon_show_03.png new file mode 100644 index 0000000..1fe9b5e Binary files /dev/null and b/static/tabbar/tabbar_icon_show_03.png differ