14 changed files with 300 additions and 3 deletions
@ -0,0 +1,36 @@ |
|||||
|
const api = require('../../../../utils/api') |
||||
|
Page({ |
||||
|
data: { |
||||
|
gridList: [], |
||||
|
}, |
||||
|
onShow () { |
||||
|
this.loadGridList('1258587398679126017') |
||||
|
}, |
||||
|
// 加载网格长管辖的网格列表
|
||||
|
loadGridList (id) { |
||||
|
//默认写死传榆山街道id
|
||||
|
let par = { |
||||
|
pid:id?id:'1258587398679126017' |
||||
|
} |
||||
|
api.getCommunityList(par).then(res => { |
||||
|
if (res.code === 0 && res.msg === 'success') { |
||||
|
const gridList = res.data |
||||
|
|
||||
|
this.setData({ |
||||
|
gridList, |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
console.log(res); |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 点击进入
|
||||
|
changeGrid (e) { |
||||
|
wx.navigateTo({ |
||||
|
url: `/subpages/gridArmy/pages/gridEntryTwo/index?id=${e.currentTarget.dataset.id}`, |
||||
|
}) |
||||
|
} |
||||
|
}) |
@ -0,0 +1,4 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "现代榆山", |
||||
|
"usingComponents": {} |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
<view class="change-grid"> |
||||
|
<view class="grid-list"> |
||||
|
<view class="content"> |
||||
|
<view class="grid-item" wx:for="{{gridList}}" wx:item="{{item}}" wx:key="{{item.id}}"> |
||||
|
<view class="name">{{item.name}}</view> |
||||
|
<view class="enter" bind:tap="changeGrid" data-id="{{item.id}}">进入</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
@ -0,0 +1,68 @@ |
|||||
|
/* subpages/gridArmy/pages/gridEntry/index.wxss */ |
||||
|
.change-grid { |
||||
|
width: 100%; |
||||
|
height: 100vh; |
||||
|
background: #f7f7f7; |
||||
|
} |
||||
|
.nav { |
||||
|
height: 94rpx; |
||||
|
background: #ffffff; |
||||
|
width: 100%; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.nav .nav-left image { |
||||
|
width: 32rpx; |
||||
|
height: 32rpx; |
||||
|
margin: 0 9rpx 0 20rpx; |
||||
|
} |
||||
|
.nav .nav-left text { |
||||
|
font-size: 32rpx; |
||||
|
font-weight: bold; |
||||
|
color: #f13d3c; |
||||
|
} |
||||
|
.nav .nav-right { |
||||
|
font-size: 26rpx; |
||||
|
color: #999; |
||||
|
margin-right: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.grid-list { |
||||
|
width: 100%; |
||||
|
box-sizing: border-box; |
||||
|
padding: 20rpx; |
||||
|
height: auto; |
||||
|
} |
||||
|
.grid-list .content { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
background: #ffffff; |
||||
|
border-radius: 16rpx; |
||||
|
box-sizing: border-box; |
||||
|
padding: 0 23rpx; |
||||
|
} |
||||
|
.grid-list .grid-item { |
||||
|
height: 100rpx; |
||||
|
width: 100%; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.content > .grid-item + .grid-item { |
||||
|
border-top: 1rpx solid #eaeaea; |
||||
|
} |
||||
|
.grid-list .grid-item .name { |
||||
|
font-size: 34rpx; |
||||
|
color: #333; |
||||
|
} |
||||
|
.grid-list .grid-item .enter { |
||||
|
width:80rpx; |
||||
|
height:40rpx; |
||||
|
border: 1rpx solid #C0C0C0; |
||||
|
border-radius:4px; |
||||
|
line-height: 40rpx; |
||||
|
font-size: 24rpx; |
||||
|
color: #aeaeae; |
||||
|
text-align:center; |
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
const api = require('../../../../utils/api') |
||||
|
Page({ |
||||
|
data: { |
||||
|
gridList: [], |
||||
|
}, |
||||
|
onShow () { |
||||
|
}, |
||||
|
onLoad (options) { |
||||
|
wx.showLoading({ |
||||
|
title: "加载中", |
||||
|
mask: true, |
||||
|
}) |
||||
|
this.loadGridList(options.id) |
||||
|
wx.hideLoading() |
||||
|
}, |
||||
|
// 加载网格长管辖的网格列表
|
||||
|
loadGridList (id) { |
||||
|
//默认写死传榆山街道id
|
||||
|
let par = { |
||||
|
pid:id |
||||
|
} |
||||
|
api.getCommunityList(par).then(res => { |
||||
|
if (res.code === 0 && res.msg === 'success') { |
||||
|
const gridList = res.data |
||||
|
if (gridList.length > 0) { |
||||
|
}else{ |
||||
|
wx.showToast({ |
||||
|
title: '暂无网格信息', |
||||
|
icon: 'none', |
||||
|
duration: 2500 |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
this.setData({ |
||||
|
gridList, |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
console.log(res); |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 点击进入
|
||||
|
changeGrid (e) { |
||||
|
|
||||
|
wx.navigateTo({ |
||||
|
url: `/pages/index/index?scene=${e.currentTarget.dataset.id}` |
||||
|
}) |
||||
|
} |
||||
|
}) |
@ -0,0 +1,4 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "现代榆山", |
||||
|
"usingComponents": {} |
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
<view class="change-grid"> |
||||
|
<view class="grid-list" > |
||||
|
<view class="content"> |
||||
|
<view class="grid-item" wx:for="{{gridList}}" wx:item="{{item}}" wx:key="{{item.id}}"> |
||||
|
<view class="name">{{item.name}}</view> |
||||
|
<view class="enter" bind:tap="changeGrid" data-id="{{item.id}}">进入</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
@ -0,0 +1,68 @@ |
|||||
|
/* subpages/gridArmy/pages/gridEntryTwo/index.wxss */ |
||||
|
.change-grid { |
||||
|
width: 100%; |
||||
|
height: 100vh; |
||||
|
background: #f7f7f7; |
||||
|
} |
||||
|
.nav { |
||||
|
height: 94rpx; |
||||
|
background: #ffffff; |
||||
|
width: 100%; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.nav .nav-left image { |
||||
|
width: 32rpx; |
||||
|
height: 32rpx; |
||||
|
margin: 0 9rpx 0 20rpx; |
||||
|
} |
||||
|
.nav .nav-left text { |
||||
|
font-size: 32rpx; |
||||
|
font-weight: bold; |
||||
|
color: #f13d3c; |
||||
|
} |
||||
|
.nav .nav-right { |
||||
|
font-size: 26rpx; |
||||
|
color: #999; |
||||
|
margin-right: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.grid-list { |
||||
|
width: 100%; |
||||
|
box-sizing: border-box; |
||||
|
padding: 20rpx; |
||||
|
height: auto; |
||||
|
} |
||||
|
.grid-list .content { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
background: #ffffff; |
||||
|
border-radius: 16rpx; |
||||
|
box-sizing: border-box; |
||||
|
padding: 0 23rpx; |
||||
|
} |
||||
|
.grid-list .grid-item { |
||||
|
height: 100rpx; |
||||
|
width: 100%; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.content > .grid-item + .grid-item { |
||||
|
border-top: 1rpx solid #eaeaea; |
||||
|
} |
||||
|
.grid-list .grid-item .name { |
||||
|
font-size: 34rpx; |
||||
|
color: #333; |
||||
|
} |
||||
|
.grid-list .grid-item .enter { |
||||
|
width:80rpx; |
||||
|
height:40rpx; |
||||
|
border: 1rpx solid #C0C0C0; |
||||
|
border-radius:4px; |
||||
|
line-height: 40rpx; |
||||
|
font-size: 24rpx; |
||||
|
color: #aeaeae; |
||||
|
text-align:center; |
||||
|
} |
Loading…
Reference in new issue