Browse Source

优化

master
zhaoyongnian 5 years ago
parent
commit
d9d788d2a3
  1. 10
      subpages/associationNew/pages/eventlist/eventlist.js
  2. 2
      subpages/associationNew/pages/eventlist/eventlist.wxml

10
subpages/associationNew/pages/eventlist/eventlist.js

@ -1,4 +1,5 @@
// subpages/associationNew/pages/eventlist/eventlist.js // subpages/associationNew/pages/eventlist/eventlist.js
const app = getApp()
import { topiclist, commentSubmit,statement } from '../../utils/api' import { topiclist, commentSubmit,statement } from '../../utils/api'
import { import {
getTimestamp getTimestamp
@ -56,6 +57,7 @@ Page({
topiclist(para).then(res => { topiclist(para).then(res => {
that.setData({ that.setData({
bannedFlag: res.data.bannedFlag, bannedFlag: res.data.bannedFlag,
nodata: false,
topiclist: that.data.topiclist.concat(res.data.topicList), topiclist: that.data.topiclist.concat(res.data.topicList),
loadMoreType: res.data.topicList.length === that.data.pageSize ? 'loading' : 'none', loadMoreType: res.data.topicList.length === that.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.topicList.length === that.data.pageSize ? false : true loadMoreVisible: res.data.topicList.length === that.data.pageSize ? false : true
@ -215,6 +217,14 @@ Page({
}) })
console.log('点击事件') console.log('点击事件')
}, },
previewImage (e) {
console.log(JSON.stringify(e))
app.globalData.previewImage = true
wx.previewImage({
urls: e.currentTarget.dataset.imgarry,
current: e.currentTarget.dataset.src
})
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享

2
subpages/associationNew/pages/eventlist/eventlist.wxml

@ -10,7 +10,7 @@
<view wx:if="{{item.images.length > 0 && topicType == '0'}}" class="image-list" <view wx:if="{{item.images.length > 0 && topicType == '0'}}" class="image-list"
style="height: {{item.images.length === 3 ? '160rpx' : item.images.length === 2 ? '205rpx' : item.images.length === 1 ? '350rpx' : '' }}"> style="height: {{item.images.length === 3 ? '160rpx' : item.images.length === 2 ? '205rpx' : item.images.length === 1 ? '350rpx' : '' }}">
<image mode="aspectFill" catchtap="previewImage" data-src="{{_item}}" class="image-item" <image mode="aspectFill" catchtap="previewImage" data-src="{{_item}}" data-imgArry="{{item.images}}" class="image-item"
wx:for="{{item.images}}" wx:key="{{index}}" wx:for-index="index" wx:for-item="_item" src="{{_item}}" /> wx:for="{{item.images}}" wx:key="{{index}}" wx:for-index="index" wx:for-item="_item" src="{{_item}}" />
</view> </view>
<view class="attitude"> <view class="attitude">

Loading…
Cancel
Save