Browse Source

优化界面

master
lqq 6 years ago
parent
commit
dc320f7a48
  1. 4
      components/cell/index.js
  2. 13
      components/cell/index.wxml
  3. 23
      components/cell/index.wxss
  4. 2
      pages/article/index.js
  5. 3
      pages/article/index.wxml
  6. 11
      pages/article/index.wxss
  7. 1
      pages/home/index.js
  8. 1
      pages/home/index.wxml
  9. 1
      pages/topics/index.js
  10. 10
      pages/topics/interactive/cell/index.wxss
  11. 36
      pages/user/myActivity/cell/index.js
  12. 4
      pages/user/myActivity/cell/index.json
  13. 18
      pages/user/myActivity/cell/index.wxml
  14. 106
      pages/user/myActivity/cell/index.wxss
  15. 4
      pages/user/myActivity/index.js
  16. 2
      pages/user/myActivity/index.json
  17. 9
      pages/user/myActivity/index.wxml
  18. 1
      pages/user/myFavorite/index.json
  19. 2
      pages/user/myFavorite/index.wxml
  20. 7
      pages/user/myIdea/index.js
  21. 1
      pages/user/myIdea/index.json
  22. 1
      pages/user/myIdea/index.wxml
  23. 7
      pages/user/myMessage/index.js
  24. 3
      pages/user/myMessage/index.json
  25. 1
      pages/user/myMessage/index.wxml
  26. 7
      pages/user/myTopics/index.js
  27. 6
      pages/user/myTopics/myParticipant/cell/index.wxss
  28. 1
      pages/user/myTopics/myParticipant/index.json
  29. 1
      pages/user/myTopics/myParticipant/index.wxml

4
components/cell/index.js

@ -15,6 +15,10 @@ Component({
showTop: { showTop: {
type: Boolean, type: Boolean,
value: false, value: false,
},
image: {
type: String,
value: ''
} }
}, },
observers: { observers: {

13
components/cell/index.wxml

@ -1,8 +1,13 @@
<!--components/cell/index.wxml--> <!--components/cell/index.wxml-->
<view class="cell" id="e-cell" bindtap="onTap"> <view class="cell" id="e-cell" bindtap="onTap">
<view class="cell_title {{_readed ? 'cell_title_readed':''}}">{{title}}</view> <view class="cell-left">
<view class="cell_info"> <view class="cell_title {{_readed ? 'cell_title_readed':''}}">{{title}}</view>
<view class="cell_info_meta">{{time}}</view> <view class="cell_info">
<image wx:if="{{showTop}}" class="cell_info_top" src="images/top.png"></image> <view class="cell_info_meta">{{time}}</view>
<image wx:if="{{showTop}}" class="cell_info_top" src="images/top.png"></image>
</view>
</view>
<view class="cell-right" wx:if="{{image.length > 0}}">
<image src="{{image}}" class="cell-image"/>
</view> </view>
</view> </view>

23
components/cell/index.wxss

@ -3,13 +3,24 @@
background-color: white; background-color: white;
border-bottom: 1px solid #E7E7E7; border-bottom: 1px solid #E7E7E7;
display: flex; display: flex;
flex-direction: row;
padding: 10px 20rpx;
}
.cell-left {
flex:1;
display: flex;
flex-direction: column; flex-direction: column;
padding: 10px 20px; justify-content: space-around;
} }
.cell_title { .cell_title {
font-weight: 300; font-weight: 300;
font-size: 17px; font-size: 17px;
color: #000; color: #000;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
} }
.cell_title_readed { .cell_title_readed {
color: #9C9C9C; color: #9C9C9C;
@ -28,3 +39,13 @@
width: 20px; width: 20px;
height: 12px; height: 12px;
} }
.cell-right {
margin-left: 10rpx;
width: 30vw;
height: 100%;
}
.cell-image {
display: block;
width: 100%;
height: 160rpx;
}

2
pages/article/index.js

