|
@@ -1,42 +1,118 @@
|
|
|
<template>
|
|
|
- <div id="app">
|
|
|
- <header class="mui-bar mui-bar-nav vongi-bar">
|
|
|
- <h1 class="mui-title">手机开门</h1>
|
|
|
- </header>
|
|
|
+ <div>
|
|
|
+ <common @asynCallBack="asynCallBack"></common>
|
|
|
+ <top-header :pageTitle="pageTitle"></top-header>
|
|
|
+
|
|
|
<div class="mui-content">
|
|
|
<div class="vongi-opendoor">
|
|
|
<div class="flew-items">
|
|
|
<div class="mui-col-xs-3">
|
|
|
<div class="vongi-opendoor-img">
|
|
|
- <img src="~$project/assets/img/audit1.png" />
|
|
|
+ <img :src="person_data.faceImageUrl" />
|
|
|
</div>
|
|
|
- 门卫
|
|
|
+ {{person_popedom.personRoleName}}
|
|
|
</div>
|
|
|
<div class="mui-col-xs-9 mui-media-body">
|
|
|
- 湖北荆鹏软件集团有限公司
|
|
|
- <h5>保卫科</h5>
|
|
|
+ {{person_data.position1}}
|
|
|
+ <h5 v-text="person_data.position2"></h5>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="vongi-yuan vongi-yuan1"></div>
|
|
|
<div class="vongi-yuan vongi-yuan2"></div>
|
|
|
</div>
|
|
|
<div class="vongi-opendoor-bottom">
|
|
|
- <div class="flew-sp">
|
|
|
- A栋大厅玻璃门
|
|
|
- <button class="mui-btn mui-btn-primary">开门</button>
|
|
|
- </div>
|
|
|
- <div class="flew-sp">
|
|
|
- 门房电控门
|
|
|
- <button class="mui-btn mui-btn-primary">开门</button>
|
|
|
+ <div v-for="(item,index) in doorList" class="flew-sp">
|
|
|
+ {{item.name}}
|
|
|
+ <button class="mui-btn mui-btn-primary" @click="open(item.id)">开门</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <loading :visible="isLoading"></loading>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import * as API_Device from '@/apis/Common/device'
|
|
|
+
|
|
|
+ import Common from '$project/components/Common.vue'
|
|
|
+ import Loading from '$project/components/Loading.vue'
|
|
|
+ import TopHeader from '$project/components/TopHeader.vue'
|
|
|
+
|
|
|
+ import {
|
|
|
+ mapGetters,
|
|
|
+ mapMutations
|
|
|
+ } from 'vuex'
|
|
|
+ export default {
|
|
|
+ name: 'CommonDeviceOpenDoor',
|
|
|
+ components: {
|
|
|
+ Common,
|
|
|
+ Loading,
|
|
|
+ TopHeader
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ pageTitle: '手机开门',
|
|
|
+ doorList: [],
|
|
|
+ isLoading: false,
|
|
|
+ onNum: 0,
|
|
|
+ offNum: 0,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ //获取列表
|
|
|
+ getDoorList() {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_Device.getDoorList().then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+ this.doorList = response;
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //开门
|
|
|
+ open(id) {
|
|
|
+ var _this = this;
|
|
|
+ var btnArray = ['否', '是'];
|
|
|
+ mui.confirm('确认开门?', '提示', btnArray, function(e) {
|
|
|
+ if (e.index == 1) {
|
|
|
+ _this.openDoor(id);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //开门操作
|
|
|
+ openDoor(id) {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_Device.openDoor(id).then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast('开门成功');
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ asynCallBack() {
|
|
|
+
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ //获取列表
|
|
|
+ this.getDoorList();
|
|
|
+ },
|
|
|
+ destroyed() {},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ openId: 'wx_openid',
|
|
|
+ token: 'token',
|
|
|
+ person_data: 'person_data',
|
|
|
+ person_popedom: 'person_popedom',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
-<style src="$project/assets/css/xpgj.css"></style>
|
|
|
-<style>
|
|
|
+<style scoped src="$project/assets/css/xpgj.css"></style>
|
|
|
+<style scoped>
|
|
|
</style>
|