Browse Source

显示点赞人员;显示社区居民标识

master
ZhaoTongYao 5 years ago
parent
commit
c2acac176a
  1. 2
      project.config.json
  2. 2
      subpages/associationNew/components/communityList/communityList.wxss
  3. 35
      subpages/associationNew/pages/eventlist/eventlist.js
  4. 4
      subpages/associationNew/pages/eventlist/eventlist.wxml
  5. 6
      subpages/associationNew/pages/eventlist/eventlist.wxss
  6. 1
      subpages/associationNew/utils/api.js
  7. 1
      utils/config.js

2
project.config.json

@ -22,7 +22,7 @@
"disablePlugins": [],
"outputPath": ""
},
"useCompilerModule": true,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",

2
subpages/associationNew/components/communityList/communityList.wxss

@ -19,7 +19,7 @@
width: 100%;
height: 100%;
position: absolute;
background: rgba(0, 0, 0, 0.2);
background: rgba(0, 0, 0, 0.1);
border-radius: 10rpx;
text-align: center;
display: flex;

35
subpages/associationNew/pages/eventlist/eventlist.js

@ -175,7 +175,9 @@ Page({
if (this.verifyCompleteInfo()) {
return false
}
let index = e.currentTarget.dataset.index
this.setData({
index: e.currentTarget.dataset.index
})
// <!-- 用户是否已点赞 0否;1是 -->
if (this.data.bannedFlag == '1') {//被禁言
wx.showToast({
@ -198,13 +200,7 @@ Page({
}
statement(para).then(res => {
// 点赞成功以后实现局部刷新功能
var obj = that.data.topiclist[index]
// <!-- 用户是否已点赞 0否;1是 -->
obj.likeFlag = obj.likeFlag == '0' ? '1' : '0'
obj.supportNum = obj.likeFlag == '1' ? obj.supportNum + 1 : obj.supportNum - 1
that.setData({
["topiclist[" + index + "]"]: obj
})
that.nowLikesList(e.currentTarget.dataset.id);
}).catch(err => {
console.log(err)
})
@ -314,5 +310,28 @@ Page({
*/
onShareAppMessage: function () {
},
nowLikesList (topicId) {
let that = this;
const para = {
pageIndex: 1,
pageSize: 10,
timestamp: getTimestamp(),
topicType: this.data.topicType,
partyGroupId: this.data.partyGroupId, //党群id
partyTopicId: topicId
}
topiclist(para).then(res => {
var obj = that.data.topiclist[that.data.index]
obj = res.data.topicList[0]
// <!-- 用户是否已点赞 0否;1是 -->
// obj.likeFlag = obj.likeFlag == '0' ? '1' : '0'
// obj.supportNum = obj.likeFlag == '1' ? obj.supportNum + 1 : obj.supportNum - 1
that.setData({
["topiclist[" + that.data.index + "]"]: obj
})
}).catch(err => {
console.log(err)
})
}
})

4
subpages/associationNew/pages/eventlist/eventlist.wxml

@ -2,8 +2,8 @@
<view class="user-info">
<image src="{{item.userFace}}"></image>
<view class="name-date">
<view class="name">{{item.nickname}}</view>
<image class="community-logo" wx:if="{{item.thisCommunity === '1'}}" src="../../images/resident@2x.png"></image>
<view class="name">{{item.nickname}}
<image class="community-logo" wx:if="{{item.thisCommunity == '1'}}" src="../../images/resident@2x.png"></image></view>
<view class="date">{{item.createdTime}}</view>
</view>
</view>

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

@ -33,6 +33,8 @@ page {
font-size: 28rpx;
font-weight: bold;
color: rgba(51, 51, 51, 1);
display: flex;
align-items: center;
}
.user-info .name-date .community-logo {
@ -114,8 +116,8 @@ page {
}
.line {
width: calc(100% - 60rpx);
height: 1px;
background-color: #999999;
height: 0.5px;
background-color: #dddddd;
}
.comment {

1
subpages/associationNew/utils/api.js

@ -133,3 +133,4 @@ export function getGuideInfo(partyGroupId) {

1
utils/config.js

@ -14,6 +14,7 @@ function BASEURL() {
// return 'https://epdc-app.qingdaoshibei.cn/epdc-api/api/' // 电政办 正式环境 接口地址
// return 'https://epdc-shibei.elinkservice.cn/epdc-api/api/' // 电政办 正式环境 接口地址
// return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址
// return 'http://10.10.10.40:9094/epdc-api/api/' // 锦水测试环境
}
function WEBROOT() {

Loading…
Cancel
Save