@ -12,6 +12,7 @@ Page({
nodes: '', nodes: '',
isStar: true, // 是否 isStar: true, // 是否
showBtn: false, showBtn: false,
image: '',
aId: '', aId: '',
title: '', title: '',
date: '', date: '',
@ -49,6 +50,7 @@ Page({
nodes: data.content, nodes: data.content,
title: data.title, title: data.title,
date: date, date: date,
image: data.titlePic,
origin: data.source, origin: data.source,
isStar: data.isCollection ? true : false, isStar: data.isCollection ? true : false,
showBtn: data.typeFlag >= 2 ? true : false, showBtn: data.typeFlag >= 2 ? true : false,

3
pages/article/index.wxml

@ -7,6 +7,9 @@
<text class="artice_time">{{date || ''}}</text> <text class="artice_time">{{date || ''}}</text>
<image class="artice_collect" src="{{isStar ? star : unStar}}" bindtap="onClickCollect"></image> <image class="artice_collect" src="{{isStar ? star : unStar}}" bindtap="onClickCollect"></image>
</view> </view>
<view class="artice_image" wx:if="{{image.length > 0}}">
<image class="title_image" src="{{image}}"></image>
</view>
</view> </view>
<view class="page_bd {{showBtn ? 'page_bd_short':''}}"> <view class="page_bd {{showBtn ? 'page_bd_short':''}}">
<rich-text nodes="{{nodes}}"></rich-text> <rich-text nodes="{{nodes}}"></rich-text>

11
pages/article/index.wxss

@ -8,6 +8,7 @@
flex-direction: column; flex-direction: column;
margin-bottom: 10px; margin-bottom: 10px;
} }
/* 标题 */
.artice_title { .artice_title {
color: #373737; color: #373737;
font-size: 20px; font-size: 20px;
@ -36,6 +37,16 @@
width: 20px; width: 20px;
height: 20px; height: 20px;
} }
.artice_image {
margin-top: 10rpx;
}
.title_image {
width: 100%;
height: 160px;
}
/* 底部 button 区域 */
.page_footer { .page_footer {
background-color: white; background-color: white;
border-top: 1px solid #f7f7f7; border-top: 1px solid #f7f7f7;

1
pages/home/index.js

@ -61,6 +61,7 @@ Page({
tempDatas.push({ tempDatas.push({
id: item.id, id: item.id,
title: item.title, title: item.title,
image: item.titlePic,
showTop: item.isTop == 1 ? true : false, showTop: item.isTop == 1 ? true : false,
time: dayjs(item.createTime).toNow(), time: dayjs(item.createTime).toNow(),
readed: item.isRead == 0 ? false : true readed: item.isRead == 0 ? false : true

1
pages/home/index.wxml

@ -6,6 +6,7 @@
<e-cell <e-cell
index="{{index}}" index="{{index}}"
read="{{item.readed}}" read="{{item.readed}}"
image="{{item.image}}"
cId="{{item.id}}" cId="{{item.id}}"
title="{{item.title}}" title="{{item.title}}"
time="{{item.time}}" time="{{item.time}}"

1
pages/topics/index.js

@ -50,6 +50,7 @@ Page({
datas.forEach(item => { datas.forEach(item => {
tempDatas.push({ tempDatas.push({
topicId: item.id, topicId: item.id,
userIcon: item.groupAvator || '',
title: item.title, title: item.title,
userName: item.author, userName: item.author,
commentNum: item.commentNum, commentNum: item.commentNum,

10
pages/topics/interactive/cell/index.wxss

@ -38,6 +38,10 @@
border-radius: 50%; border-radius: 50%;
} }
.userName{ .userName{
max-width: 120rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 0 5px 0 5px; margin: 0 5px 0 5px;
font-size: 12px; font-size: 12px;
color: #3B3B3B; color: #3B3B3B;
@ -81,6 +85,12 @@ image{
font-weight: 300; font-weight: 300;
font-size: 17px; font-size: 17px;
color: #000; color: #000;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
} }
.cell_title_selected { .cell_title_selected {
color: #9C9C9C; color: #9C9C9C;

36
pages/user/myActivity/cell/index.js

@ -1,36 +0,0 @@
// 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 })
}
}
})

4
pages/user/myActivity/cell/index.json

@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}

18
pages/user/myActivity/cell/index.wxml

@ -1,18 +0,0 @@
<!--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 && articleImg !== 'null'}}">
<image class="articleImg" src="{{topicImg}}"></image>
</view>
</view>

106
pages/user/myActivity/cell/index.wxss

@ -1,106 +0,0 @@
/* 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;
}

4
pages/user/myActivity/index.js

@ -89,9 +89,7 @@ Page({
}, },
clickListItem(e) { clickListItem(e) {
const item = e.detail.item; const {id} = e.detail
console.log(item);
let id = item.articleId
wx.navigateTo({ wx.navigateTo({
url: `/pages/article/index?id=${id}`, url: `/pages/article/index?id=${id}`,
}) })

2
pages/user/myActivity/index.json

@ -2,6 +2,6 @@
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"navigationBarTitleText": "我的活动", "navigationBarTitleText": "我的活动",
"usingComponents": { "usingComponents": {
"cell": "./cell/index" "e-cell": "/components/cell/index"
} }
} }

9
pages/user/myActivity/index.wxml

@ -1,13 +1,12 @@
<!--pages/user/common/myActivity/index.wxml--> <!--pages/user/common/myActivity/index.wxml-->
<view class="container"> <view class="container">
<block wx:for="{{list}}" wx:key="{{index}}"> <block wx:for="{{list}}" wx:key="{{index}}">
<cell <e-cell
articleId="{{item.articleId}}" index="{{index}}"
image="{{item.articleImg}}"
cId="{{item.articleId}}"
title="{{item.title}}" title="{{item.title}}"
articleImg="{{item.articleImg}}"
userName="{{item.userName}}"
time="{{item.time}}" time="{{item.time}}"
commentNum="{{item.commentNum}}"
showTop="{{item.showTop}}" showTop="{{item.showTop}}"
bind:clickListItem="clickListItem"/> bind:clickListItem="clickListItem"/>
</block> </block>

1
pages/user/myFavorite/index.json

@ -3,6 +3,7 @@
"navigationBarTitleText": "我的收藏", "navigationBarTitleText": "我的收藏",
"usingComponents": { "usingComponents": {
"cell": "../myTopics/myParticipant/cell/index", "cell": "../myTopics/myParticipant/cell/index",
"e-empty": "/components/empty/index",
"artice-cell": "/components/cell/index" "artice-cell": "/components/cell/index"
} }
} }

2
pages/user/myFavorite/index.wxml

@ -20,6 +20,6 @@
userIcon="{{item.userIcon}}" userIcon="{{item.userIcon}}"
bind:clickListItem="clickListItem"/> bind:clickListItem="clickListItem"/>
</block> </block>
</block> </block>
<e-empty empty="{{list.length <= 0}}" message="暂无内容"/>
</view> </view>

7
pages/user/myIdea/index.js

@ -25,13 +25,6 @@ Page({
fetchMyIdeaList(){ fetchMyIdeaList(){
let page = this.data.currentPage let page = this.data.currentPage
userModel.goldenList(page,res=>{ userModel.goldenList(page,res=>{
console.log(res)
if (res.result.list.length == 0) {
wx.showToast({
title: '暂无数据',
icon: 'none'
})
}
const datas = res.result.list const datas = res.result.list
let tempDatas = [] let tempDatas = []
datas.forEach(item => { datas.forEach(item => {

1
pages/user/myIdea/index.json

@ -3,6 +3,7 @@
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"navigationBarTitleText": "我的金点子", "navigationBarTitleText": "我的金点子",
"usingComponents": { "usingComponents": {
"e-empty": "/components/empty/index",
"cell": "../../topics/goodIdea/cell/index" "cell": "../../topics/goodIdea/cell/index"
} }
} }

1
pages/user/myIdea/index.wxml

@ -5,4 +5,5 @@
itemData="{{item}}" itemData="{{item}}"
bind:clickListItem="clickListItem"/> bind:clickListItem="clickListItem"/>
</block> </block>
<e-empty empty="{{list.length <= 0}}" message="暂无内容"/>
</view> </view>

7
pages/user/myMessage/index.js

@ -26,13 +26,6 @@ Page({
let page = this.data.currentPage let page = this.data.currentPage
userModel.getMyMessageList(page,res=>{ userModel.getMyMessageList(page,res=>{
console.log('我的消息') console.log('我的消息')
console.log(res)
if (res.result.list.length == 0){
wx.showToast({
title: '暂无数据',
icon: 'none'
})
}
const datas = res.result.list const datas = res.result.list
let tempDatas = [] let tempDatas = []
datas.forEach(item => { datas.forEach(item => {

3
pages/user/myMessage/index.json

@ -2,6 +2,7 @@
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"navigationBarTitleText": "我的消息", "navigationBarTitleText": "我的消息",
"usingComponents": { "usingComponents": {
"cell": "./cell/index" "cell": "./cell/index",
"e-empty": "/components/empty/index"
} }
} }

1
pages/user/myMessage/index.wxml

@ -5,4 +5,5 @@
itemData="{{item}}" itemData="{{item}}"
bind:clickListItem="clickListItem"/> bind:clickListItem="clickListItem"/>
</block> </block>
<e-empty empty="{{list.length <= 0}}" message="暂无消息"/>
</view> </view>

7
pages/user/myTopics/index.js

@ -29,13 +29,6 @@ Page({
fetchMyTopicList(){ fetchMyTopicList(){
let page = this.data.currentPage let page = this.data.currentPage
userModel.getMyTopics(page,this.data.selectedTitle+1,res=>{ userModel.getMyTopics(page,this.data.selectedTitle+1,res=>{
console.log(res)
if (res.result.list.length == 0) {
wx.showToast({
title: '暂无数据',
icon: 'none'
})
}
const datas = res.result.list const datas = res.result.list
let tempDatas = [] let tempDatas = []
datas.forEach(item => { datas.forEach(item => {

6
pages/user/myTopics/myParticipant/cell/index.wxss

@ -3,7 +3,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding: 10px 20px; padding: 10px 20rpx;
box-sizing: border-box; box-sizing: border-box;
align-items: center; align-items: center;
position: relative; position: relative;
@ -43,6 +43,10 @@
background-color: #EEEEEE; background-color: #EEEEEE;
} }
.userName{ .userName{
max-width: 120rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 0 5px 0 5px; margin: 0 5px 0 5px;
font-size: 12px; font-size: 12px;
color: #3B3B3B; color: #3B3B3B;

1
pages/user/myTopics/myParticipant/index.json

@ -1,6 +1,7 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"e-empty": "/components/empty/index",
"cell": "./cell/index" "cell": "./cell/index"
} }
} }

1
pages/user/myTopics/myParticipant/index.wxml

@ -10,4 +10,5 @@
commentNum="{{item.commentNum}}" commentNum="{{item.commentNum}}"
bind:clickListItem="clickListItem"/> bind:clickListItem="clickListItem"/>
</block> </block>
<e-empty empty="{{list.length <= 0}}" message="暂无内容"/>
</view> </view>

Loading…
Cancel
Save