|
@@ -1,52 +1,48 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="container">
|
|
<view class="container">
|
|
|
- <picker class="picker-item1" @tap="clickSelect1" @change="changeSelect1" :range="array1" :value="index1"
|
|
|
|
|
- :disabled="dis_num1">
|
|
|
|
|
|
|
+ <picker class="picker-item1" @tap="clickSelect1" @change="changeSelect1" :range="array1" :value="index1" :disabled="dis_num1">
|
|
|
<view class="select-item">
|
|
<view class="select-item">
|
|
|
<view class="picker-item-logol">
|
|
<view class="picker-item-logol">
|
|
|
<image class="picker-item-logo-left" src="../static/images/school.png"></image>
|
|
<image class="picker-item-logo-left" src="../static/images/school.png"></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="picker-item-label">校区</view>
|
|
<view class="picker-item-label">校区</view>
|
|
|
- <view class="picker-item-content" :class="{'font-txt':add_class1==1}">{{arr1[index1]}}</view>
|
|
|
|
|
|
|
+ <view class="picker-item-content" :class="{'font-txt':add_class1==1, 'font-txt-red': add_class1!=1}">{{arr1[index1]}}</view>
|
|
|
<view class="picker-item-logor">
|
|
<view class="picker-item-logor">
|
|
|
<image class="picker-item-logo-right" src="../static/images/right.png"></image>
|
|
<image class="picker-item-logo-right" src="../static/images/right.png"></image>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</picker>
|
|
</picker>
|
|
|
- <picker class="picker-item2" @tap="clickSelect2" @change="changeSelect2" :range="array2" :value="index2"
|
|
|
|
|
- :disabled="dis_num2">
|
|
|
|
|
|
|
+ <picker class="picker-item2" @tap="clickSelect2" @change="changeSelect2" :range="array2" :value="index2" :disabled="dis_num2">
|
|
|
<view class="select-item">
|
|
<view class="select-item">
|
|
|
<view class="picker-item-logol">
|
|
<view class="picker-item-logol">
|
|
|
<image class="picker-item-logo-left" src="../static/images/building.png"></image>
|
|
<image class="picker-item-logo-left" src="../static/images/building.png"></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="picker-item-label">楼栋</view>
|
|
<view class="picker-item-label">楼栋</view>
|
|
|
- <view class="picker-item-content" :class="{'font-txt':add_class2==1}">{{arr2[index2]}}</view>
|
|
|
|
|
|
|
+ <view class="picker-item-content" :class="{'font-txt':add_class2==1, 'font-txt-red': add_class2!=1}">{{arr2[index2]}}</view>
|
|
|
<view class="picker-item-logor">
|
|
<view class="picker-item-logor">
|
|
|
<image class="picker-item-logo-right" src="../static/images/right.png"></image>
|
|
<image class="picker-item-logo-right" src="../static/images/right.png"></image>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</picker>
|
|
</picker>
|
|
|
- <picker class="picker-item2" @tap="clickSelect3" @change="changeSelect3" :range="array3" :value="index3"
|
|
|
|
|
- :disabled="dis_num3">
|
|
|
|
|
|
|
+ <picker class="picker-item2" @tap="clickSelect3" @change="changeSelect3" :range="array3" :value="index3" :disabled="dis_num3">
|
|
|
<view class="select-item">
|
|
<view class="select-item">
|
|
|
<view class="picker-item-logol">
|
|
<view class="picker-item-logol">
|
|
|
<image class="picker-item-logo-left" src="../static/images/floor.png"></image>
|
|
<image class="picker-item-logo-left" src="../static/images/floor.png"></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="picker-item-label">楼层</view>
|
|
<view class="picker-item-label">楼层</view>
|
|
|
- <view class="picker-item-content" :class="{'font-txt':add_class3==1}">{{arr3[index3]}}</view>
|
|
|
|
|
|
|
+ <view class="picker-item-content" :class="{'font-txt':add_class3==1, 'font-txt-red': add_class3!=1}">{{arr3[index3]}}</view>
|
|
|
<view class="picker-item-logor">
|
|
<view class="picker-item-logor">
|
|
|
<image class="picker-item-logo-right" src="../static/images/right.png"></image>
|
|
<image class="picker-item-logo-right" src="../static/images/right.png"></image>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</picker>
|
|
</picker>
|
|
|
- <picker class="picker-item2" @tap="clickSelect4" @change="changeSelect4" :range="array4" :value="index4"
|
|
|
|
|
- :disabled="dis_num4">
|
|
|
|
|
|
|
+ <picker class="picker-item2" @tap="clickSelect4" @change="changeSelect4" :range="array4" :value="index4" :disabled="dis_num4">
|
|
|
<view class="select-item">
|
|
<view class="select-item">
|
|
|
<view class="picker-item-logol">
|
|
<view class="picker-item-logol">
|
|
|
<image class="picker-item-logo-left" src="../static/images/room.png"></image>
|
|
<image class="picker-item-logo-left" src="../static/images/room.png"></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="picker-item-label">房间</view>
|
|
<view class="picker-item-label">房间</view>
|
|
|
- <view class="picker-item-content" :class="{'font-txt':add_class4==1}">{{arr4[index4]}}</view>
|
|
|
|
|
|
|
+ <view class="picker-item-content" :class="{'font-txt':add_class4==1, 'font-txt-red': add_class4!=1}">{{arr4[index4]}}</view>
|
|
|
<view class="picker-item-logor">
|
|
<view class="picker-item-logor">
|
|
|
<image class="picker-item-logo-right" src="../static/images/right.png"></image>
|
|
<image class="picker-item-logo-right" src="../static/images/right.png"></image>
|
|
|
</view>
|
|
</view>
|
|
@@ -59,7 +55,6 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- // import sortdata from '../../static/test.js'
|
|
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -80,15 +75,14 @@
|
|
|
array3: [],
|
|
array3: [],
|
|
|
array4: [],
|
|
array4: [],
|
|
|
room: '', //存储选择器选择的所有值
|
|
room: '', //存储选择器选择的所有值
|
|
|
- add_class1: '', //选择器class属性
|
|
|
|
|
- add_class2: '',
|
|
|
|
|
- add_class3: '',
|
|
|
|
|
- add_class4: '',
|
|
|
|
|
|
|
+ add_class1: 0, //选择器class属性
|
|
|
|
|
+ add_class2: 0,
|
|
|
|
|
+ add_class3: 0,
|
|
|
|
|
+ add_class4: 0,
|
|
|
dis_num1: 1, //选择器disable属性,是否禁用
|
|
dis_num1: 1, //选择器disable属性,是否禁用
|
|
|
dis_num2: 1,
|
|
dis_num2: 1,
|
|
|
dis_num3: 1,
|
|
dis_num3: 1,
|
|
|
dis_num4: 1,
|
|
dis_num4: 1,
|
|
|
- // dis_num5: 1,
|
|
|
|
|
allData: [], //所有数据
|
|
allData: [], //所有数据
|
|
|
storage: {}, //存放选择数据
|
|
storage: {}, //存放选择数据
|
|
|
ceshi: 'code',
|
|
ceshi: 'code',
|
|
@@ -100,13 +94,13 @@
|
|
|
if (this.test == 'weihuzhong') {
|
|
if (this.test == 'weihuzhong') {
|
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
|
url: '../../pages/index/index'
|
|
url: '../../pages/index/index'
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 获取校区
|
|
// 获取校区
|
|
|
- this.getCampus()
|
|
|
|
|
|
|
+ this.getCampus();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
/**
|
|
/**
|
|
@@ -120,27 +114,27 @@
|
|
|
header: {
|
|
header: {
|
|
|
'content-type': 'application/json'
|
|
'content-type': 'application/json'
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
// console.log(res.data);
|
|
// console.log(res.data);
|
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
|
let tmpData = res.data.data;
|
|
let tmpData = res.data.data;
|
|
|
- this.nschool = tmpData.length
|
|
|
|
|
- this.array1 = []
|
|
|
|
|
|
|
+ this.nschool = tmpData.length;
|
|
|
|
|
+ this.array1 = [];
|
|
|
|
|
|
|
|
for (var i = 0; i < this.nschool; i++) {
|
|
for (var i = 0; i < this.nschool; i++) {
|
|
|
- this.array1.push(tmpData[i].school)
|
|
|
|
|
|
|
+ this.array1.push(tmpData[i].school);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.dis_num1 = 0
|
|
|
|
|
|
|
+ this.dis_num1 = 0;
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '未获得校区',
|
|
title: '未获得校区',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (this.$store.state.building.roomSelect != '') {
|
|
if (this.$store.state.building.roomSelect != '') {
|
|
|
- this.fillData()
|
|
|
|
|
|
|
+ this.fillData();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -170,26 +164,23 @@
|
|
|
// 自动填充
|
|
// 自动填充
|
|
|
if (arr.length > 0) {
|
|
if (arr.length > 0) {
|
|
|
if (arr[1] != null && arr[1].length > 0) {
|
|
if (arr[1] != null && arr[1].length > 0) {
|
|
|
- this.arr1 = [arr[1]]
|
|
|
|
|
|
|
+ this.arr1 = [arr[1]];
|
|
|
}
|
|
}
|
|
|
let len = arr[2].length
|
|
let len = arr[2].length
|
|
|
if (arr[2] != null && len > 0) {
|
|
if (arr[2] != null && len > 0) {
|
|
|
- let a = arr[2].split('-')
|
|
|
|
|
- this.arr2 = [a[0] + '栋']
|
|
|
|
|
- this.arr3 = [a[1].substring(0, a[1].length - 2) + '层']
|
|
|
|
|
- this.arr4 = [arr[2]]
|
|
|
|
|
|
|
+ let a = arr[2].split('-');
|
|
|
|
|
+ this.arr2 = [a[0] + '栋'];
|
|
|
|
|
+ this.arr3 = [a[1].substring(0, a[1].length - 2) + '层'];
|
|
|
|
|
+ this.arr4 = [arr[2]];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.sel1(this.arr1, true);
|
|
this.sel1(this.arr1, true);
|
|
|
|
|
|
|
|
- this.add_class1 = 1
|
|
|
|
|
- this.add_class2 = 1
|
|
|
|
|
- this.add_class3 = 1
|
|
|
|
|
- this.add_class4 = 1
|
|
|
|
|
|
|
+ this.checkNull();
|
|
|
|
|
|
|
|
- this.dis_num2 = 0
|
|
|
|
|
- this.dis_num3 = 0
|
|
|
|
|
- this.dis_num4 = 0
|
|
|
|
|
|
|
+ this.dis_num2 = 0;
|
|
|
|
|
+ this.dis_num3 = 0;
|
|
|
|
|
+ this.dis_num4 = 0;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
clickSelect1() {
|
|
clickSelect1() {
|
|
@@ -197,17 +188,18 @@
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '未获得校区,可能网络异常',
|
|
title: '未获得校区,可能网络异常',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 选择校区
|
|
* 选择校区
|
|
|
*/
|
|
*/
|
|
|
changeSelect1(e) {
|
|
changeSelect1(e) {
|
|
|
- this.array2 = []
|
|
|
|
|
- this.array3 = []
|
|
|
|
|
- this.array4 = []
|
|
|
|
|
- this.sel1(e.detail.value, false)
|
|
|
|
|
|
|
+ // console.log(e);
|
|
|
|
|
+ this.array2 = [];
|
|
|
|
|
+ this.array3 = [];
|
|
|
|
|
+ this.array4 = [];
|
|
|
|
|
+ this.sel1(e.detail.value, false);
|
|
|
},
|
|
},
|
|
|
// 根据参数的值选中
|
|
// 根据参数的值选中
|
|
|
sel1(index, theRoomIsExist) {
|
|
sel1(index, theRoomIsExist) {
|
|
@@ -215,34 +207,55 @@
|
|
|
// console.log(typeof(index))
|
|
// console.log(typeof(index))
|
|
|
this.arr1 = this.array1;
|
|
this.arr1 = this.array1;
|
|
|
//获取选择器1的值
|
|
//获取选择器1的值
|
|
|
- if (typeof(index) == 'string') {
|
|
|
|
|
|
|
+ if (typeof index == 'string') {
|
|
|
this.index1 = index;
|
|
this.index1 = index;
|
|
|
} else {
|
|
} else {
|
|
|
for (var i = 0; i < this.nschool; i++) {
|
|
for (var i = 0; i < this.nschool; i++) {
|
|
|
if (index[0] == this.array1[i]) {
|
|
if (index[0] == this.array1[i]) {
|
|
|
- this.index1 = i
|
|
|
|
|
|
|
+ this.index1 = i;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//获取选择器二中的值
|
|
//获取选择器二中的值
|
|
|
- this.getBuilds(this.array1[this.index1], theRoomIsExist)
|
|
|
|
|
|
|
+ this.getBuilds(this.array1[this.index1], theRoomIsExist);
|
|
|
|
|
|
|
|
- if (typeof(index) == 'string') {
|
|
|
|
|
- this.arr2 = ['请选择楼栋']
|
|
|
|
|
- this.arr3 = ['请选择楼层']
|
|
|
|
|
- this.arr4 = ['请选择房间']
|
|
|
|
|
- this.index2 = 0
|
|
|
|
|
- this.index3 = 0
|
|
|
|
|
- this.index4 = 0
|
|
|
|
|
|
|
+ if (typeof index == 'string') {
|
|
|
|
|
+ this.arr2 = ['请选择楼栋'];
|
|
|
|
|
+ this.arr3 = ['请选择楼层'];
|
|
|
|
|
+ this.arr4 = ['请选择房间'];
|
|
|
|
|
+ this.index2 = 0;
|
|
|
|
|
+ this.index3 = 0;
|
|
|
|
|
+ this.index4 = 0;
|
|
|
|
|
|
|
|
- this.room = ''
|
|
|
|
|
|
|
+ this.room = '';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.add_class1 = 1;
|
|
this.add_class1 = 1;
|
|
|
this.dis_num2 = 0;
|
|
this.dis_num2 = 0;
|
|
|
-
|
|
|
|
|
- this.chgDisable()
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ // 检测对应的下拉列表是否为空,空为红色,非空黑色
|
|
|
|
|
+ checkNull() {
|
|
|
|
|
+ if (this.array1.length == 0) {
|
|
|
|
|
+ this.add_class1 = 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.add_class1 = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.array2.length == 0) {
|
|
|
|
|
+ this.add_class2 = 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.add_class2 = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.array3.length == 0) {
|
|
|
|
|
+ this.add_class3 = 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.add_class3 = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.array4.length == 0) {
|
|
|
|
|
+ this.add_class4 = 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.add_class4 = 1;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 获取楼栋
|
|
* 获取楼栋
|
|
@@ -259,73 +272,76 @@
|
|
|
data: {
|
|
data: {
|
|
|
school: campus
|
|
school: campus
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
// console.log('楼栋:', res.data);
|
|
// console.log('楼栋:', res.data);
|
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
|
let tmpData = res.data.data;
|
|
let tmpData = res.data.data;
|
|
|
// this.allData = rooms
|
|
// this.allData = rooms
|
|
|
//得到选择器二中值的个数
|
|
//得到选择器二中值的个数
|
|
|
- this.nbuilds = tmpData.length
|
|
|
|
|
- this.array2 = []
|
|
|
|
|
|
|
+ this.nbuilds = tmpData.length;
|
|
|
|
|
+ this.array2 = [];
|
|
|
//将数据加入选择器二中
|
|
//将数据加入选择器二中
|
|
|
for (var j = 0; j < this.nbuilds; j++) {
|
|
for (var j = 0; j < this.nbuilds; j++) {
|
|
|
- this.array2.push(tmpData[j].build)
|
|
|
|
|
|
|
+ this.array2.push(tmpData[j].build);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (theRoomIsExist == true) {
|
|
if (theRoomIsExist == true) {
|
|
|
- this.sel2(this.arr2, true)
|
|
|
|
|
|
|
+ this.sel2(this.arr2, true);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
this.array2 = []
|
|
this.array2 = []
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '未获得楼栋',
|
|
title: '未获得楼栋',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ this.checkNull();
|
|
|
|
|
+
|
|
|
|
|
+ this.chgDisable();
|
|
|
},
|
|
},
|
|
|
clickSelect2() {
|
|
clickSelect2() {
|
|
|
if (this.array2.length == 0) {
|
|
if (this.array2.length == 0) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '未获得楼栋,该校区没有楼栋',
|
|
title: '未获得楼栋,该校区没有楼栋',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
changeSelect2(e) {
|
|
changeSelect2(e) {
|
|
|
- this.array3 = []
|
|
|
|
|
- this.array4 = []
|
|
|
|
|
- this.sel2(e.detail.value, false)
|
|
|
|
|
|
|
+ // console.log(e);
|
|
|
|
|
+ this.array3 = [];
|
|
|
|
|
+ this.array4 = [];
|
|
|
|
|
+ this.sel2(e.detail.value, false);
|
|
|
},
|
|
},
|
|
|
sel2(index, theRoomIsExist) {
|
|
sel2(index, theRoomIsExist) {
|
|
|
// console.log(index);
|
|
// console.log(index);
|
|
|
// console.log(typeof index);
|
|
// console.log(typeof index);
|
|
|
this.arr2 = this.array2;
|
|
this.arr2 = this.array2;
|
|
|
|
|
|
|
|
- if (typeof(index) == 'string') {
|
|
|
|
|
|
|
+ if (typeof index == 'string') {
|
|
|
this.index2 = index;
|
|
this.index2 = index;
|
|
|
} else {
|
|
} else {
|
|
|
for (var i = 0; i < this.nbuilds; i++) {
|
|
for (var i = 0; i < this.nbuilds; i++) {
|
|
|
if (index[0] == this.array2[i]) {
|
|
if (index[0] == this.array2[i]) {
|
|
|
- this.index2 = i
|
|
|
|
|
|
|
+ this.index2 = i;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.getFloors(this.array1[this.index1], this.array2[this.index2], theRoomIsExist)
|
|
|
|
|
|
|
+ this.getFloors(this.array1[this.index1], this.array2[this.index2], theRoomIsExist);
|
|
|
|
|
|
|
|
- if (typeof(index) == 'string') {
|
|
|
|
|
- this.arr3 = ['请选择楼层']
|
|
|
|
|
- this.arr4 = ['请选择房间']
|
|
|
|
|
- this.index3 = 0
|
|
|
|
|
- this.index4 = 0
|
|
|
|
|
|
|
+ if (typeof index == 'string') {
|
|
|
|
|
+ this.arr3 = ['请选择楼层'];
|
|
|
|
|
+ this.arr4 = ['请选择房间'];
|
|
|
|
|
+ this.index3 = 0;
|
|
|
|
|
+ this.index4 = 0;
|
|
|
|
|
|
|
|
- this.room = ''
|
|
|
|
|
|
|
+ this.room = '';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.add_class2 = 1;
|
|
this.add_class2 = 1;
|
|
|
this.dis_num3 = 0;
|
|
this.dis_num3 = 0;
|
|
|
-
|
|
|
|
|
- this.chgDisable()
|
|
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 获取楼层
|
|
* 获取楼层
|
|
@@ -345,36 +361,41 @@
|
|
|
school: campus,
|
|
school: campus,
|
|
|
build: build
|
|
build: build
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
// console.log('楼层:', res.data);
|
|
// console.log('楼层:', res.data);
|
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
|
let tmpData = res.data.data;
|
|
let tmpData = res.data.data;
|
|
|
- this.floors = tmpData.length
|
|
|
|
|
- this.array3 = []
|
|
|
|
|
|
|
+ this.floors = tmpData.length;
|
|
|
|
|
+ this.array3 = [];
|
|
|
|
|
|
|
|
for (var j = 0; j < this.floors; j++) {
|
|
for (var j = 0; j < this.floors; j++) {
|
|
|
- this.array3.push(tmpData[j].floors)
|
|
|
|
|
|
|
+ this.array3.push(tmpData[j].floors);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (theRoomIsExist == true) {
|
|
if (theRoomIsExist == true) {
|
|
|
- this.sel3(this.arr3, true)
|
|
|
|
|
|
|
+ this.sel3(this.arr3, true);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '未获得楼层',
|
|
title: '未获得楼层',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ this.checkNull();
|
|
|
|
|
+
|
|
|
|
|
+ this.chgDisable();
|
|
|
},
|
|
},
|
|
|
clickSelect3() {
|
|
clickSelect3() {
|
|
|
if (this.array3.length == 0) {
|
|
if (this.array3.length == 0) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '未获得楼层,请选择楼栋',
|
|
title: '未获得楼层,请选择楼栋',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
changeSelect3(e) {
|
|
changeSelect3(e) {
|
|
|
|
|
+ // console.log(e);
|
|
|
this.array4 = []
|
|
this.array4 = []
|
|
|
this.sel3(e.detail.value, false)
|
|
this.sel3(e.detail.value, false)
|
|
|
},
|
|
},
|
|
@@ -382,29 +403,27 @@
|
|
|
// console.log(index)
|
|
// console.log(index)
|
|
|
this.arr3 = this.array3;
|
|
this.arr3 = this.array3;
|
|
|
|
|
|
|
|
- if (typeof(index) == 'string') {
|
|
|
|
|
|
|
+ if (typeof index == 'string') {
|
|
|
this.index3 = index;
|
|
this.index3 = index;
|
|
|
} else {
|
|
} else {
|
|
|
for (var i = 0; i < this.floors; i++) {
|
|
for (var i = 0; i < this.floors; i++) {
|
|
|
if (index[0] == this.array3[i]) {
|
|
if (index[0] == this.array3[i]) {
|
|
|
- this.index3 = i
|
|
|
|
|
|
|
+ this.index3 = i;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.getDoms(this.array1[this.index1], this.array2[this.index2], this.array3[this.index3], theRoomIsExit)
|
|
|
|
|
|
|
+ this.getDoms(this.array1[this.index1], this.array2[this.index2], this.array3[this.index3], theRoomIsExit);
|
|
|
|
|
|
|
|
- if (typeof(index) == 'string') {
|
|
|
|
|
- this.arr4 = ['请选择房间']
|
|
|
|
|
- this.index4 = 0
|
|
|
|
|
|
|
+ if (typeof index == 'string') {
|
|
|
|
|
+ this.arr4 = ['请选择房间'];
|
|
|
|
|
+ this.index4 = 0;
|
|
|
|
|
|
|
|
- this.room = ''
|
|
|
|
|
|
|
+ this.room = '';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.add_class3 = 1;
|
|
this.add_class3 = 1;
|
|
|
this.dis_num4 = 0;
|
|
this.dis_num4 = 0;
|
|
|
-
|
|
|
|
|
- this.chgDisable()
|
|
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 获取房间
|
|
* 获取房间
|
|
@@ -426,35 +445,40 @@
|
|
|
build: build,
|
|
build: build,
|
|
|
floors: floors
|
|
floors: floors
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
// console.log('房间:', res.data);
|
|
// console.log('房间:', res.data);
|
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
|
let tmpData = res.data.data;
|
|
let tmpData = res.data.data;
|
|
|
- this.rooms = tmpData.length
|
|
|
|
|
- this.array4 = []
|
|
|
|
|
|
|
+ this.rooms = tmpData.length;
|
|
|
|
|
+ this.array4 = [];
|
|
|
for (var j = 0; j < this.rooms; j++) {
|
|
for (var j = 0; j < this.rooms; j++) {
|
|
|
- this.array4.push(tmpData[j].dom)
|
|
|
|
|
|
|
+ this.array4.push(tmpData[j].dom);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (theRoomIsExist == true) {
|
|
if (theRoomIsExist == true) {
|
|
|
- this.sel4(this.arr4, true)
|
|
|
|
|
|
|
+ this.sel4(this.arr4, true);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '未获得房间',
|
|
title: '未获得房间',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ this.checkNull();
|
|
|
|
|
+
|
|
|
|
|
+ this.chgDisable();
|
|
|
},
|
|
},
|
|
|
clickSelect4() {
|
|
clickSelect4() {
|
|
|
if (this.array4.length == 0) {
|
|
if (this.array4.length == 0) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '未获得房间,请选择楼层',
|
|
title: '未获得房间,请选择楼层',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
changeSelect4(e) {
|
|
changeSelect4(e) {
|
|
|
|
|
+ // console.log(e);
|
|
|
this.sel4(e.detail.value, false)
|
|
this.sel4(e.detail.value, false)
|
|
|
},
|
|
},
|
|
|
sel4(index, theRoomIsExist) {
|
|
sel4(index, theRoomIsExist) {
|
|
@@ -464,16 +488,16 @@
|
|
|
this.add_class4 = 1;
|
|
this.add_class4 = 1;
|
|
|
|
|
|
|
|
if (this.room) {
|
|
if (this.room) {
|
|
|
- this.room = ''
|
|
|
|
|
|
|
+ this.room = '';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (typeof(index) == 'string') {
|
|
|
|
|
|
|
+ if (typeof index == 'string') {
|
|
|
this.index4 = index;
|
|
this.index4 = index;
|
|
|
} else {
|
|
} else {
|
|
|
for (var i = 0; i < this.rooms; i++) {
|
|
for (var i = 0; i < this.rooms; i++) {
|
|
|
if (this.array4[i] == index[0]) {
|
|
if (this.array4[i] == index[0]) {
|
|
|
- this.index4 = i
|
|
|
|
|
|
|
+ this.index4 = i;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -486,18 +510,18 @@
|
|
|
chgDisable() {
|
|
chgDisable() {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
if (this.array1.length == 0) {
|
|
if (this.array1.length == 0) {
|
|
|
- this.dis_num1 = 1
|
|
|
|
|
|
|
+ this.dis_num1 = 1;
|
|
|
}
|
|
}
|
|
|
if (this.array2.length == 0) {
|
|
if (this.array2.length == 0) {
|
|
|
- this.dis_num2 = 1
|
|
|
|
|
|
|
+ this.dis_num2 = 1;
|
|
|
}
|
|
}
|
|
|
if (this.array3.length == 0) {
|
|
if (this.array3.length == 0) {
|
|
|
- this.dis_num3 = 1
|
|
|
|
|
|
|
+ this.dis_num3 = 1;
|
|
|
}
|
|
}
|
|
|
if (this.array4.length == 0) {
|
|
if (this.array4.length == 0) {
|
|
|
- this.dis_num4 = 1
|
|
|
|
|
|
|
+ this.dis_num4 = 1;
|
|
|
}
|
|
}
|
|
|
- }, 300)
|
|
|
|
|
|
|
+ }, 300);
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 跳转缴费页面
|
|
* 跳转缴费页面
|
|
@@ -512,21 +536,21 @@
|
|
|
this.$store.state.building.roomSelect = this.storage.roomSelect;
|
|
this.$store.state.building.roomSelect = this.storage.roomSelect;
|
|
|
this.$store.state.building.add_class = 1;
|
|
this.$store.state.building.add_class = 1;
|
|
|
this.$store.state.building.dorm_number = this.storage.dom;
|
|
this.$store.state.building.dorm_number = this.storage.dom;
|
|
|
|
|
+
|
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|
|
|
delta: 1
|
|
delta: 1
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
icon: 'success',
|
|
icon: 'success',
|
|
|
title: '宿舍号不完整'
|
|
title: '宿舍号不完整'
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|
|
|
@import url("select.css");
|
|
@import url("select.css");
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|