Browse Source

merge

feature/optimise
lihenian 5 years ago
parent
commit
364b105b8e
  1. 3
      app.json
  2. 9
      pages/heartNew/heartNew.js
  3. 2
      pages/heartNew/heartNew.wxml
  4. 4
      project.config.json
  5. BIN
      subpages/heart/images/ic_yueduliang.png
  6. 23
      subpages/heart/pages/bannerDetail/bannerDetail.js
  7. 6
      subpages/heart/pages/bannerDetail/bannerDetail.json
  8. 28
      subpages/heart/pages/bannerDetail/bannerDetail.wxml
  9. 126
      subpages/heart/pages/bannerDetail/bannerDetail.wxss
  10. 8
      utils/activity.js

3
app.json

@ -114,7 +114,8 @@
"pages/noticeDetail/noticeDetail",
"pages/myApply/myApply",
"pages/myApplyList/myApplyList",
"pages/myApplyDetail/myApplyDetail"
"pages/myApplyDetail/myApplyDetail",
"pages/bannerDetail/bannerDetail"
]
},
{

9
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}`
})
},
})

2
pages/heartNew/heartNew.wxml

@ -30,7 +30,7 @@
<block wx:if="{{banner.length > 0}}">
<block wx:for="{{banner}}" wx:key="*this">
<swiper-item>
<view class="swiper-item" data-id="{{item.actId}}">
<view class="swiper-item" data-id="{{item.id}}" bindtap="toBannerDetail">
<image class="banner" src='{{item.bannerImg}}' mode="aspectFill" />
</view>
</swiper-item>

4
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",

BIN
subpages/heart/images/ic_yueduliang.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

23
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)
})
}
})

6
subpages/heart/pages/bannerDetail/bannerDetail.json

@ -0,0 +1,6 @@
{
"usingComponents": {
"parser": "../../../../components/parser/parser"
},
"navigationBarTitleText": "详情"
}

28
subpages/heart/pages/bannerDetail/bannerDetail.wxml

@ -0,0 +1,28 @@
<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
<view class="notice-detail">
<view class="selfContent" wx:if="{{!preloadVisible}}">
<view class="detail-title">
<view>{{noticeObj.title}}</view>
</view>
<view class="detail-subtitle">
<view class="left">
<!-- <span>{{noticeObj.deptName}}</span> -->
<span>{{filter.formatTime(noticeObj.createdTime, 'yyyy-MM-dd')}}</span>
</view>
<view class="right">
<view class="readNum">
<image src="../../images/ic_yueduliang.png" />
</view>
<view class="num">{{noticeObj.browseNum}}</view>
</view>
</view>
<view class="richContent">
<!-- <rich-text space="nbsp" nodes="{{noticeObjContent}}"></rich-text> -->
<parser html="{{noticeObjContent}}"></parser>
</view>
</view>
<view class="preload" wx:else>
<view class="preload-title"></view>
<view class="preload-content"></view>
</view>
</view>

126
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 */

8
utils/activity.js

@ -5,7 +5,8 @@ module.exports = {
bannerListV2,
volunteerlist,
volunteerV2list,
getImgUrl
getImgUrl,
getBannerDetail
}
function getActivityList (params) {
@ -31,3 +32,8 @@ function volunteerV2list (params) {
function getImgUrl (imgType) {
return fly.get(`imgConfig/getImgUrl/${imgType}`)
}
//banner跳转详情
function getBannerDetail (id) {
return fly.get(`heart/act/banner/detail/${id}`)
}
Loading…
Cancel
Save