Browse Source

Merge branch 'release'

master tagv1.6.0
lihenian 5 years ago
parent
commit
f99c643c6c
  1. 3
      app.json
  2. 56
      pages/indexNew/indexNew.js
  3. 2
      pages/toRegister/toRegister.js
  4. 178
      subpages/oneKeyService/pages/index/index.js
  5. 6
      subpages/oneKeyService/pages/index/index.json
  6. 12
      subpages/oneKeyService/pages/index/index.wxml
  7. 83
      subpages/oneKeyService/pages/moduleList/components/newsList/newsList.js
  8. 3
      subpages/oneKeyService/pages/moduleList/components/newsList/newsList.json
  9. 51
      subpages/oneKeyService/pages/moduleList/components/newsList/newsList.wxml
  10. 159
      subpages/oneKeyService/pages/moduleList/components/newsList/newsList.wxss
  11. 314
      subpages/oneKeyService/pages/moduleList/moduleList.js
  12. 8
      subpages/oneKeyService/pages/moduleList/moduleList.json
  13. 128
      subpages/oneKeyService/pages/moduleList/moduleList.wxml
  14. 467
      subpages/oneKeyService/pages/moduleList/moduleList.wxss
  15. 130
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.js
  16. 1
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.json
  17. 32
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.wxml
  18. 139
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.wxss
  19. 3
      subpages/understandJs/pages/delicious/delicious.wxss
  20. 8
      utils/api.js
  21. 8
      utils/understandJs.js

3
app.json

@ -140,7 +140,8 @@
"pages/noticeDetail/noticeDetail",
"pages/search/search",
"pages/laobingzaixian/laobingzaixian",
"pages/laobingzaixianDict/laobingzaixianDict"
"pages/laobingzaixianDict/laobingzaixianDict",
"pages/moduleList/moduleList"
]
}
],

56
pages/indexNew/indexNew.js

