@ -0,0 +1,27 @@ |
|||||
|
Component({ |
||||
|
data: { |
||||
|
|
||||
|
}, |
||||
|
properties: { |
||||
|
associationList: { |
||||
|
type: Array, |
||||
|
value: [], |
||||
|
observer: function (value) { |
||||
|
if (value.length > 0) { |
||||
|
console.log(value) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
navigateToAss (e) { |
||||
|
console.log('navigateToAss') |
||||
|
if (e.currentTarget.dataset.join === '0'){ |
||||
|
this.triggerEvent('joinGroupCallBack',{partyGroupId: e.currentTarget.dataset.code}) |
||||
|
} |
||||
|
wx.navigateTo({ |
||||
|
url: `/subpages/associationNew/pages/community/community?code=${e.currentTarget.dataset.code}` |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
<view class="community-list"> |
||||
|
<view class="community-item" |
||||
|
wx:for="{{associationList}}" |
||||
|
wx:for-index="index" |
||||
|
wx:for-item="item" |
||||
|
wx:key="index"> |
||||
|
<image src="{{item.partyGroupAvatar}}"/> |
||||
|
<view class="cover-image"> |
||||
|
<text class="community-name">{{item.partyGroupName}}</text> |
||||
|
<button bindtap="navigateToAss"data-join="{{item.isJoin}}" data-code="{{item.id}}" class="community-add" plain='true' hover-class="hover-btn"><image src="../../images/add.png"/></button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
@ -0,0 +1,44 @@ |
|||||
|
.hover-btn { |
||||
|
box-shadow: 0 0 10rpx rgba(63, 63, 63, 0.1); |
||||
|
} |
||||
|
.community-item{ |
||||
|
width: 690rpx; |
||||
|
height: 300rpx; |
||||
|
border-radius: 10rpx; |
||||
|
position: relative; |
||||
|
margin: 0 auto; |
||||
|
margin-top: 28rpx; |
||||
|
} |
||||
|
.community-item image{ |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
position: absolute; |
||||
|
border-radius: 10rpx; |
||||
|
} |
||||
|
.community-item .cover-image{ |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
position: absolute; |
||||
|
background: rgba(0, 0, 0, 0.6); |
||||
|
border-radius: 10rpx; |
||||
|
text-align: center; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
} |
||||
|
.community-item .cover-image .community-name{ |
||||
|
color: white; |
||||
|
font-size: 48rpx; |
||||
|
} |
||||
|
.community-item .cover-image .community-add{ |
||||
|
width: 150rpx; |
||||
|
height: 46rpx; |
||||
|
text-align: left; |
||||
|
padding: 0; |
||||
|
margin-top: 32rpx; |
||||
|
border: 0px; |
||||
|
} |
||||
|
.community-item .cover-image .community-add image{ |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
@ -0,0 +1,100 @@ |
|||||
|
Component({ |
||||
|
data: { |
||||
|
}, |
||||
|
properties: { |
||||
|
currentUser: { |
||||
|
type: Object, |
||||
|
value: {} |
||||
|
}, |
||||
|
gMembersList: { |
||||
|
type: Array, |
||||
|
value: [], |
||||
|
observer: function (value) { |
||||
|
if (value.length > 0) { |
||||
|
console.log(value) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
gOfficialsList: { |
||||
|
type: Array, |
||||
|
value: [], |
||||
|
observer: function (value) { |
||||
|
if (value.length > 0) { |
||||
|
console.log(value) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
onNoSpeak (e) { |
||||
|
var _this = this; |
||||
|
wx.showActionSheet({ |
||||
|
itemList: ['取消禁言','禁言1天', '禁言1周', '禁言1月', '永久禁言'], |
||||
|
success (res) { |
||||
|
// console.log(e.currentTarget.dataset.groupUserId,res.tapIndex)
|
||||
|
let data = { |
||||
|
groupUserId: e.currentTarget.dataset.groupUserId, |
||||
|
bannedFlag: res.tapIndex.toString() |
||||
|
} |
||||
|
_this.triggerEvent('bannedChange',data) |
||||
|
}, |
||||
|
fail (res) { |
||||
|
console.log(e.currentTarget.dataset.groupUserId,res.errMsg) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
onPhone (e) { |
||||
|
if (this.getSysInfo()){ |
||||
|
wx.showModal({ |
||||
|
title: '拨打电话', |
||||
|
content: `您确定拨打${e.currentTarget.dataset.number}`, |
||||
|
cancelColor: '#29B9A5', |
||||
|
confirmColor: '#29B9A5', |
||||
|
success: (res) => { |
||||
|
if (res.confirm) { |
||||
|
console.log('用户点击确定') |
||||
|
wx.makePhoneCall({ |
||||
|
phoneNumber: e.currentTarget.dataset.number |
||||
|
}) |
||||
|
} else if (res.cancel) { |
||||
|
console.log('用户点击取消') |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} else { |
||||
|
wx.makePhoneCall({ |
||||
|
phoneNumber: e.currentTarget.dataset.number |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
getSysInfo () { |
||||
|
wx.getSystemInfo({ |
||||
|
success:function(res){ |
||||
|
if(res.platform == "devtools"){ |
||||
|
return false |
||||
|
}else if(res.platform == "ios"){ |
||||
|
return false |
||||
|
}else if(res.platform == "android"){ |
||||
|
return true |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
gLevelUp (e) { |
||||
|
console.log(e.currentTarget.dataset.groupUserId) |
||||
|
let parm = { |
||||
|
groupUserId: e.currentTarget.dataset.groupUserId, |
||||
|
identityFlag: '1' |
||||
|
} |
||||
|
this.triggerEvent('modifyIdentity',parm) |
||||
|
}, |
||||
|
gLevelDown (e) { |
||||
|
console.log(e.currentTarget.dataset.groupUserId) |
||||
|
let parm = { |
||||
|
groupUserId: e.currentTarget.dataset.groupUserId, |
||||
|
identityFlag: '2' |
||||
|
} |
||||
|
this.triggerEvent('modifyIdentity',parm) |
||||
|
} |
||||
|
} |
||||
|
}) |
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"component": true |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
<wxs module="filters" src="../../utils/filters.wxs"></wxs> |
||||
|
<view class="members-list"> |
||||
|
<block wx:if="{{gMembersList.length > 0}}"> |
||||
|
<view class="members-item" |
||||
|
wx:for="{{gMembersList}}" |
||||
|
wx:for-index="index" |
||||
|
wx:for-item="item" |
||||
|
wx:key="index"> |
||||
|
<view class="item-top"> |
||||
|
<image class="head-icon" src="{{item.userAvatar}}"></image> |
||||
|
<text class="user-name">{{item.nickname}}</text><image wx:if="{{item.identityFlag === '0'}}" class="leader-logo" src="../../images/leader-logo.png"></image> |
||||
|
</view> |
||||
|
<view class="line"></view> |
||||
|
<view class="item-bottom"> |
||||
|
<button bindtap="gLevelUp" data-group-user-id="{{item.id}}" class="levelup-btn" plain='true' hover-class="hover-btn" wx:if="{{filters.getIdentity(0,currentUser.identityFlag,item.identityFlag)}}"> |
||||
|
<text>升级副群主</text> |
||||
|
<image src="../../images/btn1.png"/> |
||||
|
</button> |
||||
|
<button bindtap="gLevelDown" data-group-user-id="{{item.id}}" class="levelup-btn" plain='true' hover-class="hover-btn" wx:if="{{filters.getIdentity(1,currentUser.identityFlag,item.identityFlag)}}"> |
||||
|
<text>降为群成员</text> |
||||
|
<image src="../../images/btn1.png"/> |
||||
|
</button> |
||||
|
<!-- <button class="takeout-btn" plain='true' hover-class="hover-btn"> |
||||
|
<text>踢出群</text> |
||||
|
<image src="../../images/btn2.png"/> |
||||
|
</button> --> |
||||
|
<button disabled="{{!filters.disabledBanned(currentUser.identityFlag,item.identityFlag)}}" bindtap="onNoSpeak" data-group-user-id="{{item.id}}" class="forbidden-btn {{filters.forbiddenClass(currentUser.identityFlag,item.identityFlag)?'disForbidden-btn':''}}" plain='true' hover-class="hover-btn" wx:if="{{item.identityFlag!=='0'}}"> |
||||
|
<text space="ensp">{{filters.getBanned(item.bannedFlag)}}</text> |
||||
|
<image src="../../images/{{filters.forbiddenClass(currentUser.identityFlag,item.identityFlag)?'arrowd2.png':'arrowd.png'}}"/> |
||||
|
</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</block> |
||||
|
<block wx:if="{{gOfficialsList.length > 0}}"> |
||||
|
<view class="members-item" |
||||
|
wx:for="{{gOfficialsList}}" |
||||
|
wx:for-index="index" |
||||
|
wx:for-item="item" |
||||
|
wx:key="index"> |
||||
|
<view class="item-top"> |
||||
|
<image class="head-icon" src="{{item.faceImg}}"></image> |
||||
|
<view class="np-info"> |
||||
|
<text class="user-name">{{item.name}}</text> |
||||
|
<text class="user-phone">{{item.mobile}}</text> |
||||
|
</view> |
||||
|
<button class="call-btn" plain='true' hover-class="hover-btn" bindtap="onPhone" data-number="{{item.mobile}}"> |
||||
|
<image src="../../images/call.png"/> |
||||
|
</button> |
||||
|
</view> |
||||
|
<view class="line"></view> |
||||
|
<view class="item-bottom2"> |
||||
|
<text class="member-label">{{item.motto}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</block> |
||||
|
</view> |
@ -0,0 +1,164 @@ |
|||||
|
.hover-btn { |
||||
|
box-shadow: 0 0 10rpx rgba(63, 63, 63, 0.1); |
||||
|
} |
||||
|
.line { |
||||
|
width: 690rpx; |
||||
|
height: 2rpx; |
||||
|
margin: 0 auto; |
||||
|
background: rgba(240, 240, 240, 1); |
||||
|
} |
||||
|
.members-item{ |
||||
|
background: rgba(255, 255, 255, 1); |
||||
|
margin-top: 20rpx; |
||||
|
position: relative; |
||||
|
} |
||||
|
.members-item .item-top{ |
||||
|
width: 750rpx; |
||||
|
height: 130rpx; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
justify-content: left; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.members-item .item-top .head-icon{ |
||||
|
width: 90rpx; |
||||
|
height: 90rpx; |
||||
|
border-radius: 50%; |
||||
|
margin-left: 29rpx; |
||||
|
} |
||||
|
.members-item .item-top .user-name{ |
||||
|
font-size: 32rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: 500; |
||||
|
color: rgba(0, 0, 0, 1); |
||||
|
margin-left: 20rpx; |
||||
|
} |
||||
|
.members-item .item-top .leader-logo{ |
||||
|
width: 59rpx; |
||||
|
height: 28rpx; |
||||
|
margin-left: 8rpx; |
||||
|
} |
||||
|
.members-item .item-bottom{ |
||||
|
height: 100rpx; |
||||
|
width: 750rpx; |
||||
|
position: relative; |
||||
|
} |
||||
|
.members-item .item-bottom .levelup-btn{ |
||||
|
display: inline-block; |
||||
|
width: 180rpx; |
||||
|
height: 48rpx; |
||||
|
padding: 0; |
||||
|
position: relative; |
||||
|
border: none; |
||||
|
margin-left: 29rpx; |
||||
|
margin-top: 26rpx; |
||||
|
} |
||||
|
.members-item .item-bottom .takeout-btn{ |
||||
|
display: inline-block; |
||||
|
width: 140rpx; |
||||
|
height: 48rpx; |
||||
|
padding: 0; |
||||
|
position: relative; |
||||
|
border: none; |
||||
|
z-index: 0; |
||||
|
margin-left: 20rpx; |
||||
|
} |
||||
|
.members-item .item-bottom .forbidden-btn{ |
||||
|
display: inline-block; |
||||
|
width: 170rpx; |
||||
|
height: 48rpx; |
||||
|
padding: 0; |
||||
|
position: absolute; |
||||
|
z-index: 0; |
||||
|
margin-left: 20rpx; |
||||
|
right: 32rpx; |
||||
|
top: 26rpx; |
||||
|
border: 1rpx solid rgba(241, 86, 28, 1); |
||||
|
border-radius: 23rpx; |
||||
|
} |
||||
|
.levelup-btn image, .takeout-btn image, .forbidden-btn image, .call-btn image{ |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
position: absolute; |
||||
|
left: 0; |
||||
|
top: 0; |
||||
|
} |
||||
|
.forbidden-btn image{ |
||||
|
width: 24rpx; |
||||
|
height: 14rpx; |
||||
|
position: absolute; |
||||
|
left: 135rpx; |
||||
|
top: 18rpx; |
||||
|
} |
||||
|
.levelup-btn text, .takeout-btn text{ |
||||
|
font-size: 26rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: bold; |
||||
|
color: rgba(255, 255, 255, 1); |
||||
|
z-index: 1; |
||||
|
position: absolute; |
||||
|
left: 25rpx; |
||||
|
top: 0; |
||||
|
height: 48rpx; |
||||
|
line-height: 48rpx; |
||||
|
} |
||||
|
.forbidden-btn text{ |
||||
|
font-size: 26rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: 500; |
||||
|
color: rgba(242, 80, 27, 1); |
||||
|
z-index: 1; |
||||
|
position: absolute; |
||||
|
left: 28rpx; |
||||
|
top: 0; |
||||
|
height: 48rpx; |
||||
|
line-height: 48rpx; |
||||
|
} |
||||
|
.disForbidden-btn { |
||||
|
border: 1rpx solid rgba(170, 170, 170, 1) !important; |
||||
|
} |
||||
|
.disForbidden-btn text{ |
||||
|
color: rgba(170, 170, 170, 1) !important; |
||||
|
} |
||||
|
|
||||
|
.members-item .item-top .call-btn{ |
||||
|
width: 156rpx; |
||||
|
height: 56rpx; |
||||
|
padding: 0; |
||||
|
position: absolute; |
||||
|
border: none; |
||||
|
right: 31rpx; |
||||
|
} |
||||
|
.members-item .item-top .np-info{ |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
} |
||||
|
.members-item .item-top .user-phone{ |
||||
|
font-size: 32rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: 500; |
||||
|
color: rgba(240, 133, 38, 1); |
||||
|
margin-left: 20rpx; |
||||
|
} |
||||
|
.members-item .item-bottom2{ |
||||
|
height: 100rpx; |
||||
|
width: 750rpx; |
||||
|
position: relative; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.member-label{ |
||||
|
margin-left: 30rpx; |
||||
|
margin-right: 37rpx; |
||||
|
font-size: 28rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: 500; |
||||
|
color: rgba(153, 153, 153, 1); |
||||
|
display: -webkit-box; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
word-wrap: break-word; |
||||
|
white-space: normal !important; |
||||
|
-webkit-line-clamp: 2; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 417 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 912 B |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 61 KiB |
@ -0,0 +1,308 @@ |
|||||
|
import { $wuxActionSheet } from '../../../../dist/index' |
||||
|
import { addTopic } from '../../utils/api' |
||||
|
const QQMapWX = require('../../utils/qqmap-wx-jssdk') |
||||
|
const config = require('../../../../utils/config') |
||||
|
|
||||
|
Page({ |
||||
|
data: { |
||||
|
topicValue: '', |
||||
|
imageList: [], |
||||
|
qqmapsdk: '', |
||||
|
addressValue: '', |
||||
|
imageId: 1, |
||||
|
location: { |
||||
|
latitude: '', |
||||
|
longitude: '' |
||||
|
}, |
||||
|
partyGroupId: '', |
||||
|
topicType:'',//0:事好儿鼓个掌 1:话对捧个场
|
||||
|
addTopicPrevious: 0 |
||||
|
}, |
||||
|
onShow () { |
||||
|
|
||||
|
}, |
||||
|
onLoad (options) { |
||||
|
const qqmapsdk = new QQMapWX({ |
||||
|
key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ' |
||||
|
}) |
||||
|
this.setData({ |
||||
|
qqmapsdk, |
||||
|
partyGroupId: options.partyGroupId, |
||||
|
topicType: options.topicType, |
||||
|
}) |
||||
|
if(options.topicType == 0){ |
||||
|
wx.setNavigationBarTitle({ |
||||
|
title: '事好儿鼓个掌' |
||||
|
}) |
||||
|
}else{ |
||||
|
wx.setNavigationBarTitle({ |
||||
|
title: '话对捧个场' |
||||
|
}) |
||||
|
} |
||||
|
this.getLocation() |
||||
|
}, |
||||
|
// 话题内容框 值双向绑定
|
||||
|
bindTopicValue (e) { |
||||
|
this.setData({ |
||||
|
topicValue: e.detail.value |
||||
|
}) |
||||
|
console.log(this.data.topicValue) |
||||
|
}, |
||||
|
// 地址框 值双向绑定
|
||||
|
bindAddressValue (e) { |
||||
|
this.setData({ |
||||
|
addressValue: e.detail.value |
||||
|
}) |
||||
|
console.log(this.data.addressValue) |
||||
|
}, |
||||
|
// 选择图片
|
||||
|
chooseImage () { |
||||
|
const that = this |
||||
|
$wuxActionSheet().showSheet({ |
||||
|
buttons: [{ |
||||
|
text: '拍照' |
||||
|
}, |
||||
|
{ |
||||
|
text: '从相册中获取' |
||||
|
}, |
||||
|
], |
||||
|
buttonClicked(index, item) { |
||||
|
if (index === 0) { |
||||
|
wx.chooseImage({ |
||||
|
count: 1, |
||||
|
sizeType: ['original', 'compressed'], |
||||
|
sourceType: ['camera'], |
||||
|
success (res) { |
||||
|
const imageList = [...that.data.imageList] |
||||
|
imageList.push({ |
||||
|
img: res.tempFilePaths[0], |
||||
|
upload: true, |
||||
|
id: that.data.imageId++, |
||||
|
ossUrl: '' |
||||
|
}) |
||||
|
that.setData({ |
||||
|
imageList |
||||
|
}) |
||||
|
wx.uploadFile({ |
||||
|
url: config.BASEURL() + 'group/topic/upload', |
||||
|
filePath: res.tempFilePaths[0], |
||||
|
name: 'file', |
||||
|
header: { |
||||
|
'Content-Type': 'multipart/form-data' |
||||
|
}, |
||||
|
success (fileres) { |
||||
|
const data = JSON.parse(fileres.data) |
||||
|
if (data.code === 0 && data.msg === 'success') { |
||||
|
imageList[imageList.length - 1].ossUrl = data.data |
||||
|
imageList[imageList.length - 1].upload = false |
||||
|
} else { |
||||
|
imageList.pop() |
||||
|
wx.showToast({ |
||||
|
title: '上传图片失败,请重试', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
} |
||||
|
that.setData({ |
||||
|
imageList |
||||
|
}) |
||||
|
}, |
||||
|
fail (err) { |
||||
|
console.log(err) |
||||
|
imageList.pop() |
||||
|
wx.showToast({ |
||||
|
title: '上传图片失败,请重试', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
that.setData({ |
||||
|
imageList |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} else if (index === 1) { |
||||
|
wx.chooseImage({ |
||||
|
count: 3 - that.data.imageList.length, |
||||
|
sizeType: ['original', 'compressed'], |
||||
|
sourceType: ['album'], |
||||
|
success (res) { |
||||
|
let imageList = [] |
||||
|
res.tempFilePaths.forEach(item => { |
||||
|
imageList.push({ |
||||
|
img: item, |
||||
|
upload: true, |
||||
|
id: that.data.imageId++, |
||||
|
ossUrl: '' |
||||
|
}) |
||||
|
}) |
||||
|
that.setData({ |
||||
|
imageList: [...that.data.imageList, ...imageList] |
||||
|
}) |
||||
|
imageList.forEach((item, index) => { |
||||
|
(function (index) { |
||||
|
wx.uploadFile({ |
||||
|
url: `${config.BASEURL()}group/topic/upload`, |
||||
|
filePath: imageList[index].img, |
||||
|
name: 'file', |
||||
|
header: { |
||||
|
'Content-Type': 'multipart/form-data' |
||||
|
}, |
||||
|
success (fileRes) { |
||||
|
const data = JSON.parse(fileRes.data) |
||||
|
if (data.code === 0 && data.msg === 'success') { |
||||
|
imageList[index].ossUrl = data.data |
||||
|
imageList[index].upload = false |
||||
|
|
||||
|
} else { |
||||
|
imageList.splice(index, 1) |
||||
|
wx.showToast({ |
||||
|
title: '上传图片失败,请重试', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
} |
||||
|
that.data.imageList = that.data.imageList.slice(0, that.data.imageList.length - res.tempFilePaths.length) |
||||
|
that.setData({ |
||||
|
imageList: [...that.data.imageList, ...imageList] |
||||
|
}) |
||||
|
}, |
||||
|
fail (err) { |
||||
|
console.log(err) |
||||
|
imageList.splice(index, 1) |
||||
|
wx.showToast({ |
||||
|
title: '上传图片失败,请重试', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
that.data.imageList = that.data.imageList.slice(0, that.data.imageList.length - res.tempFilePaths.length) |
||||
|
that.setData({ |
||||
|
imageList: [...that.data.imageList, ...imageList] |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
})(index) |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
return true |
||||
|
}, |
||||
|
cancelText: '取消', |
||||
|
cancel() {}, |
||||
|
destructiveButtonClicked() {}, |
||||
|
}) |
||||
|
}, |
||||
|
// 获取经纬度
|
||||
|
getLocation () { |
||||
|
wx.getLocation({ |
||||
|
type: 'gcj02', |
||||
|
success: (res) => { |
||||
|
console.log('经纬度', res) |
||||
|
this.reverseGeocoder(res) |
||||
|
this.setData({ |
||||
|
location: { |
||||
|
latitude: res.latitude, |
||||
|
longitude: res.longitude |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 逆地址解析
|
||||
|
reverseGeocoder ({latitude, longitude}) { |
||||
|
this.data.qqmapsdk.reverseGeocoder({ |
||||
|
location: { |
||||
|
latitude, |
||||
|
longitude |
||||
|
}, |
||||
|
success: (res) => { |
||||
|
console.log('逆地址解析', res) |
||||
|
if (res.message === 'query ok') { |
||||
|
this.setData({ |
||||
|
addressValue: res.result.address |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// throttleAddTopic () {
|
||||
|
// let now = new Date()
|
||||
|
// if (now - this.data.addTopicPrevious > 2000) {
|
||||
|
// this.addTopic()
|
||||
|
// this.data.addTopicPrevious = now
|
||||
|
// }
|
||||
|
// },
|
||||
|
// 添加话题事件
|
||||
|
addTopic () { |
||||
|
if (this.data.topicValue === '') { |
||||
|
wx.showToast({ |
||||
|
title: '请输入-话题内容', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
return false |
||||
|
} else if (this.data.addressValue === '') { |
||||
|
wx.showToast({ |
||||
|
title: '请输入-地址', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
const imagesList = [] |
||||
|
if (this.data.imageList.length > 0) { |
||||
|
const isUploadingStatus = this.data.imageList.some(item => item.upload) |
||||
|
if (isUploadingStatus) { |
||||
|
wx.showToast({ |
||||
|
title: '请等待图片上传完成', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
this.data.imageList.forEach(item => { |
||||
|
imagesList.push(item.ossUrl) |
||||
|
}) |
||||
|
} |
||||
|
const para = { |
||||
|
topicType:this.data.topicType,//话题类型:0:事好儿鼓个掌 1:话对捧个场
|
||||
|
topicContent: this.data.topicValue,//话题内容
|
||||
|
topicAddress: this.data.addressValue,//话题地址
|
||||
|
topicLatitude: this.data.location.latitude,//话题位置纬度
|
||||
|
topicLongitude: this.data.location.longitude,//话题位置经度
|
||||
|
partyGroupId:this.data.partyGroupId,//党群ID
|
||||
|
images: imagesList |
||||
|
} |
||||
|
wx.showLoading({ |
||||
|
title: '加载中', |
||||
|
}) |
||||
|
addTopic(para).then(res => { |
||||
|
wx.hideLoading() |
||||
|
console.log(res) |
||||
|
wx.showToast({ |
||||
|
title: '发布成功', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
var pages = getCurrentPages() |
||||
|
// var prePages = pages[pages.length - 2]
|
||||
|
setTimeout(() => { |
||||
|
// prePages.pullRefreshGetTopicList()
|
||||
|
wx.navigateBack() |
||||
|
}, 1000) |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
// 删除图片
|
||||
|
deleteImage (e) { |
||||
|
const index = this.data.imageList.findIndex((item,index) => index === e.currentTarget.dataset.index) |
||||
|
this.data.imageList.splice(index, 1) |
||||
|
const imageList = this.data.imageList |
||||
|
this.setData({ |
||||
|
imageList |
||||
|
}) |
||||
|
} |
||||
|
}) |
@ -0,0 +1,6 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"wux-actionsheet": "../../../../dist/actionsheet/index" |
||||
|
}, |
||||
|
"navigationBarTitleText": "" |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
<view class="add-topic"> |
||||
|
<view class="topic"> |
||||
|
<textarea value="{{topicValue}}" bindinput="bindTopicValue" maxlength="500"> |
||||
|
<view wx:if="{{topicValue.length == 0}}" class="placeholder-textarea"> |
||||
|
<view>请将事描述清晰</view> |
||||
|
</view> |
||||
|
</textarea> |
||||
|
<view wx:if="{{topicType == '0'}}" class="picture"> |
||||
|
<view class="image-box" wx:for="{{imageList}}" wx:key="{{item}}" wx:for-item="item" wx:for-index="index"> |
||||
|
<image src="{{item.img}}" /> |
||||
|
<image wx:if="{{item.upload}}" class="loading" src="../../images/loading.gif" /> |
||||
|
<image bindtap="deleteImage" data-index="{{index}}" wx:else class="delete-image" src="../../images/icon_close.png" /> |
||||
|
</view> |
||||
|
<view class="image-box"> |
||||
|
<image bindtap="chooseImage" wx:if="{{imageList.length <= 2}}" src="../../images/ig_tianjiatupian@2x.png" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="address"> |
||||
|
<textarea value="{{addressValue}}" bindinput="bindAddressValue" placeholder-class="placeholder-textarea" placeholder="请输入定位地址" /> |
||||
|
<view class="tip"> |
||||
|
<image src="../../images/ic_dingwei@2x.png" /> |
||||
|
<text>话题定位</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="topic-button"> |
||||
|
<button bindtap="addTopic" type="default" size="defaultSize" hover-class="hover-button">发起话题</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<wux-actionsheet id="wux-actionsheet" /> |
@ -0,0 +1,143 @@ |
|||||
|
page { |
||||
|
width: 100%; |
||||
|
height:100%; |
||||
|
} |
||||
|
.add-topic { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
background: #f7f7f7; |
||||
|
box-sizing: border-box; |
||||
|
padding: 20rpx; |
||||
|
} |
||||
|
.add-topic .topic { |
||||
|
width: 100%; |
||||
|
height: 640rpx; |
||||
|
background: #fff; |
||||
|
border-radius: 16rpx; |
||||
|
box-sizing: border-box; |
||||
|
padding: 45rpx 20rpx 0; |
||||
|
} |
||||
|
.add-topic .topic textarea { |
||||
|
color: #333; |
||||
|
font-size: 34rpx; |
||||
|
line-height: 46rpx; |
||||
|
width: 100%; |
||||
|
height: 340rpx; |
||||
|
box-sizing: border-box; |
||||
|
padding-bottom: 20rpx; |
||||
|
position: relative; |
||||
|
} |
||||
|
.add-topic .topic textarea .placeholder-textarea { |
||||
|
font-size: 28rpx; |
||||
|
line-height: 46rpx; |
||||
|
color: #999; |
||||
|
position: absolute; |
||||
|
left: 0; |
||||
|
top: 0; |
||||
|
} |
||||
|
.add-topic .topic .picture { |
||||
|
display: flex; |
||||
|
height: 255rpx; |
||||
|
box-sizing: border-box; |
||||
|
padding: 20rpx 0; |
||||
|
} |
||||
|
.add-topic .topic .picture .image-box, .add-topic .topic .picture image { |
||||
|
width: 215rpx; |
||||
|
height: 215rpx; |
||||
|
object-fit:cover; |
||||
|
border-radius: 8rpx; |
||||
|
} |
||||
|
.add-topic .topic .picture .image-box image { |
||||
|
width: 215rpx; |
||||
|
height: 215rpx; |
||||
|
object-fit:cover; |
||||
|
} |
||||
|
.add-topic .topic .picture .image-box { |
||||
|
position: relative; |
||||
|
} |
||||
|
.add-topic .topic .picture .image-box .loading { |
||||
|
position: absolute; |
||||
|
left: 25%; |
||||
|
top: 25%; |
||||
|
width: 50%; |
||||
|
height: 50%; |
||||
|
} |
||||
|
.add-topic .topic .picture .image-box .delete-image { |
||||
|
width: 40rpx; |
||||
|
height: 40rpx; |
||||
|
position: absolute; |
||||
|
right: -20rpx; |
||||
|
top: -20rpx; |
||||
|
} |
||||
|
.add-topic .topic .picture .image-box + .image-box { |
||||
|
margin-left: 10rpx; |
||||
|
} |
||||
|
|
||||
|
.add-topic .address { |
||||
|
width: 100%; |
||||
|
height: 210rpx; |
||||
|
background: #fff; |
||||
|
border-radius: 16rpx; |
||||
|
margin-top: 20rpx; |
||||
|
box-sizing: border-box; |
||||
|
padding: 0 20rpx; |
||||
|
} |
||||
|
.add-topic .address textarea { |
||||
|
width: 100%; |
||||
|
height: 122rpx; |
||||
|
box-sizing: border-box; |
||||
|
padding-top: 35rpx; |
||||
|
font-size: 34rpx; |
||||
|
color: #333; |
||||
|
line-height: 46rpx; |
||||
|
} |
||||
|
.add-topic .address .placeholder-textarea { |
||||
|
font-size: 28rpx; |
||||
|
line-height: 46rpx; |
||||
|
color: #999; |
||||
|
} |
||||
|
.add-topic .address .tip { |
||||
|
width: 100%; |
||||
|
height: 78rpx; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.add-topic .address .tip image { |
||||
|
width: 22rpx; |
||||
|
height: 26rpx; |
||||
|
object-fit: cover; |
||||
|
} |
||||
|
.add-topic .address .tip text { |
||||
|
font-size: 26rpx; |
||||
|
color: #999; |
||||
|
margin-left: 14rpx; |
||||
|
} |
||||
|
|
||||
|
.add-topic .topic-button { |
||||
|
width: 100%; |
||||
|
height: 85rpx; |
||||
|
display:flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
position: fixed; |
||||
|
bottom: 100rpx; |
||||
|
left: 0; |
||||
|
} |
||||
|
.add-topic .topic-button button { |
||||
|
width: 560rpx; |
||||
|
height: 85rpx; |
||||
|
line-height: 85rpx; |
||||
|
text-align:center; |
||||
|
color: #fff; |
||||
|
font-size: 36rpx; |
||||
|
border-radius: 16rpx; |
||||
|
background: linear-gradient(to right, #F40C0C, #FF4E4E) |
||||
|
} |
||||
|
.add-topic .topic-button .hover-button { |
||||
|
background: red; |
||||
|
} |
||||
|
|
||||
|
.wux-actionsheet__button { |
||||
|
font-size: 34rpx !important; |
||||
|
color: #333 !important; |
||||
|
} |
@ -0,0 +1,110 @@ |
|||||
|
// subpages/associationNew/pages/associationlist/associationlist.js
|
||||
|
import { |
||||
|
getPartyGroupList, |
||||
|
getJoinGroup |
||||
|
} from '../../utils/api' |
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
associationList: [], |
||||
|
loadMoreVisible: false, |
||||
|
loadMoreType: 'none', |
||||
|
pageNo: 1, |
||||
|
pageSize: 10 |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad: function () { |
||||
|
// this.getPartyGroupList();
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面初次渲染完成 |
||||
|
*/ |
||||
|
onReady: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面显示 |
||||
|
*/ |
||||
|
onShow: function () { |
||||
|
this.setData({ |
||||
|
associationList: [] |
||||
|
}) |
||||
|
this.getPartyGroupList() |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面隐藏 |
||||
|
*/ |
||||
|
onHide: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面卸载 |
||||
|
*/ |
||||
|
onUnload: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面相关事件处理函数--监听用户下拉动作 |
||||
|
*/ |
||||
|
onPullDownRefresh: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面上拉触底事件的处理函数 |
||||
|
*/ |
||||
|
onReachBottom: function () { |
||||
|
this.setData({ |
||||
|
loadMoreVisible: true |
||||
|
}) |
||||
|
if (this.data.loadMoreType === 'loading') { |
||||
|
this.setData({ |
||||
|
pageNo: this.data.pageNo + 1 |
||||
|
}) |
||||
|
this.getPartyGroupList() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//获取党群列表
|
||||
|
getPartyGroupList () { |
||||
|
getPartyGroupList().then(res => { |
||||
|
console.log('获取党群列表', res) |
||||
|
this.setData({ |
||||
|
associationList: [...this.data.associationList, ...res.data], |
||||
|
loadMoreType: res.data.length === this.data.pageSize ? 'loading': 'none' |
||||
|
}) |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
this.setData({ |
||||
|
associationList: [], |
||||
|
loadMoreType: 'none' |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
//加入党群
|
||||
|
getJoinGroup (pid) { |
||||
|
let parm = { |
||||
|
partyGroupId: pid |
||||
|
} |
||||
|
getJoinGroup(parm).then(res => { |
||||
|
console.log(res) |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
joinGroupCallBack (e) { |
||||
|
this.getJoinGroup(e.detail.partyGroupId); |
||||
|
} |
||||
|
}) |
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"load-more": "../../../../components/loadMore/loadMore", |
||||
|
"community-list": "../../components/communityList/communityList" |
||||
|
}, |
||||
|
"navigationBarTitleText": "党群列表" |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
<!--subpages/associationNew/pages/associationlist/associationlist.wxml--> |
||||
|
<view class="association-list"> |
||||
|
<community-list |
||||
|
associationList="{{associationList}}" |
||||
|
bind:joinGroupCallBack="joinGroupCallBack"> |
||||
|
</community-list> |
||||
|
<load-more |
||||
|
loadMoreVisible="{{loadMoreVisible}}" |
||||
|
loadMoreType="{{loadMoreType}}"> |
||||
|
</load-more> |
||||
|
</view> |
@ -0,0 +1,7 @@ |
|||||
|
/* subpages/associationNew/pages/associationlist/associationlist.wxss */ |
||||
|
page { |
||||
|
width:100%; |
||||
|
height: auto; |
||||
|
overflow-y: auto; |
||||
|
background: #f7f7f7; |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
import { getImageUrl} from '../../utils/api' |
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
partyGroupId: '', |
||||
|
imageUrlList: [], |
||||
|
pageNo: 1, |
||||
|
pageSize: 10 |
||||
|
}, |
||||
|
onLoad: function (options) { |
||||
|
this.data.partyGroupId = options.code |
||||
|
getImageUrl().then(res => { |
||||
|
this.setData({ |
||||
|
imageUrlList: [...res.data] |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面相关事件处理函数--监听用户下拉动作 |
||||
|
*/ |
||||
|
onPullDownRefresh: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面上拉触底事件的处理函数 |
||||
|
*/ |
||||
|
onReachBottom: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 用户点击右上角分享 |
||||
|
*/ |
||||
|
onShareAppMessage: function () { |
||||
|
|
||||
|
}, |
||||
|
//跳转页面
|
||||
|
navToGroupMembers (e) { |
||||
|
console.log(this.data.partyGroupId) |
||||
|
wx.navigateTo({ |
||||
|
url: `/subpages/associationNew/pages/gMembersList/gMembersList?partyGroupId=${this.data.partyGroupId}` |
||||
|
}) |
||||
|
}, |
||||
|
navToNewPage (e) { |
||||
|
// console.log(e.currentTarget.dataset.page);
|
||||
|
if (e.currentTarget.dataset.page === 'help') { |
||||
|
wx.navigateTo({ |
||||
|
url: `/subpages/associationNew/pages/gOfficialsList/gOfficialsList?partyGroupId=${this.data.partyGroupId}` |
||||
|
}) |
||||
|
} else if (e.currentTarget.dataset.page === 'gather') { |
||||
|
console.log('/subpages/associationNew/pages/community/community.js') |
||||
|
wx.navigateTo({ |
||||
|
url:`/subpages/associationNew/pages/eventlist/eventlist?partyGroupId=${this.data.partyGroupId}&topicType=1` //`#/话对捧个场`
|
||||
|
}) |
||||
|
} else if (e.currentTarget.dataset.page === 'applause') { |
||||
|
wx.navigateTo({ |
||||
|
url:`/subpages/associationNew/pages/eventlist/eventlist?partyGroupId=${this.data.partyGroupId}&topicType=0` //`#/事好鼓个掌`
|
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
@ -0,0 +1,6 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"load-more": "../../../../components/loadMore/loadMore" |
||||
|
}, |
||||
|
"navigationBarTitleText": "党群 1+1" |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
<view class="community"> |
||||
|
<view class="func-top"> |
||||
|
<text>群成员</text> |
||||
|
<button hover-class="hover-class" class="top-right" bindtap="navToGroupMembers" plain='true'><image src="../../images/next.png"/></button> |
||||
|
</view> |
||||
|
<view class="func-item" |
||||
|
wx:for="{{imageUrlList}}" |
||||
|
wx:for-index="index" |
||||
|
wx:for-item="item" |
||||
|
wx:key="index"> |
||||
|
<image bindtap="navToNewPage" data-page="{{item.imgCode}}" src="{{item.imgUrl}}"/> |
||||
|
</view> |
||||
|
</view> |
@ -0,0 +1,49 @@ |
|||||
|
page { |
||||
|
width:100%; |
||||
|
height: auto; |
||||
|
overflow-y: auto; |
||||
|
background: #f7f7f7; |
||||
|
} |
||||
|
.hover-btn { |
||||
|
box-shadow: 0 0 10rpx rgba(63, 63, 63, 0.1); |
||||
|
} |
||||
|
.community .func-top{ |
||||
|
height: 94rpx; |
||||
|
width: 750rpx; |
||||
|
position: relative; |
||||
|
background: rgba(255, 255, 255, 1); |
||||
|
} |
||||
|
.community .func-top text{ |
||||
|
height: 94rpx; |
||||
|
font-size: 32rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: bold; |
||||
|
color: rgba(51, 51, 51, 1); |
||||
|
line-height: 94rpx; |
||||
|
position: absolute; |
||||
|
left: 29rpx; |
||||
|
} |
||||
|
.community .func-top .top-right{ |
||||
|
width: 40rpx; |
||||
|
height: 94rpx; |
||||
|
padding: 0; |
||||
|
border: none; |
||||
|
position: absolute; |
||||
|
right: 34rpx; |
||||
|
} |
||||
|
.community .func-top .top-right image{ |
||||
|
width: 18rpx; |
||||
|
height: 24rpx; |
||||
|
margin: 0; |
||||
|
position: absolute; |
||||
|
top: 30rpx; |
||||
|
} |
||||
|
.community .func-item{ |
||||
|
width: 720rpx; |
||||
|
height: 270rpx; |
||||
|
margin: 0 auto; |
||||
|
} |
||||
|
.community .func-item image{ |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
@ -0,0 +1,243 @@ |
|||||
|
// subpages/associationNew/pages/eventlist/eventlist.js
|
||||
|
const app = getApp() |
||||
|
import { topiclist, commentSubmit, statement } from '../../utils/api' |
||||
|
import { |
||||
|
getTimestamp |
||||
|
} from '../../../../utils/common' |
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
topiclist: [], |
||||
|
timestamp: '', |
||||
|
pageIndex: 1, |
||||
|
pageSize: 10, |
||||
|
partyGroupId: '',//党群id
|
||||
|
topicType: '',//0:事好儿鼓个掌 1:话对捧个场
|
||||
|
nodata: false, |
||||
|
loadMoreType: 'none', |
||||
|
loadMoreVisible: false, |
||||
|
bannedFlag: '',//是否禁言 0:否 1:是
|
||||
|
ifcomment: false,//是否显示评论
|
||||
|
focus: false, |
||||
|
topicId: '',//被评论的话题ID
|
||||
|
commentContent: '', |
||||
|
}, |
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad: function (options) { |
||||
|
this.setData({ |
||||
|
partyGroupId: options.partyGroupId, |
||||
|
topicType: options.topicType,//0:事好儿鼓个掌 1:话对捧个场
|
||||
|
}) |
||||
|
if (options.topicType == 0) { |
||||
|
wx.setNavigationBarTitle({ |
||||
|
title: '事好儿鼓个掌' |
||||
|
}) |
||||
|
} else { |
||||
|
wx.setNavigationBarTitle({ |
||||
|
title: '话对捧个场' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
// 查列表
|
||||
|
topiclist() { |
||||
|
let that = this; |
||||
|
const para = { |
||||
|
pageIndex: this.data.pageIndex, |
||||
|
pageSize: this.data.pageSize, |
||||
|
timestamp: getTimestamp(), |
||||
|
topicType: this.data.topicType, |
||||
|
partyGroupId: this.data.partyGroupId, //党群id
|
||||
|
} |
||||
|
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 |
||||
|
}) |
||||
|
if (that.data.topiclist.length == 0) {//没有值
|
||||
|
that.setData({ |
||||
|
nodata: true, |
||||
|
loadMoreType: 'none', |
||||
|
loadMoreVisible: false, |
||||
|
}) |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
that.setData({ |
||||
|
topiclist: [], |
||||
|
nodata: true, |
||||
|
loadMoreType: 'none', |
||||
|
loadMoreVisible: false, |
||||
|
}) |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
// 跳转 发布话题
|
||||
|
navigateToAddTopic() { |
||||
|
// if (this.data.groupState === '15') {
|
||||
|
// wx.showToast({
|
||||
|
// title: '该群已禁言,暂不可发布话题',
|
||||
|
// icon: 'none',
|
||||
|
// duration: 2000
|
||||
|
// })
|
||||
|
// return false
|
||||
|
// }
|
||||
|
wx.navigateTo({ |
||||
|
url: `/subpages/associationNew/pages/addTopic/addTopic?partyGroupId=${this.data.partyGroupId}&topicType=${this.data.topicType}` |
||||
|
}) |
||||
|
}, |
||||
|
/** |
||||
|
* 生命周期函数--监听页面初次渲染完成 |
||||
|
*/ |
||||
|
onReady: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面显示 |
||||
|
*/ |
||||
|
onShow: function () { |
||||
|
this.setData({ |
||||
|
topiclist: [], |
||||
|
}) |
||||
|
this.topiclist() |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面隐藏 |
||||
|
*/ |
||||
|
onHide: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面卸载 |
||||
|
*/ |
||||
|
onUnload: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面相关事件处理函数--监听用户下拉动作 |
||||
|
*/ |
||||
|
onPullDownRefresh: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面上拉触底事件的处理函数 |
||||
|
*/ |
||||
|
onReachBottom: function () { |
||||
|
this.setData({ |
||||
|
loadMoreVisible: true |
||||
|
}) |
||||
|
if (this.data.loadMoreType === 'loading') { |
||||
|
this.setData({ |
||||
|
pageIndex: this.data.pageIndex + 1, |
||||
|
pageSize: this.data.pageSize, |
||||
|
}) |
||||
|
this.topiclist() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//点赞
|
||||
|
clicklike(e) { |
||||
|
// <!-- 用户是否已点赞 0否;1是 -->
|
||||
|
if (this.data.bannedFlag == '1') {//被禁言
|
||||
|
wx.showToast({ |
||||
|
title: '您已经被禁言', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
let attitude = "" |
||||
|
if (e.currentTarget.dataset.likeflag == '0') {//点赞
|
||||
|
attitude = 0 |
||||
|
} else { |
||||
|
attitude = 2 |
||||
|
} |
||||
|
let that = this; |
||||
|
const para = { |
||||
|
topicId: e.currentTarget.dataset.id,//被评论的话题ID
|
||||
|
attitude: attitude,//表态 0赞;1踩;2取消赞;3取消踩
|
||||
|
} |
||||
|
statement(para).then(res => { |
||||
|
that.setData({ |
||||
|
topiclist: [], |
||||
|
}) |
||||
|
this.topiclist() |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
// Textarea获取焦点
|
||||
|
clickTextarea(e) { |
||||
|
if (this.data.bannedFlag == '1') {//被禁言
|
||||
|
wx.showToast({ |
||||
|
title: '您已经被禁言', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
this.setData({ |
||||
|
ifcomment: true, |
||||
|
focus: true, |
||||
|
topicId: e.currentTarget.dataset.id |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 失去焦点
|
||||
|
bindAddressInput(e) { |
||||
|
this.setData({ //失去焦点以后view隐藏
|
||||
|
ifcomment: false |
||||
|
}) |
||||
|
}, |
||||
|
// 双向绑定
|
||||
|
bindIdentity(e) { |
||||
|
this.setData({ |
||||
|
commentContent: e.detail.value |
||||
|
}) |
||||
|
}, |
||||
|
// 评论按钮点击事件
|
||||
|
commentSubmit() { |
||||
|
|
||||
|
let that = this; |
||||
|
const para = { |
||||
|
topicId: this.data.topicId,//被评论的话题ID
|
||||
|
faCommentId: '',//父评论(被评论)ID
|
||||
|
content: this.data.commentContent,//评论内容
|
||||
|
} |
||||
|
commentSubmit(para).then(res => { |
||||
|
that.setData({ |
||||
|
topiclist: [], |
||||
|
}) |
||||
|
this.topiclist() |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
previewImage(e) { |
||||
|
app.globalData.previewImage = true |
||||
|
wx.previewImage({ |
||||
|
urls: e.currentTarget.dataset.imgarry, |
||||
|
current: e.currentTarget.dataset.src |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 用户点击右上角分享 |
||||
|
*/ |
||||
|
onShareAppMessage: function () { |
||||
|
|
||||
|
} |
||||
|
}) |
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"load-more": "../../../../components/loadMore/loadMore", |
||||
|
"no-data":"../../../../components/nodata/nodata" |
||||
|
}, |
||||
|
"navigationBarTitleText": "" |
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
<view class="item-list" wx:for-index="index" wx:for-item="item" wx:key="index" wx:for="{{topiclist}}"> |
||||
|
<view class="user-info"> |
||||
|
<image src="{{item.userFace}}"></image> |
||||
|
<view class="name-date"> |
||||
|
<view class="name">{{item.nickname}}</view> |
||||
|
<view class="date">{{item.createdTime}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="details-info">{{item.topicContent}}</view> |
||||
|
|
||||
|
<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}}" 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"> |
||||
|
<view class="all" data-id="{{item.id}}" bindtap="clicklike" data-likeFlag="{{item.likeFlag}}"> |
||||
|
<!-- 用户是否已点赞 0否;1是 --> |
||||
|
<image wx:if="{{item.likeFlag == '0'}}" src="../../images/give.png"></image> |
||||
|
<image wx:else src="../../images/give_2.png"></image> |
||||
|
<view class="give-data {{item.likeFlag == '1' ? 'color' : ''}}">{{item.supportNum}}</view> |
||||
|
</view> |
||||
|
<view class="all"> |
||||
|
<image src="../../images/comment.png"></image> |
||||
|
<view class="give-data">{{item.commentNum}}</view> |
||||
|
</view> |
||||
|
<view class="all" data-id="{{item.id}}" bindtap="clickTextarea"> |
||||
|
<image src="../../images/ic_huifu@2x.png"></image> |
||||
|
<view class="give-data">评论</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view wx:if="{{item.comments.length > 0}}" class="comment"> |
||||
|
<view wx:for="{{item.comments}}" wx:key="{{index}}" wx:for-index="index" wx:for-item="item_" |
||||
|
class="comment-list"><text>{{item_.username}}:</text>{{item_.content}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="release" wx:if="{{ifcomment}}"> |
||||
|
<view class="replyinfo2"> |
||||
|
<textarea placeholder-class="input_null" fixed="true" maxlength="-1" show-confirm-bar="false" |
||||
|
cursor-spacing="15" auto-height="true" placeholder="请输入回复" value="{{commentContent}}" focus='{{focus}}' bindblur="bindAddressInput" bindinput="bindIdentity"></textarea> |
||||
|
<button bindtap="commentSubmit" form-type="submit" class="submit">发送</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
<!--加载更多提示--> |
||||
|
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more> |
||||
|
<no-data isShow="{{nodata}}"></no-data> |
||||
|
<!-- 是否禁言 0:否 1:是 --> |
||||
|
<view wx:if="{{bannedFlag == '0'}}" class="addIssue" bindtap="navigateToAddTopic"> |
||||
|
<image wx:if="{{topicType == '0'}}" src="../../images/story.png" /> |
||||
|
<image wx:else src="../../images/speack.png" /> |
||||
|
</view> |
@ -0,0 +1,213 @@ |
|||||
|
page { |
||||
|
background: #f7f7f7; |
||||
|
} |
||||
|
|
||||
|
.item-list { |
||||
|
width: 100%; |
||||
|
padding: 40rpx 29rpx 20rpx 29rpx; |
||||
|
background: #fff; |
||||
|
margin-top: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.user-info { |
||||
|
width: calc(100% - 58rpx); |
||||
|
height: 64rpx; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.user-info image { |
||||
|
width: 64rpx; |
||||
|
height: 64rpx; |
||||
|
} |
||||
|
|
||||
|
.user-info .name-date { |
||||
|
margin-left: 14rpx; |
||||
|
height: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
} |
||||
|
|
||||
|
.user-info .name-date .name { |
||||
|
font-size: 28rpx; |
||||
|
font-weight: bold; |
||||
|
color: rgba(51, 51, 51, 1); |
||||
|
} |
||||
|
|
||||
|
.user-info .name-date .date { |
||||
|
font-size: 20rpx; |
||||
|
font-weight: 500; |
||||
|
color: rgba(153, 153, 153, 1); |
||||
|
} |
||||
|
|
||||
|
.details-info { |
||||
|
width: calc(100% - 58rpx); |
||||
|
font-size: 36rpx; |
||||
|
font-weight: 500; |
||||
|
color: rgba(51, 51, 51, 1); |
||||
|
line-height: 54rpx; |
||||
|
} |
||||
|
|
||||
|
.image-list { |
||||
|
width: calc(100% - 58rpx); |
||||
|
margin-top: 30rpx; |
||||
|
display: grid; |
||||
|
grid-template-columns: repeat(auto-fit, minmax(216rpx, 1fr)); |
||||
|
grid-gap: 7rpx; |
||||
|
} |
||||
|
|
||||
|
.image-list .image-item { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
object-fit: cover; |
||||
|
border-radius: 8rpx; |
||||
|
} |
||||
|
|
||||
|
.attitude { |
||||
|
width: calc(100% - 158rpx); |
||||
|
margin-top: 21rpx; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: space-between; |
||||
|
/* justify-content: center; */ |
||||
|
height: 28rpx; |
||||
|
padding: 0 50rpx; |
||||
|
} |
||||
|
|
||||
|
.attitude .all { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.attitude .all image { |
||||
|
width: 28rpx; |
||||
|
height: 28rpx; |
||||
|
} |
||||
|
|
||||
|
.attitude .all .give-data { |
||||
|
font-size: 24rpx; |
||||
|
font-weight: 500; |
||||
|
color: rgba(51, 51, 51, 1); |
||||
|
margin-left: 9rpx; |
||||
|
/* width: 196rpx; */ |
||||
|
} |
||||
|
|
||||
|
.attitude .all .give-data.color { |
||||
|
color: #FFB103; |
||||
|
} |
||||
|
|
||||
|
.comment { |
||||
|
width: calc(100% - 98rpx); |
||||
|
padding: 26rpx 20rpx; |
||||
|
background: #F2F2F2; |
||||
|
border-radius: 8rpx; |
||||
|
margin-top: 25rpx; |
||||
|
} |
||||
|
|
||||
|
.comment .comment-list { |
||||
|
width: 100%; |
||||
|
margin-top: 11rpx; |
||||
|
font-size: 28rpx; |
||||
|
color: #999999; |
||||
|
} |
||||
|
|
||||
|
.comment .comment-list text { |
||||
|
color: #333333; |
||||
|
} |
||||
|
|
||||
|
/* 评论样式 */ |
||||
|
.release { |
||||
|
align-items: flex-end; |
||||
|
/*底部对齐*/ |
||||
|
box-sizing: border-box; |
||||
|
position: fixed; |
||||
|
left: 0; |
||||
|
bottom: 0; |
||||
|
width: 100%; |
||||
|
padding: 13rpx 20rpx; |
||||
|
background-color: #fff; |
||||
|
font-size: 28rpx; |
||||
|
z-index: 999; |
||||
|
} |
||||
|
|
||||
|
.replyinfo1 { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
/*两端对齐*/ |
||||
|
font-size: 35rpx; |
||||
|
} |
||||
|
|
||||
|
.replyinfo2 { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
/*两端对齐*/ |
||||
|
} |
||||
|
|
||||
|
.release textarea { |
||||
|
width: calc(100% - 200rpx); |
||||
|
min-height: 34rpx; |
||||
|
max-height: 102rpx; |
||||
|
/*最多显示三行*/ |
||||
|
border-width: 15rpx 20rpx; |
||||
|
/*使用padding与预期留白不一致,故使用border*/ |
||||
|
border-style: solid; |
||||
|
border-color: #F2F2F2; |
||||
|
line-height: 34rpx; |
||||
|
font-size: 28rpx; |
||||
|
background-color: #F2F2F2; |
||||
|
border-radius: 4rpx; |
||||
|
} |
||||
|
|
||||
|
.release .text { |
||||
|
font-size: 40rpx; |
||||
|
color: #c9c9c9; |
||||
|
} |
||||
|
|
||||
|
.cancel { |
||||
|
width: 240rpx; |
||||
|
height: 64rpx; |
||||
|
line-height: 64rpx; |
||||
|
text-align: center; |
||||
|
color: #6c0; |
||||
|
margin: 0 3px; |
||||
|
padding: 0; |
||||
|
} |
||||
|
|
||||
|
.release .submit { |
||||
|
width: 160rpx; |
||||
|
height: 60rpx; |
||||
|
line-height: 60rpx; |
||||
|
text-align: center; |
||||
|
margin: 0 3px; |
||||
|
padding: 0; |
||||
|
font-size: 32rpx; |
||||
|
font-weight: 500; |
||||
|
color: rgba(255, 255, 255, 1); |
||||
|
background: linear-gradient(to right, #e95027, #db1a1f); |
||||
|
border-radius: 50rpx; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.pro-box .info .text .delete { |
||||
|
color: #f68135; |
||||
|
border-radius: 50rpx; |
||||
|
border: 1px solid #f68135; |
||||
|
font-size: 28 rpx; |
||||
|
width: 150rpx; |
||||
|
height: 48rpx; |
||||
|
text-align: center; |
||||
|
} |
||||
|
|
||||
|
.addIssue { |
||||
|
width: 178rpx; |
||||
|
height: 178rpx; |
||||
|
position: fixed; |
||||
|
bottom: 30%; |
||||
|
right: 14rpx; |
||||
|
} |
||||
|
|
||||
|
.addIssue image { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
object-fit: cover; |
||||
|
} |
@ -0,0 +1,115 @@ |
|||||
|
import { |
||||
|
getPartyUserList, |
||||
|
postUserBanned, |
||||
|
postModifyIdentity |
||||
|
} from '../../utils/api' |
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
currentUser: {}, |
||||
|
gMembersList: [], |
||||
|
loadMoreVisible: false, |
||||
|
loadMoreType: 'none', |
||||
|
preloadVisible: true, |
||||
|
pageNo: 1, |
||||
|
pageSize: 10, |
||||
|
partyGroupId: '' |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad: function (options) { |
||||
|
this.data.partyGroupId = options.partyGroupId |
||||
|
this.getPartyUserList() |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面相关事件处理函数--监听用户下拉动作 |
||||
|
*/ |
||||
|
onPullDownRefresh: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面上拉触底事件的处理函数 |
||||
|
*/ |
||||
|
onReachBottom: function () { |
||||
|
this.setData({ |
||||
|
loadMoreVisible: true |
||||
|
}) |
||||
|
if (this.data.loadMoreType === 'loading') { |
||||
|
this.setData({ |
||||
|
pageNo: this.data.pageNo + 1 |
||||
|
}) |
||||
|
this.getPartyUserList() |
||||
|
} |
||||
|
}, |
||||
|
// 获取群成员列表
|
||||
|
getPartyUserList () { |
||||
|
const para = { |
||||
|
pageIndex: this.data.pageNo, |
||||
|
pageSize: this.data.pageSize, |
||||
|
partyGroupId: this.data.partyGroupId |
||||
|
} |
||||
|
wx.showLoading({ |
||||
|
title:'' |
||||
|
}) |
||||
|
getPartyUserList(para).then(res => { |
||||
|
console.log('获取群成员列表', res) |
||||
|
this.setData({ |
||||
|
currentUser: {...res.data.currentUser}, |
||||
|
gMembersList: [...this.data.gMembersList, ...res.data.otherUsers], |
||||
|
loadMoreType: res.data.otherUsers.length === this.data.pageSize ? 'loading': 'none', |
||||
|
preloadVisible: false |
||||
|
}) |
||||
|
if (this.data.loadMoreType === 'none' && this.data.gMembersList.length !== 0) { |
||||
|
this.setData({ |
||||
|
loadMoreVisible: true |
||||
|
}) |
||||
|
} |
||||
|
wx.hideLoading() |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
this.setData({ |
||||
|
gMembersList: [], |
||||
|
loadMoreType: 'none', |
||||
|
preloadVisible: false |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
bannedChangeCallBack (e) { |
||||
|
console.log(e.detail) |
||||
|
const para = {...e.detail} |
||||
|
postUserBanned(para).then(res => { |
||||
|
console.log('用户禁言', res) |
||||
|
this.data.gMembersList.forEach(item => { |
||||
|
if (item.id === e.detail.groupUserId) { |
||||
|
item.bannedFlag = e.detail.bannedFlag |
||||
|
} |
||||
|
}) |
||||
|
this.setData({ |
||||
|
gMembersList: this.data.gMembersList |
||||
|
}) |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
modifyIdentityCallBack (e) { |
||||
|
console.log(e.detail) |
||||
|
const para = {...e.detail} |
||||
|
postModifyIdentity(para).then(res => { |
||||
|
console.log('修改用户身份', res) |
||||
|
this.setData({ |
||||
|
gMembersList: [], |
||||
|
currentUser: {} |
||||
|
}) |
||||
|
this.getPartyUserList(); |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
} |
||||
|
}) |
@ -0,0 +1,8 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"load-more": "../../../../components/loadMore/loadMore", |
||||
|
"members-list": "../../components/membersList/membersList", |
||||
|
"no-data": "../../../../components/nodata/nodata" |
||||
|
}, |
||||
|
"navigationBarTitleText": "群成员" |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
<view class="gmembers-list"> |
||||
|
<members-list |
||||
|
gMembersList="{{gMembersList}}" |
||||
|
currentUser="{{currentUser}}" |
||||
|
bind:modifyIdentity="modifyIdentityCallBack" |
||||
|
bind:bannedChange="bannedChangeCallBack"> |
||||
|
</members-list> |
||||
|
<no-data isShow="{{gMembersList.length == 0}}"></no-data> |
||||
|
<load-more |
||||
|
loadMoreVisible="{{loadMoreVisible}}" |
||||
|
loadMoreType="{{loadMoreType}}"> |
||||
|
</load-more> |
||||
|
</view> |
@ -0,0 +1,7 @@ |
|||||
|
/* subpages/associationNew/pages/associationlist/associationlist.wxss */ |
||||
|
page { |
||||
|
width:100%; |
||||
|
height: auto; |
||||
|
overflow-y: auto; |
||||
|
background: #f7f7f7; |
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
import { getOfficialsList } from '../../utils/api' |
||||
|
Page({ |
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
partyGroupId: '', |
||||
|
gOfficialsList: [], |
||||
|
loadMoreVisible: false, |
||||
|
loadMoreType: 'none', |
||||
|
preloadVisible: true, |
||||
|
pageNo: 1, |
||||
|
pageSize: 10 |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad: function (options) { |
||||
|
this.data.partyGroupId = options.partyGroupId |
||||
|
this.getOfficialsList(); |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面相关事件处理函数--监听用户下拉动作 |
||||
|
*/ |
||||
|
onPullDownRefresh: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面上拉触底事件的处理函数 |
||||
|
*/ |
||||
|
onReachBottom: function () { |
||||
|
this.setData({ |
||||
|
loadMoreVisible: true |
||||
|
}) |
||||
|
if (this.data.loadMoreType === 'loading') { |
||||
|
this.setData({ |
||||
|
pageNo: this.data.pageNo + 1 |
||||
|
}) |
||||
|
this.getOfficialsList() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 官小带个长 列表
|
||||
|
getOfficialsList () { |
||||
|
const para = { |
||||
|
pageIndex: this.data.pageNo, |
||||
|
pageSize: this.data.pageSize, |
||||
|
partyGroupId: this.data.partyGroupId |
||||
|
} |
||||
|
getOfficialsList(para).then(res => { |
||||
|
console.log('获取官小带个长列表', res) |
||||
|
this.setData({ |
||||
|
gOfficialsList: [...this.data.gOfficialsList, ...res.data], |
||||
|
loadMoreType: res.data.length === this.data.pageSize ? 'loading': 'none', |
||||
|
preloadVisible: false |
||||
|
}) |
||||
|
if (this.data.loadMoreType === 'none' && this.data.gOfficialsList.length !== 0) { |
||||
|
this.setData({ |
||||
|
loadMoreVisible: true |
||||
|
}) |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
this.setData({ |
||||
|
gOfficialsList: [], |
||||
|
loadMoreType: 'none', |
||||
|
preloadVisible: false |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
}) |
@ -0,0 +1,8 @@ |
|||||
|
{ |
||||
|
"usingComponents": { |
||||
|
"load-more": "../../../../components/loadMore/loadMore", |
||||
|
"no-data": "../../../../components/nodata/nodata", |
||||
|
"members-list": "../../components/membersList/membersList" |
||||
|
}, |
||||
|
"navigationBarTitleText": "官小带个长" |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
<view class="gmembers-list"> |
||||
|
<members-list gOfficialsList="{{gOfficialsList}}"> |
||||
|
</members-list> |
||||
|
<no-data isShow="{{gOfficialsList.length == 0}}"></no-data> |
||||
|
<load-more |
||||
|
loadMoreVisible="{{loadMoreVisible}}" |
||||
|
loadMoreType="{{loadMoreType}}"> |
||||
|
</load-more> |
||||
|
</view> |
@ -0,0 +1,6 @@ |
|||||
|
page { |
||||
|
width:100%; |
||||
|
height: auto; |
||||
|
overflow-y: auto; |
||||
|
background: #f7f7f7; |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
// subpages/associationNew/pages/talklist/talklist.js
|
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad: function (options) { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面初次渲染完成 |
||||
|
*/ |
||||
|
onReady: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面显示 |
||||
|
*/ |
||||
|
onShow: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面隐藏 |
||||
|
*/ |
||||
|
onHide: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面卸载 |
||||
|
*/ |
||||
|
onUnload: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面相关事件处理函数--监听用户下拉动作 |
||||
|
*/ |
||||
|
onPullDownRefresh: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面上拉触底事件的处理函数 |
||||
|
*/ |
||||
|
onReachBottom: function () { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 用户点击右上角分享 |
||||
|
*/ |
||||
|
onShareAppMessage: function () { |
||||
|
|
||||
|
} |
||||
|
}) |
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"usingComponents": {} |
||||
|
} |
@ -0,0 +1,2 @@ |
|||||
|
<!--subpages/associationNew/pages/talklist/talklist.wxml--> |
||||
|
<text>subpages/associationNew/pages/talklist/talklist.wxml</text> |
@ -0,0 +1 @@ |
|||||
|
/* subpages/associationNew/pages/talklist/talklist.wxss */ |
@ -0,0 +1,121 @@ |
|||||
|
const request = require('../../../utils/request') |
||||
|
/** |
||||
|
*获取图片 |
||||
|
*/ |
||||
|
export function getImageUrl() { |
||||
|
return request.get('imgConfig/getImgUrl/1') |
||||
|
} |
||||
|
/** |
||||
|
*进入党群 |
||||
|
*/ |
||||
|
export function getJoinGroup({partyGroupId}) { |
||||
|
return request.get('partyGroup/group/join',{ |
||||
|
partyGroupId |
||||
|
}) |
||||
|
} |
||||
|
/** |
||||
|
*党群名称列表 |
||||
|
*/ |
||||
|
export function getPartyGroupList() { |
||||
|
return request.get('partyGroup/group/list') |
||||
|
} |
||||
|
/** |
||||
|
* 群成员列表 |
||||
|
*/ |
||||
|
export function getPartyUserList({pageIndex, pageSize, partyGroupId}) { |
||||
|
return request.get('partyGroup/user/list',{ |
||||
|
pageIndex, |
||||
|
pageSize, |
||||
|
partyGroupId |
||||
|
}) |
||||
|
} |
||||
|
/** |
||||
|
* 官小带个长列表 |
||||
|
*/ |
||||
|
export function getOfficialsList({pageIndex, pageSize, partyGroupId}) { |
||||
|
return request.get('partyGroup/officials/list',{ |
||||
|
pageIndex, |
||||
|
pageSize, |
||||
|
partyGroupId |
||||
|
}) |
||||
|
} |
||||
|
/** |
||||
|
* 当前用户信息 |
||||
|
*/ |
||||
|
export function getCurrentUserInfo(partyGroupId) { |
||||
|
return request.get('partyGroup/user/currentUserInfo/'+partyGroupId) |
||||
|
} |
||||
|
/** |
||||
|
* 用户身份修改 |
||||
|
*/ |
||||
|
export function postModifyIdentity({groupUserId, identityFlag}) { |
||||
|
return request.post('partyGroup/user/modifyIdentity',{ |
||||
|
groupUserId, |
||||
|
identityFlag |
||||
|
}) |
||||
|
} |
||||
|
/** |
||||
|
* 用户禁言 |
||||
|
*/ |
||||
|
export function postUserBanned({groupUserId, bannedFlag}) { |
||||
|
return request.post('partyGroup/user/banned',{ |
||||
|
groupUserId, |
||||
|
bannedFlag |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 话题列表 |
||||
|
*/ |
||||
|
export function topiclist({pageIndex,pageSize,timestamp,topicType,partyGroupId}) { |
||||
|
return request.get('partyGroup/topic/list',{ |
||||
|
pageIndex, |
||||
|
pageSize, |
||||
|
timestamp, |
||||
|
topicType, |
||||
|
partyGroupId, |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 发布话题 |
||||
|
*/ |
||||
|
|
||||
|
export function addTopic({topicType, topicContent,topicAddress,topicLatitude,topicLongitude,partyGroupId,images}) { |
||||
|
return request.post('partyGroup/topic/submit',{ |
||||
|
topicType, |
||||
|
topicContent, |
||||
|
topicAddress, |
||||
|
topicLatitude, |
||||
|
topicLongitude, |
||||
|
partyGroupId, |
||||
|
images |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 话题评论 |
||||
|
*/ |
||||
|
|
||||
|
export function commentSubmit({topicId, faCommentId,content}) { |
||||
|
return request.post('partyGroup/comment/submit',{ |
||||
|
topicId, |
||||
|
faCommentId, |
||||
|
content |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 表态话题(赞/踩) |
||||
|
*/ |
||||
|
export function statement({attitude, topicId}) { |
||||
|
return request.post('partyGroup/topic/statement',{ |
||||
|
topicId, |
||||
|
attitude |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,65 @@ |
|||||
|
var GROUP_LEADER='0'; |
||||
|
var GROUP_LEADER_2='1'; |
||||
|
var GROUP_MEMBER='2'; |
||||
|
|
||||
|
var getIdentity = function (btnType,mypower,userpower) { |
||||
|
if (btnType === 0) { |
||||
|
if (mypower === GROUP_LEADER && userpower === GROUP_MEMBER) { |
||||
|
return true |
||||
|
} else { |
||||
|
return false |
||||
|
} |
||||
|
} else if (btnType === 1) { |
||||
|
if (mypower === GROUP_LEADER && userpower === GROUP_LEADER_2) { |
||||
|
return true |
||||
|
} else { |
||||
|
return false |
||||
|
} |
||||
|
} else { |
||||
|
if (mypower === GROUP_LEADER && userpower !== GROUP_LEADER) { |
||||
|
return true |
||||
|
} else if (mypower === GROUP_LEADER_2 && userpower === GROUP_MEMBER) { |
||||
|
return true |
||||
|
} else { |
||||
|
return false |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
var getBanned = function (code) { |
||||
|
var index = parseInt(code) |
||||
|
return [ |
||||
|
' 未禁言', |
||||
|
'禁言1天', |
||||
|
'禁言1周', |
||||
|
'禁言1月', |
||||
|
'永久禁言' |
||||
|
][index] |
||||
|
} |
||||
|
var disabledBanned = function (identity,uIdentity) { |
||||
|
if (identity === GROUP_LEADER) { |
||||
|
return true |
||||
|
} else if (identity === GROUP_LEADER_2) { |
||||
|
if (uIdentity !== GROUP_MEMBER) { |
||||
|
return false |
||||
|
} else { |
||||
|
return true |
||||
|
} |
||||
|
} else { |
||||
|
return false |
||||
|
} |
||||
|
} |
||||
|
var forbiddenClass = function(identity,uIdentity){ |
||||
|
if (identity === GROUP_LEADER_2 && uIdentity === GROUP_LEADER_2) { |
||||
|
return true |
||||
|
} else if (identity === GROUP_MEMBER) { |
||||
|
return true |
||||
|
} else { |
||||
|
return false |
||||
|
} |
||||
|
} |
||||
|
module.exports = { |
||||
|
getIdentity: getIdentity, |
||||
|
getBanned: getBanned, |
||||
|
disabledBanned:disabledBanned, |
||||
|
forbiddenClass:forbiddenClass |
||||
|
} |