|
@@ -15,7 +15,7 @@
|
|
|
<u-swipe-action btn-width="500">
|
|
|
<u-swipe-action-item v-if="show1" :options="options1" @click="click(item.id)"
|
|
|
v-for="(item,index) in productList" :key="index">
|
|
|
- <view class="list-items">
|
|
|
+ <view v-if="productList.length!==0" class="list-items">
|
|
|
<view class="list-item" @click="toText(item)">
|
|
|
<view class="left">
|
|
|
<!-- 左 -->
|
|
@@ -27,24 +27,26 @@
|
|
|
<!-- 中 -->
|
|
|
<view class="msg">
|
|
|
<view class="id">
|
|
|
- {{item.id}}
|
|
|
+ {{item.deviceId}}
|
|
|
</view>
|
|
|
<view class="type">
|
|
|
- <text>{{item.model}}</text>
|
|
|
- <text>{{item.type}}</text>
|
|
|
- <text>信号:{{item.signalValue}}</text>
|
|
|
+ <text>{{item.description}}</text>
|
|
|
+ <text>信号值:{{item.signalValue}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
<!-- 后 -->
|
|
|
- <view class="button" @click.stop="textBtn(item.id)">
|
|
|
- <u-button v-if="item.type=='猫眼'" type="primary" size="small">风鸣</u-button>
|
|
|
+ <view class="button" @click.stop="textBtn(item)">
|
|
|
+ <u-button v-if="item.type==0" type="primary" size="small">风鸣</u-button>
|
|
|
<u-button v-else type="primary" size="small">开门</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
+ <view v-else class="noData" style="text-align: center;">
|
|
|
+ 无数据
|
|
|
+ </view>
|
|
|
</u-swipe-action-item>
|
|
|
</u-swipe-action>
|
|
|
</scroll-view>
|
|
@@ -91,12 +93,12 @@
|
|
|
|
|
|
],
|
|
|
parameter: {
|
|
|
- testProjectId: 13,
|
|
|
+ testProjectId: null,
|
|
|
pageSize: 10,
|
|
|
pageNo: 1,
|
|
|
status: 2
|
|
|
-
|
|
|
},
|
|
|
+ total: 0,
|
|
|
productList: []
|
|
|
|
|
|
|
|
@@ -108,10 +110,16 @@
|
|
|
|
|
|
methods: {
|
|
|
scrolltolower() {
|
|
|
- console.log('触底了');
|
|
|
+ // console.log('触底了');
|
|
|
+ if (this.parameter.pageNo * this.parameter.pageSize >= this.total) {
|
|
|
+ return uni.$showMsg('数据加载完毕')
|
|
|
+
|
|
|
+ }
|
|
|
+ this.parameter.pageNo++
|
|
|
+ this.getBluetoothList()
|
|
|
},
|
|
|
toText(item) {
|
|
|
- console.log(item);
|
|
|
+ // console.log(item);
|
|
|
uni.showModal({
|
|
|
title: '温馨提示',
|
|
|
content: "点击确定进入测试阶段",
|
|
@@ -119,13 +127,18 @@
|
|
|
if (res.confirm) {
|
|
|
// this.show1 = false
|
|
|
this.$u.toast(`点击了确定`)
|
|
|
- if (item.type == '猫眼') {
|
|
|
+ let currentSite = JSON.stringify(item)
|
|
|
+ if (item.type === 0) {
|
|
|
+ // console.log('猫眼');
|
|
|
+ // console.log(item);
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/cat-eye-test/cat-eye-test"
|
|
|
+ url: "/pages/cat-eye-test/cat-eye-test?item=" + currentSite
|
|
|
})
|
|
|
} else {
|
|
|
+ // console.log('门锁');
|
|
|
+ // console.log(item);
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/lock-test/lock-test"
|
|
|
+ url: "/pages/lock-test/lock-test?item=" + currentSite
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -136,26 +149,56 @@
|
|
|
})
|
|
|
|
|
|
},
|
|
|
- textBtn(id) {
|
|
|
- console.log(id);
|
|
|
+ async textBtn(item) {
|
|
|
+ if (item.type === 0) {
|
|
|
+ console.log('我是猫眼');
|
|
|
+ const {
|
|
|
+ data: res
|
|
|
+ } = await uni.$http.post('/api/v1/test/bluetooth/testCam', {
|
|
|
+ deviceId: item.deviceId
|
|
|
+ })
|
|
|
+ if (res.code === 200) {
|
|
|
+ uni.$showMsg(res.data)
|
|
|
+ } else {
|
|
|
+ uni.$showMsg('测试失败')
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ const {
|
|
|
+ data: res
|
|
|
+ } = await uni.$http.post('/api/v1/test/bluetooth/openDoor', {
|
|
|
+ deviceId: item.deviceId
|
|
|
+ })
|
|
|
+ if (res.code === 200) {
|
|
|
+ uni.$showMsg(res.data)
|
|
|
+ } else {
|
|
|
+ uni.$showMsg('测试失败')
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
change(index) {
|
|
|
// this.current = index;
|
|
|
- console.log(index.index);
|
|
|
- let current=index.index
|
|
|
- // this.parameter.status = index.index
|
|
|
- // this.getBluetoothList()
|
|
|
- if(current==1){
|
|
|
- this.parameter.status=0
|
|
|
- this.getBluetoothList()
|
|
|
- }else if(current==2){
|
|
|
- this.parameter.status=1
|
|
|
- this.getBluetoothList()
|
|
|
- }else{
|
|
|
- this.parameter.status=2
|
|
|
- this.getBluetoothList()
|
|
|
- }
|
|
|
-
|
|
|
+ // console.log(index.index);
|
|
|
+ let current = index.index
|
|
|
+ if (current == 0) {
|
|
|
+ this.productList = []
|
|
|
+ this.parameter.pageNo = 1
|
|
|
+ this.parameter.status = 2
|
|
|
+ this.getBluetoothList()
|
|
|
+ } else if (current == 1) {
|
|
|
+ this.productList = []
|
|
|
+ this.parameter.pageNo = 1
|
|
|
+ this.parameter.status = 0
|
|
|
+ this.getBluetoothList()
|
|
|
+ } else {
|
|
|
+ this.productList = []
|
|
|
+ this.parameter.pageNo = 1
|
|
|
+ this.parameter.status = 1
|
|
|
+ this.getBluetoothList()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
|
|
|
scan() {
|
|
@@ -171,6 +214,8 @@
|
|
|
},
|
|
|
search() {
|
|
|
console.log('点击了搜索');
|
|
|
+ this.productList = []
|
|
|
+ this.parameter.pageNo = 1
|
|
|
this.getBluetoothList()
|
|
|
|
|
|
},
|
|
@@ -197,15 +242,31 @@
|
|
|
const {
|
|
|
data: res
|
|
|
} = await uni.$http.post('/api/v1/test/testResult/queryByCondition', this.parameter)
|
|
|
-
|
|
|
- this.productList = res.data.records
|
|
|
- console.log(this.productList);
|
|
|
- }
|
|
|
+ console.log(res);
|
|
|
+ if (res.code === 200) {
|
|
|
+ uni.$showMsg('数据加载成功')
|
|
|
+ this.total = res.data.total
|
|
|
+ this.productList = [
|
|
|
+ ...this.productList,
|
|
|
+ ...res.data.records
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ uni.$showMsg('数据加载失败')
|
|
|
+ }
|
|
|
|
|
|
+ // console.log(this.productList);
|
|
|
+
|
|
|
+ },
|
|
|
+ async searchBluetooth() {
|
|
|
|
|
|
|
|
|
- },
|
|
|
|
|
|
+ // const {
|
|
|
+ // data: res
|
|
|
+ // } = await uni.$http.post('/api/v1/test/testProject/bluetooth/search', testId)
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
onLoad() {
|
|
|
let btn = uni.createSelectorQuery().in(this).select('.btn')
|
|
|
btn.boundingClientRect(data => {
|
|
@@ -216,8 +277,10 @@
|
|
|
// console.log(this.wh);
|
|
|
}).exec()
|
|
|
const sysInfo = uni.getSystemInfoSync()
|
|
|
-
|
|
|
+ this.parameter.testProjectId = uni.getStorageSync('testProjectId')
|
|
|
+ console.log(this.parameter.testProjectId);
|
|
|
this.getBluetoothList()
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -260,6 +323,7 @@
|
|
|
}
|
|
|
|
|
|
.scan {
|
|
|
+ z-index: 9999;
|
|
|
position: fixed;
|
|
|
width: 120rpx;
|
|
|
height: 120rpx;
|