From 5f2a66b04f9d6babf38d14c93924fdfe0582a8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com> Date: Mon, 28 Dec 2020 15:27:42 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E6=96=B0=E5=A2=9E=E5=8A=A8?= =?UTF-8?q?=E6=80=81tabBar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/interfaces/public.js | 4 ++- app.js | 26 +++++++++++++++ app.json | 32 +++++++++++++++++++ custom-tab-bar/index.js | 43 +++++++++++++++++++++++++ custom-tab-bar/index.json | 3 ++ custom-tab-bar/index.wxml | 9 ++++++ custom-tab-bar/index.wxss | 44 ++++++++++++++++++++++++++ static/tabbar/tabbar_icon_00.png | Bin 0 -> 415 bytes static/tabbar/tabbar_icon_01.png | Bin 0 -> 791 bytes static/tabbar/tabbar_icon_02.png | Bin 0 -> 679 bytes static/tabbar/tabbar_icon_03.png | Bin 0 -> 856 bytes static/tabbar/tabbar_icon_show_00.png | Bin 0 -> 423 bytes static/tabbar/tabbar_icon_show_01.png | Bin 0 -> 750 bytes static/tabbar/tabbar_icon_show_02.png | Bin 0 -> 672 bytes static/tabbar/tabbar_icon_show_03.png | Bin 0 -> 879 bytes 15 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 custom-tab-bar/index.js create mode 100644 custom-tab-bar/index.json create mode 100644 custom-tab-bar/index.wxml create mode 100644 custom-tab-bar/index.wxss create mode 100644 static/tabbar/tabbar_icon_00.png create mode 100644 static/tabbar/tabbar_icon_01.png create mode 100644 static/tabbar/tabbar_icon_02.png create mode 100644 static/tabbar/tabbar_icon_03.png create mode 100644 static/tabbar/tabbar_icon_show_00.png create mode 100644 static/tabbar/tabbar_icon_show_01.png create mode 100644 static/tabbar/tabbar_icon_show_02.png create mode 100644 static/tabbar/tabbar_icon_show_03.png 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 0000000000000000000000000000000000000000..fc32af06288631b3deb9284936683ed0675e3f67 GIT binary patch literal 415 zcmeAS@N?(olHy`uVBq!ia0vp^fgsGm3?%0U?qUH_P60k4u0Yz?FTgh-$k#v6*AIyN zqN8K{fNcK&AKw5Upoo7UkOAa^l==AskzW8rWuTvb08nK~=#+0jQ$$OG{DK*t9Cj~D z%6zv%-{$77FgdO%A}#Z@Ix3?ifC|2Qx;TbJ9DaNKG+(oVfJ5MtfP%L68=wB~zvUXf zOjN?);pr$!KEBhBs$QP$t?;BTCb#p8my(>G z-+T9-oRf*WU$_JpEYpx)-hFhk%Z2ane_l{!%l;I%Vnx#5-E1X-MH|^;zoZ5(<6dKU zY7s~5`>Ol1OWxPrIccwNY;3QDM_vRR{9o1V*W*77}FY@@jtl;3x#EGtAktrKL$60LeUNNg`PEqpq_U>KmM<&hK;2g3@ vM8YUzvBqQ%mgyQ=t))s8=eYZRua5iI+->!w@#+&`5HNVU`njxgN@xNAukfi% literal 0 HcmV?d00001 diff --git a/static/tabbar/tabbar_icon_01.png b/static/tabbar/tabbar_icon_01.png new file mode 100644 index 0000000000000000000000000000000000000000..416bb50ba87e73246c960c6717cdac7e5efa2c28 GIT binary patch literal 791 zcmeAS@N?(olHy`uVBq!ia0vp^fgsGm3?%0U?qUH_9sxcfu0Yz)Kag^?x8}-TpjqN2 zL4Lsu(-K;oG)`^jTPw5J*sr9w=HR6q>$|V63u{y`FfgTix;TbJ9DW;dbJA@E0TXkM zmUmD8|2H`))h!{hr9mrnWs!YT=GlwIQ{?4qKHNVTad!W{KGxhfd{&t|xdXP$E+`ZH za_^}7RBuNsj*X|8z6vl++0DJt}N-7ypay^_zWWDp$B^M56Py=TmdJ7BhuhSWpzq z@&7?;s7k{jd+|5o+i$OUC2{j@VU10^EbGd=sXdDp9N!j~cyQKD>Fl(I*H%8W)wYLo zeVMl~S8a)KRn|=IgELfC9A-nQXV2$nj=kSJ;l9Df^ny74x7r8pdbbuZ z9CLGeqR_EVH?@>ee|4_#<45Y>n$O+uj1x&)es_~oTSVdW9UGpk-L%wy{mR&yo_(jZ zD^=4kO

EuJzfYvvwT6-_pPO>Gs&aUKdXZIbL5hOYsozD*hYCHccrLKM;PS<>7JF z61ABUKY!o#i`ggY=fK&>+7vOVVv1>@l%%SvvTMa$lbmU%0&Tz{NDTa-0 zubycbADj8`qPPre&XtB`$Cd~Lggh3S@K{QI`K<*Dg=z#DcB`C}ke_!traC6{#gu~i z0XGe@7JQvjK25pUeN&>leGJDl6QygdN1CR5IHz>JTI{^c9NsF0DbtM`g?rX&{4{Bc z?ps|xN%i&QnbYjcJH*`U=Lv0bZ9@dzq;~;S2zFLM|M=%pRs(s<@sxN>2xO! gvwnWNAIE>Nmdmv~HTw|54NR2`p00i_>zopr0HH2myZ`_I literal 0 HcmV?d00001 diff --git a/static/tabbar/tabbar_icon_02.png b/static/tabbar/tabbar_icon_02.png new file mode 100644 index 0000000000000000000000000000000000000000..89d01a36c31b97e56579b55efaabce3a9a986248 GIT binary patch literal 679 zcmeAS@N?(olHy`uVBq!ia0vp^fgsGm3?%0U?qUH_u>n3Iu0Yz?H^A55-_JkL*DnBq zfNTiY2PhE`+27d^$!552g^d$`}u(wK0bbaegQGDaavm1YU=7h1rd?aS=y4v zffmS?1o;Isq{jYOck^(y!;9%sf(2)F10R3r+u7{7SjBWgoUhrZ%WD}J81HzxIEF+V zetYBgq}c{M3;{p86eXA$owi;5_dmTXz3Z;ZYsTnv-szV4iEKZW5=9=ASna)g^h^-H z*XdI+_k`95NoYjNP1dft^fh3~)E{SKwj}imnlG3v@s%+|^jPgbCMop`tG7A2Hz)E@``9{!Vz!n$1h)rFhd;a2$Wr`0vLW!56)|HrgCA z>*xJ4YhP#e^D~zgUSG29l(M%?m-}?HqrWy>tBBecZg1qhp7ZK59-D&;FE}jrl$`$5 zCMxuh*)_ej@;)cF@%`sFnx>oB-j$Pl^T$?sQ}snw%K!QWr>?&_=X$$c-ZR(vS3__A zT^6R$XRMONvS`Ov_V|-(ClzN-ot*oyJ6&fi#^`!rx>)UPcE1>Zb0JFb3NF*fjtv1d>wXs`Sfv`wNtgAy{2={*PrL8Ckm7r%ugw>U zT{!E=$%s|GQm$;5dlR(IA3oLIK40U~y~!G2350lejj}G_s3C&lN&?MbvS-Fa-!wa9<6(Fp%K%pr7SiT1zmU{ETlKl_Y4c? z+XDqkrjG*IlUhVHMD0$0`k41Hz`NgT!U-M8x6>55GM?$Kn&@^_`|wu7MYAlj^5(qG zU2z~mopCnPE2p#Qt|XxeB7f6*AGqK^Mw6m{JN5ECzp?<>w#&S!PC{xWt~$(695&Xhxz~j literal 0 HcmV?d00001 diff --git a/static/tabbar/tabbar_icon_show_00.png b/static/tabbar/tabbar_icon_show_00.png new file mode 100644 index 0000000000000000000000000000000000000000..64cdf86c9d07e004fa0bc9f78752fa90d6e3a857 GIT binary patch literal 423 zcmeAS@N?(olHy`uVBq!ia0vp^fgsGm3?%0U?qUH_P60k4u0Wcb!I2U)Yt998pedpy zL4LsuPfsa2)JFREa(}ooW4A_;MXLUCu}j}wSb+-ud%8G=L>zv56{GgaqZgirY<2_6yYWTUMN2JF`=OJ2L4wL5!mPlLpq^Z&fx&Jmd&zqyZHVCM6U zOcS>o%XRG8yYFm=>7n_{>Z|OR{hlHb_BZ*;(>edo)tt6_c&%pdtQqE%J?LpqkVmv_;z4W OFnGH9xvX3-pq0c9hqioqFfoD?14W1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