18 changed files with 369 additions and 13 deletions
After Width: | Height: | Size: 368 B |
After Width: | Height: | Size: 25 KiB |
@ -0,0 +1,65 @@ |
|||||
|
const api = require('../../../../utils/api') |
||||
|
|
||||
|
Page({ |
||||
|
data: { |
||||
|
loadType: 'none', |
||||
|
loadVisible: false, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 10, |
||||
|
deptId: '', |
||||
|
isShow: true, |
||||
|
categoryList: [], |
||||
|
categoryCode: '', |
||||
|
}, |
||||
|
onLoad(options) { |
||||
|
if (options.name) { |
||||
|
wx.setNavigationBarTitle({ |
||||
|
title: options.name, |
||||
|
}) |
||||
|
this.setData({ |
||||
|
deptId: options.id |
||||
|
}) |
||||
|
} |
||||
|
this.getGridCategoryList() |
||||
|
}, |
||||
|
// 获取社区列表
|
||||
|
getGridCategoryList() { |
||||
|
api.getGridCategoryList().then(res => { |
||||
|
if (res.code == 0 && res.msg == 'success') { |
||||
|
this.setData({ |
||||
|
isShow: false, |
||||
|
categoryList: this.data.categoryList.concat(res.data), |
||||
|
// loadType: res.data.length < this.data.pageSize ? 'none' : 'loading',
|
||||
|
}) |
||||
|
if (this.data.categoryList.length == 0) { |
||||
|
this.setData({ |
||||
|
isShow: true, |
||||
|
// loadVisible: false,
|
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
this.setData({ |
||||
|
isShow: true, |
||||
|
loadVisible: false, |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
// onReachBottom() {
|
||||
|
// if (this.data.loadType == 'none') {
|
||||
|
// return
|
||||
|
// }
|
||||
|
// this.setData({
|
||||
|
// pageIndex: ++this.data.pageIndex,
|
||||
|
// })
|
||||
|
// this.getGridCategoryList()
|
||||
|
// },
|
||||
|
//
|
||||
|
navigateTo(e) { |
||||
|
let code = e.currentTarget.dataset.code |
||||
|
let name = e.currentTarget.dataset.name |
||||
|
wx.navigateTo({ |
||||
|
url: `../index/index?id=${this.data.deptId}&code=${code}&name=${name}` |
||||
|
}) |
||||
|
}, |
||||
|
}) |
@ -0,0 +1,9 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "", |
||||
|
"navigationBarTextStyle": "white", |
||||
|
"navigationBarBackgroundColor": "#349c83", |
||||
|
"usingComponents": { |
||||
|
"no-data": "/components/nodata/nodata", |
||||
|
"load-more": "/components/nodata/nodata" |
||||
|
} |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
<view class="list"> |
||||
|
<view class="top"> |
||||
|
<view class="left"> |
||||
|
<view class="title">网格队伍</view> |
||||
|
<view class="desc">基层党建·为民服务</view> |
||||
|
<view class="line"></view> |
||||
|
</view> |
||||
|
<image src="../../images/top-img.png" class="top-img" /> |
||||
|
</view> |
||||
|
<view class="org-list"> |
||||
|
<view class="list-item" bindtap="navigateTo" wx:for="{{categoryList}}" wx:for-item="item" wx:for-index="index" wx:key="value" data-code="{{item.typeCode}}" data-name="{{item.typeName}}" hover-class="org-hover" hover-stay-time="150"> |
||||
|
<view class="list-item-label">{{item.typeName}}</view> |
||||
|
<image class="list-item-icon" src="../../images/right-sword.png" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<!-- <load-more loadType="{{loadType}}" loadVisible="{{loadVisible}}"></load-more> --> |
||||
|
<no-data isShow="{{isShow}}"></no-data> |
@ -0,0 +1,77 @@ |
|||||
|
page { |
||||
|
width: 100%; |
||||
|
min-height: 100vh; |
||||
|
height: auto; |
||||
|
} |
||||
|
.list { |
||||
|
width: 100%; |
||||
|
} |
||||
|
.list .top { |
||||
|
width: 100%; |
||||
|
height: 338rpx; |
||||
|
border-radius: 0 0 40rpx 40rpx; |
||||
|
background: linear-gradient(to bottom, #349c83, #39b092); |
||||
|
display: flex; |
||||
|
} |
||||
|
.list .top .left { |
||||
|
color: #ffffff; |
||||
|
width: 450rpx; |
||||
|
height: 227rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: flex-start; |
||||
|
justify-content: center; |
||||
|
padding-left: 70rpx; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
.list .top .left .title { |
||||
|
font-size: 44rpx; |
||||
|
letter-spacing: 4rpx; |
||||
|
} |
||||
|
.list .top .left .desc { |
||||
|
font-size: 25rpx; |
||||
|
letter-spacing: 4rpx; |
||||
|
margin-top: 25rpx; |
||||
|
} |
||||
|
.list .top .left .line { |
||||
|
width: 99rpx; |
||||
|
height: 8rpx; |
||||
|
background-color: #ffb71c; |
||||
|
margin-top: 23rpx; |
||||
|
} |
||||
|
.list .top .top-img { |
||||
|
width: 256rpx; |
||||
|
height: 227rpx; |
||||
|
} |
||||
|
|
||||
|
.list .org-list { |
||||
|
width: 100%; |
||||
|
box-sizing: border-box; |
||||
|
padding: 0 30rpx; |
||||
|
position: relative; |
||||
|
top: -90rpx; |
||||
|
} |
||||
|
.list .org-list .list-item { |
||||
|
width: 100%; |
||||
|
height: 130rpx; |
||||
|
background: #fff; |
||||
|
box-shadow: 0rpx 5rpx 32rpx 0rpx rgba(198, 198, 198, 0.56); |
||||
|
border-radius: 14rpx; |
||||
|
box-sizing: border-box; |
||||
|
padding: 0 33rpx 0 35rpx; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: space-between; |
||||
|
margin-top: 30rpx; |
||||
|
} |
||||
|
.list .org-list .list-item .list-item-label { |
||||
|
color: #333; |
||||
|
font-size: 34rpx; |
||||
|
} |
||||
|
.list .org-list .list-item .list-item-icon { |
||||
|
width: 24rpx; |
||||
|
height: 24rpx; |
||||
|
} |
||||
|
.list .org-list .org-hover { |
||||
|
background: #f6f7f7; |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
const api = require('../../../../utils/api') |
||||
|
|
||||
|
Page({ |
||||
|
data: { |
||||
|
loadType: 'none', |
||||
|
loadVisible: false, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 10, |
||||
|
deptId: '', |
||||
|
isShow: true, |
||||
|
deptList: [], |
||||
|
}, |
||||
|
onLoad() { |
||||
|
this.getCommunityDeptList() |
||||
|
}, |
||||
|
// 获取社区列表
|
||||
|
getCommunityDeptList() { |
||||
|
api.getCommunityDeptList().then(res => { |
||||
|
if (res.code == 0 && res.msg == 'success') { |
||||
|
this.setData({ |
||||
|
isShow: false, |
||||
|
deptList: this.data.deptList.concat(res.data), |
||||
|
// loadType: res.data.length < this.data.pageSize ? 'none' : 'loading',
|
||||
|
}) |
||||
|
if (this.data.deptList.length == 0) { |
||||
|
this.setData({ |
||||
|
isShow: true, |
||||
|
// loadVisible: false,
|
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
this.setData({ |
||||
|
isShow: true, |
||||
|
loadVisible: false, |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
// onReachBottom() {
|
||||
|
// if (this.data.loadType == 'none') {
|
||||
|
// return
|
||||
|
// }
|
||||
|
// this.setData({
|
||||
|
// pageIndex: ++this.data.pageIndex,
|
||||
|
// })
|
||||
|
// this.getCommunityDeptList()
|
||||
|
// },
|
||||
|
//
|
||||
|
navigateTo(e) { |
||||
|
let id = e.currentTarget.dataset.id |
||||
|
let name = e.currentTarget.dataset.name |
||||
|
wx.navigateTo({ |
||||
|
url: `../categoryList/categoryList?id=${id}&name=${name}` |
||||
|
}) |
||||
|
}, |
||||
|
}) |
@ -0,0 +1,9 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "网格队伍", |
||||
|
"navigationBarTextStyle": "white", |
||||
|
"navigationBarBackgroundColor": "#349c83", |
||||
|
"usingComponents": { |
||||
|
"no-data": "/components/nodata/nodata", |
||||
|
"load-more": "/components/nodata/nodata" |
||||
|
} |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
<view class="list"> |
||||
|
<view class="top"> |
||||
|
<view class="left"> |
||||
|
<view class="title">网格队伍</view> |
||||
|
<view class="desc">基层党建·为民服务</view> |
||||
|
<view class="line"></view> |
||||
|
</view> |
||||
|
<image src="../../images/top-img.png" class="top-img" /> |
||||
|
</view> |
||||
|
<view class="org-list"> |
||||
|
<view class="list-item" bindtap="navigateTo" wx:for="{{deptList}}" wx:for-item="item" wx:for-index="index" wx:key="value" data-id="{{item.id}}" data-name="{{item.name}}" hover-class="org-hover" hover-stay-time="150"> |
||||
|
<view class="list-item-label">{{item.name}}</view> |
||||
|
<image class="list-item-icon" src="../../images/right-sword.png" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<!-- <load-more loadType="{{loadType}}" loadVisible="{{loadVisible}}"></load-more> --> |
||||
|
<no-data isShow="{{isShow}}"></no-data> |
@ -0,0 +1,77 @@ |
|||||
|
page { |
||||
|
width: 100%; |
||||
|
min-height: 100vh; |
||||
|
height: auto; |
||||
|
} |
||||
|
.list { |
||||
|
width: 100%; |
||||
|
} |
||||
|
.list .top { |
||||
|
width: 100%; |
||||
|
height: 338rpx; |
||||
|
border-radius: 0 0 40rpx 40rpx; |
||||
|
background: linear-gradient(to bottom, #349c83, #39b092); |
||||
|
display: flex; |
||||
|
} |
||||
|
.list .top .left { |
||||
|
color: #ffffff; |
||||
|
width: 450rpx; |
||||
|
height: 227rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: flex-start; |
||||
|
justify-content: center; |
||||
|
padding-left: 70rpx; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
.list .top .left .title { |
||||
|
font-size: 44rpx; |
||||
|
letter-spacing: 4rpx; |
||||
|
} |
||||
|
.list .top .left .desc { |
||||
|
font-size: 25rpx; |
||||
|
letter-spacing: 4rpx; |
||||
|
margin-top: 25rpx; |
||||
|
} |
||||
|
.list .top .left .line { |
||||
|
width: 99rpx; |
||||
|
height: 8rpx; |
||||
|
background-color: #ffb71c; |
||||
|
margin-top: 23rpx; |
||||
|
} |
||||
|
.list .top .top-img { |
||||
|
width: 256rpx; |
||||
|
height: 227rpx; |
||||
|
} |
||||
|
|
||||
|
.list .org-list { |
||||
|
width: 100%; |
||||
|
box-sizing: border-box; |
||||
|
padding: 0 30rpx; |
||||
|
position: relative; |
||||
|
top: -90rpx; |
||||
|
} |
||||
|
.list .org-list .list-item { |
||||
|
width: 100%; |
||||
|
height: 130rpx; |
||||
|
background: #fff; |
||||
|
box-shadow: 0rpx 5rpx 32rpx 0rpx rgba(198, 198, 198, 0.56); |
||||
|
border-radius: 14rpx; |
||||
|
box-sizing: border-box; |
||||
|
padding: 0 33rpx 0 35rpx; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: space-between; |
||||
|
margin-top: 30rpx; |
||||
|
} |
||||
|
.list .org-list .list-item .list-item-label { |
||||
|
color: #333; |
||||
|
font-size: 34rpx; |
||||
|
} |
||||
|
.list .org-list .list-item .list-item-icon { |
||||
|
width: 24rpx; |
||||
|
height: 24rpx; |
||||
|
} |
||||
|
.list .org-list .org-hover { |
||||
|
background: #f6f7f7; |
||||
|
} |
@ -1,8 +1,7 @@ |
|||||
{ |
{ |
||||
"navigationBarBackgroundColor": "#d73e32", |
|
||||
"backgroundColor": "#f7f7f7", |
|
||||
"navigationBarTextStyle": "white", |
"navigationBarTextStyle": "white", |
||||
"navigationBarTitleText": "网格队伍", |
"navigationBarBackgroundColor": "#349c83", |
||||
|
"navigationBarTitleText": "", |
||||
"usingComponents": { |
"usingComponents": { |
||||
"no-data": "/components/nodata/nodata" |
"no-data": "/components/nodata/nodata" |
||||
} |
} |
||||
|
Loading…
Reference in new issue