Browse Source

话对捧个场/事好鼓个掌群主副群主权限增加话题置顶取消置顶功能;话题增加置顶标签显示;

feature/optimise
ZhaoTongYao 5 years ago
parent
commit
fa27c7db19
  1. BIN
      subpages/associationNew/images/top-flag.png
  2. BIN
      subpages/associationNew/images/top.png
  3. BIN
      subpages/associationNew/images/untop.png
  4. 80
      subpages/associationNew/pages/eventlist/eventlist.js
  5. 15
      subpages/associationNew/pages/eventlist/eventlist.wxml
  6. 6
      subpages/associationNew/pages/eventlist/eventlist.wxss
  7. 10
      subpages/associationNew/utils/api.js

BIN
subpages/associationNew/images/top-flag.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 B

BIN
subpages/associationNew/images/top.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

BIN
subpages/associationNew/images/untop.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

80
subpages/associationNew/pages/eventlist/eventlist.js

@ -1,6 +1,6 @@
// subpages/associationNew/pages/eventlist/eventlist.js // subpages/associationNew/pages/eventlist/eventlist.js
const app = getApp() const app = getApp()
import { topiclist, commentSubmit, statement, shieldTopic } from "../../utils/api" import { topiclist, commentSubmit, statement, shieldTopic, topTopic } from "../../utils/api"
import { import {
getTimestamp getTimestamp
} from "../../../../utils/common" } from "../../../../utils/common"
@ -454,5 +454,83 @@ Page({
this.topiclist() this.topiclist()
} }
}) })
},
topTopic (e) {
const param = {
topicId: e.currentTarget.dataset.id,
topFlag: '1'
}
let that = this
wx.showModal({
title: '提示',
content: '确定要把选择的话题置顶?',
confirmColor: '#04BCA0',
cancelColor: '#999',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
topTopic(param).then( res => {
console.log(res.data)
if (res.code == '0') {
wx.showToast({
title: '置顶成功',
icon: 'none',
duration: 2000
})
that.setData({
pageIndex: 1,
pageSize: 10,
nodata: false,
loadMoreType: "none",
loadMoreVisible: false,
topiclist: [],
})
that.topiclist()
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
unTopTopic (e) {
const param = {
topicId: e.currentTarget.dataset.id,
topFlag: '0'
}
let that = this
wx.showModal({
title: '提示',
content: '确定要取消该话题的置顶?',
confirmColor: '#04BCA0',
cancelColor: '#999',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
topTopic(param).then( res => {
console.log(res.data)
if (res.code == '0') {
wx.showToast({
title: '取消置顶成功',
icon: 'none',
duration: 2000
})
that.setData({
pageIndex: 1,
pageSize: 10,
nodata: false,
loadMoreType: "none",
loadMoreVisible: false,
topiclist: [],
})
that.topiclist()
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
} }
}) })

15
subpages/associationNew/pages/eventlist/eventlist.wxml

@ -7,7 +7,9 @@
<image src="{{item.userFace}}"></image> <image src="{{item.userFace}}"></image>
<view class="name-date"> <view class="name-date">
<view class="name">{{item.nickname}} <view class="name">{{item.nickname}}
<image class="community-logo" wx:if="{{item.thisCommunity == '1'}}" src="../../images/resident@2x.png"></image></view> <image class="community-logo" wx:if="{{item.thisCommunity == '1'}}" src="../../images/resident@2x.png"></image>
<image class="top-logo" wx:if="{{item.topFlag == '1'}}" src="../../images/top-flag.png"></image>
</view>
<view class="date">{{item.createdTime}}</view> <view class="date">{{item.createdTime}}</view>
</view> </view>
</view> </view>
@ -35,6 +37,17 @@
<image src="../../images/shield.png"></image> <image src="../../images/shield.png"></image>
<view class="give-data-m">屏蔽</view> <view class="give-data-m">屏蔽</view>
</view> </view>
<block wx:if="{{currentUserIdentity=='0'||currentUserIdentity=='1'}}">
<view class="all" data-id="{{item.id}}" bindtap="unTopTopic" wx:if="{{item.topFlag == '1'}}">
<image src="../../images/top.png"></image>
<view class="give-data-m">取消置顶</view>
</view>
<view class="all" data-id="{{item.id}}" bindtap="topTopic" wx:else>
<image src="../../images/untop.png"></image>
<view class="give-data-m">置顶</view>
</view>
</block>
<view class="all" data-id="{{item.id}}" data-index="{{index}}" bindtap="clickTextarea"> <view class="all" data-id="{{item.id}}" data-index="{{index}}" bindtap="clickTextarea">
<!-- <image class="wcomment" src="../../images/wcomment@2x.png"></image> --> <!-- <image class="wcomment" src="../../images/wcomment@2x.png"></image> -->
<view class="give-data-s"> <view class="give-data-s">

6
subpages/associationNew/pages/eventlist/eventlist.wxss

@ -45,6 +45,12 @@ page {
border-radius: 0px; border-radius: 0px;
} }
.user-info .name-date .top-logo {
height: 28rpx;
width: 58rpx;
margin-left: 8rpx;
border-radius: 0px;
}
.user-info .name-date .date { .user-info .name-date .date {
font-size: 20rpx; font-size: 20rpx;
font-weight: 500; font-weight: 500;

10
subpages/associationNew/utils/api.js

@ -142,6 +142,16 @@ export function shieldTopic ({id, shieldReason}) {
}) })
} }
/**
* 群主或副群主 置顶 取消置顶
*/
export function topTopic ({topicId, topFlag}) {
return request.post("partyGroup/topic/top", {
topicId,
topFlag
})
}

Loading…
Cancel
Save