From c7f6c43f46cff7d06029868c745951cde0ea4905 Mon Sep 17 00:00:00 2001 From: dong_bo0602 <358256383@qq.com> Date: Thu, 9 Jun 2022 15:40:43 +0800 Subject: [PATCH] 0609 --- pages/index/index.js | 9 ++++-- pages/neighbor/circle/circleDetail.wxml | 10 +++++-- pages/neighbor/circle/circleDetail.wxss | 29 +++++++++++++++++-- pages/neighbor/circle/new.wxml | 4 +-- pages/neighbor/help/helpDetail.wxml | 13 +++++++-- pages/neighbor/help/helpDetail.wxss | 29 +++++++++++++++++-- pages/neighbor/help/helpList.js | 6 +++- pages/neighbor/help/helpList.wxml | 10 +++++-- pages/neighbor/help/helpList.wxss | 27 +++++++++++++++++- pages/neighbor/help/new.js | 7 +++++ pages/neighbor/help/new.wxml | 4 +-- pages/neighbor/neighbor.js | 13 ++++++--- pages/neighbor/neighbor.wxml | 21 +++++++++++--- pages/neighbor/neighbor.wxss | 38 +++++++++++++++++++++++-- pages/news/newsList.js | 4 +++ pages/talk/newTalk.wxml | 8 ++++-- pages/talk/newTalk.wxss | 15 ++++++++-- pages/talk/talk.js | 6 ++++ pages/talk/talk.wxml | 10 +++++-- pages/talk/talk.wxss | 23 +++++++++++++-- pages/talk/talkDetail.wxml | 7 +++-- pages/talk/talkDetail.wxss | 30 +++++++++++++++---- 22 files changed, 277 insertions(+), 46 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index e44a302..276a407 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -10,7 +10,8 @@ Page({ page: 1, rows: 5, newsTypeId: '52baf515-304c-46f2-911a-355d889346f2', - showArea: '6dcbb862-4b48-4dca-aee1-d78fd76adc05' + showArea: '6dcbb862-4b48-4dca-aee1-d78fd76adc05', + areaCode: '' }, noticeList: [], serviceUrl: app.baseUrls.serviceUrl, @@ -273,7 +274,7 @@ Page({ */ onLoad: function (options) { // this.doLogin() - this.getNotice() + this.checkPermission() wx.setStorage({ data: '1', @@ -304,8 +305,10 @@ Page({ this.setData({ curCommunityName: wx.getStorageSync('curCommunityName') ? wx.getStorageSync('curCommunityName'): '切换社区', curCommunityId: wx.getStorageSync('curCommunityId') ? wx.getStorageSync('curCommunityId') : '', - curCommunity: wx.getStorageSync('curCommunityName') + curCommunity: wx.getStorageSync('curCommunityName'), + ['page.areaCode']: wx.getStorageSync('areaCode') ? wx.getStorageSync('areaCode') : '' }) + this.getNotice() }, /** diff --git a/pages/neighbor/circle/circleDetail.wxml b/pages/neighbor/circle/circleDetail.wxml index bb1cebc..c11d819 100644 --- a/pages/neighbor/circle/circleDetail.wxml +++ b/pages/neighbor/circle/circleDetail.wxml @@ -18,8 +18,14 @@ {{circleDetail.problemTypeName}} - - + + + + + + + + diff --git a/pages/neighbor/circle/circleDetail.wxss b/pages/neighbor/circle/circleDetail.wxss index fada20b..7d48ca9 100644 --- a/pages/neighbor/circle/circleDetail.wxss +++ b/pages/neighbor/circle/circleDetail.wxss @@ -96,16 +96,41 @@ .photo-box{ display: inline-block; width: 32%; - height: 150rpx; + height: 180rpx; margin-right: 2%; margin-bottom: 15rpx; text-align: center; + position: relative; + overflow: hidden; } .photo-box:nth-child(3n){ margin-right: 0; } -.photo-box image{ +/* .photo-box image{ height: 100%; +} */ +.photo-one{ + width: 50%; + height: auto; + max-height: 600rpx; +} +.photo-one image{ + max-width: 100%; +} +.photo-four image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} +.photo-four:nth-child(3){ + margin-right: 2%; +} +.photo-more image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); } .reply-row{ line-height: 60rpx; diff --git a/pages/neighbor/circle/new.wxml b/pages/neighbor/circle/new.wxml index ad05649..399c14c 100644 --- a/pages/neighbor/circle/new.wxml +++ b/pages/neighbor/circle/new.wxml @@ -11,7 +11,7 @@ 邻里圈 - + @@ -23,7 +23,7 @@ - + diff --git a/pages/neighbor/help/helpDetail.wxml b/pages/neighbor/help/helpDetail.wxml index e2dbeb7..be54065 100644 --- a/pages/neighbor/help/helpDetail.wxml +++ b/pages/neighbor/help/helpDetail.wxml @@ -17,9 +17,18 @@ {{helpDetail.problemTypeName}} - - + + + + + + + + + diff --git a/pages/neighbor/help/helpDetail.wxss b/pages/neighbor/help/helpDetail.wxss index 1903b7a..7f4fea3 100644 --- a/pages/neighbor/help/helpDetail.wxss +++ b/pages/neighbor/help/helpDetail.wxss @@ -95,16 +95,41 @@ .photo-box{ display: inline-block; width: 32%; - height: 150rpx; + height: 180rpx; margin-right: 2%; margin-bottom: 15rpx; text-align: center; + position: relative; + overflow: hidden; } .photo-box:nth-child(3n){ margin-right: 0; } -.photo-box image{ +/* .photo-box image{ height: 100%; +} */ +.photo-one{ + width: 50%; + height: auto; + max-height: 600rpx; +} +.photo-one image{ + max-width: 100%; +} +.photo-four image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} +.photo-four:nth-child(3){ + margin-right: 2%; +} +.photo-more image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); } .reply-row{ line-height: 60rpx; diff --git a/pages/neighbor/help/helpList.js b/pages/neighbor/help/helpList.js index d739b4b..2d5fcef 100644 --- a/pages/neighbor/help/helpList.js +++ b/pages/neighbor/help/helpList.js @@ -10,7 +10,8 @@ Page({ helpList: [], page: { page: 1, - rows: 10 + rows: 10, + communityId: '' }, haveMore: true, serviceUrl: app.baseUrls.serviceUrl, @@ -77,6 +78,9 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { + this.setData({ + ['page.communityId']: options.communityId + }) this.getHelpList() }, diff --git a/pages/neighbor/help/helpList.wxml b/pages/neighbor/help/helpList.wxml index 7a8c180..d66c526 100644 --- a/pages/neighbor/help/helpList.wxml +++ b/pages/neighbor/help/helpList.wxml @@ -11,8 +11,14 @@ {{item.content}} - - + + + + + + + + diff --git a/pages/neighbor/help/helpList.wxss b/pages/neighbor/help/helpList.wxss index 0dcb400..4bd842f 100644 --- a/pages/neighbor/help/helpList.wxss +++ b/pages/neighbor/help/helpList.wxss @@ -54,12 +54,37 @@ page{ margin-right: 2%; margin-bottom: 20rpx; text-align: center; + position: relative; + overflow: hidden; } .help-photo-box:nth-child(3n){ margin-right: 0; } -.help-photo-box image{ +/* .help-photo-box image{ height: 100%; +} */ +.photo-one{ + width: 50%; + height: auto; + max-height: 600rpx; +} +.photo-one image{ + max-width: 100%; +} +.photo-four image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} +.photo-four:nth-child(3){ + margin-right: 2%; +} +.photo-more image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); } .help-video{ margin-top: 20rpx; diff --git a/pages/neighbor/help/new.js b/pages/neighbor/help/new.js index e62932b..f7cdc50 100644 --- a/pages/neighbor/help/new.js +++ b/pages/neighbor/help/new.js @@ -58,6 +58,13 @@ Page({ submitHelp: function () { var self = this if (!self.data.isLoading) { + if (self.data.index == 0) { + wx.showToast({ + title: '请选择发布类型', + icon: 'error' + }) + return + } var photo = '' if (self.data.imageList.length > 0) { for (let i = 0; i < self.data.imageList.length; i++) { diff --git a/pages/neighbor/help/new.wxml b/pages/neighbor/help/new.wxml index e176bfd..f5ce61f 100644 --- a/pages/neighbor/help/new.wxml +++ b/pages/neighbor/help/new.wxml @@ -11,7 +11,7 @@ 问题描述 - + @@ -23,7 +23,7 @@ - + diff --git a/pages/neighbor/neighbor.js b/pages/neighbor/neighbor.js index 1f0bff1..22ba54d 100644 --- a/pages/neighbor/neighbor.js +++ b/pages/neighbor/neighbor.js @@ -26,9 +26,10 @@ Page({ }, // 邻里互助查看更多 checkHelpMore: function () { + var self = this if (this.data.tab == '1') { wx.navigateTo({ - url: './help/helpList', + url: './help/helpList?communityId=' + self.data.communitySelected, }) } else { wx.navigateTo({ @@ -52,6 +53,10 @@ Page({ ['page.communityId']: self.data.communityList[e.detail.value].communityId, areaCode: self.data.communityList[e.detail.value].areaCode, }) + wx.setStorage({ + data: e.detail.value, + key: 'communityIndex' + }) if (this.data.tab == '1') { self.getHelpList() } else { @@ -135,9 +140,9 @@ Page({ self.setData({ communityList: data, array: arr, - communitySelected: data[0].communityId, - ['page.communityId']: data[0].communityId, - areaCode: data[0].areaCode + communitySelected: wx.getStorageSync('communityIndex') ? data[wx.getStorageSync('communityIndex')].communityId : data[0].communityId, + ['page.communityId']: wx.getStorageSync('communityIndex') ? data[wx.getStorageSync('communityIndex')].communityId : data[0].communityId, + areaCode: wx.getStorageSync('communityIndex') ? data[wx.getStorageSync('communityIndex')].areaCode : data[0].areaCode, }) if (self.data.tab == '1') { self.getHelpList() diff --git a/pages/neighbor/neighbor.wxml b/pages/neighbor/neighbor.wxml index 4de74e4..8a3c659 100644 --- a/pages/neighbor/neighbor.wxml +++ b/pages/neighbor/neighbor.wxml @@ -6,6 +6,7 @@ {{array[index]}} + @@ -34,8 +35,14 @@ {{item.content}} - - + + + + + + + + @@ -54,8 +61,14 @@ {{item.content}} - - + + + + + + + + diff --git a/pages/neighbor/neighbor.wxss b/pages/neighbor/neighbor.wxss index a4c5da1..d1bf9b7 100644 --- a/pages/neighbor/neighbor.wxss +++ b/pages/neighbor/neighbor.wxss @@ -118,21 +118,47 @@ .help-photo-box{ display: inline-block; width: 32%; - height: 150rpx; + height: 180rpx; margin-right: 2%; margin-bottom: 20rpx; text-align: center; + position: relative; + overflow: hidden; } .help-photo-box:nth-child(3n){ margin-right: 0; } -.help-photo-box image{ +/* .help-photo-box image{ height: 100%; +} */ +.photo-one{ + width: 50%; + height: auto; + max-height: 600rpx; +} +.photo-one image{ + max-width: 100%; +} +.photo-four image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} +.photo-four:nth-child(3){ + margin-right: 2%; +} +.photo-more image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); } .help-video{ margin-top: 20rpx; + width: 65%; } -.help-video, .help-video video{ +.help-video video{ width: 100%; } .help-more{ @@ -149,3 +175,9 @@ .neighbor-tab{ margin-bottom: 30rpx; } +.picker image{ + width: 28rpx; + height: 28rpx; + vertical-align: middle; + margin-top: -10rpx; +} \ No newline at end of file diff --git a/pages/news/newsList.js b/pages/news/newsList.js index a5fc6a6..9761e23 100644 --- a/pages/news/newsList.js +++ b/pages/news/newsList.js @@ -14,6 +14,7 @@ Page({ page: 1, rows: 10, newsTypeId: '', + areaCode: '' }, newsList: [], serviceUrl: app.baseUrls.serviceUrl, @@ -101,6 +102,9 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { + this.setData({ + ['page.areaCode']: wx.getStorageSync('areaCode') ? wx.getStorageSync('areaCode') : '' + }) this.getNewsType() }, diff --git a/pages/talk/newTalk.wxml b/pages/talk/newTalk.wxml index b4d5b5f..27514d1 100644 --- a/pages/talk/newTalk.wxml +++ b/pages/talk/newTalk.wxml @@ -2,17 +2,19 @@ - + 上传图片({{imageList.length}}/9) - + + + + - + 上传视频 diff --git a/pages/talk/newTalk.wxss b/pages/talk/newTalk.wxss index 29d491f..57b43f9 100644 --- a/pages/talk/newTalk.wxss +++ b/pages/talk/newTalk.wxss @@ -40,8 +40,19 @@ .upload-img:nth-child(3n), .add{ margin-right: 0; } -.upload-img image{ - height: 100%; +.upload-img .upload-photo{ + width: 100%; + height: auto; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} +.upload-img-box{ + position: relative; + width: 100%; + height: 150rpx; + overflow: hidden; } .add{ font-size: 60rpx; diff --git a/pages/talk/talk.js b/pages/talk/talk.js index a39023a..28218f1 100644 --- a/pages/talk/talk.js +++ b/pages/talk/talk.js @@ -48,6 +48,12 @@ Page({ title: '暂无更多', icon: 'none' }) + if (self.data.page.page > 1) { + self.setData({ + ['page.page']: self.data.page.page - 1 + }) + } + } }, function (code, data) { diff --git a/pages/talk/talk.wxml b/pages/talk/talk.wxml index 302e476..37a8f18 100644 --- a/pages/talk/talk.wxml +++ b/pages/talk/talk.wxml @@ -17,8 +17,14 @@ {{item.content}} - - + + + + + + + + diff --git a/pages/talk/talk.wxss b/pages/talk/talk.wxss index 9cf0e3a..1600166 100644 --- a/pages/talk/talk.wxss +++ b/pages/talk/talk.wxss @@ -49,11 +49,12 @@ } .photo-box{ width: 32%; - height: 150rpx; + height: 180rpx; overflow: hidden; display: inline-block; margin-right: 2%; text-align: center; + position: relative; } .photo-box:nth-child(3n){ margin-right: 0; @@ -86,7 +87,7 @@ background-color: #f55054; } .video-box{ - width: 100%; + width: 65%; height: auto !important; } .video-box video{ @@ -99,3 +100,21 @@ .no-data image{ width: 300rpx; } +.photo-one{ + width: 50%; + height: auto; +} +.photo-one image{ + max-width: 100%; +} +.photo-more image, .photo-four image{ + width: 100%; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + height: auto; +} +.photo-four:nth-child(3){ + margin-right: 2%; +} \ No newline at end of file diff --git a/pages/talk/talkDetail.wxml b/pages/talk/talkDetail.wxml index 5a05bb2..c6fd94d 100644 --- a/pages/talk/talkDetail.wxml +++ b/pages/talk/talkDetail.wxml @@ -16,8 +16,11 @@ {{talkDetail.content}} - - + + + + + diff --git a/pages/talk/talkDetail.wxss b/pages/talk/talkDetail.wxss index aa32746..62299ac 100644 --- a/pages/talk/talkDetail.wxss +++ b/pages/talk/talkDetail.wxss @@ -15,6 +15,7 @@ width: 80rpx; height: 80rpx; margin-right: 20rpx; + border-radius: 50%; } .good image{ width: 40rpx; @@ -61,12 +62,18 @@ display: inline-block; margin-right: 2%; text-align: center; + position: relative; } .photo-box:nth-child(3n){ margin-right: 0; } -.photo-box image{ - height: 100%; +.photo-more image{ + width: 100%; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + height: auto; } .click-good{ padding: 20rpx; @@ -118,7 +125,7 @@ padding: 0 20rpx; } .video-box{ - width: 100%; + width: 65%; height: auto !important; } .video-box video{ @@ -133,5 +140,18 @@ .reply-row text{ font-weight: bold; } - - +.photo-one{ + width: 50%; + height: auto; +} +.photo-one image{ + max-width: 100%; +} +.photo-more image{ + width: 100%; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + height: auto; +} \ No newline at end of file