You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
181 lines
4.2 KiB
181 lines
4.2 KiB
<template> |
|
<view class="highway_home"> |
|
<!-- 退出 --> |
|
<view class="act_btn_loginout" @click="doLoginout"> |
|
退出 |
|
</view> |
|
<view style="text-align: center;"> |
|
<image v-if="routersData.name" :src="'../../static/image/' + routersData.name.replace('/','') + '01.png'" class="highway_logo"></image> |
|
<view class="home_title">{{routersData.meta.title}}</view> |
|
</view> |
|
<view class="act_wrap" v-for="(item,index) in routersData.children" :key="index"> |
|
<view class="act_box" @click="changeShowStatus(index)"> |
|
<image v-if="index == 0" src="../../static/image/icon_rundata.png" class="act_logo"></image> |
|
<image v-else src="../../static/image/icon_runstatus.png" class="act_logo"></image> |
|
<text class="act_txt">{{item.meta.title}}</text> |
|
</view> |
|
<!-- 子路由 --> |
|
<view v-show="index === showIndex"> |
|
<view @click="goPage('/pages'+ routersData.path + '/' + item.name+'/form?type=add')" class="act_sub_box" style="margin-bottom: 30rpx;"> |
|
报送 |
|
</view> |
|
<view @click="goPage('/pages'+ routersData.path + '/' + item.name+'/list')" class="act_sub_box"> |
|
历史查询 |
|
</view> |
|
</view> |
|
</view> |
|
<!-- 底部备注 --> |
|
<view class="foot_intro"> |
|
<view>如有填报问题,请咨询公共服务中心</view> |
|
<view>中心值班电话:<text @click="call(mobile)" class="tel">{{mobile}}</text></view> |
|
</view> |
|
</view> |
|
</template> |
|
<script> |
|
export default { |
|
data() { |
|
return { |
|
routersData: [], |
|
showIndex: 0, |
|
mobile: getApp().globalData.mobile |
|
} |
|
}, |
|
onLoad(options) { |
|
if(this.routersData.length == 0 && options.routers) { |
|
this.routersData = JSON.parse(options.routers); |
|
uni.setNavigationBarTitle({ |
|
title: this.routersData.meta.title || '交通运输报送系统' |
|
}) |
|
this.routersData.children.map((item,index) => { |
|
item.show = index == 0 ? true : false; |
|
}) |
|
if(this.routersData.path.indexOf('/') == '-1'){ |
|
this.routersData.path = '/' + this.routersData.path |
|
} |
|
} |
|
}, |
|
methods: { |
|
call(tel) { |
|
uni.makePhoneCall({ |
|
phoneNumber: tel |
|
}); |
|
}, |
|
//切换展示 |
|
changeShowStatus(index) { |
|
this.showIndex = index; |
|
console.log('changeShow', index) |
|
}, |
|
goPage(url) { |
|
console.log('gopage', url) |
|
uni.navigateTo({ |
|
url: url |
|
}) |
|
}, |
|
//退出 |
|
doLoginout() { |
|
uni.showModal({ |
|
title: '提示', |
|
content: '您确认要退出当前登录吗?', |
|
success: (res) => { |
|
if(res.confirm) { |
|
uni.clearStorageSync(); |
|
uni.reLaunch({ |
|
url: '/pages/login/login' |
|
}) |
|
} |
|
} |
|
}) |
|
}, |
|
} |
|
} |
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
.highway_home { |
|
position: relative; |
|
height: calc(100vh - 140rpx); |
|
padding: 0 50rpx 140rpx; |
|
background-color: #fff; |
|
overflow: auto; |
|
.act_btn_loginout{ |
|
position: absolute; |
|
right: 50rpx; |
|
top: 30rpx; |
|
color: #fff; |
|
width: 100rpx; |
|
font-size: 24rpx; |
|
line-height: 44rpx; |
|
text-align: center; |
|
background-color: #C1C1C1; |
|
border-radius: 30rpx; |
|
} |
|
|
|
.highway_logo { |
|
width: 128rpx; |
|
height: 128rpx; |
|
margin: 50rpx auto 0; |
|
} |
|
|
|
.home_title { |
|
color: #333; |
|
line-height: 40rpx; |
|
font-size: 28rpx; |
|
font-family: PingFang SC-Bold, PingFang SC; |
|
font-weight: bold; |
|
text-align: center; |
|
margin-bottom: 75rpx; |
|
} |
|
|
|
.act_wrap{ |
|
margin-bottom: 40rpx; |
|
.act_box { |
|
display: flex; |
|
align-items: center; |
|
justify-content: center; |
|
height: 100rpx; |
|
background: #EFF7FF; |
|
border-radius: 20rpx; |
|
margin-bottom: 30rpx; |
|
|
|
.act_logo { |
|
width: 44rpx; |
|
height: 44rpx; |
|
} |
|
|
|
.act_txt { |
|
font-size: 28rpx; |
|
font-family: PingFang SC-Regular, PingFang SC; |
|
font-weight: 400; |
|
color: #2D8CF0; |
|
} |
|
} |
|
.act_sub_box{ |
|
color: #333333; |
|
font-size: 28rpx; |
|
font-family: PingFang SC-Regular, PingFang SC; |
|
font-weight: 400; |
|
line-height: 100rpx; |
|
text-align: center; |
|
border: 1rpx solid #C1C1C1; |
|
border-radius: 20rpx; |
|
} |
|
} |
|
.foot_intro{ |
|
position: fixed; |
|
left: 0; |
|
right: 0; |
|
bottom: 0; |
|
padding: 20rpx 0 44rpx; |
|
color: #666; |
|
font-size: 26rpx; |
|
font-family: PingFang SC-Bold, PingFang SC; |
|
line-height: 48rpx; |
|
text-align: center; |
|
background: #fff; |
|
.tel{ |
|
color: #2D8CF0; |
|
font-weight: bold; |
|
} |
|
} |
|
} |
|
</style> |