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_myTopics_url:'/api/group/groupByUser', // 我的议题
user_myActivity_url:'/api/activity/activityList', // 我的活动 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 { class UserModel extends HTTP {
constructor () { constructor () {
@ -43,7 +44,24 @@ class UserModel extends HTTP {
this.request(params) 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){ getMyMessageList(page, success){
let params = { let params = {
url: UserConst.user_myMessage_url, url: UserConst.user_myMessage_url,

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

@ -18,8 +18,8 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
unPraise: '/images/common/zan.png', unPraise: '/images/topic/un_zan.png',
praise: '/images/common/star_light.png', praise: '/images/topic/zan.png',
isTouchMove:false, isTouchMove:false,
startX: 0, //开始坐标 startX: 0, //开始坐标
startY: 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="touch-item {{isTouchMove ? 'touch-move-active' : ''}}" data-index="{{itemIndex}}" data-name="{{itemData.commentName}}" bindtouchstart="touchstart" bindtouchmove="touchmove" >
<view class="content"> <view class="content">
<view class="content-left"> <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>
<view class="content-right"> <view class="content-right">
<view class="userInfo"> <view class="userInfo">
@ -13,9 +13,7 @@
</view> </view>
<view class="userInfo-right" bindtap="onClickPraise" data-item="{{itemData}}" data-index='{{itemIndex}}'> <view class="userInfo-right" bindtap="onClickPraise" data-item="{{itemData}}" data-index='{{itemIndex}}'>
<view class="praiseNum">{{itemData.praiseNum}}</view> <view class="praiseNum">{{itemData.praiseNum}}</view>
<view class="praise-icon"> <image class="praise-icon" src="{{itemData.isSupport ==='0' ? unPraise : praise}}"></image>
<image src="{{item.isPraise ? praise : unPraise}}" style="width:100%;"></image>
</view>
</view> </view>
</view> </view>
<view style="color:#3B3B3B;font-size:14px;padding: 0 0 5px 0;">{{itemData.comment}}</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; */ padding: 10px; */
} }
.content-left{ .content-left{
width: 20px; width: 30px;
height: 20px; height: 30px;
border-radius: 50%;
background-color: #EEEEEE;
} }
.content-right{ .content-right{
width: 100%; width: 100%;
@ -40,10 +38,9 @@ image{
height: 100%; height: 100%;
} }
.praise-icon{ .praise-icon{
margin-left: 5px;
width: 15px; width: 15px;
height: 15px; height: 15px;
line-height: 10px;
margin-left: 5px;
} }
.userName{ .userName{
color: #66708B; color: #66708B;

8
pages/topics/index.js

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

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

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

12
pages/user/index.js

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

7
pages/user/myIdea/index.js

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

20
pages/user/myInfo/index.js

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

4
pages/user/myInfo/index.wxml

@ -27,14 +27,14 @@
title="工作单位" title="工作单位"
ext-class="cell-item"> ext-class="cell-item">
<!-- <view slot="footer" class="msg_footer" >{{company}}</view> --> <!-- <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>
<mp-cell <mp-cell
bindtap="onTapItem" data-type="position" bindtap="onTapItem" data-type="position"
title="职务" title="职务"
ext-class="cell-item"> ext-class="cell-item">
<!-- <view slot="footer" class="msg_footer" >{{position}}</view> --> <!-- <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> </mp-cell>
<view class="btnView"> <view class="btnView">
<e-ibutton title="提交" bind:onTap="submit"/> <e-ibutton title="提交" bind:onTap="submit"/>

Loading…
Cancel
Save