Commit 824c0d85 by wjd

Merge branch 'zjx' into 'test/96'

Zjx

See merge request iot-project-js/doorlock!18
parents 341e1778 51b2aef1
......@@ -141,6 +141,8 @@
"openDoorFailure": "远程开门失败",
"remoteTimeout": "远程开门超时",
"remoteOpendoorAgain": "请尝试重试",
"offlineTip": "设备已离线,收到远程开门请求后,请尽快处理",
"textlengthTip": "密码长度为6~12位数字",
"error": {
"noPasswordTip": "远程密码不能为空"
}
......@@ -193,9 +195,9 @@
},
"wifiAdd": {
"unbindWifiTip": "当前无Wi-Fi",
"wifiBinding": "配网中",
"wifiBindSuccess": "Wi-Fi连接成功,正在激活设备",
"deviceActivating": "Wi-Fi连接成功,正在激活设备",
"wifiBinding": "正在连接网络...",
"wifiBindSuccess": "Wi-Fi连接成功,正在激活设备...",
"deviceActivating": "Wi-Fi连接成功,正在激活设备...",
"deviceActivateSuccess":"激活成功",
"deviceActivateFailure":"激活失败",
"bindTimeout":"连接超时",
......@@ -204,6 +206,7 @@
"remindCont1": "1. 请确保Wi-Fi信号良好",
"remindCont2": "2. 本产品暂不支持5GHz无线网络",
"noticeTip": "检测到您还未开启通知,将无法及时<br>接收安全推送",
"countDownText": "{0}s",
"error": {
}
......@@ -241,7 +244,7 @@
"unbind": "未绑定"
},
"addUser":{
"nameInputTip": "请输入您想添加的用户名",
"nameInputTip": "请为门锁用户创建显示昵称",
"addUserSuccess": "添加用户成功",
"addUserFailure": "添加用户失败",
"error": {
......@@ -284,7 +287,7 @@
},
"unlockInfo":{
"bindUnlockInfo": "已关联的开锁信息",
"noInfoTip": "当前无绑定开锁ID,请添加",
"noInfoTip": "尚未关联开锁信息",
"passwordOpenDoor": "密码",
"fingerprintOpenDoor": "指纹",
"ICcardOpenDoor": "IC卡",
......
......@@ -141,6 +141,8 @@
"openDoorFailure": "远程开门失败",
"remoteTimeout": "远程开门超时",
"remoteOpendoorAgain": "请尝试重试",
"offlineTip": "设备已离线,收到远程开门请求后,请尽快处理",
"textlengthTip": "密码长度为6~12位数字",
"error": {
"noPasswordTip": "远程密码不能为空"
}
......@@ -193,9 +195,9 @@
},
"wifiAdd": {
"unbindWifiTip": "当前无Wi-Fi",
"wifiBinding": "配网中",
"wifiBindSuccess": "Wi-Fi连接成功,正在激活设备",
"deviceActivating": "Wi-Fi连接成功,正在激活设备",
"wifiBinding": "正在连接网络...",
"wifiBindSuccess": "Wi-Fi连接成功,正在激活设备...",
"deviceActivating": "Wi-Fi连接成功,正在激活设备...",
"deviceActivateSuccess":"激活成功",
"deviceActivateFailure":"激活失败",
"bindTimeout":"连接超时",
......@@ -204,6 +206,7 @@
"remindCont1": "1. 请确保Wi-Fi信号良好",
"remindCont2": "2. 本产品暂不支持5GHz无线网络",
"noticeTip": "检测到您还未开启通知,将无法及时<br>接收安全推送",
"countDownText": "{0}s",
"error": {
}
......@@ -241,7 +244,7 @@
"unbind": "未绑定"
},
"addUser":{
"nameInputTip": "请输入您想添加的用户名",
"nameInputTip": "请为门锁用户创建显示昵称",
"addUserSuccess": "添加用户成功",
"addUserFailure": "添加用户失败",
"error": {
......@@ -284,7 +287,7 @@
},
"unlockInfo":{
"bindUnlockInfo": "已关联的开锁信息",
"noInfoTip": "当前无绑定开锁ID,请添加",
"noInfoTip": "尚未关联开锁信息",
"passwordOpenDoor": "密码",
"fingerprintOpenDoor": "指纹",
"ICcardOpenDoor": "IC卡",
......
......@@ -27,13 +27,15 @@ export default {
"model": "USMARTLOCK_SECURITY_SMARTDOOR_SMART_LOCK",
"GET_MSG_INTERVAL": 5000,
"wifi_add_timeout": 150000,
"add_wifi_timeout": 60,
"active_device_timeout": 30,
//门铃晃动间隔时间
"await_time": 3000,
//门铃晃动次数
"shake_times": 3,
//门锁晃动总时间
"ring_time": 12000,
"remote_opendoor_timeout": 30000,
"remote_opendoor_timeout": 15000,
//二维码失效时间
"qrcode_timeout": 600000,
"remote_timeout": 120,
......@@ -41,7 +43,8 @@ export default {
"maxlength": 16
},
"password":{
"maxlength": 6
"maxlength": 12,
"minlength": 6
},
"ringBell_timeout": 300,
"intervalTime": 3,
......
export default {
"url": "http://192.168.2.96:20000",
"model": "USMARTLOCK_SECURITY_SMARTDOOR_SMART_LOCK"
"url": "https://cloud.iot.u-gen.net/",
// "url": "http://192.168.2.96:20000",
"model": "UGEN_SECURITY_SMARTDOOR_YJ2017"
// "model": "USMARTLOCK_SECURITY_SMARTDOOR_SMART_LOCK"
}
\ No newline at end of file
......@@ -12,8 +12,8 @@ const iot = new UIOT({
lang: ['zh', 'en'],
vue: Vue,
i18n: VueI18n,
appId: '10004',
appSecret: '10004',
appId: '20004',
appSecret: '20004',
wx: {
appId: ''
},
......
......@@ -39,6 +39,9 @@ function init() {
self.noticeTipShowFlag = !iot.native.isNotifycationOpen();
scanCodeSuccess(self);
});
plus.key.addEventListener('backbutton',function(){
iot.utils.closeScanBarcode(self.barcode);
},false);
},
methods:{
//tap <
......@@ -73,9 +76,8 @@ function initComponentsConfig() {
//tap <
function backTap(self){
iot.navigator.back();
console.log(self.barcode);
iot.utils.closeScanBarcode(self.barcode);
iot.navigator.aback();
}
function openScanCode(self){
......@@ -246,7 +248,8 @@ function scanCodeFailue(self){
"class": 'custom-process-button', 'text': Vue.t('addDevice.reBindDevice'), 'callback': () => {
//激活失败
uComponents.hideProcess(self);
uComponents.showProcess(self, 0, Vue.t('addDevice.loading'));
iot.utils.closeScanBarcode(self.barcode);
// uComponents.showProcess(self, 0, Vue.t('addDevice.loading'));
openScanCode(self);
}
}]);
......
......@@ -24,7 +24,11 @@ function init() {
//配置组件
componentsConfig: initComponentsConfig(),
noticeTipShowFlag: false,
timeout: null
timeout: null,
countDownText: config.add_wifi_timeout,
wifiAddSuccess: false,
activeSuccess: false,
activing: false
},
mounted(){
resolve(this);
......@@ -148,6 +152,23 @@ function backTap(){
//tap 连接
function connectButtonTap(self){
self.countDownText = config.add_wifi_timeout;
self.activing = false;
let countDown = setInterval(() => {
self.countDownText --;
if((self.countDownText <= 0) && (self.wifiAddSuccess == false)){
window.clearInterval(countDown);
addFailue(self);
// iot.business.sds.stopFindWIFI({
// success: (response) => {},
// error: (error) => {}
// });
iot.business.sds.stopFindDevices({
success: (response) => {},
error: (error) => {}
});
}
},1000);
if(self.getTextWiFiName() == null || self.getTextWiFiName().trim() == ''){
self.setTextErrorTip(Vue.t('wifiAdd.unbindWifiTip'));
}else if(self.getTextPassword() == null || self.getTextPassword().trim() == ''){
......@@ -204,6 +225,7 @@ function connectButtonTap(self){
iot.business.sds.findDevices({
success: (response) => {
console.log('findDevices');
console.log(response);
if(window.iotDebug){
iotDebug.push('end: 找设备'+JSON.stringify(response));
}
......@@ -218,6 +240,23 @@ function connectButtonTap(self){
if (window.iotDebug) {
iotDebug.upload(iot,'激活中');
}
self.wifiAddSuccess = true;
if(self.activing == false){
self.countDownText = config.active_device_timeout;
window.clearInterval(countDown);
countDown = setInterval(() => {
self.countDownText --;
if((self.countDownText <= 0) && (self.activeSuccess == false)){
window.clearInterval(countDown);
addFailue(self);
iot.business.sds.stopFindDevices({
success: (response) => {},
error: (error) => {}
});
}
},1000);
self.activing = true;
}
uComponents.showProcess(self, 0, Vue.t('wifiAdd.deviceActivating'));
}else if(response.data == "joined success"){
if(window.iotDebug){
......@@ -227,7 +266,27 @@ function connectButtonTap(self){
iotDebug.upload(iot,'激活成功');
}
let deviceId = response.info.sn;
unbind(self, deviceId, productId);
// unbind(self, deviceId, productId);
bind(self, deviceId, productId);
iot.business.sds.setDeviceStatus({
data: {
uuid: response.info.uuid,
setParams: {
'action': {
'value': 'regiserSuccess'
}
}
},
success: (response) => {
//激活成功
console.log(response);
},
error: (error) => {
console.log(error);
uPublic.openRequestErrorAlert(self);
},
complete(){}
});
}else if(response.data == "fail"){
//连接失败
if(window.iotDebug){
......@@ -256,15 +315,15 @@ function connectButtonTap(self){
}
});
}
self.timeout = setTimeout(function (){
console.log("timeout");
window.clearTimeout(self.timeout);
addFailue(self);
iot.business.sds.stopFindDevices({
success: (response) => {},
error: (error) => {}
});
},config.wifi_add_timeout);
// self.timeout = setTimeout(function (){
// console.log("timeout");
// window.clearTimeout(self.timeout);
// addFailue(self);
// iot.business.sds.stopFindDevices({
// success: (response) => {},
// error: (error) => {}
// });
// },config.wifi_add_timeout);
}
//云端绑定之前先解绑
......@@ -313,6 +372,7 @@ function bind(self, deviceId, productId){
let data = response.data;
if(data.success){
addSuccess(self);
self.activeSuccess = true;
}
if(window.iotDebug){
iotDebug.push('end: 绑定成功'+JSON.stringify(response));
......
......@@ -256,15 +256,52 @@
}
}
.u-process{
.u-process-content{
.loader{
&:before{
.transform(translateZ(0) scale(0.7));
}
}
}
}
.u-process.u-process-status-0{
.u-process-content{
.loading{
position: relative;
.loading-text{
position: absolute;
left: 0;
top: 0;
font-size: 16px;
line-height: 3.750em;
width: 100%;
text-align: center;
}
}
}
}
.u-process.u-process-status-1{
.u-process-content{
top: 200px;
.loading{
.loading-text{
display: none;
}
}
}
}
.u-process.u-process-status-2{
.u-process-content{
top: 200px;
.loading{
.loading-text{
display: none;
}
}
}
}
......@@ -1122,6 +1122,11 @@ p {
}
}
.u-process-content .loader:before {
-webkit-transform: translateZ(0) scale(0.7);
transform: translateZ(0) scale(0.7);
}
.scanContent {
position: fixed;
top: 1.173rem;
......@@ -1197,10 +1202,37 @@ p {
background-color: transparent;
}
.u-process .u-process-content .loader:before {
-webkit-transform: translateZ(0) scale(0.7);
transform: translateZ(0) scale(0.7);
}
.u-process.u-process-status-0 .u-process-content .loading {
position: relative;
}
.u-process.u-process-status-0 .u-process-content .loading .loading-text {
position: absolute;
left: 0;
top: 0;
font-size: 0.427rem;
line-height: 3.750em;
width: 100%;
text-align: center;
}
.u-process.u-process-status-1 .u-process-content {
top: 5.333rem;
}
.u-process.u-process-status-1 .u-process-content .loading .loading-text {
display: none;
}
.u-process.u-process-status-2 .u-process-content {
top: 5.333rem;
}
.u-process.u-process-status-2 .u-process-content .loading .loading-text {
display: none;
}
\ No newline at end of file
......@@ -48,7 +48,10 @@
<p class="icon"></p>
</u-comm-loading> -->
<u-process ref="uprocess" :init-param="componentsConfig.processLoading.initParam">
<div class="loading">
<p class="loader"></p>
<p class="loading-text">{{ $t('wifiAdd.countDownText',[countDownText]) }}</p>
</div>
<p class="icon"></p>
<p class="noticeContent" v-show = "noticeTipShowFlag">
<span>&#xe637;</span>
......
......@@ -104,7 +104,8 @@
<div class="content">
<div class="inputBox">
<u-text :init-param="componentsConfig.passwordInput.initParam" :text="textPassword"
v-on:u-text-change="onPasswordChange(arguments[0])"></u-text>
v-on:u-text-change="onPasswordChange(arguments[0])"
v-on:u-text-match-minlength="onPasswordMatchlength(arguments[0])"></u-text>
<p class="errorTip" v-if="textErrorTip">{{ textErrorTip }}</p>
</div>
<u-button :init-param="componentsConfig.confirmButton.initParam" v-on:u-button-tap="onConfirmButtonTap"></u-button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment