qrcode-app/pages/index/index.vue

150 lines
2.9 KiB
Vue
Raw Normal View History

2024-07-19 08:50:05 +08:00
<template>
<view class="content">
2024-07-24 14:45:27 +08:00
<view class="list">
<u-grid :border="false" @click="click" :col="2">
2024-07-25 11:35:20 +08:00
<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex" bgColor="#fff">
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.iconName" :size="42" color="#304ffe"></u-icon>
<text class="grid-text">{{baseListItem.name}}</text>
2024-07-24 14:45:27 +08:00
</u-grid-item>
</u-grid>
2024-07-25 11:35:20 +08:00
<view style="display: flex;flex-direction: row;" class="home-button">
<!-- <u-button type="primary" @click="reset" color="#3d4b70" :plain="true" style="margin-right: 5px;">重置</u-button> -->
<u-button type="primary" @click="goCamera" color="#3d4b70">隐患随手拍</u-button>
</view>
2024-07-19 08:50:05 +08:00
</view>
</view>
</template>
<script>
2024-07-25 11:35:20 +08:00
import {
getMenu
} from '../../services/apply'
2024-07-19 08:50:05 +08:00
export default {
data() {
return {
2024-07-25 11:35:20 +08:00
baseList: [
2024-07-24 14:45:27 +08:00
{
2024-07-25 11:35:20 +08:00
name: "新增用户",
iconName: "man-add"
2024-07-24 14:45:27 +08:00
},
2024-07-25 11:35:20 +08:00
// {
// name: "风险区域明细",
// iconName: "man-add"
// },
// {
// name: "区域风险四色图",
// iconName: "man-add"
// },
// {
// name: "区域隐患数量",
// iconName: "man-add"
// },
2024-07-24 14:45:27 +08:00
]
2024-07-19 08:50:05 +08:00
}
2024-07-24 14:45:27 +08:00
},
onShow() {
2024-07-19 08:50:05 +08:00
},
onLoad() {
2024-07-24 14:45:27 +08:00
this.getCaidan()
2024-07-19 08:50:05 +08:00
},
2024-07-25 11:35:20 +08:00
onNavigationBarButtonTap(e) {
let url = 'http://47.122.43.22:9100/'
uni.navigateTo({
url: '/pages/webview/webview?url=' + url
})
},
2024-07-19 08:50:05 +08:00
methods: {
2024-07-24 14:45:27 +08:00
click(name) {
2024-07-25 11:35:20 +08:00
this.baseList.map((item, index) => {
if (index == name) {
if (item.name == '新增用户') {
uni.navigateTo({
url: '/pages/apply/index?Company=GXBB&post=1'
})
}
}
})
2024-07-24 14:45:27 +08:00
},
2024-07-25 11:35:20 +08:00
goCamera() {
uni.navigateTo({
url: '/pages/camera/index'
})
2024-07-24 14:45:27 +08:00
},
getCaidan() {
const json = {
Company: 'XLK',
Post: '搬运工',
Type: 1
}
getMenu(json).then((res) => {
console.log('成功', res);
2024-07-25 11:35:20 +08:00
this.baseList = res.data
2024-07-24 14:45:27 +08:00
}).catch((err) => {
console.error('失败', err);
})
}
2024-07-19 08:50:05 +08:00
}
}
</script>
<style>
.content {
2024-07-24 14:45:27 +08:00
background-color: #f4f7ff;
width: 100%;
2024-07-25 11:35:20 +08:00
/* #ifndef APP-PLUS */
height: calc(100vh - 44px - 50px); // 非APP平台下生效
/* #endif */
/* #ifdef APP-PLUS */
height: calc(100vh); // APP平台下生效
/* #endif */
2024-07-24 14:45:27 +08:00
}
.list {
padding: 20px;
2024-07-19 08:50:05 +08:00
}
2024-07-24 14:45:27 +08:00
.list .u-grid {
justify-content: space-between !important;
2024-07-19 08:50:05 +08:00
}
2024-07-24 14:45:27 +08:00
.list .u-grid-item {
padding: 20px 0px;
/* margin: 0px 0px 20px 0px; */
margin: 20px 10px;
width: 40% !important;
border-radius: 10px;
2024-07-19 08:50:05 +08:00
}
2024-07-25 11:35:20 +08:00
.home-button {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
padding: 10px 36px;
box-sizing: border-box;
background: #f4f7ff;
z-index: 999;
}
.home-button .u-button {
height: 50px;
}
2024-07-24 14:45:27 +08:00
.grid-text {
font-size: 14px;
color: #000;
font-weight: bold;
padding: 10rpx 0 20rpx 0rpx;
/* #ifndef APP-PLUS */
box-sizing: border-box;
/* #endif */
2024-07-19 08:50:05 +08:00
}
2024-07-24 14:45:27 +08:00
</style>