From d7049dae792f0a6d2ee4246acf4b42bf0b36635c Mon Sep 17 00:00:00 2001 From: Administrator <Administrator@USER-20180117QL> Date: 星期二, 25 十二月 2018 11:11:02 +0800 Subject: [PATCH] Merge branch 'dev_lxw' of https://whyccjj@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw --- gx_tieta/WebRoot/js/VoiceUtil.js | 32 +++++++++++++++++++++++++++++++- 1 files changed, 31 insertions(+), 1 deletions(-) diff --git a/gx_tieta/WebRoot/js/VoiceUtil.js b/gx_tieta/WebRoot/js/VoiceUtil.js index 6bf489e..08e3a96 100644 --- a/gx_tieta/WebRoot/js/VoiceUtil.js +++ b/gx_tieta/WebRoot/js/VoiceUtil.js @@ -52,6 +52,16 @@ }; +// 寮�鍚�/鍏抽棴褰撳墠璇煶鎾姤 锛堜緷璧栦笌base.js瀵煎叆鐨凜ookie鏂规硶锛� +Voice.prototype.changeSpeak = function(bool) { + this.speak_enable = bool; + setCookie('voice', bool); + // 閫�鍑哄綋鍓嶆挱鎶� + if(!bool) { + this.cancel(); + } +}; + // 閫�鍑哄綋鍓嶆挱鎶� Voice.prototype.cancel = function() { this.speak.cancel(); @@ -83,4 +93,24 @@ var voice = new Voice(); -voice.cancel(); \ No newline at end of file +var voiceStatus = getCookie('voice'); +// 璁剧疆鍒濆璇煶鎾姤鐘舵�� +voiceStatus = voiceStatus=='false'?false:true; +voice.changeSpeak(voiceStatus); +voice.cancel(); + +// 璁剧疆鍒濆鍖栬闊虫挱鎶ュ浘鏍� +if(!voiceStatus) { + $('.web-status .cell-list.voice').addClass('close-voice'); +} + +// 鐐瑰嚮澹伴煶鐨勫浘鏍� +$('.web-status .cell-list.voice').click(function() { + $(this).toggleClass('close-voice'); + // 鍒ゆ柇鏄惁鍏抽棴澹伴煶 + if($(this).hasClass('close-voice')) { + voice.changeSpeak(false); + }else { + voice.changeSpeak(true); + } +}); \ No newline at end of file -- Gitblit v1.9.1