From 6ee2429b63ff94f80a5c3e5db963ef77745b0094 Mon Sep 17 00:00:00 2001 From: liuwh <hugeinfo123> Date: Sat, 09 May 2020 10:34:24 +0800 Subject: [PATCH] 典型案例列表及详情 --- SunshineLnsMinApp/app.json | 1 SunshineLnsMinApp/pages/dxal/dxal.wxss | 15 + SunshineLnsMinApp/pages/dxalInfo/dxalInfo.wxss | 46 +++++++ SunshineLnsMinApp/pages/dxal/dxal.wxml | 28 +-- SunshineLnsMinApp/pages/dxalInfo/dxalInfo.js | 119 +++++++++++++++++++ SunshineLnsMinApp/pages/dxalInfo/dxalInfo.wxml | 49 ++++++++ SunshineLnsMinApp/pages/dxal/dxal.js | 87 +++++++------ SunshineLnsMinApp/pages/dxalInfo/dxalInfo.json | 6 + 8 files changed, 288 insertions(+), 63 deletions(-) diff --git a/SunshineLnsMinApp/app.json b/SunshineLnsMinApp/app.json index f6560f2..d51466c 100644 --- a/SunshineLnsMinApp/app.json +++ b/SunshineLnsMinApp/app.json @@ -15,6 +15,7 @@ "pages/zhgk/zhgk", "pages/zhdt/zhdt", "pages/zhdtInfo/zhdtInfo", + "pages/dxalInfo/dxalInfo", "pages/me/me", "pages/wdjb/wdjb", "pages/wdjbInfo/wdjbInfo", diff --git a/SunshineLnsMinApp/pages/dxal/dxal.js b/SunshineLnsMinApp/pages/dxal/dxal.js index a1dc494..d918bf1 100644 --- a/SunshineLnsMinApp/pages/dxal/dxal.js +++ b/SunshineLnsMinApp/pages/dxal/dxal.js @@ -1,9 +1,4 @@ // pages/dxal/dxal.js -import { - $startWuxRefresher, - $stopWuxRefresher, - $stopWuxLoader -} from '../../templeteDist/wuxDist/index'; var app = getApp(); @@ -18,7 +13,8 @@ dongtai3_1: app.globalData.imgUrl + '/image/dongtai3-1.jpg', inputShowed: false, inputVal: "", - + page:1, + content: '------加载中------', items: [], count: 0, scrollTop: 0, @@ -28,44 +24,53 @@ * 生命周期函数--监听页面加载 */ onLoad: function(options) { - $startWuxRefresher(); - }, - onPageScroll(e) { - this.setData({ - scrollTop: e.scrollTop - }) - }, - onRefresh() { - console.log('onRefresh') - - this.setData({ - count: 10 - }) - - setTimeout(() => { - this.setData({ - items: this.getList() - }) - $stopWuxRefresher() - }, 1000) - }, - onLoadmore() { - console.log('onLoadmore') - setTimeout(() => { - this.setData({ - items: [...this.data.items, ...this.getList(10, this.data.count)], - count: this.data.count + 10, - }) - - if (this.data.items.length < 30) { - $stopWuxLoader() - } else { - console.log('没有更多数据') - $stopWuxLoader('#wux-refresher', this, true) + var that = this; + wx.showLoading(); + wx.request({ + url: app.globalData.url + '/api/article/publicMsgQuery', + data: { + page: that.data.page, + size: 10, + flag: '典型案例', + }, + success: function(res) { + wx.hideLoading(); + console.log('res', res); + if (res.data.code == 0) { + let content = res.data.data.result.content.map(({ + createTime, + ...i + }) => ({ + ...i, + createTime: app.formatDate(createTime), + })); + console.log(content) + if (content.length < 10) { + that.setData({ + items: [...that.data.items, ...content], + hasMoreData: false, + content: '------我是有底线的------' + }) + } else { + that.setData({ + items: [...that.data.items, ...content], + hasMoreData: true, + content: '------加载更多------', + page: that.data.page + 1 + }) + } + } else { + wx.showToast({ + title: res.data.msg, + }) + } } - }, 1000) + }) }, + + + getList: (count = 10, step = 0) => [...new Array(count)].map((n, i) => ({ title: `Pull down ${i + step}`, content: 'Wux Weapp' diff --git a/SunshineLnsMinApp/pages/dxal/dxal.wxml b/SunshineLnsMinApp/pages/dxal/dxal.wxml index 7efffe3..c691498 100644 --- a/SunshineLnsMinApp/pages/dxal/dxal.wxml +++ b/SunshineLnsMinApp/pages/dxal/dxal.wxml @@ -11,22 +11,16 @@ </view> </view> --> -<wux-refresher id="wux-refresher" bind:pulling="onPulling" bind:refresh="onRefresh" bind:loadmore="onLoadmore" scrollTop="{{scrollTop}}"> - <view class="weui-panel weui-panel_access"> - <view class="weui-panel__bd"> - <view class="weui-media-box weui-media-box_text" wx:for="{{ items }}" wx:key=""> - <!-- <view class="weui-media-box__title weui-media-box__title_in-text">{{ item.title }}</view> - <view class="weui-media-box__desc">{{ item.content }}</view> --> - <view class="zhwj-b-main" data-str="zhdtInfo" data-id="1" bindtap='linkFunction'> - <view class="zhwj-b-head-l"> - <view class="zhwj-b-head-l-title text-black">南沙区院召开2019“沙鸥”法治宣讲团年度总结暨课件评选会</view> - <view class="text-grey">检察宣传部 60阅读</view> - </view> - <!-- <view class="zhwj-b-head-r"> - <image mode='widthFix' src="{{dongtai1_1}}"></image> - </view> --> - </view> - </view> +<view class="zhwj-b"> + <view class="zhwj-b-main" wx:for="{{ items }}" data-str="dxalInfo" data-Id="{{item.id}}" bindtap='linkFunction'> + <view class="zhwj-b-head-l"> + <view class="zhwj-b-head-l-title text-black">{{item.title}}</view> + <view class="text-grey">{{item.createTime}} + <text decode="{{true}}" space="{{true}}"> </text>{{item.readCount}}阅读</view> </view> + <!-- <view class="zhwj-b-head-r"> + <image mode='widthFix' src="{{item.attList[0].path}}"></image> + </view> --> </view> -</wux-refresher> \ No newline at end of file + <div class="businessSchedule-load">------{{content}}------</div> +</view> \ No newline at end of file diff --git a/SunshineLnsMinApp/pages/dxal/dxal.wxss b/SunshineLnsMinApp/pages/dxal/dxal.wxss index 8191ea5..f94ae59 100644 --- a/SunshineLnsMinApp/pages/dxal/dxal.wxss +++ b/SunshineLnsMinApp/pages/dxal/dxal.wxss @@ -1,13 +1,10 @@ -/* pages/dxal/dxal.wxss */ +/* pages/zhdt/zhdt.wxss */ @import '../../weui.wxss'; -.weui-media-box{ - padding: 0 15px; -} .zhwj-b-main { display: flex; - /* border-bottom: 1px solid #ebf2fa; */ + border-bottom: 1px solid #ebf2fa; } .zhwj-b-head-l { @@ -19,6 +16,14 @@ width: 100%; } +.businessSchedule-load { + display: flex; + justify-content: center; + color: #999; + font-size: 14px; + margin-bottom: 4vh; +} + .zhwj-b-head-r { margin: 6px; } diff --git a/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.js b/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.js new file mode 100644 index 0000000..1f72926 --- /dev/null +++ b/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.js @@ -0,0 +1,119 @@ +// pages/zhdtInfo/zhdtInfo.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + id: '', + swiperList: [], + data: {}, + attList: {}, + excelSrc: app.globalData.imgUrl + '/image/fileIcon/excel.svg', + fileSrc: app.globalData.imgUrl + '/image/fileIcon/file.svg', + mp3Src: app.globalData.imgUrl + '/image/fileIcon/mp3.svg', + mp4Src: app.globalData.imgUrl + '/image/fileIcon/mp4.svg', + pdfSrc: app.globalData.imgUrl + '/image/fileIcon/pdf.svg', + pictureSrc: app.globalData.imgUrl + '/image/fileIcon/picture.svg', + pptSrc: app.globalData.imgUrl + '/image/fileIcon/ppt.svg', + wordSrc: app.globalData.imgUrl + '/image/fileIcon/word.svg', + zipSrc: app.globalData.imgUrl + '/image/fileIcon/zip.svg', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + console.log(options.id) + var that = this; + wx.request({ + url: app.globalData.url + '/api/article/publicMsgDetails?msgId=' + options.id, + success: function(res) { + wx.hideLoading(); + console.log(res) + if (res.data.code == 0) { + var attList = res.data.data.maps || []; + var attList21 = app.where(attList, { + type: 21 + }) || []; + attList21.forEach(e => { + e.iconSrc = that.data.mp4Src + }) + var attList22 = app.where(attList, { + type: 22 + }) || []; + attList22.forEach(e => { + e.iconSrc = that.data.pictureSrc + }) + var attList23 = app.where(attList, { + type: 23 + }) || []; + attList23.forEach(e => { + e.iconSrc = that.data.wordSrc + }) + var attList24 = app.where(attList, { + type: 24 + }) || []; + attList24.forEach(e => { + e.iconSrc = that.data.excelSrc + }) + var attList25 = app.where(attList, { + type: 25 + }) || []; + attList25.forEach(e => { + e.iconSrc = that.data.pptSrc + }) + var attList26 = app.where(attList, { + type: 26 + }) || []; + attList26.forEach(e => { + e.iconSrc = that.data.pdfSrc + }) + var attList27 = app.where(attList, { + type: 27 + }) || []; + attList27.forEach(e => { + e.iconSrc = that.data.zipSrc + }) + var attList28 = app.where(attList, { + type: 28 + }) || []; + attList28.forEach(e => { + e.iconSrc = that.data.fileSrc + }) + var attList99 = app.where(attList, { + type: 99 + }) || []; + attList99.forEach(e => { + e.iconSrc = that.data.fileSrc + }) + var attList = { + attList21, + attList22, + attList23, + attList24, + attList25, + attList26, + attList27, + attList28, + attList99 + }; + + console.log(attList) + that.setData({ + data: { + ...res.data.data, + createTime: app.formatDate(res.data.data.createTime), + } + }) + } else { + wx.showModal({ + title: '提示', + content: "请求失败!" + }) + } + } + }) + }, +}) \ No newline at end of file diff --git a/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.json b/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.json new file mode 100644 index 0000000..2e2baaf --- /dev/null +++ b/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "典型案例详情", + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTextStyle": "black" +} \ No newline at end of file diff --git a/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.wxml b/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.wxml new file mode 100644 index 0000000..e8eee18 --- /dev/null +++ b/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.wxml @@ -0,0 +1,49 @@ +<!--pages/zhdtInfo/zhdtInfo.wxml--> +<view class="zhgk-Info-main"> + <view class=" text-lg" style="padding:30rpx 30rpx 0;"> + <text class="zhgk-Info-main-title text-black">{{data.title}}</text> + </view> + <view class=' text-df padding'> + <rich-text nodes="{{data.content}}"></rich-text> + </view> +</view> + +<div class="boxshadow"> + <div class="PetitionLetters-message1"> + <span></span> + <span>相关附件</span> + </div> + <div class="detail-img"> + <view class="educt_hasupload_pic" wx:for="{{attList.attList22}}" wx:key="{{key}}"> + <image src="{{item.path}}" class="upload" bindtap="previewImage" data-src="{{item.path}}"></image> + </view> + <view class="educt_hasupload_pic" wx:for="{{attList.attList23}}" wx:key="{{key}}"> + <image src="{{item.iconSrc}}" class="fileIcon" bindtap="open" data-path="{{item.path}}" class="detail-img-top"></image> + <div class="detail-img-bottom">{{item.name}}</div> + </view> + <view class="educt_hasupload_pic" wx:for="{{attList.attList24}}" wx:key="{{key}}"> + <image src="{{item.iconSrc}}" class="fileIcon" bindtap="open" data-path="{{item.path}}" class="detail-img-top"></image> + <div class="detail-img-bottom">{{item.name}}</div> + </view> + <view class="educt_hasupload_pic" wx:for="{{attList.attList25}}" wx:key="{{key}}"> + <image src="{{item.iconSrc}}" class="fileIcon" bindtap="open" data-path="{{item.path}}" class="detail-img-top"></image> + <div class="detail-img-bottom">{{item.name}}</div> + </view> + <view class="educt_hasupload_pic" wx:for="{{attList.attList26}}" wx:key="{{key}}"> + <image src="{{item.iconSrc}}" class="fileIcon" bindtap="open" data-path="{{item.path}}" class="detail-img-top"></image> + <div class="detail-img-bottom">{{item.name}}</div> + </view> + <view class="educt_hasupload_pic" wx:for="{{attList.attList27}}" wx:key="{{key}}"> + <image src="{{item.iconSrc}}" class="fileIcon" bindtap="open" data-path="{{item.path}}" class="detail-img-top"></image> + <div class="detail-img-bottom">{{item.name}}</div> + </view> + <view class="educt_hasupload_pic" wx:for="{{attList.attList28}}" wx:key="{{key}}"> + <image src="{{item.iconSrc}}" class="fileIcon" bindtap="open" data-path="{{item.path}}" class="detail-img-top"></image> + <div class="detail-img-bottom">{{item.name}}</div> + </view> + <view class="educt_hasupload_pic" wx:for="{{attList.attList99}}" wx:key="{{key}}"> + <image src="{{item.iconSrc}}" class="fileIcon" bindtap="open" data-path="{{item.path}}" class="detail-img-top"></image> + <div class="detail-img-bottom">{{item.name}}</div> + </view> + </div> +</div> \ No newline at end of file diff --git a/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.wxss b/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.wxss new file mode 100644 index 0000000..a3908f8 --- /dev/null +++ b/SunshineLnsMinApp/pages/dxalInfo/dxalInfo.wxss @@ -0,0 +1,46 @@ +/* pages/zhdtInfo/zhdtInfo.wxss */ + +.zhgk-Info-main { + background-color: #fff; +} + +.zhgk-Info-main-title { + color: #249eff; +} + +.detail-img { + display: flex; + flex-direction: columns; + align-items: center; + padding: 2vh; +} + +.PetitionLetters-message1 { + display: flex; + padding: 2vh; +} + +.PetitionLetters-message1 span:nth-child(1) { + border-left: 3px solid #2195ff; +} + +.PetitionLetters-message1 span:nth-child(2) { + padding-left: 1vh; + font-size: 18px; + font-weight: bold; +} + +.detail-img-top { + width: 48px; + height: 48px; +} + +.detail-img-bottom { + font-size: 12px; + color: #333; + width: 70px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + text-align: center; +} -- Gitblit v1.8.0