Browse Source

增加样式10并配置详情样式;

master
ZhaoTongYao 4 years ago
parent
commit
41e78ac050
  1. 4
      pages/heartNew/heartNew.js
  2. 3
      pages/heartNew/heartNew.wxss
  3. 8
      subpages/oneKeyService/pages/moduleList/moduleList.js
  4. 15
      subpages/oneKeyService/pages/moduleList/moduleList.wxml
  5. 26
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.js
  6. 10
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.wxml
  7. 2
      utils/config.js

4
pages/heartNew/heartNew.js

@ -802,11 +802,11 @@ Page({
//如果是 详情样式,直接跳转详情页面
if (this.data.shouye.moduleStyle == '4') {
wx.navigateTo({
url: `/subpages/oneKeyService/pages/noticeDetail/noticeDetail?pid=${this.data.shouye.pid}&bannerflag=${this.data.shouye.bannerFlag}&categorycode=${this.data.shouye.categoryCode}&modulestyle=${this.data.shouye.moduleStyle}&categoryname=${this.data.shouye.categoryName}`
url: `/subpages/oneKeyService/pages/noticeDetail/noticeDetail?pid=${this.data.shouye.pid}&bannerflag=${this.data.shouye.bannerFlag}&categorycode=${this.data.shouye.categoryCode}&modulestyle=${this.data.shouye.moduleStyle}&categoryname=${this.data.shouye.categoryName}&detailstyle=${this.data.shouye.detailStyle}`
})
} else {
wx.navigateTo({
url: `/subpages/oneKeyService/pages/moduleList/moduleList?pid=${this.data.shouye.id}&bannerflag=${this.data.shouye.bannerFlag}&categorycode=${this.data.shouye.categoryCode}&modulestyle=${this.data.shouye.moduleStyle}&categoryname=${this.data.shouye.categoryName}`
url: `/subpages/oneKeyService/pages/moduleList/moduleList?pid=${this.data.shouye.id}&bannerflag=${this.data.shouye.bannerFlag}&categorycode=${this.data.shouye.categoryCode}&modulestyle=${this.data.shouye.moduleStyle}&categoryname=${this.data.shouye.categoryName}&detailstyle=${this.data.shouye.detailStyle}`
})
}
},

3
pages/heartNew/heartNew.wxss

@ -361,7 +361,8 @@ button:last-child {
.tab-bar .tab {
font-size: 34rpx;
font-weight: 500;
color: rgba(171, 171, 171, 1);
/* color: rgba(171, 171, 171, 1); */
color: rgba(0, 0, 0, 1);
width: 25%;
height: 100%;
line-height: 92rpx;

8
subpages/oneKeyService/pages/moduleList/moduleList.js

@ -95,7 +95,7 @@ Page({
//modulestyle 调用模式
getModuleStyleType () {
let moduleStyle = this.data.moduleInfo.modulestyle
if (moduleStyle == '1' || moduleStyle == '3' || moduleStyle == '5' || moduleStyle == '6' || moduleStyle == '7' || moduleStyle == '9') {
if (moduleStyle == '1' || moduleStyle == '3' || moduleStyle == '5' || moduleStyle == '6' || moduleStyle == '7' || moduleStyle == '9' || moduleStyle == '10') {
return 'notice_list'
} else if (moduleStyle == '2') {
return 'module_list'
@ -299,12 +299,12 @@ Page({
const info = e.currentTarget.dataset.info
if (info.moduleStyle == '4') {
wx.navigateTo({
url: `../noticeDetail/noticeDetail?pid=${info.pid}&bannerflag=${info.bannerFlag}&categorycode=${info.categoryCode}&modulestyle=${info.moduleStyle}&categoryname=${info.categoryName}&commentFlag=${info.commentFlag}`
url: `../noticeDetail/noticeDetail?pid=${info.pid}&bannerflag=${info.bannerFlag}&categorycode=${info.categoryCode}&modulestyle=${info.moduleStyle}&categoryname=${info.categoryName}&commentFlag=${info.commentFlag}&detailstyle=${info.detailStyle}`
})
}
else {
wx.navigateTo({
url: `./moduleList?pid=${info.id}&bannerflag=${info.bannerFlag}&categorycode=${info.categoryCode}&modulestyle=${info.moduleStyle}&categoryname=${info.categoryName}&commentFlag=${info.commentFlag}`
url: `./moduleList?pid=${info.id}&bannerflag=${info.bannerFlag}&categorycode=${info.categoryCode}&modulestyle=${info.moduleStyle}&categoryname=${info.categoryName}&commentFlag=${info.commentFlag}&detailstyle=${info.detailStyle}`
})
}
},
@ -313,7 +313,7 @@ Page({
toDetail(e){
const info = e.currentTarget.dataset
wx.navigateTo({
url: `../noticeDetail/noticeDetail?id=${info.id}&title=${this.data.moduleInfo.categoryname}&commentFlag=${this.data.moduleInfo.commentFlag}`
url: `../noticeDetail/noticeDetail?id=${info.id}&title=${this.data.moduleInfo.categoryname}&commentFlag=${this.data.moduleInfo.commentFlag}&detailstyle=${this.data.moduleInfo.detailstyle}`
})
},

15
subpages/oneKeyService/pages/moduleList/moduleList.wxml

@ -118,6 +118,21 @@
<view class="line"></view>
<view class="top-box" hover-class="none" hover-stop-propagation="false"><view class="top">{{item.noticeTitle}}</view></view>
</view>
</view>
<!-- 10. 图片、标题、时间 -->
<view class="type-5" wx:if="{{noticelist.length > 0 && moduleInfo.modulestyle == '10'}}">
<view class="list-all">
<view class="list-item" wx:for="{{noticelist}}" data-id="{{item.id}}" bindtap="toDetail" wx:for-index="index" wx:for-item="item" wx:key="index">
<image src="{{item.imgUrl}}"></image>
<view class="item-info">
<view class="item-info-name">{{item.noticeTitle}}</view>
<view class="item-info-time">
<text></text>
<text>{{filter.formatTime(item.noticeTime, 'yyyy-MM-dd')}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<complete-info-dialog completeInfoDialogVisible="{{completeInfoDialogVisible}}"></complete-info-dialog>

26
subpages/oneKeyService/pages/noticeDetail/noticeDetail.js

@ -42,6 +42,8 @@ Page({
dialogCancelText: "",
loadMoreVisible: false, // loadMoreVisible 和 loadMoreType 控制 超出一屏时的 加载和没有更多的显示与隐藏
loadMoreType: "none",
detailStyle: [],
detailObj: {}
},
/**
@ -52,6 +54,12 @@ Page({
infoCompleted: app.globalData.infoCompleted,
commentFlag: options.commentFlag
})
if (options.detailstyle && options.detailstyle != 'undefined') {
this.setData({
detailStyle: options.detailstyle.split(',')
})
console.log(this.data.detailStyle)
}
if (options.id) {
wx.setNavigationBarTitle({
title: options.title
@ -78,6 +86,11 @@ Page({
}
this.noticelist()
}
if (options.detailstyle) {
this.setData({
noDeptName: true
})
}
},
swiperChange: function(e) {
@ -150,7 +163,20 @@ Page({
noticeDetail (noticeId){
let that = this;
api.noticeDetail(noticeId).then(function (res) {
if (that.data.detailStyle.length > 0) {
Object.keys(res.data).forEach(item => {
let show = that.data.detailStyle.some((showItem) => {
return showItem == item
})
that.data.detailObj[item] = show
})
} else {
Object.keys(res.data).forEach(item => {
that.data.detailObj[item] = true
})
}
that.setData({
detailObj: that.data.detailObj,
noticeObj: res.data,
noticeObjContent: util.formatRichText(res.data.noticeContent),
preloadVisible: false

10
subpages/oneKeyService/pages/noticeDetail/noticeDetail.wxml

@ -29,20 +29,20 @@
</view>
</view>
<view class="selfContent" wx:if="{{!preloadVisible}}">
<view class="detail-title">{{noticeObj.noticeTitle}}</view>
<view class="detail-title" wx:if="{{detailObj.noticeTitle}}">{{noticeObj.noticeTitle}}</view>
<view class="detail-subtitle">
<view class="left">
<span>{{noticeObj.deptName}}</span>
<span>{{filter.formatTime(noticeObj.noticeTime, 'yyyy-MM-dd')}}</span>
<span wx:if="{{detailObj.deptName}}">{{noticeObj.deptName}}</span>
<span wx:if="{{detailObj.noticeTime}}">{{filter.formatTime(noticeObj.noticeTime, 'yyyy-MM-dd')}}</span>
</view>
<view class="right">
<view class="right" wx:if="{{detailObj.readingAmount}}">
<view class="readNum">
<image src="../../images/ic_yueduliang.png" />
</view>
<view class="num">{{noticeObj.readingAmount}}</view>
</view>
</view>
<view class="richContent">
<view class="richContent" wx:if="{{detailObj.noticeContent}}">
<!-- <rich-text space="nbsp" nodes="{{noticeObjContent}}"></rich-text> -->
<parser html="{{noticeObjContent}}"></parser>
</view>

2
utils/config.js

@ -8,7 +8,7 @@ module.exports = {
function BASEURL() {
// return 'https://epdc-jinan-test.elinkservice.cn/js/epdc-api/api/' // 锦水测试环境
return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址
// return 'http://10.10.10.5:9094/epdc-api/api/'
// return 'http://10.10.10.91:9094/epdc-api/api/'
// return 'https://nei.netease.com/api/apimock-v2/068b11343b2a993a9292d11f4b3fa8a8/api/'
}

Loading…
Cancel
Save