@ -80,7 +80,9 @@ Page({
visible: false,
signMsg: '',
signCode: 0,
isSignUp: 0
isSignUp: 0,
yjfwPID: '', //一键服务pid
jmjsPID: '', //解码锦水pid
},
onShow: function () {
if (wx.getStorageSync("token") != "" && wx.getStorageSync("token") != undefined && wx.getStorageSync("token") != null) {
@ -184,6 +186,14 @@ Page({
that.setData({
zyzqnGridId:item.residentValue
})
} else if (item.residentType === 'module_category' && item.residentCode === 'module_category_yjfw') {
that.setData({
yjfwPID:item.residentValue
})
} else if (item.residentType === 'module_category' && item.residentCode === 'module_category_jmjs') {
that.setData({
jmjsPID:item.residentValue
})
}
})
}
@ -389,9 +399,10 @@ Page({
url: "/pages/heartNew/heartNew"
})
} else if (that.data.sceneFrom == 'module_ma_code_lbzx') {
wx.navigateTo({
url: "/subpages/oneKeyService/pages/laobingzaixian/laobingzaixian?modulecode=notice_yjfu_lbzx"
})
// wx.navigateTo({
// url: "/subpages/oneKeyService/pages/laobingzaixian/laobingzaixian?modulecode=notice_yjfu_lbzx"
// })
that.toLaoBingZaiXian(1)
}
if (wx.getStorageSync("shareObj")) {
const para = JSON.parse(wx.getStorageSync("shareObj"))
@ -446,7 +457,7 @@ Page({
//跳转到 一键服务页面(新) 2020.07.15
toOneKeyService () {
wx.navigateTo({
url: '/subpages/oneKeyService/pages/index/index'
url: `/subpages/oneKeyService/pages/index/index?pid=${this.data.yjfwPID}&title=一键服务`
})
},
// 点击-更多,跳转通知列表
@ -466,7 +477,7 @@ Page({
//了解锦水
toUnderstandJs (){
wx.navigateTo({
url: "/subpages/understandJs/pages/index/index"
url: `/subpages/oneKeyService/pages/index/index?pid=${this.data.jmjsPID}&title=解码锦水`
})
},
@ -722,5 +733,38 @@ Page({
this.setData({
visible: false
});
},
//跳转到新老兵在线2020.11.02
toLaoBingZaiXian(page) {
let params = {
pageIndex: page,
pageSize: 10,
pid: this.data.yjfwPID
}
let op = {}
return new Promise((resolve, reject) => {
api.moduleCategory(params).then(res => {
// console.log('toLBZX',res.data)
res.data.forEach(item => {
if (item.categoryCode == 'notice_yjfu_lbzx') {
op = { ...item }
}
})
if (Object.keys(op).length > 0) {
wx.navigateTo({
url: `/subpages/oneKeyService/pages/moduleList/moduleList?pid=${op.id}&bannerflag=${op.bannerFlag}&categorycode=${op.categoryCode}&modulestyle=${op.moduleStyle}&categoryname=${op.categoryName}`
})
} else {
if (res.data.length == 10) {
page++
this.toLaoBingZaiXian(page)
}
}
resolve(true)
}).catch(err => {
console.log(err)
reject(false)
})
})
}
})

2
pages/toRegister/toRegister.js

@ -21,7 +21,7 @@ Page({
// }
// })
let that = this
const versionNum = "1.5.5"
const versionNum = "1.6.0"
api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data)
let state = res.data.scanFlag

178
subpages/oneKeyService/pages/index/index.js

@ -5,83 +5,147 @@ Page({
* 页面的初始数据
*/
data: {
moduleCategory: 'module_type_service', //module_type_jmjs (解码锦水) //module_type_service (一键服务)
modulelist: []
pageIndex: 1,
pageSize: 10,
nodata: false,
loadMoreType: 'none',
loadMoreVisible: false,
isLoadMore: false, //是否显示load-more组件
modulelist: [],
pid: '', //主页获取一键服务pid
// moduleCategory: 'module_type_service', //module_type_jmjs (解码锦水) //module_type_service (一键服务)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.modulelist()
// this.modulelist()
this.setData({
pid: options.pid
})
wx.setNavigationBarTitle({
title: options.title
})
this.getModuleCategory()
},
modulelist() {
let that = this;
api.modulelist(that.data.moduleCategory).then(function (res) {
that.setData({
modulelist: res.data,
// modulelist() {
// let that = this;
// api.modulelist(that.data.moduleCategory).then(function (res) {
// that.setData({
// modulelist: res.data,
// })
// console.log(that.data.modulelist)
// })
// },
getModuleCategory() {
let params = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize,
pid: this.data.pid
}
api.moduleCategory(params).then(res => {
console.log(res.data)
this.setData({
modulelist: this.data.modulelist.concat(res.data),
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === this.data.pageSize ? false : true
})
if (this.data.modulelist.length == 0) {//没有值
this.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
this.setData({
modulelist: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
console.log(err)
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.setData({
loadMoreVisible: true
})
if (this.data.loadMoreType === 'loading') {
this.setData({
pageIndex: this.data.pageIndex + 1,
pageSize: this.data.pageSize,
})
this.getModuleCategory()
}
},
// wx.showToast({
// title: '敬请期待',
// icon: 'none',
// duration: 1000
// })
//政策、通知 /subpages/home/pages/noticeNew/noticeNew
goDetails(e) {//模块编码(政策,通知,档案,警事,一键直通)
console.log(e.currentTarget.dataset.modulecode)
if (e.currentTarget.dataset.modulecode == 'notice_navigation_hot') {
wx.navigateTo({
url: `../policyList/policyList?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == 'notice_navigation_new') {
wx.navigateTo({
url: `../policyList/policyList?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == 'module_file') {
wx.navigateTo({
url: '../archives/archives'
})
} else if (e.currentTarget.dataset.modulecode == 'notice_warning') {
wx.navigateTo({
url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == 'module_hardcore') {
wx.navigateTo({
url: `../directTo/directTo?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == 'notice_zcwsc') {
wx.navigateTo({
url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == 'notice_aq') {
if (e.currentTarget.dataset.modulestyle == '4') {
wx.navigateTo({
url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == 'notice_cgjj') {
wx.navigateTo({
url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == 'notice_jwgk') {
// wx.navigateTo({
// url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
// })
wx.navigateTo({
url: `../laobingzaixian/laobingzaixian?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == 'notice_yjfu_lbzx') {
wx.navigateTo({
url: `../laobingzaixian/laobingzaixian?modulecode=${e.currentTarget.dataset.modulecode}`
url: `../noticeDetail/noticeDetail?pid=${e.currentTarget.dataset.pid}&bannerflag=${e.currentTarget.dataset.bannerflag}&categorycode=${e.currentTarget.dataset.categorycode}&modulestyle=${e.currentTarget.dataset.modulestyle}&categoryname=${e.currentTarget.dataset.categoryname}`
})
} else {
if (e.currentTarget.dataset.categorycode == 'module_hardcore') {
wx.navigateTo({
url: `../directTo/directTo?modulecode=${e.currentTarget.dataset.categorycode}`
})
} else if (e.currentTarget.dataset.categorycode == 'module_file') {
wx.navigateTo({
url: '../archives/archives'
})
} else {
wx.navigateTo({
url: `../moduleList/moduleList?pid=${e.currentTarget.dataset.pid}&bannerflag=${e.currentTarget.dataset.bannerflag}&categorycode=${e.currentTarget.dataset.categorycode}&modulestyle=${e.currentTarget.dataset.modulestyle}&categoryname=${e.currentTarget.dataset.categoryname}`
})
}
}
// if (e.currentTarget.dataset.modulecode == 'notice_navigation_hot') {
// wx.navigateTo({
// url: `../policyList/policyList?modulecode=${e.currentTarget.dataset.modulecode}`
// })
// } else if (e.currentTarget.dataset.modulecode == 'notice_navigation_new') {
// wx.navigateTo({
// url: `../policyList/policyList?modulecode=${e.currentTarget.dataset.modulecode}`
// })
// } else if (e.currentTarget.dataset.modulecode == 'module_file') {
// wx.navigateTo({
// url: '../archives/archives'
// })
// } else if (e.currentTarget.dataset.modulecode == 'notice_warning') {
// wx.navigateTo({
// url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
// })
// } else if (e.currentTarget.dataset.modulecode == 'module_hardcore') {
// wx.navigateTo({
// url: `../directTo/directTo?modulecode=${e.currentTarget.dataset.modulecode}`
// })
// } else if (e.currentTarget.dataset.modulecode == 'notice_zcwsc') {
// wx.navigateTo({
// url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
// })
// } else if (e.currentTarget.dataset.modulecode == 'notice_aq') {
// wx.navigateTo({
// url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
// })
// } else if (e.currentTarget.dataset.modulecode == 'notice_cgjj') {
// wx.navigateTo({
// url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
// })
// } else if (e.currentTarget.dataset.modulecode == 'notice_jwgk') {
// wx.navigateTo({
// url: `../laobingzaixian/laobingzaixian?modulecode=${e.currentTarget.dataset.modulecode}`
// })
// } else if (e.currentTarget.dataset.modulecode == 'notice_yjfu_lbzx') {
// wx.navigateTo({
// url: `../laobingzaixian/laobingzaixian?modulecode=${e.currentTarget.dataset.modulecode}`
// })
// }
}
})

6
subpages/oneKeyService/pages/index/index.json

@ -1,3 +1,7 @@
{
"navigationBarTitleText": "一键服务"
"navigationBarTitleText": "一键服务",
"usingComponents": {
"load-more": "../../../../components/loadMore/loadMore",
"no-data":"../../../../components/nodata/nodata"
}
}

12
subpages/oneKeyService/pages/index/index.wxml

@ -5,9 +5,17 @@
wx:key="index"
wx:for-index="index"
wx:for="{{modulelist}}"
data-moduleCode="{{item.moduleCode}}">
data-pid="{{item.id}}"
data-bannerFlag="{{item.bannerFlag}}"
data-categoryCode="{{item.categoryCode}}"
data-moduleStyle="{{item.moduleStyle}}"
data-categoryName="{{item.categoryName}}">
<image class="img-bj" src="{{item.imgUrl}}"></image>
<!-- <view class="shadow">
<image class="img-name" src="../../images/jsyx.png"></image>
</view> -->
</button>
</button>
<!-- <load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible && isLoadMore}}"></load-more> -->
<no-data isShow="{{nodata}}"></no-data>

83
subpages/oneKeyService/pages/moduleList/components/newsList/newsList.js

@ -0,0 +1,83 @@
Component({
data: {
selectBarLeft: 0,
newsCategoryId: ''
},
properties: {
newsCategoryList: {
type: Array,
value: [],
observer: function (value) {
if (value.length > 0) {
const _this = this
const query = wx.createSelectorQuery().in(this)
query.select('#item1').boundingClientRect()
query.exec(function(res){
_this.setData({
selectBarLeft: res[0].width/2
})
console.log(_this.data.selectBarLeft)
})
}
}
},
newsList: {
type: Array,
value: []
},
preloadVisible: {
type: Boolean,
value: true
}
},
lifetimes: {
created () {
console.log('组件实例创建--created')
},
attached () {
},
detached () {
console.log('从父组件中移除-detached')
}
},
pageLifetimes: {
show () {
},
hide () {
console.log('页面隐藏')
}
},
methods: {
// 分类导航切换
onChangeClassifyTab (e) {
this.data.newsCategoryList.forEach((item, index) => {
if (index === e.currentTarget.dataset.tab) {
this.data.newsCategoryId = item.value
item.select = true
const _this = this
const query = wx.createSelectorQuery().in(this)
query.select(`#item${index + 1}`).boundingClientRect()
query.exec(function(res){
_this.setData({
selectBarLeft: res[0].width/2
})
console.log(_this.data.selectBarLeft)
})
} else {
item.select = false
}
})
this.setData({
newsCategoryList: this.data.newsCategoryList
})
this.triggerEvent('newsCategoryCallback', { newsCategoryId: this.data.newsCategoryId })
},
toDetail (e) {
wx.navigateTo({
url: `/subpages/oneKeyService/pages/noticeDetail/noticeDetail?id=${e.currentTarget.dataset.id}&title=${e.currentTarget.dataset.title}`
})
}
}
})

3
subpages/oneKeyService/pages/moduleList/components/newsList/newsList.json

@ -0,0 +1,3 @@
{
"component": true
}

51
subpages/oneKeyService/pages/moduleList/components/newsList/newsList.wxml

@ -0,0 +1,51 @@
<view class="news-module">
<scroll-view class="classify-tab" scroll-x="{{true}}">
<view class="tab-list">
<view
class="item {{item.select ? 'select' : ''}}"
id="{{'item' + (index + 1)}}"
wx:for="{{newsCategoryList}}"
wx:for-item="item"
wx:for-index="index"
data-tab="{{index}}"
bindtap="onChangeClassifyTab"
wx:key="index">
{{item.label}}
<view style="left: calc({{selectBarLeft}}px - 15rpx)" wx:if="{{item.select}}" class="select-bar"></view>
</view>
</view>
</scroll-view>
<view class="news-list">
<block wx:if="{{newsList.length > 0}}">
<view class="type-3">
<view class="list-item" wx:for="{{newsList}}" wx:for-index="index" wx:for-item="item" wx:key="index" bindtap="toDetail" data-id="{{item.id}}" data-title="{{item.noticeTitle}}">
<view class="name">{{item.noticeTitle}}</view>
<view class="info">
<text class="text">{{common.getStr(item.noticeContent)}}</text>
</view>
</view>
</view>
</block>
<block wx:if="{{preloadVisible}}">
<view class="preload-item" wx:for="{{[1,2,3,4]}}" wx:key="index" wx:for-index="index" wx:for-item="item">
<view class="left">
<view class="top">
<view class="title"></view>
<view class="title"></view>
<view class="time"></view>
</view>
<view class="bottom"></view>
</view>
<view class="right"></view>
</view>
</block>
</view>
</view>
<wxs module="common">
module.exports.cutTime = function(time) { return time.split(' ')[0] }
module.exports.getStr = function(content) {
return content.replace(getRegExp('<\/?.+?\/?>|[&nbsp;]','g'),'')
}
</wxs>

159
subpages/oneKeyService/pages/moduleList/components/newsList/newsList.wxss

@ -0,0 +1,159 @@
.news-module {
width: 100%;
background: #fff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 0 20rpx;
}
.classify-tab {
width: 100%;
height: 90rpx;
border-bottom: 1rpx solid #eaeaea;
}
::-webkit-scrollbar{
width: 0;
height: 0;
color: transparent;
display:none;
}
.classify-tab .tab-list {
width: auto;
min-width: 100%;
height: 90rpx;
display: flex;
}
.tab-list .item {
height: 90rpx;
color: #ababab;
font-size: 30rpx;
margin: 0 20rpx;
line-height: 90rpx;
flex-shrink: 0;
position: relative;
width: 150rpx;
text-align: center;
}
.tab-list .item.select {
color: #FF4848;
font-size: 32rpx;
font-weight: bold;
}
.tab-list .item:first-child {
margin-left: 0;
}
.tab-list .item:last-child {
margin-right: 0;
}
.classify-tab .tab-list .item .select-bar {
width: 30rpx;
height: 8rpx;
border-radius: 4rpx;
background: #FF4848;
position: absolute;
bottom: 0;
left: 0;
}
.news-list {
width: 100%;
}
.news-list .preload-item {
width: 100%;
padding: 30rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.news-list .preload-item + .preload-item {
border-top: 1rpx solid #eaeaea;
}
.news-list .preload-item .left {
width: calc(100% - 260rpx);
height: 170rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.news-list .preload-item .left .top .title {
height: 30rpx;
width: 100%;
border-radius: 2rpx;
background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
animation: loading 1.4s ease infinite;
background-size: 400% 100%;
margin-top:10rpx;
}
.news-list .preload-item .left .top .time {
border-radius: 6rpx;
background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
animation: loading 1.4s ease infinite;
background-size: 400% 100%;
height: 20rpx;
width: 30%;
margin-top: 10rpx;
}
.news-list .preload-item .left .bottom {
height: 20rpx;
width: 50%;
border-radius: 2rpx;
background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
animation: loading 1.4s ease infinite;
background-size: 400% 100%;
}
.news-list .preload-item .right {
width: 240rpx;
height: 170rpx;
border-radius: 16rpx;
overflow: hidden;
background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
animation: loading 1.4s ease infinite;
background-size: 400% 100%;
}
/* type-3 start */
.type-3 .list-item {
width: 100%;
padding: 40rpx 28rpx;
margin-top: 16rpx;
background: #fff;
box-sizing: border-box;
}
.type-3 .list-item .name {
font-size: 34rpx;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 50rpx;
}
.type-3 .list-item .info {
margin-top: 15rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
.type-3 .list-item .info .text {
line-height: 46rpx;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 30rpx;
}
/* type-3 end */
@keyframes loading {
0% {
background-position: 100% 50%
}
100% {
background-position: 0 50%
}
}

314
subpages/oneKeyService/pages/moduleList/moduleList.js

@ -0,0 +1,314 @@
// subpages/understandJs/pages/archives/archives.js
const api = require('../../../../utils/understandJs')
Page({
/**
* 页面的初始数据
*/
data: {
pageIndex: 1,
pageSize: 10,
modulelist: [], //module 接口
noticelist: [], //notice 接口
newsCategoryList: [], //type-8 tab list
nodata: false,
loadMoreType: 'none',
loadMoreVisible: false,
isLoadMore: false, //是否显示load-more组件
swiperBannerList: [],
indicatorDots: false, //指示点
autoplay: true, //true,//自动播放
circular: true, //衔接滑动
interval: 5000, //自动播放间隔时长(ms)
duration: 500, //幻灯片切换时长(ms)
currentSwiper: 0,
showTitle: true, //视频标题
moduleInfo: {}, //pid, bannerflag, categorycode, modulestyle, categoryname
preloadVisible: true, //type-8 预加载
lastPlayVideo: '', //正在播放的视频
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.data.moduleInfo = { ...options }
this.setData({
moduleInfo: this.data.moduleInfo
})
wx.setNavigationBarTitle({
title: options.categoryname
})
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') {
this.setData({
isLoadMore: true
})
this.getNoticelist()
} else if (options.modulestyle == '2') {
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') {
this.getModuleCategoryList().then(() => {
this.getNoticelist(this.data.newsCategoryList[0].value)
})
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.setData({
loadMoreVisible: true
})
if (this.data.loadMoreType === 'loading') {
this.setData({
pageIndex: this.data.pageIndex + 1,
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') {
this.getNoticelist()
} else if (this.data.moduleInfo.modulestyle == '2') {
this.getModuleCategory()
} else if (this.data.moduleInfo.modulestyle == '7') {
this.getNoticelist()
} else if (this.data.moduleInfo.modulestyle == '8') {
this.getNoticelist(this.data.newsCategoryList[0].value)
}
}
},
//获取模块列表
getModuleCategory() {
let params = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize,
pid: this.data.moduleInfo.pid
}
api.moduleCategory(params).then(res => {
this.setData({
modulelist: this.data.modulelist.concat(res.data),
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === this.data.pageSize ? false : true
})
if (this.data.modulelist.length == 0) {
this.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
this.setData({
modulelist: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
console.log(err)
})
},
//获取通知列表
getNoticelist(categoryCode='') {
let that = this
let params = {
pageIndex: that.data.pageIndex,
pageSize: that.data.pageSize,
noticeCategory: categoryCode == '' ? that.data.moduleInfo.categorycode : categoryCode
}
api.noticelist(params).then(res => {
let list = [ ...res.data ]
if (that.data.moduleInfo.modulestyle == '7') {
list = []
res.data.forEach(item => {
if (item.noticeVideoUrl) {
item.showTitle = false
list.push(item)
}
})
}
console.log(list)
that.setData({
noticelist: that.data.noticelist.concat(list),
loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === that.data.pageSize ? false : true,
preloadVisible: false
})
if (that.data.noticelist.length == 0) {
that.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
that.setData({
noticelist: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
preloadVisible: false
})
console.log(err)
})
},
// 获取type-8 分类列表
getModuleCategoryList () {
let params = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize,
pid: this.data.moduleInfo.pid
}
return new Promise((resolve, reject) => {
api.moduleCategory(params).then(res => {
console.log('获取分类列表', res)
// const newsCategoryList = [{
// value: 'all',
// select: true,
// label: '全部'
// }]
const newsCategoryList = []
res.data.forEach(item => {
newsCategoryList.push({
value: item.categoryCode,
select: false,
label: item.categoryName
})
})
newsCategoryList[0].select = true
this.setData({
newsCategoryList
})
resolve(true)
}).catch(err => {
console.log(err)
reject(false)
})
})
},
//获取视频banner列表
getBannerList: function(bannerNum) {
let that = this
api.bannerList(bannerNum).then(function(res) {
// console.log('res==', res.data)
that.setData({
swiperBannerList: res.data
})
})
},
swiperChange: function(e) {
wx.createVideoContext('video'+this.data.currentSwiper).pause()
this.setData({
currentSwiper: e.detail.current,
autoplay: true
})
},
bindplay() {
this.setData({
autoplay: false
})
wx.getNetworkType({
success (res) {
const networkType = res.networkType
if (res.networkType != 'wifi') {
wx.showToast({
title: '当前为非WI-FI环境,请注意流量消耗',
icon: 'none',
duration: 3000
})
}
}
})
},
bindended() {
this.setData({
autoplay: true
})
},
bindcontrolstoggle(e) {
this.setData({
showTitle: e.detail.show
})
},
videoitemplay (e) {
wx.createVideoContext(this.data.lastPlayVideo).pause()
this.setData({
lastPlayVideo: e.currentTarget.id
})
wx.getNetworkType({
success (res) {
const networkType = res.networkType
if (res.networkType != 'wifi') {
wx.showToast({
title: '当前为非WI-FI环境,请注意流量消耗',
icon: 'none',
duration: 3000
})
}
}
})
},
videoitemtoggle (e) {
this.data.noticelist[e.currentTarget.dataset.index].showTitle = e.detail.show
this.setData({
noticelist: this.data.noticelist
})
},
/**
* module 跳转模块页面
*/
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}`
})
},
//notice 跳转详情页面
toDetail(e){
const info = e.currentTarget.dataset
wx.navigateTo({
url: `../noticeDetail/noticeDetail?id=${info.id}&title=${this.data.moduleInfo.categoryname}`
})
},
//type-8 tab切换回调函数
newsCategoryCallback (e) {
// if (e.detail.newsCategoryId === 'all') {
// this.data.newsCategoryId = ''
// } else {
// this.data.newsCategoryId = e.detail.newsCategoryId
// }
this.setData({
pageIndex: 1,
noticelist: [],
loadMoreType: 'none',
loadMoreVisible: false,
preloadVisible: true,
nodata: false
})
this.getNoticelist(e.detail.newsCategoryId)
}
})

8
subpages/oneKeyService/pages/moduleList/moduleList.json

@ -0,0 +1,8 @@
{
"navigationBarTitleText": "",
"usingComponents": {
"load-more": "../../../../components/loadMore/loadMore",
"no-data":"../../../../components/nodata/nodata",
"news-list": "./components/newsList/newsList"
}
}

128
subpages/oneKeyService/pages/moduleList/moduleList.wxml

@ -0,0 +1,128 @@
<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
<view class="dept-list">
<!-- 视频图片 banner -->
<view class="banner" wx:if="{{swiperBannerList.length > 0}}">
<view class="page-section page-section-spacing swiper">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" circular="{{circular}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperChange">
<block wx:for="{{swiperBannerList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<swiper-item>
<view data-banner="{{item}}">
<view class="swiper-item" data-id="{{item.id}}">
<image wx:if="{{item.imgUrl}}" class="banner-item" src='{{item.imgUrl}}' mode="aspectFill" />
<block wx:elif="{{item.videoUrl}}">
<video id="video{{index}}" class="banner-item" src="{{item.videoUrl}}" title="{{item.title}}" bindcontrolstoggle="bindcontrolstoggle" bindpause="bindended" bindplay='bindplay' bindended='bindended'/>
<view class="video-title" hidden="{{!showTitle}}">{{item.title}}</view>
</block>
</view>
</view>
</swiper-item>
</block>
</swiper>
<!-- 重置小圆点的样式 -->
<view class="dots">
<block wx:for="{{ swiperBannerList }}" wx:key="index">
<view class="dot {{index == currentSwiper ? ' active' : '' }}"></view>
</block>
</view>
</view>
</view>
<!-- 1. 标题、部门、时间 -->
<view class="type-1" wx:if="{{noticelist.length > 0 && moduleInfo.modulestyle == '1'}}">
<view class="list-li" wx:for="{{noticelist}}" bindtap="toDetail" data-id="{{item.id}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="item-name">{{item.noticeTitle}}</view>
<view class="item-info">
<image src="../../images/ic_zhengce.png" />
<view class="street">{{item.deptName}}</view>
<view class="time">{{item.noticeTime}}</view>
</view>
</view>
</view>
<!-- 2. 图标、模块类别名称 -->
<view class="type-2" wx:if="{{modulelist.length > 0 && moduleInfo.modulestyle == '2'}}">
<view
class="list-item"
wx:for="{{modulelist}}"
wx:for-index="index"
wx:for-item="item"
wx:key="index"
bindtap="navigateToType"
data-info="{{item}}">
<view class="list-name">
<image src="{{item.imgUrl}}" class="list-icon"/>{{item.categoryName}}
</view>
<image src="../../images/right.png" class="list-arrow"></image>
</view>
</view>
<!-- 3. 标题、内容 -->
<view class="type-3" wx:if="{{noticelist.length > 0 && moduleInfo.modulestyle == '3'}}">
<view class="list-item" wx:for="{{noticelist}}" bindtap="toDetail" data-id="{{item.id}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="name">{{item.noticeTitle}}</view>
<view class="info">
<text>{{common.getStr(item.noticeContent)}}</text>
</view>
</view>
</view>
<!-- 5. 图片、标题、部门、时间 -->
<view class="type-5" wx:if="{{noticelist.length > 0 && moduleInfo.modulestyle == '5'}}">
<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>{{item.deptName}}</text>
<text>{{filter.formatTime(item.noticeTime, 'yyyy-MM-dd')}}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 6. 图片、标题-->
<view class="type-6" wx:if="{{noticelist.length > 0 && moduleInfo.modulestyle == '6'}}">
<view class="box">
<view class="item" wx:for="{{noticelist}}" bindtap="toDetail" data-id="{{item.id}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image src="{{item.imgUrl}}"></image>
<view class="name">{{item.noticeTitle}}</view>
</view>
</view>
</view>
<!-- 7. 视频列表 -->
<view class="type-7" wx:if="{{noticelist.length > 0 && moduleInfo.modulestyle == '7'}}">
<view class="video-list">
<block wx:for="{{noticelist}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="video-item">
<video id="videoItem{{index}}" src="{{item.noticeVideoUrl}}" title="{{item.noticeTitle}}" bindcontrolstoggle="videoitemtoggle" bindplay='videoitemplay' data-index="{{index}}"/>
<view class="video-title" hidden="{{!item.showTitle}}">{{item.noticeTitle}}</view>
</view>
<view class="video-line"></view>
</block>
</view>
</view>
<!-- 8. 顶部标签、通知列表 -->
<view class="type-8" wx:if="{{newsCategoryList.length > 0 && moduleInfo.modulestyle == '8'}}">
<view style="height:40rpx" wx:if="{{swiperBannerList.length > 0}}"></view>
<news-list
newsCategoryList="{{newsCategoryList}}"
newsList="{{noticelist}}"
preloadVisible="{{preloadVisible}}"
bind:newsCategoryCallback="newsCategoryCallback">
</news-list>
</view>
</view>
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible && isLoadMore}}"></load-more>
<no-data isShow="{{nodata}}"></no-data>
<wxs module="common">
module.exports.getStr = function(content) {
return content.replace(getRegExp('<\/?.+?\/?>|[&nbsp;]','g'),'')
}
</wxs>

467
subpages/oneKeyService/pages/moduleList/moduleList.wxss

@ -0,0 +1,467 @@
page {
background: #f7f7f7;
height: auto;
}
/* 列表 */
/* .dept-list {
display: grid;
grid-template-columns: 1fr;
place-items: center;
gap: 24rpx 0;
width: 690rpx;
padding: 20rpx 0;
margin: 0rpx auto;
position: relative;
z-index: 999;
} */
/* 轮播图start */
.altitle {
position: absolute;
width: 100%;
height: 66rpx;
background-color: black;
margin-top: 237rpx;
border-bottom-right-radius: 16rpx;
border-bottom-left-radius: 16rpx;
opacity: 0.5;
font-size: 22rpx;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
.altitle-name {
margin: 10rpx 20rpx;
}
.container {
width: 100vw;
}
.page-body {
padding-top: 30rpx;
background: #fff;
height: 350rpx;
}
.page-section {
width: 100%;
margin-bottom: 60rpx;
}
.page-section_center {
display: flex;
flex-direction: column;
align-items: center;
}
.page-section:last-child {
margin-bottom: 0;
}
.page-section-gap {
box-sizing: border-box;
padding: 0 30rpx;
}
.page-section-spacing {
box-sizing: border-box;
/* padding: 0 20rpx; */
height: 350rpx;
background-color: #fff;
}
.page-section-title {
font-size: 28rpx;
color: #999;
margin-bottom: 10rpx;
padding-left: 30rpx;
padding-right: 30rpx;
}
.page-section-gap .page-section-title {
padding-left: 0;
padding-right: 0;
}
.swiper-item {
display: block;
height: 350rpx;
}
.banner {
overflow: hidden;
height: 350rpx;
display: flex;
width: 100%;
margin: 0 auto;
background-color: #FFF;
padding: 44rpx 0;
}
.banner-item {
overflow: hidden;
height: 350rpx;
display: flex;
width: 100%;
border-radius: 16rpx;
margin-bottom: 8rpx;
}
.dots {
display: flex;
justify-content: center;
margin-top: -16rpx;
z-index: 999;
position: relative;
}
.dots .dot {
width: 8rpx;
height: 8rpx;
border-radius: 8rpx;
margin-left: 10rpx;
background: #d2d5da;
transition: all 0.3s;
}
.dots .dot.active {
width: 24rpx;
background: #fff;
}
.page-section-title {
margin-top: 60rpx;
position: relative;
}
swiper {
width: 710rpx;
height: 350rpx;
margin: 0 auto;
box-shadow: 0px 4px 29px 0px rgba(63, 63, 63, 0.1);
border-radius: 16rpx;
overflow: hidden;
-webkit-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
}
.video-title {
width: 100%;
height: 50rpx;
line-height: 50rpx;
padding-left: 40rpx;
color: white;
background: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0));
background: -webkit-linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0));
position: absolute;
top: 0;
}
/* 轮播图end */
/* type-1 start */
.type-1 .list-li:first-child {
margin-top: 27rpx;
}
.type-1 .list-li {
width: 100%;
background: #fff;
padding: 38rpx 30rpx;
margin-top: 16rpx;
box-sizing: border-box;
}
.type-1 .list-li .item-name {
width: 100%;
font-size: 34rpx;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 52rpx;
}
.type-1 .list-li .item-info {
width: calc(100% - 60rpx);
height: 28rpx;
margin-top: 30rpx;
display: flex;
align-items: center;
}
.type-1 .list-li .item-info image {
width: 28rpx;
height: 28rpx;
}
.type-1 .list-li .item-info .street {
margin-left: 11rpx;
font-size: 24rpx;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
.type-1 .list-li .item-info .time {
margin-left: 22rpx;
font-size: 24rpx;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
/* type-1 end */
/* type-2 start */
.type-2 {
width: 690rpx;
margin: 40rpx auto;
}
.type-2 .list-item {
width: 100%;
height: 160rpx;
background: #fff;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 14rpx;
margin-top: 12rpx;
}
.type-2 .list-item .list-name {
font-size:32rpx;
font-family:PingFang SC;
font-weight:bold;
color:rgba(51,51,51,1);
margin-left: 42rpx;
display: flex;
align-items: center;
}
.type-2 .list-item .list-arrow {
width: 16rpx;
height: 26rpx;
margin-right: 42rpx;
}
.type-2 .list-item .list-name .list-icon {
width: 106rpx;
height: 106rpx;
margin-right: 14rpx;
}
/* type-2 end */
/* type-3 start */
.type-3 .list-item {
width: 100%;
padding: 40rpx 28rpx;
margin-top: 16rpx;
background: #fff;
box-sizing: border-box;
}
.type-3 .list-item .name {
/* width: calc(100% - 56rpx); */
font-size: 34rpx;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 50rpx;
}
.type-3 .list-item .info {
/* margin-top: 15rpx;
width: calc(100% - 56rpx);
font-size: 28rpx;
font-weight: 500;
color: rgba(153, 153, 153, 1);
line-height: 44rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden; */
margin-top: 15rpx;
/* width: calc(100% - 56rpx); */
/* height: 75rpx; */
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
.type-3 .list-item .info rich-text {
/* width:100%; */
line-height: 44rpx;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.type-3 .list-item .info text {
line-height: 46rpx;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 30rpx;
}
/* type-3 end */
/* type-5 start */
.type-5 .list-all {
width: 100%;
background-color: #fff;
}
.type-5 .list-all .list-item {
border-bottom: 1rpx solid #eaeaea;
margin-top: 16rpx;
padding: 40rpx 18rpx 30rpx 16rpx;
display: flex;
}
.type-5 .list-all .list-item:first-child {
border-top: 1rpx solid #eaeaea;
}
.type-5 .list-all .list-item:last-child {
border-bottom: none;
}
.type-5 .list-all .list-item .item-info {
width: calc(100% - 220rpx);
height: 146rpx;
position: relative;
}
.type-5 .list-all .list-item .item-info .item-info-name {
width: calc(100% - 47rpx);
font-size: 32rpx;
font-weight: 500;
color: rgba(63, 63, 63, 1);
line-height: 50rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
margin: 0 auto;
}
.type-5 .list-all .list-item .item-info .item-info-time {
width: calc(100% - 47rpx);
height: 22rpx;
position: absolute;
bottom: 5rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
left: 22rpx;
}
.type-5 .list-all .list-item .item-info .item-info-time text {
font-size: 22rpx;
font-weight: 500;
color: rgba(170, 170, 170, 1);
line-height: 22rpx;
}
.type-5 .list-all .list-item image {
width: 220rpx;
height: 146rpx;
border-radius: 10rpx;
}
.type-5 .list-all .list-item .label {
position: absolute;
z-index: 999;
width: 34rpx;
height: 34rpx;
right: 45rpx;
}
.type-5 .list-all .list-item .label image {
position: absolute;
width: 100%;
height: 100%;
}
/* type-5 end */
/* type-6 start */
.type-6 .box {
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
border-top: 1rpx solid #F4F4F4;
padding: 50rpx 30rpx;
}
.type-6 .box .item:first-child {
margin-top: 0rpx;
}
.type-6 .box .item:nth-child(2) {
margin-top: 0rpx;
}
.type-6 .box .item {
margin-top: 40rpx;
width: calc(50% - 10rpx);
height: 257rpx;
}
.type-6 .box .item image {
width: 100%;
height: 206rpx;
border-radius: 10rpx;
}
.type-6 .box .item .name {
width: 100%;
height: 51rpx;
line-height: 60.5rpx;
font-size: 32rpx;
font-weight: bold;
color: rgba(36, 36, 36, 1);
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
/* type-6 end */
/* type-7 start */
.type-7 .video-list {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background-color: #fff;
}
.type-7 .video-list .video-item {
height: 310rpx;
width: 690rpx;
border-radius: 16rpx;
margin: 30rpx;
position: relative;
}
.type-7 .video-list .video-line {
width: 702rpx;
height: 1px;
background: rgba(234, 234, 234, 0.95);
}
.type-7 .video-list .video-item video{
height: 100%;
width: 100%;
border-radius: 16rpx;
}
.type-7 .video-title {
width: 650rpx;
border-radius: 16rpx;
}
.type-7 .video-list .video-line:last-child {
display: none;
}

130
subpages/oneKeyService/pages/noticeDetail/noticeDetail.js

@ -7,80 +7,130 @@ Page({
*/
data: {
noticeObj: {},
noticeObjContent: '',
noticeObjContent: "",
pageIndex:1,
pageSize:10,
noticeCategory:'',
preloadVisible: true
categoryName:'',
preloadVisible: true,
isNeedBanner: false,
bannerList: [],
indicatorDots: false, //指示点
autoplay: true, //true,//自动播放
circular: true, //衔接滑动
interval: 5000, //自动播放间隔时长(ms)
duration: 500, //幻灯片切换时长(ms)
currentSwiper: 0,
nodata: false,
showTitle: true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
noticeCategory:options.modulecode
})
if(options.modulecode == 'notice_warning'){
wx.setNavigationBarTitle({
title: '锦水警事'
})
this.noticeDetail(options.id)
} else if(options.modulecode == 'notice_zcwsc'){
console.log(options)
if (options.id) {
wx.setNavigationBarTitle({
title: '众创卫生城'
title: options.title
})
this.noticeDetail(options.id)
} else if(options.modulecode == 'notice_aq'){
wx.setNavigationBarTitle({
title: '安全365'
} else {
this.setData({
categoryName:options.categorycode
})
this.noticeDetail(options.id)
} else if(options.modulecode == 'notice_cgjj'){
wx.setNavigationBarTitle({
title: '城管聚焦'
title: options.categoryname
})
this.noticeDetail(options.id)
} else if(options.modulecode == 'notice_jwgk'){
wx.setNavigationBarTitle({
title: options.modulename
})
this.noticeDetail(options.id)
} else if(options.modulecode == 'notice_yjfu_lbzx'){
wx.setNavigationBarTitle({
title: options.modulename
})
this.noticeDetail(options.id)
if (options.bannerflag == '1') {
this.setData({
isNeedBanner: true
})
if (this.data.isNeedBanner) {
this.videoBannerList(options.categorycode)
}
}
this.noticelist()
}
},
noticelist() {
swiperChange: function(e) {
wx.createVideoContext('video'+this.data.currentSwiper).pause()
this.setData({
currentSwiper: e.detail.current,
autoplay: true
})
},
bindplay() {
this.setData({
autoplay: false
})
wx.getNetworkType({
success (res) {
const networkType = res.networkType
if (res.networkType != 'wifi') {
wx.showToast({
title: '当前为非WI-FI环境,请注意流量消耗',
icon: 'none',
duration: 3000
})
}
}
})
},
bindended() {
this.setData({
autoplay: true
})
},
bindcontrolstoggle(e) {
this.setData({
showTitle: e.detail.show
})
},
videoBannerList (code) {
api.videoBannerList(code).then( res => {
this.setData({
bannerList: res.data
})
}).catch(err => {
console.log(err)
})
},
noticelist () {
let that = this;
let params = {
pageIndex: that.data.pageIndex,
pageSize: that.data.pageSize,
noticeCategory: that.data.noticeCategory
noticeCategory: that.data.categoryName
}
api.noticelist(params).then(function (res) {
that.noticeDetail(res.data[0].id)
api.noticelist(params).then(function (res) {
if (res.data.length == 0) {
that.setData({
nodata: true
})
} else {
that.setData({
nodata: false
})
that.noticeDetail(res.data[0].id)
}
}).catch(err => {
console.log(err)
})
},
noticeDetail(noticeId){
noticeDetail (noticeId){
let that = this;
api.noticeDetail(noticeId).then(function (res) {
api.noticeDetail(noticeId).then(function (res) {
that.setData({
noticeObj: res.data,
noticeObjContent: util.formatRichText(res.data.noticeContent),
preloadVisible: false
})
console.log(that.data.noticeObj)
}).catch(err => {
console.log(err)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
@ -126,7 +176,7 @@ Page({
/**
* 用户点击右上角分享
*/
// onShareAppMessage: function () {
onShareAppMessage: function () {
// }
}
})

1
subpages/oneKeyService/pages/noticeDetail/noticeDetail.json

@ -1,5 +1,6 @@
{
"usingComponents": {
"no-data": "../../../../components/nodata/nodata",
"parser": "../../../../components/parser/parser"
},
"navigationBarTitleText": ""

32
subpages/oneKeyService/pages/noticeDetail/noticeDetail.wxml

@ -1,5 +1,33 @@
<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
<view class="notice-detail">
<view class="notice-detail" hidden="{{nodata}}">
<view class="banner" wx:if="{{isNeedBanner && bannerList.length>0}}">
<view class="page-section page-section-spacing swiper">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" circular="{{circular}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperChange">
<block wx:for="{{bannerList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<swiper-item>
<view data-banner="{{item}}">
<view class="swiper-item" data-id="{{item.id}}">
<!-- <view class="altitle">
<view class="altitle-name">{{item.title}}</view>
</view> -->
<image wx:if="{{item.imgUrl}}" class="banner" src='{{item.imgUrl}}' mode="aspectFill" />
<block wx:elif="{{item.videoUrl}}">
<video id="video{{index}}" src="{{item.videoUrl}}" show-center-play-btn='{{true}}' title="{{item.title}}" bindcontrolstoggle="bindcontrolstoggle" bindpause="bindended" bindplay='bindplay' bindended='bindended'></video>
<view class="video-title" hidden="{{!showTitle}}">{{item.title}}</view>
</block>
</view>
</view>
</swiper-item>
</block>
</swiper>
<!-- 重置小圆点的样式 -->
<view class="dots">
<block wx:for="{{ bannerList }}" wx:key="index">
<view class="dot {{index == currentSwiper ? ' active' : '' }}"></view>
</block>
</view>
</view>
</view>
<view class="selfContent" wx:if="{{!preloadVisible}}">
<view class="detail-title">{{noticeObj.noticeTitle}}</view>
<view class="detail-subtitle">
@ -24,3 +52,5 @@
<view class="preload-content"></view>
</view>
</view>
<no-data isShow="{{nodata}}"></no-data>

139
subpages/oneKeyService/pages/noticeDetail/noticeDetail.wxss

@ -127,4 +127,141 @@ page{
background-position: 0 50%
}
}
/* preload end */
/* preload end */
/* 轮播图start */
.altitle {
position: absolute;
width: 100%;
height: 66rpx;
background-color: black;
margin-top: 237rpx;
border-bottom-right-radius: 16rpx;
border-bottom-left-radius: 16rpx;
opacity: 0.5;
font-size: 22rpx;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
.altitle-name {
margin: 10rpx 20rpx;
}
.container {
width: 100vw;
}
.page-body {
padding-top: 30rpx;
background: #fff;
height: 340rpx;
}
.page-section {
width: 100%;
margin-bottom: 60rpx;
}
.page-section_center {
display: flex;
flex-direction: column;
align-items: center;
}
.page-section:last-child {
margin-bottom: 0;
}
.page-section-gap {
box-sizing: border-box;
padding: 0 30rpx;
}
.page-section-spacing {
box-sizing: border-box;
height: 340rpx;
background-color: #fff;
}
.page-section-title {
font-size: 28rpx;
color: #999;
margin-bottom: 10rpx;
padding-left: 30rpx;
padding-right: 30rpx;
}
.page-section-gap .page-section-title {
padding-left: 0;
padding-right: 0;
}
.swiper-item {
display: block;
height: 340rpx;
}
.swiper-item video {
height: 340rpx;
width: 100%;
}
.notice-detail .banner {
overflow: hidden;
height: 340rpx !important;
display: flex;
width: 100%;
border-radius: 16rpx !important;
margin: 0rpx 0rpx 20rpx 0rpx;
}
.dots {
display: flex;
justify-content: center;
margin-top: -16rpx;
z-index: 999;
position: relative;
}
.dots .dot {
width: 8rpx;
height: 8rpx;
border-radius: 8rpx;
margin-left: 10rpx;
background: #d2d5da;
transition: all 0.3s;
}
.dots .dot.active {
width: 24rpx;
background: #fff;
}
.page-section-title {
margin-top: 60rpx;
position: relative;
}
swiper {
height: 340rpx;
box-shadow: 0px 4px 29px 0px rgba(63, 63, 63, 0.1);
border-radius: 16rpx;
overflow: hidden;
-webkit-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
}
.video-title {
width: 100%;
height: 50rpx;
line-height: 50rpx;
padding-left: 40rpx;
color: white;
background: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0));
background: -webkit-linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0));
position: absolute;
top: 0;
}
/* 轮播图end */

3
subpages/understandJs/pages/delicious/delicious.wxss

@ -38,4 +38,7 @@ page{
font-size: 32rpx;
font-weight: bold;
color: rgba(36, 36, 36, 1);
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}

8
utils/api.js

@ -60,7 +60,8 @@ module.exports = {
getScrip:getScrip,
getHomePhone:getHomePhone,
gradeRankinglist:gradeRankinglist,
userInfoSignUp:userInfoSignUp
userInfoSignUp:userInfoSignUp,
moduleCategory: moduleCategory
}
function getToken (wxCode) {
@ -558,4 +559,9 @@ function gradeRankinglist ({
function userInfoSignUp () {
return fly.get("app-user/user/sign")
}
// 一键服务/解码锦水 改版模块类别接口
function moduleCategory(params) {
return fly.get('news/module/moduleCategory', params)
}

8
utils/understandJs.js

@ -9,7 +9,8 @@ module.exports = {
archiveDetail:archiveDetail,
bannerList:bannerList,
videoBannerList:videoBannerList,
getFullDictInfo:getFullDictInfo
getFullDictInfo:getFullDictInfo,
moduleCategory:moduleCategory
}
// 了解锦水-模块管理接口
function modulelist(moduleCategory='') {
@ -57,4 +58,9 @@ function videoBannerList(position) {
// 老兵在线
function getFullDictInfo (dictType) {
return fly.get(`dic/getFullDictInfo/${dictType}`)
}
// 一键服务/解码锦水 改版模块类别接口
function moduleCategory(params) {
return fly.get('news/module/moduleCategory', params)
}
Loading…
Cancel
Save