From 8d9027fa9e338206f98b957863cdf9509bb82e7c Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Fri, 15 Sep 2023 14:23:19 +0800 Subject: [PATCH] =?UTF-8?q?tabbar=E7=BB=84=E4=BB=B6,=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E6=BB=A1=E6=84=8F=E5=BA=A6=E8=87=AA=E6=9F=A5=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 -- app.js | 1 + components/custom-tab-bar/index.js | 50 ++++++++++++++++++ components/custom-tab-bar/index.json | 4 ++ components/custom-tab-bar/index.wxml | 17 ++++++ components/custom-tab-bar/index.wxss | 38 +++++++++++++ images/home/message.png | Bin 2421 -> 3323 bytes pages/index/index.json | 3 +- pages/index/index.wxml | 4 +- pages/mine/mine.json | 4 +- pages/mine/mine.wxml | 1 + pages/statistics/statistics.json | 4 +- pages/statistics/statistics.wxml | 5 +- pages/work/work.js | 14 ++++- pages/work/work.json | 5 +- pages/work/work.wxml | 5 +- pages/work/work.wxss | 3 +- project.private.config.json | 2 +- .../pages/synthesis/synthesis.js | 13 +++-- .../pages/synthesis/synthesis.wxml | 2 +- 20 files changed, 156 insertions(+), 23 deletions(-) create mode 100644 components/custom-tab-bar/index.js create mode 100644 components/custom-tab-bar/index.json create mode 100644 components/custom-tab-bar/index.wxml create mode 100644 components/custom-tab-bar/index.wxss diff --git a/README.md b/README.md index a47dc3c..f65b22e 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,6 @@ "iconPath": "images/home/information.png", "selectedIconPath": "images/home/informationSelected.png" }, - - wx.navigateTo({ - url: `/subpages/home/pages/webview/webview?url=${global.WEBROOT()}&token=${token}&deptName=${this.data.street}&gridId=${this.data.departmentId}` -}) 2a43afb52996723c6517edb048de6c79 小程序密钥 15554200534 diff --git a/app.js b/app.js index d68ced8..9830a9e 100644 --- a/app.js +++ b/app.js @@ -20,6 +20,7 @@ App({ this.globalData.deviceInfo.navigationHeight = menuButtonInfo.height + (menuButtonInfo.top - res.statusBarHeight) * 2 } }) + wx.hideTabBar() }, globalData: { userInfo: null, diff --git a/components/custom-tab-bar/index.js b/components/custom-tab-bar/index.js new file mode 100644 index 0000000..9a1cc36 --- /dev/null +++ b/components/custom-tab-bar/index.js @@ -0,0 +1,50 @@ +const app = getApp() +Component({ + data: { + selected: 0, + color: "#999", + selectedColor: "#3A80E7", + "list": [ + { + "pagePath": "/pages/index/index", + "text": "消息", + "iconPath": "/images/home/message.png", + "selectedIconPath": "/images/home/messageSelected.png" + }, + { + "pagePath": "/pages/work/work", + "text": "工作", + "iconPath": "/images/home/work.png", + "selectedIconPath": "/images/home/workSelected.png" + }, + { + "pagePath": "/pages/statistics/statistics", + "text": "统计", + "iconPath": "/images/home/information.png", + "selectedIconPath": "/images/home/informationSelected.png" + }, + { + "pagePath": "/pages/mine/mine", + "text": "我的", + "iconPath": "/images/home/mine.png", + "selectedIconPath": "/images/home/mineSelected.png" + } + ] + }, + attached() { + }, + ready: function() { + this.setData({ + selected: app.globalData.selected + }) + }, + methods: { + switchTab(e) { + console.log(e); + const data = e.currentTarget.dataset; + const url = data.path; + app.globalData.selected = data.index; + wx.switchTab({url}) + } + } +}) \ No newline at end of file diff --git a/components/custom-tab-bar/index.json b/components/custom-tab-bar/index.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/components/custom-tab-bar/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/custom-tab-bar/index.wxml b/components/custom-tab-bar/index.wxml new file mode 100644 index 0000000..560dfa5 --- /dev/null +++ b/components/custom-tab-bar/index.wxml @@ -0,0 +1,17 @@ + + + + + + + + + {{item.text}} + + + + \ No newline at end of file diff --git a/components/custom-tab-bar/index.wxss b/components/custom-tab-bar/index.wxss new file mode 100644 index 0000000..387a5c8 --- /dev/null +++ b/components/custom-tab-bar/index.wxss @@ -0,0 +1,38 @@ +.tab-bar { + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: auto; + background: white; + display: flex; + box-shadow: 0px 6rpx 18rpx 0px rgba(216,216,216,0.66); + } + .isIPhoneXRegexBottom { + padding-bottom: constant(safe-area-inset-bottom); /*兼容 IOS<11.2*/ + padding-bottom: env(safe-area-inset-bottom); /*兼容 IOS>11.2*/ + } + + .tab-bar-item { + flex: 1; + text-align: center; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + padding-top: 10rpx; + } + + .tab-bar-item image { + width: 54rpx; + height: 54rpx; + } + /* .tab-bar-item image.bigicon{ + width: 70rpx; + height: 70rpx; + } */ + .tab-bar-item view { + font-size: 22rpx; + color:#999999 + } + \ No newline at end of file diff --git a/images/home/message.png b/images/home/message.png index 2992d37b2ffbec4be5ef3fb2b07b1b603761652c..57a93ad0753c66c5a57d194b23d7b0feb1d6d77f 100644 GIT binary patch literal 3323 zcmaJ^dpwi-AD@L#PN`fwG^4qM8778`jbm6em)s7UZOt;IH zL7+`KG%sJk7w3i|F~d!W8yJ(QaF&D(0@)snVi8GU6aW%Jq0$(3(D$_>D1=6~gC0fV zOmQqUC6wlTf=%%}aoCG=B8+5Bh8{csv5i7W1i~o*5fT+nXK+wacF@0cQIh$_HXI81 z3j&1MLH}*a7v}*%Guadf(!|o3gs`xJ?6)>SSX!8xTN**kOcB;_Q!6;a+}IR>GPOh@ z_e1`^pps~8@-Y-1x{=aX zAP)Ecq2b~Gpg91Z@*ltdQ<&ow&7#2Z6b_TiCP@zNn9fEh77ER#5CJCJi^-&at)fRL z6JT;enJkEz#1cgRD2+j8@;C;65pXyZmcapt3=##4v4ct^OlUMR3T7@FN%*C|()&x!?BNc`lFxZjE zSaCL_kj>PGwrUD8+NrNLc&tFlf=T|L#O>y&lR!6ZXmh%dZW)c@AyXMD7# zuF;@ayv_uF(JfhSas%6hmicD?9%?Zo_DwKS-J_xL>uycW)t!pg*K=}mAcSBKX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L0xZvaSjq}r3eZYpq8#DL zYzx&S7Wf)?Ryu%F(kC*-fk{q03?#D-Bf?dwjIDHsnz7#r?jQcR4sl?+|H7SN8J|d= zR;itA3^CHBajWUCkIcagh0TfVbuuQqA{>|eMEeyqabUIg*Z}XbG5a!)8HBjn==DLH z0$$ja!@6eIa510W|2I>Nt7i|P_oXT5$B-We)_|FtL_;5YV(Q4Wnb}d%j0-jnp-&Ht118W_BtNp5OO69J zSA^#JJK^q7KQ2k{Xv|ct12z|sS^lmG_tvh*C8@Jtailn4aiUbmrX8@13+Xo zWwPd)&3u8arF*mnDPyFyr@6nYZMWxX)(si=a7QYTEZ39LocCaqua@svfjQa21bX#tV(rR1{@;iuphD)~NC6d-k&YPSGr4-pXU@3wTN6LQz^DRf328F$@00000NkvXXu0mjf4ZwGA diff --git a/pages/index/index.json b/pages/index/index.json index bd4e225..9e077c1 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -2,6 +2,7 @@ "navigationStyle": "custom", "usingComponents": { "load-more": "../../components/loadMore/loadMore", - "no-data": "../../components/noData/nodata" + "no-data": "../../components/noData/nodata", + "custom-tab-bar":"../../components/custom-tab-bar" } } \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 483a76f..665af4f 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -36,5 +36,5 @@ - - \ No newline at end of file + + \ No newline at end of file diff --git a/pages/mine/mine.json b/pages/mine/mine.json index 7af8b0a..c9cb9bb 100644 --- a/pages/mine/mine.json +++ b/pages/mine/mine.json @@ -1,4 +1,6 @@ { - "usingComponents": {}, + "usingComponents": { + "custom-tab-bar":"../../components/custom-tab-bar" + }, "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/mine/mine.wxml b/pages/mine/mine.wxml index 5fccd99..509ccb7 100644 --- a/pages/mine/mine.wxml +++ b/pages/mine/mine.wxml @@ -46,3 +46,4 @@ + diff --git a/pages/statistics/statistics.json b/pages/statistics/statistics.json index cf3facb..384c87d 100644 --- a/pages/statistics/statistics.json +++ b/pages/statistics/statistics.json @@ -1,4 +1,6 @@ { "navigationStyle": "custom", - "usingComponents": {} + "usingComponents": { + "custom-tab-bar":"../../components/custom-tab-bar" + } } \ No newline at end of file diff --git a/pages/statistics/statistics.wxml b/pages/statistics/statistics.wxml index a5f3769..b4b4896 100644 --- a/pages/statistics/statistics.wxml +++ b/pages/statistics/statistics.wxml @@ -2,6 +2,5 @@ {{agencyName}} - - - \ No newline at end of file + + \ No newline at end of file diff --git a/pages/work/work.js b/pages/work/work.js index 856e5ac..f1b8ea0 100644 --- a/pages/work/work.js +++ b/pages/work/work.js @@ -183,5 +183,17 @@ Page({ wx.navigateTo({ url: `/pages/webView/webView?url=${this.data.communitySelfInspTop.questionnaireUrl}`, }) - } + }, + handelClickCopy() { + wx.setClipboardData({ + data: this.data.communitySelfInspTop.questionnaireUrl, + success: function(res) { + wx.showToast({ + title: '已将链接复制至剪切板', + duration: 2000, + icon:'none' + }); + } + }); + } }) \ No newline at end of file diff --git a/pages/work/work.json b/pages/work/work.json index d7019f3..384c87d 100644 --- a/pages/work/work.json +++ b/pages/work/work.json @@ -1,3 +1,6 @@ { - "navigationStyle": "custom" + "navigationStyle": "custom", + "usingComponents": { + "custom-tab-bar":"../../components/custom-tab-bar" + } } \ No newline at end of file diff --git a/pages/work/work.wxml b/pages/work/work.wxml index 421bc23..0d43250 100644 --- a/pages/work/work.wxml +++ b/pages/work/work.wxml @@ -67,7 +67,7 @@ {{communitySelfInspTop.agencyName}}{{communitySelfInspTop.monthName}}月份满意度自查 已提交 {{communitySelfInspTop.personQty}} - 一键分享 查看统计 + 一键分享 查看统计 @@ -88,4 +88,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/pages/work/work.wxss b/pages/work/work.wxss index bacc582..93ceba7 100644 --- a/pages/work/work.wxss +++ b/pages/work/work.wxss @@ -197,13 +197,11 @@ page { text-align: left; } .body{ - height: auto; padding: 0 20rpx 20rpx; position: relative; top: -20rpx; box-sizing: border-box; overflow: hidden; - } .body .top{ width: 100%; @@ -330,6 +328,7 @@ page { border-radius: 20rpx; box-sizing: border-box; margin-top:20rpx ; + margin-bottom: 100rpx; padding: 0 30rpx 20rpx; } .body .bto .content{ diff --git a/project.private.config.json b/project.private.config.json index 0415066..2ef10ce 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -109,5 +109,5 @@ ] } }, - "libVersion": "2.27.3" + "libVersion": "2.28.1" } \ No newline at end of file diff --git a/subpages/communitySelfInsp/pages/synthesis/synthesis.js b/subpages/communitySelfInsp/pages/synthesis/synthesis.js index 0fd58b5..b0f2268 100644 --- a/subpages/communitySelfInsp/pages/synthesis/synthesis.js +++ b/subpages/communitySelfInsp/pages/synthesis/synthesis.js @@ -12,7 +12,8 @@ Page({ monthName:'',//月份 personQty:'',//提交人数 synthesisScore:'',//综合得分 - inspRecordId:''//自查表Id + inspRecordId:'',//自查表Id + fontSize:'' }, /** @@ -23,6 +24,7 @@ Page({ statusHeight: app.globalData.deviceInfo.statusHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight, }) + this.getSynthesis() }, @@ -40,7 +42,12 @@ Page({ agencyName:res.data.agencyName, inspRecordId:res.data.inspRecordId }) - + const textContent = res.data.agencyName; // 替换为你实际的内容 + if (textContent.length > 5) { // 选择一个合适的长度作为调整字体大小的标准 + this.setData({ + fontSize: '38rpx' // 选择一个适当的较小字体大小 + }); + } }).catch((err)=>{ console.log(err); }) @@ -105,5 +112,5 @@ Page({ wx.navigateBack({ delta: 1 }) - } + }, }) \ No newline at end of file diff --git a/subpages/communitySelfInsp/pages/synthesis/synthesis.wxml b/subpages/communitySelfInsp/pages/synthesis/synthesis.wxml index d528a38..e02650c 100644 --- a/subpages/communitySelfInsp/pages/synthesis/synthesis.wxml +++ b/subpages/communitySelfInsp/pages/synthesis/synthesis.wxml @@ -5,7 +5,7 @@ 社区满意度自查 - {{agencyName}}{{monthName}}月份满意度自查 + {{agencyName}}{{monthName}}月份满意度自查 进行中