|
|
@@ -5,12 +5,12 @@
|
|
|
<u-navbar :is-back="false" title=" ">
|
|
|
<view class="slot-wrap">
|
|
|
<view v-if="$isEmpty(plot)" class="padding-left-20" @click="$u.toast('暂无小区信息')">
|
|
|
- <u-icon name="map" size="34"></u-icon>
|
|
|
+ <u-icon name="map-fill" color="#2f7ff5" size="34"></u-icon>
|
|
|
<text class="padding-left-sm " style="font-size: 34rpx;">暂无小区信息</text>
|
|
|
</view>
|
|
|
<picker v-else @change="typeChange" :value="plotIndex" :range="plotArray">
|
|
|
<view class="padding-left-20 ">
|
|
|
- <u-icon name="map" size="34"></u-icon>
|
|
|
+ <u-icon name="map-fill" color="#2f7ff5" size="34"></u-icon>
|
|
|
<text class="padding-left-sm " style="font-size: 34rpx;">{{plot}}</text>
|
|
|
</view>
|
|
|
</picker>
|
|
|
@@ -33,11 +33,14 @@
|
|
|
<view style="padding: 30rpx 30rpx 0 30rpx;">
|
|
|
<text class="text-bold text-lg">智慧社区</text>
|
|
|
</view>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<view style="padding: 40rpx 10rpx 0rpx;" class="cu-list grid col-5 no-border" >
|
|
|
<view class="cu-item" :class="item.index==5?'img1-lg':''" @click="top(item.index)" v-for="(item,index) in gridList" :key="index">
|
|
|
<block v-if="item.index==5">
|
|
|
<view class="grid-icon" >
|
|
|
- <image style="width: 88rpx;height: 88rpx;" :src="modalShow?'../../static/home/open1.png':'../../static/home/open4.png'"/>
|
|
|
+ <image style="width: 88rpx;height: 88rpx;" :src="modalShow?'../../static/home/open4.png':'../../static/home/open4.png'"/>
|
|
|
</view>
|
|
|
<text style="color: #333333;font-size: 30rpx;font-weight: 800;" >{{item.title}}</text>
|
|
|
</block>
|
|
|
@@ -47,18 +50,20 @@
|
|
|
</view>
|
|
|
<text style="color: #333333;font-size: 26rpx;" >{{item.title}}</text>
|
|
|
</block>
|
|
|
- <view class="cu-tag bg-orange badge" v-if="item.badge>0">{{item.badge}}</view>
|
|
|
+ <view class="cu-tag bg-red badge" v-if="item.badge>0">{{item.badge}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
<!-- 设备列表 -->
|
|
|
- <view v-if="modalShow==true" class="flex justify-around margin-top-30" >
|
|
|
+ <view v-if="modalShow" class="flex justify-around margin-top-10" >
|
|
|
<view @click="open(item.id)" v-for="(item,index) in device_list" :key="index" style="flex-direction: column;" class="flex justify-center align-center">
|
|
|
- <image style="width: 60rpx;height: 60rpx;" src="../../static/home/kaimen.png"/>
|
|
|
- <view class="text-center padding-top-20" style="font-size: 24rpx;">
|
|
|
+ <image style="width: 60rpx;height: 60rpx;" src="/static/kaimen.png"/>
|
|
|
+ <view class="text-center padding-top-20 text-cut-1" style="font-size: 24rpx;">
|
|
|
{{item.name}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
<view class="nav-list bg-white padding-top-20" >
|
|
|
<view hover-class="none"
|
|
|
@@ -110,15 +115,15 @@
|
|
|
data() {
|
|
|
return {
|
|
|
isloading:false,
|
|
|
- modalShow:false,
|
|
|
//开门设备列表
|
|
|
device_list: [],
|
|
|
-
|
|
|
background: {
|
|
|
backgroundColor: '#e54d42',
|
|
|
},
|
|
|
noticeList:[],
|
|
|
|
|
|
+ modalShow:false,
|
|
|
+
|
|
|
userInfo:{},
|
|
|
jsCode:'',
|
|
|
openid:'',
|
|
|
@@ -206,7 +211,7 @@
|
|
|
{
|
|
|
icon:'../../static/home/fangke1.png',
|
|
|
title:"访客授权",
|
|
|
- badge:0,
|
|
|
+ badge:this.vuex_auth_audit_count,
|
|
|
index:4
|
|
|
},
|
|
|
|
|
|
@@ -214,8 +219,13 @@
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
|
- //从功能列表一键开门跳转过来的,打开开门设备列表
|
|
|
- this.modalShow=getApp().globalData.openDoor
|
|
|
+ this.fetchNoticeList()
|
|
|
+ //获取访客授权待审核的数量
|
|
|
+ if (this.canReset) this.fetchAuthRecordNum()
|
|
|
+ this.canReset=true
|
|
|
+
|
|
|
+ //获取设备列表
|
|
|
+ this.getAuthDevice()
|
|
|
|
|
|
//处理进入小程序的不同场景
|
|
|
this.execParam();
|
|
|
@@ -242,13 +252,39 @@
|
|
|
this.fetchGoodsList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ fetchAuthRecordNum(){
|
|
|
+ try{
|
|
|
+ let memberId=app.globalData.member.id
|
|
|
+ if (!this.$isEmpty(memberId)) {
|
|
|
+ let params={
|
|
|
+ member_id:memberId,
|
|
|
+ size:99,
|
|
|
+ auditStatus:0
|
|
|
+ }
|
|
|
+ let operation='guestRecord/getListByMemberId'
|
|
|
+ getApp().globalData.postRequest(params,operation,function(res){
|
|
|
+ let length=res.data.list.length
|
|
|
+ that.$u.vuex('vuex_auth_audit_count',length)
|
|
|
+ that.gridList.forEach(item=>{
|
|
|
+ if (item.index==4) {
|
|
|
+ item.badge=length
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }catch(e){
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
open(id){
|
|
|
- //进度条加载
|
|
|
- this.isloading=true
|
|
|
- let that=this
|
|
|
- setTimeout(()=>{
|
|
|
- that.openDoor(id)
|
|
|
- },2300)
|
|
|
+ //直接开门
|
|
|
+ that.openDoor(id)
|
|
|
+ //进度条加载模式开门
|
|
|
+ // this.isloading=true
|
|
|
+ // let that=this
|
|
|
+ // setTimeout(()=>{
|
|
|
+ // that.openDoor(id)
|
|
|
+ // },500)
|
|
|
},
|
|
|
//立即开门
|
|
|
openDoor: function (id) {
|
|
|
@@ -261,7 +297,6 @@
|
|
|
app.globalData.postRequest(params, operation, function (res) {
|
|
|
that.isloading=false
|
|
|
app.globalData.oneFailHint(res.data.result_msg,function(){
|
|
|
- that.modalShow=false
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
@@ -298,8 +333,6 @@
|
|
|
await this.$nextTick(function(){
|
|
|
this.touristLogin()
|
|
|
})
|
|
|
- //加载通知公告
|
|
|
- this.fetchNoticeList()
|
|
|
},
|
|
|
getParam(e){
|
|
|
// 用来保存所有的属性名称和值
|
|
|
@@ -481,6 +514,7 @@
|
|
|
//openid存入缓存
|
|
|
uni.setStorageSync("openid", res.data.openid);
|
|
|
uni.setStorageSync("appletType", res.data.appletType);
|
|
|
+ that.$u.vuex('vuex_appletType',res.data.appletType)
|
|
|
that.openid=res.data.openid
|
|
|
that.sessionKey=res.data.sessionKey
|
|
|
that.getMemberByOpenid(res.data.openid);
|
|
|
@@ -492,24 +526,20 @@
|
|
|
});
|
|
|
},
|
|
|
//根据openid获取用户信息
|
|
|
- getMemberByOpenid: function (openid) {
|
|
|
- let _this = this;
|
|
|
- let params = {};
|
|
|
- params['openid'] = openid;
|
|
|
- let operation = 'miniprogram/getMemberByOpenid';
|
|
|
- app.globalData.postRequest(params, operation, function (res) {
|
|
|
- console.info("getMemberByOpenid==" + res.data.result_msg); //获取成功
|
|
|
- if (res.data.result_code == 1) {
|
|
|
- app.globalData.member = res.data.member;
|
|
|
- that.$u.vuex('vuex_member',res.data.member)
|
|
|
-
|
|
|
- app.globalData.anyHousePass = res.data.anyHousePass; //获取房屋列表
|
|
|
- _this.getRoomByMemberId();
|
|
|
- _this.getAuthDevice()
|
|
|
- } else {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
+ async getMemberByOpenid(openid) {
|
|
|
+ let _this = this;
|
|
|
+ let params = {};
|
|
|
+ params['openid'] = openid;
|
|
|
+ let operation = 'miniprogram/getMemberByOpenid';
|
|
|
+ let res=await app.globalData.postRequestAsync(params, operation)
|
|
|
+ if (res.data.result_code == 1) {
|
|
|
+ app.globalData.member = res.data.member;
|
|
|
+ that.$u.vuex('vuex_member',res.data.member)
|
|
|
+ app.globalData.anyHousePass = res.data.anyHousePass; //获取房屋列表
|
|
|
+ _this.getRoomByMemberId();
|
|
|
+ _this.getAuthDevice()
|
|
|
+ _this.fetchAuthRecordNum()
|
|
|
+ }
|
|
|
},
|
|
|
/**
|
|
|
* 游客登陆
|
|
|
@@ -567,17 +597,18 @@
|
|
|
});
|
|
|
} else {
|
|
|
uni.setStorageSync("personTel", personTelList[0]);
|
|
|
- uni.setStorageSync("doorNeedAudit", doorNeedAuditList[0]);
|
|
|
- uni.setStorageSync("plotName", list[0]);
|
|
|
- uni.setStorageSync("residentialId", residentialIdList[0]);
|
|
|
- that.setData({
|
|
|
- plot: list[0]
|
|
|
- });
|
|
|
+ uni.setStorageSync("doorNeedAudit", doorNeedAuditList[0]);
|
|
|
+ uni.setStorageSync("plotName", list[0]);
|
|
|
+ uni.setStorageSync("residentialId", residentialIdList[0]);
|
|
|
+ that.setData({
|
|
|
+ plot: list[0]
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
let residentialList=[]
|
|
|
list.forEach((item,index)=>{
|
|
|
let tmp={}
|
|
|
+ tmp.residentialName=item
|
|
|
tmp.personTel=personTelList[index]
|
|
|
tmp.residentialId=residentialIdList[index]
|
|
|
tmp.doorNeedAudit=doorNeedAuditList[index]
|
|
|
@@ -607,17 +638,6 @@
|
|
|
* @param {Object} index 当前项的index属性,而不是当前项的下标
|
|
|
*/
|
|
|
top: function (index) {
|
|
|
- if (index==5) {
|
|
|
- if (this.$isEmpty(this.device_list)) {
|
|
|
- uni.showToast({
|
|
|
- title:"暂无设备",
|
|
|
- icon:"none"
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- this.modalShow=!this.modalShow
|
|
|
- return
|
|
|
- }
|
|
|
if (index==99) {
|
|
|
//查看更多
|
|
|
uni.navigateTo({
|
|
|
@@ -625,6 +645,13 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
+ if (index==9) {
|
|
|
+ uni.navigateToMiniProgram({
|
|
|
+ appId:'wx2eec5fb00157a603',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
var that = this;
|
|
|
var member = app.globalData.member;
|
|
|
var anyHousePass = app.globalData.anyHousePass; //会员认证状态:{ 0:未认证,1:待审审核,2:已认证 }
|
|
|
@@ -668,10 +695,18 @@
|
|
|
url = '/pages/authorize_record/authorize_record';
|
|
|
break;
|
|
|
case 5:
|
|
|
- //一键开门
|
|
|
- uni.switchTab({
|
|
|
- url:"../device/device"
|
|
|
- })
|
|
|
+ if (this.$isEmpty(this.device_list)) {
|
|
|
+ uni.showToast({
|
|
|
+ title:"暂无设备",
|
|
|
+ icon:"none"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.device_list.length==1) {
|
|
|
+ this.open(this.device_list[0].id)
|
|
|
+ }else{
|
|
|
+ this.modalShow=!this.modalShow
|
|
|
+ }
|
|
|
break;
|
|
|
case 6:
|
|
|
//防疫登记
|
|
|
@@ -689,7 +724,8 @@
|
|
|
url = '/pages/services/property/property';
|
|
|
break;
|
|
|
case 9:
|
|
|
- url = '/pages/healthCode/healthCode';
|
|
|
+
|
|
|
+ // url = '/pages/healthCode/healthCode';
|
|
|
break;
|
|
|
default:
|
|
|
url = "";
|