Browse Source

微调界面

master
lqq 6 years ago
parent
commit
92b828231c
  1. 3
      app.json
  2. 2
      components/card/index.wxml
  3. BIN
      images/temp_1.png
  4. 74
      pages/billboards/park/park-category/index.js
  5. 3
      pages/billboards/park/park-category/index.json
  6. 2
      pages/billboards/park/park-category/index.wxml
  7. 1
      pages/billboards/park/park-category/index.wxss
  8. 9
      pages/billboards/policy/policy-list/index.js
  9. 15
      pages/billboards/policy/policy-list/index.wxml
  10. 12
      pages/billboards/policy/policy-list/index.wxss

3
app.json

@ -18,7 +18,8 @@
"pages/user/myTopics/index",
"pages/user/myInfo/index",
"pages/topics/interactive/submitTopic/index",
"pages/topics/interactive/topicArticle/index"
"pages/topics/interactive/topicArticle/index",
"pages/billboards/park/park-category/index"
],
"window": {
"backgroundTextStyle": "light",

2
components/card/index.wxml

@ -1,5 +1,5 @@
<!--components/card/index.wxml-->
<view class="card tag-class" bindtap="onTap">
<image class="card_logo" src="{{image.length > 0 ? image : '/images/temp_1.png'}}"/>
<image class="card_logo" mode="aspectFill" src="{{image.length > 0 ? image : '/images/temp_1.png'}}"/>
<view class="card_title">{{title}}</view>
</view>

BIN
images/temp_1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 45 KiB

74
pages/billboards/park/park-category/index.js

@ -0,0 +1,74 @@
// pages/billboards/park/park-category/index.js
import { BillboardModel } from '../../../../models/billboard.js'
let billboard = new BillboardModel()
Page({
/**
* 页面的初始数据
*/
data: {
list: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
fetchList() {
const { curCode } = this.data
const page = this.data.currPage
billboard.fetchBailList(curCode, page, res => {
console.log(res)
const datas = res.list
let tempDatas = []
datas.forEach(item => {
tempDatas.push({
id: item.id,
title: item.title,
image: item.titlePic
})
})
if (page == 1) {
this.setData({
list: tempDatas
})
} else {
if (tempDatas.length > 0) {
const list = [...this.data.list, ...tempDatas]
this.setData({
list: list
})
} else {
const page = this.data.currPage - 1
this.setData({
currPage: page
})
wx.showToast({
title: '已加载全部',
icon: 'none'
})
}
}
wx.stopPullDownRefresh()
})
},
// 获取分类Tags
fetchTags() {
billboard.fetchTagsByCode('sc-zdqy', res => {
console.log(res)
const tags = res.result.records
const navs = tags.map(item => item.name)
this.setData({
navs: navs,
tags: tags,
curCode: tags.length > 0 ? tags[0].code : ''
})
this.fetchList()
})
},
})

3
pages/billboards/park/park-category/index.json

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

2
pages/billboards/park/park-category/index.wxml

@ -0,0 +1,2 @@
<!--pages/billboards/park/park-category/index.wxml-->
<text>pages/billboards/park/park-category/index.wxml</text>

1
pages/billboards/park/park-category/index.wxss

@ -0,0 +1 @@
/* pages/billboards/park/park-category/index.wxss */

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

@ -63,17 +63,22 @@ Page({
this.fetchPolicyArtice()
},
fetchPolicyArtice () {
wx.showLoading({
title: '加载中...',
})
policy.fetchPolicyArtice(this.data.curCode, res => {
//console.log(res)
console.log(res)
if (res.data) {
this.setData({
nodes: res.data.content || ''
readNum: res.data.readNum,
nodes: res.data.content || '',
})
} else {
this.setData({
nodes: ''
})
}
wx.hideLoading()
})
},
maskTouchMove () {

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

@ -2,11 +2,7 @@
<view class="container">
<view class="page_hd">
<view class="page_segment">
<e-segment
headerTitles="{{navs}}"
defaultSelectIndex="{{navSelectIndex}}"
bind:tapSegment="tapSegemnt"
/>
<e-segment headerTitles="{{navs}}" defaultSelectIndex="{{navSelectIndex}}" bind:tapSegment="tapSegemnt" />
</view>
<view class="page_btn_all" bindtap="onShowAllButton">
<image class="arrow_btn" src="/images/billboard/arrow-down.png"></image>
@ -14,13 +10,16 @@
</view>
<view class="page_bd" bindtap="onHiddenPopView">
<rich-text nodes="{{nodes}}"></rich-text>
<!-- <view class="read_collectNum">
<view class="read_num">阅读:{{readNum}}</view>
</view> -->
</view>
<e-empty empty="{{nodes.length <= 0}}" message="暂无数据"/>
<e-empty empty="{{nodes.length <= 0}}" message="暂无数据" />
<view class="pop_view pop_view_layout {{show ? 'pop_show': 'pop_hidden'}}">
<block wx:for="{{navs}}" wx:key="pop_{{index}}">
<text bindtap="onClickAllBtnItem" data-index="{{index}}" class="pop_item">{{item}}</text>
</block>
</view>
<view bindtap="onHiddenPopView" class="mark" wx:if="{{show}}" catchtouchmove="maskTouchMove"></view>
</view>
</view>

12
pages/billboards/policy/policy-list/index.wxss

@ -78,4 +78,16 @@
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.6);
}
/* // 阅读量 */
.read_collectNum {
padding: 20rpx 0;
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 16px;
}
.read_num {
color: #999;
}
Loading…
Cancel
Save