diff --git a/images/topic/un_zan.png b/images/topic/un_zan.png
new file mode 100644
index 0000000..c01eec1
Binary files /dev/null and b/images/topic/un_zan.png differ
diff --git a/images/topic/zan.png b/images/topic/zan.png
new file mode 100644
index 0000000..d4f077d
Binary files /dev/null and b/images/topic/zan.png differ
diff --git a/models/user.js b/models/user.js
index 0d9aa52..97ba995 100644
--- a/models/user.js
+++ b/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,
diff --git a/pages/topics/goodIdea/cell/index.js b/pages/topics/goodIdea/cell/index.js
index fb7bb6d..4defef6 100644
--- a/pages/topics/goodIdea/cell/index.js
+++ b/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
diff --git a/pages/topics/goodIdea/cell/index.wxml b/pages/topics/goodIdea/cell/index.wxml
index 181f581..34ac7ba 100644
--- a/pages/topics/goodIdea/cell/index.wxml
+++ b/pages/topics/goodIdea/cell/index.wxml
@@ -3,7 +3,7 @@
-
+
@@ -13,9 +13,7 @@
{{itemData.praiseNum}}
-
-
-
+
{{itemData.comment}}
diff --git a/pages/topics/goodIdea/cell/index.wxss b/pages/topics/goodIdea/cell/index.wxss
index 6445a96..1c1735f 100644
--- a/pages/topics/goodIdea/cell/index.wxss
+++ b/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;
diff --git a/pages/topics/index.js b/pages/topics/index.js
index 3bc3f69..f1c6208 100644
--- a/pages/topics/index.js
+++ b/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()
}
})
diff --git a/pages/topics/interactive/topicArticle/index.js b/pages/topics/interactive/topicArticle/index.js
index 72df954..8a835a6 100644
--- a/pages/topics/interactive/topicArticle/index.js
+++ b/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()
}
})
diff --git a/pages/topics/interactive/topicArticle/index.wxml b/pages/topics/interactive/topicArticle/index.wxml
index 1ac41ac..c07ba0c 100644
--- a/pages/topics/interactive/topicArticle/index.wxml
+++ b/pages/topics/interactive/topicArticle/index.wxml
@@ -62,7 +62,7 @@
diff --git a/pages/user/index.js b/pages/user/index.js
index 9de82a3..80e8c65 100644
--- a/pages/user/index.js
+++ b/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 => {
diff --git a/pages/user/myIdea/index.js b/pages/user/myIdea/index.js
index 0c5d516..5c97030 100644
--- a/pages/user/myIdea/index.js
+++ b/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()
}
})
diff --git a/pages/user/myInfo/index.js b/pages/user/myInfo/index.js
index 6026688..a2af991 100644
--- a/pages/user/myInfo/index.js
+++ b/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){
diff --git a/pages/user/myInfo/index.wxml b/pages/user/myInfo/index.wxml
index 5bb46cb..fe10cb1 100644
--- a/pages/user/myInfo/index.wxml
+++ b/pages/user/myInfo/index.wxml
@@ -27,14 +27,14 @@
title="工作单位"
ext-class="cell-item">
-
+
-
+