|
@@ -71,18 +71,6 @@
|
|
|
></u--input>
|
|
></u--input>
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
|
|
|
|
|
- <u-form-item
|
|
|
|
|
- label="设备编号:"
|
|
|
|
|
- borderBottom
|
|
|
|
|
- ref="item1"
|
|
|
|
|
- labelWidth="auto"
|
|
|
|
|
- >
|
|
|
|
|
- <u--input
|
|
|
|
|
- v-model="deviceno"
|
|
|
|
|
- border="none"
|
|
|
|
|
- ></u--input>
|
|
|
|
|
- </u-form-item>
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
<u-form-item
|
|
<u-form-item
|
|
|
label="二维码ID:"
|
|
label="二维码ID:"
|
|
@@ -96,15 +84,15 @@
|
|
|
></u--input>
|
|
></u--input>
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<u-form-item
|
|
<u-form-item
|
|
|
- label="产品ID:"
|
|
|
|
|
|
|
+ @click="showProductList = true"
|
|
|
|
|
+ label="产品类型:"
|
|
|
borderBottom
|
|
borderBottom
|
|
|
ref="item1"
|
|
ref="item1"
|
|
|
labelWidth="auto"
|
|
labelWidth="auto"
|
|
|
>
|
|
>
|
|
|
<u--input
|
|
<u--input
|
|
|
- v-model="productId"
|
|
|
|
|
|
|
+ v-model="productName"
|
|
|
border="none"
|
|
border="none"
|
|
|
></u--input>
|
|
></u--input>
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
@@ -117,6 +105,9 @@
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
<u-picker @cancel="showWiftList=false" @confirm="chooseWifi" :show="showWiftList" :columns="wifiList"></u-picker>
|
|
<u-picker @cancel="showWiftList=false" @confirm="chooseWifi" :show="showWiftList" :columns="wifiList"></u-picker>
|
|
|
|
|
+
|
|
|
|
|
+ <u-picker @cancel="showProductList=false" keyName="text" @confirm="chooseProduct" :show="showProductList" :columns="chooseProductList"></u-picker>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
@@ -137,6 +128,7 @@ import i18 from '@/utils/i18.js'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ showProductList:false,
|
|
|
showPwd:false,
|
|
showPwd:false,
|
|
|
rightPwd:"",
|
|
rightPwd:"",
|
|
|
pwd:"",
|
|
pwd:"",
|
|
@@ -152,11 +144,22 @@ import i18 from '@/utils/i18.js'
|
|
|
showSendData:false,
|
|
showSendData:false,
|
|
|
sendData:"",
|
|
sendData:"",
|
|
|
qrcodeid:"",
|
|
qrcodeid:"",
|
|
|
|
|
+ productName:"",
|
|
|
deviceno:"",
|
|
deviceno:"",
|
|
|
SSID:"",
|
|
SSID:"",
|
|
|
password:"",
|
|
password:"",
|
|
|
showWiftList:false,
|
|
showWiftList:false,
|
|
|
productId:56,
|
|
productId:56,
|
|
|
|
|
+ chooseProductList:[[ {
|
|
|
|
|
+ id:56,text:"3"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ id:56,text:"4"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ id:57,text:"5"
|
|
|
|
|
+ }
|
|
|
|
|
+ ]],
|
|
|
wifiList: [
|
|
wifiList: [
|
|
|
[]
|
|
[]
|
|
|
],
|
|
],
|
|
@@ -167,6 +170,7 @@ import i18 from '@/utils/i18.js'
|
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
|
title: "蓝牙配网"
|
|
title: "蓝牙配网"
|
|
|
})
|
|
})
|
|
|
|
|
+ this.deviceno = this.generateTimestamp();
|
|
|
ecUI.showLoading("正在初始化蓝牙模块")
|
|
ecUI.showLoading("正在初始化蓝牙模块")
|
|
|
ctx = this
|
|
ctx = this
|
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
@@ -174,6 +178,7 @@ import i18 from '@/utils/i18.js'
|
|
|
ctx.deviceListDataShow = JSON.parse(JSON.stringify(deviceListData))
|
|
ctx.deviceListDataShow = JSON.parse(JSON.stringify(deviceListData))
|
|
|
}, 800)
|
|
}, 800)
|
|
|
console.log(this.commonCode)
|
|
console.log(this.commonCode)
|
|
|
|
|
+ this.productName = this.chooseProductList[0][0].text;
|
|
|
},
|
|
},
|
|
|
onUnload(){
|
|
onUnload(){
|
|
|
ecBLE.stopBluetoothDevicesDiscovery();
|
|
ecBLE.stopBluetoothDevicesDiscovery();
|
|
@@ -188,6 +193,27 @@ import i18 from '@/utils/i18.js'
|
|
|
}, 100)
|
|
}, 100)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ chooseProduct(e){
|
|
|
|
|
+ this.productId = e.value[0].id;
|
|
|
|
|
+ this.productName = e.value[0].text;
|
|
|
|
|
+ this.showProductList= false;
|
|
|
|
|
+ },
|
|
|
|
|
+ generateTimestamp() {
|
|
|
|
|
+ const date = new Date();
|
|
|
|
|
+ const year = date.getFullYear().toString().substr(2);
|
|
|
|
|
+ const month = date.getMonth() + 1;
|
|
|
|
|
+ const day = date.getDate();
|
|
|
|
|
+ const hours = date.getHours();
|
|
|
|
|
+ const minutes = date.getMinutes();
|
|
|
|
|
+
|
|
|
|
|
+ // 生成6位随机数字
|
|
|
|
|
+ const randomNum = Math.floor(Math.random() * 900000) + 100000;
|
|
|
|
|
+
|
|
|
|
|
+ // 将数字拼接成字符串
|
|
|
|
|
+ const timestamp = `${year}${month < 10 ? '0' + month : month}${day < 10 ? '0' + day : day}${hours}${minutes < 10 ? '0' + minutes : minutes}${randomNum}`;
|
|
|
|
|
+
|
|
|
|
|
+ return timestamp;
|
|
|
|
|
+},
|
|
|
getAuth(){
|
|
getAuth(){
|
|
|
wx.getSetting({
|
|
wx.getSetting({
|
|
|
success(res) {
|
|
success(res) {
|