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
const app = getApp()
import { topiclist, commentSubmit,statement } from '../../utils/api'
import {
getTimestamp
@ -56,6 +57,7 @@ Page({
topiclist(para).then(res => {
that.setData({
bannedFlag: res.data.bannedFlag,
nodata: false,
topiclist: that.data.topiclist.concat(res.data.topicList),
loadMoreType: res.data.topicList.length === that.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.topicList.length === that.data.pageSize ? false : true
@ -215,6 +217,14 @@ Page({
})
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"
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}}" />
</view>
<view class="attitude">

Loading…
Cancel
Save