43 changed files with 863 additions and 188 deletions
@ -1,11 +1,97 @@ |
|||||
import {HTTP} from '../utils/http.js' |
import { HTTP, Method} from '../utils/http.js' |
||||
const UserConst = { |
const UserConst = { |
||||
user_info: '', // 个人信息
|
user_info: '', // 个人信息
|
||||
|
user_myMessage_url:'/api/message/page', // 我的消息
|
||||
|
user_myFavorite_url: '/api/collect/collectionList', // 我的收藏
|
||||
|
user_goldenList_url: '/api/comment/goldenList', // 我的金点子
|
||||
|
user_myTopics_url:'/api/group/groupByUser', // 我的议题
|
||||
|
user_myActivity_url:'/api/activity/activityList' // 我的活动
|
||||
} |
} |
||||
class UserModel extends HTTP { |
class UserModel extends HTTP { |
||||
constructor () { |
constructor () { |
||||
super() |
super() |
||||
} |
} |
||||
|
|
||||
|
getMyMessageList(page, success){ |
||||
|
let params = { |
||||
|
url: UserConst.user_myMessage_url, |
||||
|
method: Method.POST, |
||||
|
data: { |
||||
|
page: page, |
||||
|
pageSize: 10, |
||||
|
}, |
||||
|
success: success |
||||
|
} |
||||
|
this.request(params) |
||||
|
} |
||||
|
|
||||
|
getMyMessageTotal(success) { |
||||
|
let params = { |
||||
|
url: UserConst.user_myTopics_url, |
||||
|
method: Method.POST, |
||||
|
data:{ |
||||
|
page:1, |
||||
|
pageSize:10, |
||||
|
}, |
||||
|
success: success |
||||
|
} |
||||
|
this.request(params) |
||||
|
} |
||||
|
|
||||
|
getMyTopics(page,type,success){ |
||||
|
let params = { |
||||
|
url: UserConst.user_myTopics_url, |
||||
|
method: Method.POST, |
||||
|
data: { |
||||
|
page: page, |
||||
|
type: type, |
||||
|
pageSize: 10, |
||||
|
}, |
||||
|
success: success |
||||
|
} |
||||
|
this.request(params) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
getMyFavoriteList(page, success) { |
||||
|
let params = { |
||||
|
url: UserConst.user_myFavorite_url, |
||||
|
method: Method.POST, |
||||
|
data: { |
||||
|
page: page, |
||||
|
pageSize: 10, |
||||
|
}, |
||||
|
success: success |
||||
|
} |
||||
|
this.request(params) |
||||
|
} |
||||
|
|
||||
|
goldenList(page, success) { |
||||
|
let params = { |
||||
|
url: UserConst.user_goldenList_url, |
||||
|
method: Method.POST, |
||||
|
data: { |
||||
|
type: 2, // 1.全部 2.我的金点子
|
||||
|
page: page, |
||||
|
pageSize: 10, |
||||
|
}, |
||||
|
success: success |
||||
|
} |
||||
|
this.request(params) |
||||
|
} |
||||
|
|
||||
|
getMyActivityList(page, success) { |
||||
|
let params = { |
||||
|
url: UserConst.user_myActivity_url, |
||||
|
method: Method.POST, |
||||
|
data: { |
||||
|
page: page, |
||||
|
pageSize: 10, |
||||
|
}, |
||||
|
success: success |
||||
|
} |
||||
|
this.request(params) |
||||
|
} |
||||
} |
} |
||||
|
|
||||
export { UserModel } |
export { UserModel } |
@ -0,0 +1,36 @@ |
|||||
|
// pages/topics/common/interactive/common/imageCell/index.js
|
||||
|
Component({ |
||||
|
/** |
||||
|
* 组件的属性列表 |
||||
|
*/ |
||||
|
properties: { |
||||
|
articleId: String, |
||||
|
title: String, |
||||
|
articleImg: String, |
||||
|
userName: String, |
||||
|
time: String, |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 组件的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 组件的方法列表 |
||||
|
*/ |
||||
|
methods: { |
||||
|
onTap() { |
||||
|
let item = { |
||||
|
articleId: this.properties.articleId, |
||||
|
title: this.properties.title, |
||||
|
articleImg: this.properties.articleImg, |
||||
|
userName: this.properties.userName, |
||||
|
time: this.properties.time, |
||||
|
} |
||||
|
this.triggerEvent('clickListItem', { item: item }) |
||||
|
} |
||||
|
} |
||||
|
}) |
@ -0,0 +1,4 @@ |
|||||
|
{ |
||||
|
"component": true, |
||||
|
"usingComponents": {} |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
<!--pages/topics/common/interactive/common/imageCell/index.wxml--> |
||||
|
<view class="cell" id="cell" bindtap="onTap"> |
||||
|
<view class="left {{articleImg === '' ? 'leftActive' : ''}}"> |
||||
|
<view class="left-top"> |
||||
|
<view class="cell_title">{{title}}</view> |
||||
|
</view> |
||||
|
<view class="left-bottom"> |
||||
|
|
||||
|
<view class="left-bottom-userInfo"> |
||||
|
<view class="userName">{{userName}}</view> |
||||
|
<view class="cell_info_meta">{{time}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="right" wx:if="{{articleImg.length > 0}}"> |
||||
|
<image class="articleImg" src="{{topicImg}}"></image> |
||||
|
</view> |
||||
|
</view> |
@ -0,0 +1,106 @@ |
|||||
|
/* pages/topics/common/interactive/common/imageCell/index.wxss */ |
||||
|
.cell { |
||||
|
|
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
padding: 10px 20px; |
||||
|
box-sizing: border-box; |
||||
|
align-items: center; |
||||
|
position: relative; |
||||
|
} |
||||
|
.cell:after { |
||||
|
content: ""; |
||||
|
position: absolute; |
||||
|
bottom: 1px; |
||||
|
left: 20px; |
||||
|
right: 20px; |
||||
|
border-bottom: 1px solid #E7E7E7; |
||||
|
} |
||||
|
.left{ |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
width: 70%; |
||||
|
} |
||||
|
.leftActive{ |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
width: 100%; |
||||
|
} |
||||
|
.left-bottom{ |
||||
|
display: flex; |
||||
|
flex: row; |
||||
|
justify-content: space-between; |
||||
|
} |
||||
|
.left-bottom-userInfo{ |
||||
|
display: flex; |
||||
|
flex: row; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.user-icon{ |
||||
|
width: 20px; |
||||
|
height: 20px; |
||||
|
border-radius: 50%; |
||||
|
background-color: #EEEEEE; |
||||
|
} |
||||
|
.userName{ |
||||
|
margin: 0 5px 0 0; |
||||
|
font-size: 12px; |
||||
|
color: #3B3B3B; |
||||
|
} |
||||
|
.left-bottom-comments{ |
||||
|
display: flex; |
||||
|
flex: row; |
||||
|
align-items: center; |
||||
|
margin-right: 10px; |
||||
|
} |
||||
|
.comments-icon{ |
||||
|
width: 15px; |
||||
|
height: 12px; |
||||
|
line-height: 10px; |
||||
|
margin-right: 5px; |
||||
|
} |
||||
|
.image_icon { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
.commentNum{ |
||||
|
font-size: 12px; |
||||
|
color: #3B3B3B; |
||||
|
} |
||||
|
.right{ |
||||
|
width: 30%; |
||||
|
height: 70px; |
||||
|
border-radius: 5px; |
||||
|
background-color: #EEEEEE; |
||||
|
} |
||||
|
image{ |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
.articleImg{ |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
border-radius: 5px; |
||||
|
} |
||||
|
.cell_title { |
||||
|
font-weight: 300; |
||||
|
font-size: 17px; |
||||
|
color: #000; |
||||
|
} |
||||
|
.cell_title_selected { |
||||
|
color: #9C9C9C; |
||||
|
} |
||||
|
.cell_info_meta { |
||||
|
padding-top: 10rpx; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
font-size: 12px; |
||||
|
line-height: 12px; |
||||
|
color: #D4D4D4; |
||||
|
} |
||||
|
.cell_info_top { |
||||
|
padding: 0 10px; |
||||
|
width: 20px; |
||||
|
height: 12px; |
||||
|
} |
@ -1,6 +1,7 @@ |
|||||
{ |
{ |
||||
|
"enablePullDownRefresh": true, |
||||
"navigationBarTitleText": "我的活动", |
"navigationBarTitleText": "我的活动", |
||||
"usingComponents": { |
"usingComponents": { |
||||
"cell": "../myTopics/myParticipant/cell/index" |
"cell": "./cell/index" |
||||
} |
} |
||||
} |
} |
@ -1,14 +1,15 @@ |
|||||
<!--pages/user/common/myFavorite/index.wxml--> |
<!--pages/user/common/myFavorite/index.wxml--> |
||||
<view class="container"> |
<view class="container"> |
||||
<block wx:for="{{list}}" wx:key="*this"> |
<block wx:for="{{list}}" wx:key="{{index}}"> |
||||
<cell |
<cell |
||||
articleId="{{item.articleId}}" |
topicId="{{item.topicId}}" |
||||
title="{{item.title}}" |
title="{{item.title}}" |
||||
articleImg="{{item.articleImg}}" |
topicImg="{{item.topicImg}}" |
||||
userName="{{item.userName}}" |
userName="{{item.userName}}" |
||||
time="{{item.time}}" |
time="{{item.time}}" |
||||
commentNum="{{item.commentNum}}" |
commentNum="{{item.commentNum}}" |
||||
showTop="{{item.showTop}}" |
type="{{item.type}}" |
||||
|
userIcon="{{item.userIcon}}" |
||||
bind:clickListItem="clickListItem"/> |
bind:clickListItem="clickListItem"/> |
||||
</block> |
</block> |
||||
</view> |
</view> |
||||
|
@ -1,6 +1,6 @@ |
|||||
<!--pages/user/common/myTopics/index.wxml--> |
<!--pages/user/common/myTopics/index.wxml--> |
||||
<view class="content-wrapper"> |
<view class="content-wrapper"> |
||||
<e-segment bind:tapSegment="tapSegment" headerTitles="{{headerTitles}}" defaultSelectIndex="{{selectedTitle}}"/> |
<e-segment bind:tapSegment="tapSegment" headerTitles="{{headerTitles}}" defaultSelectIndex="{{selectedTitle}}"/> |
||||
<myParticipant wx:if="{{selectedTitle==0}}" /> |
<myParticipant wx:if="{{selectedTitle==0}}" list="{{list}}"/> |
||||
<myRelease wx:if="{{selectedTitle==1}}" /> |
<myRelease wx:if="{{selectedTitle==1}}" list="{{list}}"/> |
||||
</view> |
</view> |
||||
|
@ -1,14 +1,13 @@ |
|||||
<!--pages/user/myTopics/myParticipant/index.wxml--> |
<!--pages/user/myTopics/myParticipant/index.wxml--> |
||||
<view class="container"> |
<view class="container"> |
||||
<block wx:for="{{list}}" wx:key="*this"> |
<block wx:for="{{list}}" wx:key="{{index}}"> |
||||
<cell |
<cell |
||||
articleId="{{item.articleId}}" |
topicId="{{item.topicId}}" |
||||
title="{{item.title}}" |
title="{{item.title}}" |
||||
articleImg="{{item.articleImg}}" |
topicImg="{{item.topicImg}}" |
||||
userName="{{item.userName}}" |
userName="{{item.userName}}" |
||||
time="{{item.time}}" |
time="{{item.time}}" |
||||
commentNum="{{item.commentNum}}" |
commentNum="{{item.commentNum}}" |
||||
showTop="{{item.showTop}}" |
|
||||
bind:clickListItem="clickListItem"/> |
bind:clickListItem="clickListItem"/> |
||||
</block> |
</block> |
||||
</view> |
</view> |
||||
|
@ -1,14 +1,13 @@ |
|||||
<!--pages/user/myTopics/myRelease/index.wxml--> |
<!--pages/user/myTopics/myRelease/index.wxml--> |
||||
<view class="container"> |
<view class="container"> |
||||
<block wx:for="{{list}}" wx:key="*this"> |
<block wx:for="{{list}}" wx:key="{{index}}"> |
||||
<cell |
<cell |
||||
articleId="{{item.articleId}}" |
topicId="{{item.topicId}}" |
||||
title="{{item.title}}" |
title="{{item.title}}" |
||||
articleImg="{{item.articleImg}}" |
topicImg="{{item.topicImg}}" |
||||
userName="{{item.userName}}" |
userName="{{item.userName}}" |
||||
time="{{item.time}}" |
time="{{item.time}}" |
||||
commentNum="{{item.commentNum}}" |
commentNum="{{item.commentNum}}" |
||||
showTop="{{item.showTop}}" |
|
||||
bind:clickListItem="clickListItem"/> |
bind:clickListItem="clickListItem"/> |
||||
</block> |
</block> |
||||
</view> |
</view> |
||||
|
Loading…
Reference in new issue