Browse Source

修改BUG 0.0.2

master
lqq 6 years ago
parent
commit
4be59e5ab4
  1. 16
      components/cell/index.js
  2. 2
      components/cell/index.wxml
  3. 6
      components/empty/index.js
  4. 4
      components/swiper/index.wxml
  5. 16
      components/swiper/index.wxss
  6. 8
      pages/article/index.js
  7. 4
      pages/article/index.wxml
  8. 4
      pages/article/index.wxss
  9. 1
      pages/billboards/policy/index.json
  10. 1
      pages/billboards/policy/index.wxml
  11. 4
      pages/billboards/policy/policy-list/index.js
  12. 3
      pages/billboards/policy/policy-list/index.json
  13. 1
      pages/billboards/policy/policy-list/index.wxml
  14. 9
      pages/home/index.js
  15. 1
      pages/home/index.wxml

16
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})
}
}
})

2
components/cell/index.wxml

@ -1,6 +1,6 @@
<!--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_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>

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);
}

8
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'
})
}

4
pages/article/index.wxml

@ -3,8 +3,8 @@
<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>

4
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;

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>

9
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({

1
pages/home/index.wxml

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

Loading…
Cancel
Save