fanp 6 years ago
parent
commit
9cf1b92909
  1. 20
      components/cell/index.js
  2. 13
      components/cell/index.wxml
  3. 23
      components/cell/index.wxss
  4. 6
      components/empty/index.js
  5. 4
      components/swiper/index.wxml
  6. 16
      components/swiper/index.wxss
  7. 10
      pages/article/index.js
  8. 7
      pages/article/index.wxml
  9. 15
      pages/article/index.wxss
  10. 1
      pages/billboards/policy/index.json
  11. 1
      pages/billboards/policy/index.wxml
  12. 4
      pages/billboards/policy/policy-list/index.js
  13. 3
      pages/billboards/policy/policy-list/index.json
  14. 1
      pages/billboards/policy/policy-list/index.wxml
  15. 10
      pages/home/index.js
  16. 2
      pages/home/index.wxml
  17. 1
      pages/topics/index.js
  18. 10
      pages/topics/interactive/cell/index.wxss
  19. 36
      pages/user/myActivity/cell/index.js
  20. 4
      pages/user/myActivity/cell/index.json
  21. 18
      pages/user/myActivity/cell/index.wxml
  22. 106
      pages/user/myActivity/cell/index.wxss
  23. 4
      pages/user/myActivity/index.js
  24. 2
      pages/user/myActivity/index.json
  25. 9
      pages/user/myActivity/index.wxml
  26. 1
      pages/user/myFavorite/index.json
  27. 2
      pages/user/myFavorite/index.wxml
  28. 7
      pages/user/myIdea/index.js
  29. 1
      pages/user/myIdea/index.json
  30. 1
      pages/user/myIdea/index.wxml
  31. 7
      pages/user/myMessage/index.js
  32. 3
      pages/user/myMessage/index.json
  33. 1
      pages/user/myMessage/index.wxml
  34. 7
      pages/user/myTopics/index.js
  35. 6
      pages/user/myTopics/myParticipant/cell/index.wxss
  36. 1
      pages/user/myTopics/myParticipant/index.json
  37. 1
      pages/user/myTopics/myParticipant/index.wxml

20
components/cell/index.js

