diff --git a/components/cell/index.js b/components/cell/index.js
index 071032c..149fe98 100644
--- a/components/cell/index.js
+++ b/components/cell/index.js
@@ -4,6 +4,7 @@ Component({
* 组件的属性列表
*/
properties: {
+ index: Number,
cId: String,
title: String,
readed: {
@@ -16,12 +17,18 @@ Component({
value: false,
}
},
-
+ observers: {
+ readed (value) {
+ this.setData({
+ _readed: value
+ })
+ }
+ },
/**
* 组件的初始数据
*/
data: {
-
+ _readed: false,
},
/**
@@ -29,7 +36,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})
}
}
})
diff --git a/components/cell/index.wxml b/components/cell/index.wxml
index 072caf8..1edd25e 100644
--- a/components/cell/index.wxml
+++ b/components/cell/index.wxml
@@ -1,6 +1,6 @@
- {{title}}
+ {{title}}
{{time}}
diff --git a/components/empty/index.js b/components/empty/index.js
index 7519f39..2dd67c5 100644
--- a/components/empty/index.js
+++ b/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: '暂无内容数据'
}
},
diff --git a/components/swiper/index.wxml b/components/swiper/index.wxml
index ea851fb..a3575ee 100644
--- a/components/swiper/index.wxml
+++ b/components/swiper/index.wxml
@@ -10,7 +10,9 @@
>
-
+
+ {{item.title}}
+
diff --git a/components/swiper/index.wxss b/components/swiper/index.wxss
index fd522bd..9ef836e 100644
--- a/components/swiper/index.wxss
+++ b/components/swiper/index.wxss
@@ -1,8 +1,24 @@
/* components/swiper/index.wxss */
+.e-swiper {
+ position: relative;
+}
.e-swiper>swiper {
height: 180px;
}
.swiper_icon {
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);
}
\ No newline at end of file
diff --git a/pages/article/index.js b/pages/article/index.js
index 749eb23..539939c 100644
--- a/pages/article/index.js
+++ b/pages/article/index.js
@@ -59,12 +59,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'
})
}
diff --git a/pages/article/index.wxml b/pages/article/index.wxml
index da2c9be..ab21314 100644
--- a/pages/article/index.wxml
+++ b/pages/article/index.wxml
@@ -3,8 +3,8 @@
{{title}}
- {{origin}}
- {{date}}
+ {{origin || ''}}
+ {{date || ''}}
diff --git a/pages/article/index.wxss b/pages/article/index.wxss
index 499b497..5a2396b 100644
--- a/pages/article/index.wxss
+++ b/pages/article/index.wxss
@@ -20,7 +20,11 @@
line-height: 27px;
}
.artice_origin {
+ max-width: 50vw;
color: #66708B;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
}
.artice_time {
color: #B3B3B3;
diff --git a/pages/billboards/policy/index.json b/pages/billboards/policy/index.json
index 5b07c78..144aa75 100644
--- a/pages/billboards/policy/index.json
+++ b/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"
}
}
\ No newline at end of file
diff --git a/pages/billboards/policy/index.wxml b/pages/billboards/policy/index.wxml
index 8cacdf2..c906a80 100644
--- a/pages/billboards/policy/index.wxml
+++ b/pages/billboards/policy/index.wxml
@@ -12,4 +12,5 @@
bind:clickListItem="clickListItem"
/>
+
diff --git a/pages/billboards/policy/policy-list/index.js b/pages/billboards/policy/policy-list/index.js
index fa935d2..be85474 100644
--- a/pages/billboards/policy/policy-list/index.js
+++ b/pages/billboards/policy/policy-list/index.js
@@ -50,10 +50,6 @@ Page({
this.setData({
nodes: ''
})
- wx.showToast({
- title: res.message,
- icon: 'none'
- })
}
})
}
diff --git a/pages/billboards/policy/policy-list/index.json b/pages/billboards/policy/policy-list/index.json
index 4107059..ac02898 100644
--- a/pages/billboards/policy/policy-list/index.json
+++ b/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"
}
}
\ No newline at end of file
diff --git a/pages/billboards/policy/policy-list/index.wxml b/pages/billboards/policy/policy-list/index.wxml
index ef9e20f..017dda3 100644
--- a/pages/billboards/policy/policy-list/index.wxml
+++ b/pages/billboards/policy/policy-list/index.wxml
@@ -10,4 +10,5 @@
+
diff --git a/pages/home/index.js b/pages/home/index.js
index 93fd5c0..db2c24a 100644
--- a/pages/home/index.js
+++ b/pages/home/index.js
@@ -63,7 +63,7 @@ Page({
title: item.title,
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 +98,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 +137,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({
diff --git a/pages/home/index.wxml b/pages/home/index.wxml
index 20ab212..f5fdb4c 100644
--- a/pages/home/index.wxml
+++ b/pages/home/index.wxml
@@ -4,6 +4,7 @@