313 lines
6.2 KiB
Vue
313 lines
6.2 KiB
Vue
<template>
|
||
<view class="contentStyle" style="">
|
||
<view class="status-bar"></view>
|
||
<uni-nav-bar title="服务" backgroundColor="transparent" :border="false">
|
||
</uni-nav-bar>
|
||
<!-- 表单区域 -->
|
||
<scroll-view class="page" scroll-y>
|
||
<view class="container">
|
||
<!-- 顶部 Banner 轮播 -->
|
||
<view class="banner-box" style="overflow-y: hidden;">
|
||
<image class="banner-img" src="/static/propertyImgs/serviceImg.png" />
|
||
</view>
|
||
|
||
<!-- 常用功能区 -->
|
||
<view class="func-section">
|
||
<view class="section-title">
|
||
<text class="title-text">常用功能</text>
|
||
</view>
|
||
<view class="func-grid">
|
||
<view class="func-item" v-for="(item, index) in commonFuncList" :key="index"
|
||
@click="handleFuncClick(item)">
|
||
<view class="func-icon"
|
||
:style="{'background-image': 'url(' + (item.icon) + ')', 'background-repeat': 'no-repeat','background-size': '100% 100%','background-position': 'center',}">
|
||
<!-- <image :src="item.icon" mode="aspectFit"></image> -->
|
||
</view>
|
||
<text class="func-name">{{ item.name }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 智慧社区功能区 -->
|
||
<view class="func-section" style="margin-bottom: 0px;">
|
||
<view class="section-title">
|
||
<text class="title-text">智慧社区</text>
|
||
</view>
|
||
<view class="func-grid community-grid">
|
||
<view class="func-item" v-for="(item, index) in communityFuncList" :key="index"
|
||
@click="handleFuncClick(item)">
|
||
<view class="func-icon">
|
||
<image :src="item.icon" mode="aspectFit"></image>
|
||
</view>
|
||
<text class="func-name">{{ item.name }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
</scroll-view>
|
||
|
||
</view>
|
||
|
||
|
||
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
onReady: function(e) {},
|
||
components: {
|
||
|
||
},
|
||
|
||
computed: {
|
||
|
||
|
||
|
||
|
||
},
|
||
created() {
|
||
|
||
},
|
||
onShow() {
|
||
|
||
},
|
||
|
||
mounted() {},
|
||
|
||
onReady() {
|
||
this.$nextTick(() => {
|
||
|
||
})
|
||
},
|
||
data() {
|
||
return {
|
||
/* 设定状态栏默认高度 */
|
||
statusBarHeight: 20,
|
||
// 常用功能列表
|
||
commonFuncList: [{
|
||
name: "一键开门",
|
||
icon: "/static/propertyImgs/icon-door.png",
|
||
path: "/pages/notice-list/oneClickOpen"
|
||
},
|
||
{
|
||
name: "生活缴费",
|
||
icon: "/static/propertyImgs/icon-pay.png",
|
||
path: "/pages/payment-list/paymentIndex"
|
||
},
|
||
{
|
||
name: "在线报修",
|
||
icon: "/static/propertyImgs/icon-repair.png",
|
||
path: "/pages/online-repair/onlineRepair"
|
||
},
|
||
{
|
||
name: "访客邀请",
|
||
icon: "/static/propertyImgs/icon-visitor.png",
|
||
path: "/pages/visitor/visitor-list"
|
||
}
|
||
],
|
||
// 智慧社区功能列表
|
||
communityFuncList: [{
|
||
name: "一键开门",
|
||
icon: "/static/propertyImgs/icon-door.png",
|
||
path: "/pages/notice-list/oneClickOpen"
|
||
},
|
||
{
|
||
name: "生活缴费",
|
||
icon: "/static/propertyImgs/icon-pay.png",
|
||
path: "/pages/payment-list/paymentIndex"
|
||
},
|
||
{
|
||
name: "在线报修",
|
||
icon: "/static/propertyImgs/icon-repair.png",
|
||
path: "/pages/online-repair/onlineRepair"
|
||
},
|
||
{
|
||
name: "访客邀请",
|
||
icon: "/static/propertyImgs/icon-visitor.png",
|
||
path: "/pages/visitor/visitor-list"
|
||
},
|
||
{
|
||
name: "投诉意见",
|
||
icon: "/static/propertyImgs/icon-complaint.png",
|
||
path: "/pages/service-list/complaintsSuggestionsIndex"
|
||
},
|
||
{
|
||
name: "问卷调查",
|
||
icon: "/static/propertyImgs/icon-survey.png",
|
||
path: "/pages/service-list/questionnaireSurveyIndex"
|
||
},
|
||
{
|
||
name: "社区活动",
|
||
icon: "/static/propertyImgs/icon-activity.png",
|
||
path: "/pages/activity-list/activityList"
|
||
},
|
||
{
|
||
name: "公告公示",
|
||
icon: "/static/propertyImgs/icon-notice.png",
|
||
path: "/pages/notice-list/noticeList"
|
||
},
|
||
{
|
||
name: "联系物业",
|
||
icon: "/static/propertyImgs/icon-contact.png",
|
||
path: "/pages/service-list/contactProperty"
|
||
}
|
||
]
|
||
|
||
|
||
}
|
||
},
|
||
|
||
|
||
methods: {
|
||
// 功能点击事件
|
||
handleFuncClick(item) {
|
||
console.log(item.path);
|
||
uni.redirectTo({
|
||
url: item.path,
|
||
success: res => {},
|
||
fail: () => {},
|
||
complete: () => {}
|
||
});
|
||
},
|
||
|
||
|
||
},
|
||
|
||
|
||
}
|
||
</script>
|
||
<style lang="scss">
|
||
page {
|
||
background: #f2f1f6;
|
||
}
|
||
</style>
|
||
<style scoped>
|
||
.status-bar {
|
||
width: 100vw;
|
||
height: 46px;
|
||
}
|
||
|
||
.contentStyle {
|
||
display: flex;
|
||
flex-direction: column;
|
||
height: 100vh;
|
||
/* 关键:占满屏幕高度 */
|
||
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
|
||
}
|
||
|
||
.page {
|
||
flex: 1;
|
||
overflow-y: auto;
|
||
padding: 0px 40rpx;
|
||
box-sizing: border-box;
|
||
/* background-color: #fff; */
|
||
}
|
||
|
||
|
||
|
||
.container {
|
||
/* padding: 40rpx; */
|
||
}
|
||
|
||
/* Banner 轮播 */
|
||
.banner-box {
|
||
width: 100%;
|
||
border-radius: 20rpx;
|
||
overflow: hidden;
|
||
margin-bottom: 40rpx;
|
||
height: 122rpx;
|
||
}
|
||
|
||
.banner-img {
|
||
width: 100%;
|
||
height: 122rpx;
|
||
|
||
}
|
||
|
||
|
||
/* 功能区通用样式 */
|
||
.func-section {
|
||
width: 100%;
|
||
background-color: #ffffff;
|
||
border-radius: 20rpx;
|
||
padding: 20rpx;
|
||
box-sizing: border-box;
|
||
margin-bottom: 40rpx;
|
||
}
|
||
|
||
.section-title {
|
||
display: flex;
|
||
align-items: center;
|
||
margin-bottom: 20rpx;
|
||
}
|
||
|
||
.title-line {
|
||
width:12rpx;
|
||
height: 48rpx;
|
||
background-color: #007aff;
|
||
border-radius:6rpx;
|
||
margin-right: 20rpx;
|
||
}
|
||
|
||
.title-text {
|
||
font-size: 32rpx;
|
||
font-weight: 600;
|
||
color: #000000;
|
||
}
|
||
|
||
/* 功能网格 */
|
||
.func-grid {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.func-item {
|
||
width: 22%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
margin-bottom: 40rpx;
|
||
}
|
||
|
||
.func-icon {
|
||
width: 84rpx;
|
||
height: 84rpx;
|
||
border-radius: 50%;
|
||
background-color: #f0f5ff;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin-bottom: 20rpx;
|
||
position: relative;
|
||
}
|
||
|
||
|
||
.func-icon image {
|
||
max-height: 100%;
|
||
/* 限制最大高度不超出 */
|
||
object-fit: cover;
|
||
/* 保持比例 */
|
||
/* width: 200px; */
|
||
/* height: 200px; */
|
||
}
|
||
|
||
.func-name {
|
||
font-size: 28rpx;
|
||
color: #000000;
|
||
font-weight: 400;
|
||
text-align: center;
|
||
line-height: 1.4;
|
||
}
|
||
|
||
/* 智慧社区网格(适配9个图标,最后一个左对齐) */
|
||
.community-grid .func-item {
|
||
width: 22%;
|
||
}
|
||
|
||
.community-grid .func-item:nth-child(9) {
|
||
margin-right: auto;
|
||
margin-left: 0;
|
||
}
|
||
</style> |