diff --git a/app.json b/app.json index 8c56edf..2f7390c 100644 --- a/app.json +++ b/app.json @@ -114,7 +114,8 @@ "pages/noticeDetail/noticeDetail", "pages/myApply/myApply", "pages/myApplyList/myApplyList", - "pages/myApplyDetail/myApplyDetail" + "pages/myApplyDetail/myApplyDetail", + "pages/bannerDetail/bannerDetail" ] }, { diff --git a/pages/heartNew/heartNew.js b/pages/heartNew/heartNew.js index e2f30d7..ac5cdec 100644 --- a/pages/heartNew/heartNew.js +++ b/pages/heartNew/heartNew.js @@ -448,5 +448,12 @@ Page({ wx.navigateTo({ url: "/subpages/heart/pages/myApply/myApply" }) - } + }, + + //banner跳转到详情 + toBannerDetail (e) { + wx.navigateTo({ + url: `/subpages/heart/pages/bannerDetail/bannerDetail?id=${e.currentTarget.dataset.id}` + }) + }, }) \ No newline at end of file diff --git a/pages/heartNew/heartNew.wxml b/pages/heartNew/heartNew.wxml index 7b2b403..190e7df 100644 --- a/pages/heartNew/heartNew.wxml +++ b/pages/heartNew/heartNew.wxml @@ -30,7 +30,7 @@ - + diff --git a/project.config.json b/project.config.json index cb937de..cc7159e 100644 --- a/project.config.json +++ b/project.config.json @@ -29,9 +29,13 @@ "useIsolateContext": true, "useCompilerModule": true, "userConfirmedUseCompilerModuleSwitch": false, + "userConfirmedBundleSwitch": false, "packNpmManually": false, "packNpmRelationList": [], +<<<<<<< HEAD "userConfirmedBundleSwitch": false, +======= +>>>>>>> feature/volunteer "minifyWXSS": true }, "compileType": "miniprogram", diff --git a/subpages/heart/images/ic_yueduliang.png b/subpages/heart/images/ic_yueduliang.png new file mode 100644 index 0000000..7d6f21f Binary files /dev/null and b/subpages/heart/images/ic_yueduliang.png differ diff --git a/subpages/heart/pages/bannerDetail/bannerDetail.js b/subpages/heart/pages/bannerDetail/bannerDetail.js new file mode 100644 index 0000000..481f694 --- /dev/null +++ b/subpages/heart/pages/bannerDetail/bannerDetail.js @@ -0,0 +1,23 @@ +const api = require("../../../../utils/activity") +import util from "../../../../utils/util" +Page({ + data: { + noticeObj: {}, + noticeObjContent: "", //富文本内容 + preloadVisible: true + }, + onLoad (options) { + this.getNoticeDetail(options.id) + }, + getNoticeDetail (id) { + api.getBannerDetail(id).then(res => { + this.setData({ + noticeObj: res.data, + noticeObjContent: util.formatRichText(res.data.content), + preloadVisible: false + }) + }).catch(err => { + console.log(err) + }) + } +}) \ No newline at end of file diff --git a/subpages/heart/pages/bannerDetail/bannerDetail.json b/subpages/heart/pages/bannerDetail/bannerDetail.json new file mode 100644 index 0000000..cab45d7 --- /dev/null +++ b/subpages/heart/pages/bannerDetail/bannerDetail.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "parser": "../../../../components/parser/parser" + }, + "navigationBarTitleText": "详情" +} \ No newline at end of file diff --git a/subpages/heart/pages/bannerDetail/bannerDetail.wxml b/subpages/heart/pages/bannerDetail/bannerDetail.wxml new file mode 100644 index 0000000..c05c183 --- /dev/null +++ b/subpages/heart/pages/bannerDetail/bannerDetail.wxml @@ -0,0 +1,28 @@ + + + + + {{noticeObj.title}} + + + + + {{filter.formatTime(noticeObj.createdTime, 'yyyy-MM-dd')}} + + + + + + {{noticeObj.browseNum}} + + + + + + + + + + + + \ No newline at end of file diff --git a/subpages/heart/pages/bannerDetail/bannerDetail.wxss b/subpages/heart/pages/bannerDetail/bannerDetail.wxss new file mode 100644 index 0000000..8de4bcb --- /dev/null +++ b/subpages/heart/pages/bannerDetail/bannerDetail.wxss @@ -0,0 +1,126 @@ +.notice-detail { + width: 100%; + height: 100%; + box-sizing: border-box; + padding: 20rpx; + background: #f7f7f7; +} +.selfContent { + width: 100%; + display: table; + background: #ffffff; + border-radius: 16rpx; + box-sizing: border-box; + padding: 0 25rpx 38rpx; +} +.detail-title { + font-family: PingFang-SC-Bold; + font-size: 48rpx; + font-weight: bold; + line-height: 68rpx; + color: #333333; + padding-top: 40rpx; + margin-bottom: 20rpx; + position: relative; +} +.detail-title-img { + text-align: right; +} +.detail-title image { + width: 176rpx; + height: 66rpx; + vertical-align: middle; +} +.detail-subtitle { + display: flex; + width: 100%; + justify-content: space-between; + font-size: 22rpx; + color: #999999; + margin-top:45rpx; + margin-bottom: 20rpx; +} +.detail-subtitle .left span:nth-child(1){ + margin-right: 32rpx; +} +.detail-subtitle .right{ + display: flex; + height: 32rpx; + line-height: 32rpx; +} + +.detail-subtitle .right .readNum { + /* display: inline-block; */ + width: 32rpx; + height: 32rpx; + margin-right: 10rpx; +} +.detail-subtitle .right .readNum image{ + width: 100%; + height: 100%; + float:left; + object-fit: cover; +} +.banner { + width: 100%; + height: 400rpx; + margin: 39rpx 0 19rpx 0; +} +.banner image{ + width: 100%; + height: 100%; + float:left; + object-fit: cover; + border-radius: 16rpx; + overflow: hidden; +} +.paragraph { + font-size: 38rpx; + line-height: 58rpx; + color: #333333; + text-indent: 76rpx; + margin-top:22rpx; +} + +.richContent{ + word-break: break-all; +} + +/* preload start */ +.preload { + width: 100%; + background: #fff; + box-sizing: border-box; + border-radius: 16rpx; + padding: 0 24rpx; + overflow: hidden; + margin-bottom: 20rpx; +} +.preload-title { + width: 100%; + height: 80rpx; + border-radius: 8rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + animation: loading 1.4s ease infinite; + background-size: 400% 100%; + margin-top: 20rpx; +} +.preload-content { + width: 100%; + height: 200rpx; + border-radius: 8rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + animation: loading 1.4s ease infinite; + background-size: 400% 100%; + margin-top: 20rpx; +} +@keyframes loading { + 0% { + background-position: 100% 50% + } + + 100% { + background-position: 0 50% + } +} +/* preload end */ \ No newline at end of file diff --git a/utils/activity.js b/utils/activity.js index a78a6cb..b3cef3f 100644 --- a/utils/activity.js +++ b/utils/activity.js @@ -5,7 +5,8 @@ module.exports = { bannerListV2, volunteerlist, volunteerV2list, - getImgUrl + getImgUrl, + getBannerDetail } function getActivityList (params) { @@ -30,4 +31,9 @@ function volunteerV2list (params) { // 获取配置图片 function getImgUrl (imgType) { return fly.get(`imgConfig/getImgUrl/${imgType}`) +} + +//banner跳转详情 +function getBannerDetail (id) { + return fly.get(`heart/act/banner/detail/${id}`) } \ No newline at end of file