Commit c6e15c32 by 朱建香

2018/01/12 19:14

1.notify组件优化
2.关联开锁ID也页面html添加
parent 37ec32c1
...@@ -78,22 +78,29 @@ ...@@ -78,22 +78,29 @@
endSetting:Vue.t('androidNotify.endSetting'), endSetting:Vue.t('androidNotify.endSetting'),
toAppIndex:Vue.t('androidNotify.toIndex'), toAppIndex:Vue.t('androidNotify.toIndex'),
notifyState:false, // 当前是否开启了通知 //notifyState:false, // 当前是否开启了通知
gotoIndex:this.toIndex,// 处理点击到index按钮事件 //gotoIndex:this.toIndex,// 处理点击到index按钮事件
isKnow:iot.native.isNotifycationOpen(),//是否需要显示 我已阅读 //isKnow:iot.native.isNotifycationOpen(),//是否需要显示 我已阅读
isToIndex:false,// 是否需要显示去首页按钮 //isToIndex:false,// 是否需要显示去首页按钮
isStep1Finish:iot.native.isNotifycationOpen(),//是否需要显示步骤1的勾 isStep1Finish:iot.native.isNotifycationOpen(),//是否需要显示步骤1的勾
isStep2Finish:false,//是否需要显示步骤2的勾 isStep2Finish:false,//是否需要显示步骤2的勾
isStep3Finish:false,//是否需要显示步骤3的勾 isStep3Finish:false,//是否需要显示步骤3的勾
isToSetting:!iot.native.isNotifycationOpen(),//是否需要显示去设置按钮 isToSetting:!iot.native.isNotifycationOpen(),//是否需要显示去设置按钮
setp1Active:'active', setp1Active:null,
setp2Active:null,// 默认为灰色 不显示active setp2Active:null,// 默认为灰色 不显示active
setp3Active:null, setp3Active:null,
notifyState:false, // 当前是否开启了通知
gotoIndex:this.toIndex,// 处理点击到index按钮事件
isKnow:iot.native.isNotifycationOpen(),//是否需要显示 我已阅读
isToIndex:false,// 是否需要显示去首页按钮
} }
}, },
mounted: function () { mounted: function () {
console.log("notifyState:"+iot.native.isNotifycationOpen()) this.setp1Active=this.isStep1Finish?"active changeBorder":null;
// 监听程序恢复前台 this.setp2Active=this.isStep1Finish?"active changeBorder":null;
console.log("notifyState:"+iot.native.isNotifycationOpen());
onTest(this);
// 监听程序恢复前台
document.addEventListener("resume", ()=>{ document.addEventListener("resume", ()=>{
onAppReume(this); onAppReume(this);
}, false); }, false);
...@@ -116,7 +123,11 @@ ...@@ -116,7 +123,11 @@
} }
}; };
function openNotify(self) { function onTest(self){
console.log(self.isStep1Finish);
console.log(self.setp2Active);
}
function openNotify(self) {
console.log("去开启"); console.log("去开启");
iot.native.toNotifycationSetting("notify"); iot.native.toNotifycationSetting("notify");
self.setp1Active = 'active changeBorder'; self.setp1Active = 'active changeBorder';
...@@ -125,7 +136,7 @@ ...@@ -125,7 +136,7 @@
function IKonw(self){ function IKonw(self){
console.log("点击了我已阅读"); console.log("点击了我已阅读");
self.isStep2Finish = true; // 点击阅读后显示步骤2的勾 self.isStep2Finish = true; // 点击阅读后显示步骤2的勾
self.setp2Active = "active changeBorder";// 点击阅读后显示步骤2的字体亮度调高 // self.setp2Active = "active changeBorder";// 点击阅读后显示步骤2的字体亮度调高
self.setp3Active = "active";// 同时步骤3的字体亮度也调高 self.setp3Active = "active";// 同时步骤3的字体亮度也调高
self.isStep3Finish = true; // 步骤3的勾勾选 self.isStep3Finish = true; // 步骤3的勾勾选
self.isToIndex = true;//显示去首页按钮 self.isToIndex = true;//显示去首页按钮
...@@ -140,13 +151,21 @@ ...@@ -140,13 +151,21 @@
function onAppReume(self){ function onAppReume(self){
let notifyState = iot.native.isNotifycationOpen(); let notifyState = iot.native.isNotifycationOpen();
console.log("notifyState:"+notifyState); console.log("notifyState:"+notifyState);
if (notifyState) {self.setp2Active = "active changeBorder";} if (notifyState) {
self.isStep1Finish = iot.native.isNotifycationOpen();// 再次判断当前通知是否开启 self.setp2Active = "active changeBorder";
self.isToSetting = !iot.native.isNotifycationOpen(); // 再次判断是否需要显示去设置按钮 }else{// 恢复默认
self.isKnow = iot.native.isNotifycationOpen(),// 再次判断是否需要显示 我已阅读 self.setp2Active = null;
self.$nextTick(function () { self.setp3Active = null;
self.isStep2Finish = false;
self.isStep3Finish = false;
self.isToIndex = false;
}
self.isStep1Finish = iot.native.isNotifycationOpen();// 再次判断当前通知是否开启
self.isToSetting = !iot.native.isNotifycationOpen(); // 再次判断是否需要显示去设置按钮
self.isKnow = iot.native.isNotifycationOpen(),// 再次判断是否需要显示 我已阅读
self.$nextTick(function () {
console.log("重新渲染"); console.log("重新渲染");
}); });
} }
</script> </script>
......
...@@ -37,9 +37,11 @@ ...@@ -37,9 +37,11 @@
<p class="title">{{ $t('addUnlockInfo.opendoorRecord') }}</p> <p class="title">{{ $t('addUnlockInfo.opendoorRecord') }}</p>
<u-select ref="uselect" :value="recordSelectIndex" :init-param="componentsConfig.recordSelect.initParam" <u-select ref="uselect" :value="recordSelectIndex" :init-param="componentsConfig.recordSelect.initParam"
v-on:u-select-change="onRecordSelectChange(arguments[0])"></u-select> v-on:u-select-change="onRecordSelectChange(arguments[0])"></u-select>
<p class="tip">{{ $t('addUnlockInfo.tip') }}</p> <div class="position">
<u-switch :value="valueSetHijack" v-show="recordSelectList.length && selectedMode == 2" <p class="tip">{{ $t('addUnlockInfo.tip') }}</p>
:init-param="componentsConfig.setHijackSwitch.initParam" v-on:u-switch-tap="onSetHijackTap(arguments[0])"></u-switch> <u-switch :value="valueSetHijack" v-show="recordSelectList.length && selectedMode == 2"
:init-param="componentsConfig.setHijackSwitch.initParam" v-on:u-switch-tap="onSetHijackTap(arguments[0])"></u-switch>
</div>
</div> </div>
<u-button :init-param="componentsConfig.addButton.initParam" :disabled="!recordSelectList.length" v-on:u-button-tap="onAddButtonTap"></u-button> <u-button :init-param="componentsConfig.addButton.initParam" :disabled="!recordSelectList.length" v-on:u-button-tap="onAddButtonTap"></u-button>
</div> </div>
......
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