From 8b0f5636c964fecf3e44c71374e849163d05207c Mon Sep 17 00:00:00 2001 From: ZhaoTongYao <531131322@qq.com> Date: Tue, 17 Nov 2020 17:29:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=88=97=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=A0=B7=E5=BC=8F9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/newsList/newsList.wxss | 6 +- .../pages/moduleList/moduleList.js | 66 ++++++++++++++----- .../pages/moduleList/moduleList.wxml | 11 ++++ .../pages/moduleList/moduleList.wxss | 51 ++++++++++++++ 4 files changed, 115 insertions(+), 19 deletions(-) diff --git a/subpages/oneKeyService/pages/moduleList/components/newsList/newsList.wxss b/subpages/oneKeyService/pages/moduleList/components/newsList/newsList.wxss index c369258..8da210f 100644 --- a/subpages/oneKeyService/pages/moduleList/components/newsList/newsList.wxss +++ b/subpages/oneKeyService/pages/moduleList/components/newsList/newsList.wxss @@ -1,15 +1,17 @@ .news-module { width: 100%; - background: #fff; + background: #f7f7f7; border-radius: 16rpx; box-sizing: border-box; - padding: 0 20rpx; } .classify-tab { width: 100%; height: 90rpx; border-bottom: 1rpx solid #eaeaea; + background-color: #fff; + padding: 0rpx 20rpx; + box-sizing: border-box; } ::-webkit-scrollbar{ width: 0; diff --git a/subpages/oneKeyService/pages/moduleList/moduleList.js b/subpages/oneKeyService/pages/moduleList/moduleList.js index 808283f..1423fe2 100644 --- a/subpages/oneKeyService/pages/moduleList/moduleList.js +++ b/subpages/oneKeyService/pages/moduleList/moduleList.js @@ -43,23 +43,18 @@ Page({ if (options.bannerflag == '1') { this.getBannerList(options.categorycode) } - if (this.data.moduleInfo.modulestyle == '1' || this.data.moduleInfo.modulestyle == '3' || this.data.moduleInfo.modulestyle == '5' || this.data.moduleInfo.modulestyle == '6') { + if (this.getModuleStyleType() == 'notice_list') { this.setData({ isLoadMore: true }) this.getNoticelist() - } else if (options.modulestyle == '2') { + } else if (this.getModuleStyleType() == 'module_list') { this.getModuleCategory() } else if (options.modulestyle == '4') { wx.navigateTo({ url: `../noticeDetail/noticeDetail?pid=${this.data.moduleInfo.pid}&bannerflag=${this.data.moduleInfo.bannerflag}&categorycode=${this.data.moduleInfo.categorycode}&modulestyle=${this.data.moduleInfo.modulestyle}&categoryname=${this.data.moduleInfo.categoryname}` }) - } else if (options.modulestyle == '7') { - this.setData({ - isLoadMore: true - }) - this.getNoticelist() - } else if (options.modulestyle == '8') { + }else if (this.getModuleStyleType() == 'notice_list_2') { this.getModuleCategoryList().then(() => { this.getNoticelist(this.data.newsCategoryList[0].value) }) @@ -86,18 +81,27 @@ Page({ pageSize: this.data.pageSize, }) - if (this.data.moduleInfo.modulestyle == '1' || this.data.moduleInfo.modulestyle == '3' || this.data.moduleInfo.modulestyle == '5' || this.data.moduleInfo.modulestyle == '6') { + if (this.getModuleStyleType() == 'notice_list') { this.getNoticelist() - } else if (this.data.moduleInfo.modulestyle == '2') { + } else if (this.getModuleStyleType() == 'module_list') { this.getModuleCategory() - } else if (this.data.moduleInfo.modulestyle == '7') { - this.getNoticelist() - } else if (this.data.moduleInfo.modulestyle == '8') { + }else if (this.getModuleStyleType() == 'notice_list_2') { this.getNoticelist(this.data.newsCategoryList[0].value) } } }, - + //modulestyle 调用模式 + getModuleStyleType () { + let moduleStyle = this.data.moduleInfo.modulestyle + if (moduleStyle == '1' || moduleStyle == '3' || moduleStyle == '5' || moduleStyle == '6' || moduleStyle == '7' || moduleStyle == '9') { + return 'notice_list' + } else if (moduleStyle == '2') { + return 'module_list' + } else if (moduleStyle == '8') { + return 'notice_list_2' + } + return 'notice_list' + }, //获取模块列表 getModuleCategory() { let params = { @@ -282,9 +286,17 @@ Page({ */ navigateToType (e) { const info = e.currentTarget.dataset.info - wx.navigateTo({ - url: `./moduleList?pid=${info.id}&bannerflag=${info.bannerFlag}&categorycode=${info.categoryCode}&modulestyle=${info.moduleStyle}&categoryname=${info.categoryName}` - }) + if (info.moduleStyle) { + wx.navigateTo({ + url: `./moduleList?pid=${info.id}&bannerflag=${info.bannerFlag}&categorycode=${info.categoryCode}&modulestyle=${info.moduleStyle}&categoryname=${info.categoryName}` + }) + } else { + wx.showToast({ + title: '样式不能为空', + icon: 'none', + duration: 2000 + }) + } }, //notice 跳转详情页面 @@ -323,6 +335,26 @@ Page({ }) }, + //type-9 拨打电话 + mobile(e) { + wx.showModal({ + title: '拨打电话', + content: `您确定拨打${e.currentTarget.dataset.mobile}`, + cancelColor: '#29B9A5', + confirmColor: '#29B9A5', + success: (res) => { + if (res.confirm) { + console.log('用户点击确定') + wx.makePhoneCall({ + phoneNumber: e.currentTarget.dataset.mobile + }) + } else if (res.cancel) { + console.log('用户点击取消') + } + } + }) + }, + // 检查 是否完善信息 verifyCompleteInfo () { if (app.globalData.infoCompleted == 0) { diff --git a/subpages/oneKeyService/pages/moduleList/moduleList.wxml b/subpages/oneKeyService/pages/moduleList/moduleList.wxml index 8ce894b..f5c01f4 100644 --- a/subpages/oneKeyService/pages/moduleList/moduleList.wxml +++ b/subpages/oneKeyService/pages/moduleList/moduleList.wxml @@ -104,6 +104,17 @@ + + + + + 举报电话:{{item.mobile}} + + + + {{item.noticeTitle}} + + diff --git a/subpages/oneKeyService/pages/moduleList/moduleList.wxss b/subpages/oneKeyService/pages/moduleList/moduleList.wxss index 12ce6ab..f1618d1 100644 --- a/subpages/oneKeyService/pages/moduleList/moduleList.wxss +++ b/subpages/oneKeyService/pages/moduleList/moduleList.wxss @@ -498,3 +498,54 @@ swiper { .type-7 .video-list .video-line:last-child { display: none; } + + +.type-9 .list-item { + margin-top: 16rpx; + background: #fff; + width: 100%; + padding: 0 30rpx 4rpx; + box-sizing: border-box; +} + +.type-9 .list-item .top-box { + width: 100%; + height: 106rpx; + display: flex; + align-items: center; +} +.type-9 .list-item .top { + width: 100%; + font-size: 34rpx; + color: rgba(51, 51, 51, 1); + overflow: hidden; + text-overflow: ellipsis; + word-wrap:break-word; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} +.type-9 .list-item .line { + height: 1px; + background-color: #f7f7f7; + width: 100%; +} +.type-9 .list-item .bottom { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; +} + +.type-9 .list-item .bottom .name { + height: 106rpx; + line-height: 106rpx; + font-size: 34rpx; + font-weight: 500; + color: rgba(51, 51, 51, 1); +} + +.type-9 .list-item .bottom image { + width: 156rpx; + height: 56rpx; +}