Browse Source

Merge refs/remotes/origin/master into refs/heads/master

master
lqq 6 years ago
parent
commit
3fba75f5eb
  1. BIN
      images/topic/un_zan.png
  2. BIN
      images/topic/zan.png
  3. 22
      models/user.js
  4. 4
      pages/topics/goodIdea/cell/index.js
  5. 6
      pages/topics/goodIdea/cell/index.wxml
  6. 9
      pages/topics/goodIdea/cell/index.wxss
  7. 8
      pages/topics/index.js
  8. 10
      pages/topics/interactive/topicArticle/index.js
  9. 2
      pages/topics/interactive/topicArticle/index.wxml
  10. 12
      pages/user/index.js
  11. 7
      pages/user/myIdea/index.js
  12. 20
      pages/user/myInfo/index.js
  13. 4
      pages/user/myInfo/index.wxml

BIN
images/topic/un_zan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/topic/zan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

22
models/user.js

@ -8,7 +8,8 @@ const UserConst = {
user_myTopics_url:'/api/group/groupByUser', // 我的议题
user_myActivity_url:'/api/activity/activityList', // 我的活动
user_updateUserInfo_url:'/api/miniuser/updateMiniUser' // 更新用户信息
user_updateUserInfo_url:'/api/miniuser/updateMiniUser', // 更新用户信息
user_sendUserInfo_url:'/api/miniuser/updateUserInfo' // 上传用户信息
}
class UserModel extends HTTP {
constructor () {
@ -43,7 +44,24 @@ class UserModel extends HTTP {
this.request(params)
}
sendUserInfo(weChatInfo,success){
let params = {
url: UserConst.user_sendUserInfo_url,
method: Method.POST,
data: {
avatarUrl: weChatInfo.avatarUrl,
city: weChatInfo.city,
country: weChatInfo.country,
gender: weChatInfo.gender,
nickName: weChatInfo.nickName,
province: weChatInfo.province
},
success: success
}
this.request(params)
}
getMyMessageList(page, success){
let params = {
url: UserConst.user_myMessage_url,

4
pages/topics/goodIdea/cell/index.js

@ -18,8 +18,8 @@ Component({
* 组件的初始数据
*/
data: {
unPraise: '/images/common/zan.png',
praise: '/images/common/star_light.png',
unPraise: '/images/topic/un_zan.png',
praise: '/images/topic/zan.png',
isTouchMove:false,
startX: 0, //开始坐标
startY: 0

6
pages/topics/goodIdea/cell/index.wxml

@ -3,7 +3,7 @@
<view class="touch-item {{isTouchMove ? 'touch-move-active' : ''}}" data-index="{{itemIndex}}" data-name="{{itemData.commentName}}" bindtouchstart="touchstart" bindtouchmove="touchmove" >
<view class="content">
<view class="content-left">
<image src="{{itemData.commentIcon}}" style="width:20px;height:20px;"></image>
<image src="{{itemData.commentIcon}}" style="width:30px;height:30px;"></image>
</view>
<view class="content-right">
<view class="userInfo">
@ -13,9 +13,7 @@
</view>
<view class="userInfo-right" bindtap="onClickPraise" data-item="{{itemData}}" data-index='{{itemIndex}}'>
<view class="praiseNum">{{itemData.praiseNum}}</view>
<view class="praise-icon">
<image src="{{item.isPraise ? praise : unPraise}}" style="width:100%;"></image>
</view>
<image class="praise-icon" src="{{itemData.isSupport ==='0' ? unPraise : praise}}"></image>
</view>
</view>
<view style="color:#3B3B3B;font-size:14px;padding: 0 0 5px 0;">{{itemData.comment}}</view>

9
pages/topics/goodIdea/cell/index.wxss

@ -5,10 +5,8 @@
padding: 10px; */
}
.content-left{
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #EEEEEE;
width: 30px;
height: 30px;
}
.content-right{
width: 100%;
@ -40,10 +38,9 @@ image{
height: 100%;
}
.praise-icon{
margin-left: 5px;
width: 15px;
height: 15px;
line-height: 10px;
margin-left: 5px;
}
.userName{
color: #66708B;

8
pages/topics/index.js

@ -136,6 +136,7 @@ Page({
commentTime: item.createTime,
comment: item.comment,
praiseNum: item.supportNum,
isSupport: item.isSupport,
// 议题数据
topicTtitle: item.title,
topicGroupAvator: item.groupAvator,
@ -288,13 +289,10 @@ Page({
this.fetchGoodIdeaPraise(e.detail.commentId)
},
fetchGoodIdeaPraise(id) {
wx.showLoading()
topicModel.topicCommentPraise(id, res => {
console.log(res)
if (res.code === 200) {
wx.showToast({
title: res.message,
icon: 'none'
})
wx.hideLoading()
this.onPullDownRefresh()
}
})

10
pages/topics/interactive/topicArticle/index.js

@ -29,7 +29,8 @@ Page({
isCollect:Number,
currPage: 1,
commentList: [],
praise: '/images/common/zan.png',
unPraise: '/images/topic/un_zan.png',
praise: '/images/topic/zan.png',
hiddenmodalput:true,
currentComment:'',
@ -95,6 +96,7 @@ Page({
detail: item.comment,
time: item.createTime,
praiseNum: item.supportNum,
isSupport: item.isSupport,
isTouchMove:false,
})
})
@ -152,12 +154,10 @@ Page({
},
fetchTopicCommentPraise(commentId){
wx.showLoading()
topicModel.topicCommentPraise(commentId,res =>{
if (res.code === 200) {
wx.showToast({
title: res.message,
icon: 'none'
})
wx.hideLoading()
this.fetchDetailComment()
}
})

2
pages/topics/interactive/topicArticle/index.wxml

@ -62,7 +62,7 @@
<view class="comment_info_time_left">{{item.time}}</view>
<view class="comment_info_time_right" bindtap="onClickPraise" data-item="{{item}}" data-index='{{index}}'>
<view class="praiseNum">{{item.praiseNum}}</view>
<image class="praiseIcon" src="{{praise}}"></image>
<image class="praiseIcon" src="{{item.isSupport ==='0' ? unPraise : praise}}"></image>
</view>
</view>
</view>

12
pages/user/index.js

@ -44,19 +44,19 @@ Page({
if (e.detail.userInfo){
let avatarUrl = e.detail.userInfo.avatarUrl
let nickName = e.detail.userInfo.nickName
this.updateUserInfo(avatarUrl,nickName)
this.sendUserInfo(e.detail.userInfo)
}
},
// 将用户信息发送服务器
updateUserInfo (avatarUrl, nickName) {
userModel.updateUserInfo(avatarUrl, nickName, res => {
if(res.code === 200){
// 上传用户信息
sendUserInfo(weChatInfo){
userModel.sendUserInfo(weChatInfo, res => {
if (res.code === 200) {
this.getUserInfo()
}
})
},
// 获取用户信息
getUserInfo () {
userModel.getUserInfo(res => {

7
pages/user/myIdea/index.js

@ -47,6 +47,7 @@ Page({
commentTime: item.createTime,
comment: item.comment,
praiseNum: item.supportNum,
isSupport: item.isSupport,
// 议题数据
topicTtitle: item.title,
topicGroupAvator: item.groupAvator,
@ -116,13 +117,11 @@ Page({
this.fetchGoodIdeaPraise(itemData.commentId)
},
fetchGoodIdeaPraise(id) {
wx.showLoading()
topicModel.topicCommentPraise(id, res => {
console.log(res)
if (res.code === 200) {
wx.showToast({
title: res.message,
icon: 'none'
})
wx.hideLoading()
this.onPullDownRefresh()
}
})

20
pages/user/myInfo/index.js

@ -79,16 +79,16 @@ Page({
// phone: e.detail.value
// })
// },
bindCompanyInput(e) {
this.setData({
company: e.detail.value
})
},
bindPositionInput(e) {
this.setData({
position: e.detail.value
})
},
// bindCompanyInput(e) {
// this.setData({
// company: e.detail.value
// })
// },
// bindPositionInput(e) {
// this.setData({
// position: e.detail.value
// })
// },
submit(){
userModel.updateUserInfo(this.data, res => {
if(res.code === 200){

4
pages/user/myInfo/index.wxml

@ -27,14 +27,14 @@
title="工作单位"
ext-class="cell-item">
<!-- <view slot="footer" class="msg_footer" >{{company}}</view> -->
<input slot="footer" class="footer_input" maxlength="45" bindinput="bindCompanyInput" value="{{company}}"></input>
<input slot="footer" class="footer_input_phone" maxlength="45" bindinput="bindCompanyInput" value="{{company}}" disabled></input>
</mp-cell>
<mp-cell
bindtap="onTapItem" data-type="position"
title="职务"
ext-class="cell-item">
<!-- <view slot="footer" class="msg_footer" >{{position}}</view> -->
<input slot="footer" class="footer_input" maxlength="45" bindinput="bindPositionInput" value="{{position}}"></input>
<input slot="footer" class="footer_input_phone" maxlength="45" bindinput="bindPositionInput" value="{{position}}" disabled></input>
</mp-cell>
<view class="btnView">
<e-ibutton title="提交" bind:onTap="submit"/>

Loading…
Cancel
Save