@ -4,6 +4,7 @@ Component({
* 组件的属性列表
*/
properties: {
index: Number,
cId: String,
title: String,
readed: {
@ -14,14 +15,24 @@ Component({
showTop: {
type: Boolean,
value: false,
},
image: {
type: String,
value: ''
}
},
observers: {
readed (value) {
this.setData({
_readed: value
})
}
},
/**
* 组件的初始数据
*/
data: {
_readed: false,
},
/**
@ -29,7 +40,10 @@ Component({
*/
methods: {
onTap () {
this.triggerEvent('clickListItem', { id: this.properties.cId})
this.setData({
_readed: true
})
this.triggerEvent('clickListItem', { id: this.properties.cId, index: this.properties.index})
}
}
})

13
components/cell/index.wxml

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

23
components/cell/index.wxss

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

6
components/empty/index.js

@ -6,15 +6,15 @@ Component({
properties: {
loading: {
type: Boolean,
value: true,
value: false,
},
empty: {
type: Boolean,
value: false,
},
message: {
type: Boolean,
value: '页面迷路了!'
type: String,
value: '暂无内容数据'
}
},

4
components/swiper/index.wxml

@ -10,7 +10,9 @@
>
<block wx:for="{{images}}" wx:key="swiper-{{index}}">
<swiper-item bind:tap="onTapImage" data-item="{{item}}">
<image class="swiper_icon" src="{{item.image}}"></image>
<image class="swiper_icon" src="{{item.image}}">
<text class="swiper_title">{{item.title}}</text>
</image>
</swiper-item>
</block>
</swiper>

16
components/swiper/index.wxss

@ -1,4 +1,7 @@
/* components/swiper/index.wxss */
.e-swiper {
position: relative;
}
.e-swiper>swiper {
height: 180px;
}
@ -6,3 +9,16 @@
width: 100%;
height: 100%;
}
.swiper_title {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 0 10rpx;
z-index: 10;
text-overflow: ellipsis;
color: white;
white-space: nowrap;
overflow: hidden;
background-color: rgba(0, 0, 0, 0.2);
}

10
pages/article/index.js

@ -12,6 +12,7 @@ Page({
nodes: '',
isStar: true, // 是否
showBtn: false,
image: '',
aId: '',
title: '',
date: '',
@ -49,6 +50,7 @@ Page({
nodes: data.content,
title: data.title,
date: date,
image: data.titlePic,
origin: data.source,
isStar: data.isCollection ? true : false,
showBtn: data.typeFlag >= 2 ? true : false,
@ -59,12 +61,12 @@ Page({
addOrRemoveCollectionApi () {
artice.addOrRemoveCollect(this.data.aId, res => {
console.log(res)
this.setData({
isStar: !this.data.isStar
})
if (res.code == 200) {
this.setData({
isStar: !this.data.isStar
})
wx.showToast({
title: res.message,
title: this.data.isStar ? '收藏成功' : '取消收藏成功',
icon: 'none'
})
}

7
pages/article/index.wxml

@ -3,10 +3,13 @@
<view class="page_hd">
<view class="artice_title">{{title}}</view>
<view class="artice_info">
<text class="artice_origin">{{origin}}</text>
<text class="artice_time">{{date}}</text>
<text class="artice_origin">{{origin || ''}}</text>
<text class="artice_time">{{date || ''}}</text>
<image class="artice_collect" src="{{isStar ? star : unStar}}" bindtap="onClickCollect"></image>
</view>
<view class="artice_image" wx:if="{{image.length > 0}}">
<image class="title_image" src="{{image}}"></image>
</view>
</view>
<view class="page_bd {{showBtn ? 'page_bd_short':''}}">
<rich-text nodes="{{nodes}}"></rich-text>

15
pages/article/index.wxss

@ -8,6 +8,7 @@
flex-direction: column;
margin-bottom: 10px;
}
/* 标题 */
.artice_title {
color: #373737;
font-size: 20px;
@ -20,7 +21,11 @@
line-height: 27px;
}
.artice_origin {
max-width: 50vw;
color: #66708B;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.artice_time {
color: #B3B3B3;
@ -32,6 +37,16 @@
width: 20px;
height: 20px;
}
.artice_image {
margin-top: 10rpx;
}
.title_image {
width: 100%;
height: 160px;
}
/* 底部 button 区域 */
.page_footer {
background-color: white;
border-top: 1px solid #f7f7f7;

1
pages/billboards/policy/index.json

@ -4,6 +4,7 @@
"usingComponents": {
"w-searchbar": "/components/weui/searchbar/searchbar",
"e-cell": "/components/cell/index",
"e-empty": "/components/empty/index",
"e-tags": "components/tags/index"
}
}

1
pages/billboards/policy/index.wxml

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

4
pages/billboards/policy/policy-list/index.js

@ -50,10 +50,6 @@ Page({
this.setData({
nodes: ''
})
wx.showToast({
title: res.message,
icon: 'none'
})
}
})
}

3
pages/billboards/policy/policy-list/index.json

@ -1,6 +1,7 @@
{
"navigationBarTitleText": "人才政策",
"usingComponents": {
"e-segment": "/components/segment/index"
"e-segment": "/components/segment/index",
"e-empty": "/components/empty/index"
}
}

1
pages/billboards/policy/policy-list/index.wxml

@ -10,4 +10,5 @@
<view class="page_bd">
<rich-text nodes="{{nodes}}"></rich-text>
</view>
<e-empty empty="{{nodes.length <= 0}}" message="暂无数据"/>
</view>

10
pages/home/index.js

@ -61,9 +61,10 @@ Page({
tempDatas.push({
id: item.id,
title: item.title,
image: item.titlePic,
showTop: item.isTop == 1 ? true : false,
time: dayjs(item.createTime).toNow(),
readed: item.isRead == 0 ? 'false' : 'true'
readed: item.isRead == 0 ? false : true
})
})
if (page == 1) {
@ -98,10 +99,10 @@ Page({
const datas = res.list
let tempBanners = []
datas.forEach(item => {
console.log(item)
tempBanners.push({
id: item.id,
image: item.titlePic
image: item.titlePic,
title: item.title
})
})
this.setData({
@ -137,7 +138,8 @@ Page({
},
clickListItem (e) {
console.log(e.detail)
this.gotoArticePage(e.detail.id)
const {id, index} = e.detail
this.gotoArticePage(id)
},
gotoArticePage (id) {
wx.navigateTo({

2
pages/home/index.wxml

@ -4,7 +4,9 @@
<e-focus bind:tapFocusItem="tapFocusItem" items="{{hots}}"/>
<block wx:for="{{list}}" wx:key="{{index}}">
<e-cell
index="{{index}}"
read="{{item.readed}}"
image="{{item.image}}"
cId="{{item.id}}"
title="{{item.title}}"
time="{{item.time}}"

1
pages/topics/index.js

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

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

@ -38,6 +38,10 @@
/* border-radius: 50%; */
}
.userName{
max-width: 120rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 0 5px 0 5px;
font-size: 12px;
color: #3B3B3B;
@ -81,6 +85,12 @@ image{
font-weight: 300;
font-size: 17px;
color: #000;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
.cell_title_selected {
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) {
const item = e.detail.item;
console.log(item);
let id = item.articleId
const {id} = e.detail
wx.navigateTo({
url: `/pages/article/index?id=${id}`,
})

2
pages/user/myActivity/index.json

@ -2,6 +2,6 @@
"enablePullDownRefresh": true,
"navigationBarTitleText": "我的活动",
"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-->
<view class="container">
<block wx:for="{{list}}" wx:key="{{index}}">
<cell
articleId="{{item.articleId}}"
<e-cell
index="{{index}}"
image="{{item.articleImg}}"
cId="{{item.articleId}}"
title="{{item.title}}"
articleImg="{{item.articleImg}}"
userName="{{item.userName}}"
time="{{item.time}}"
commentNum="{{item.commentNum}}"
showTop="{{item.showTop}}"
bind:clickListItem="clickListItem"/>
</block>

1
pages/user/myFavorite/index.json

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

2
pages/user/myFavorite/index.wxml

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

7
pages/user/myIdea/index.js

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

1
pages/user/myIdea/index.json

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

1
pages/user/myIdea/index.wxml

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

7
pages/user/myMessage/index.js

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

3
pages/user/myMessage/index.json

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

1
pages/user/myMessage/index.wxml

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

7
pages/user/myTopics/index.js

@ -29,13 +29,6 @@ Page({
fetchMyTopicList(){
let page = this.data.currentPage
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
let tempDatas = []
datas.forEach(item => {

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

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

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

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

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

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

Loading…
Cancel
Save