From fa00382db413a8489d07983b66f0869305b51a9a Mon Sep 17 00:00:00 2001
From: 81041 <81041@DESKTOP-025NVD9>
Date: 星期五, 11 一月 2019 11:35:54 +0800
Subject: [PATCH] 批量读取系统参数

---
 gx_tieta/WebRoot/js/VoiceUtil.js |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/gx_tieta/WebRoot/js/VoiceUtil.js b/gx_tieta/WebRoot/js/VoiceUtil.js
index 6bf489e..83f3db4 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,32 @@
 
 
 var voice = new Voice();
-voice.cancel();
\ No newline at end of file
+var voiceStatus = checkPageVoiceStatus();
+// 璁剧疆鍒濆璇煶鎾姤鐘舵��
+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);
+	}
+});
+
+// 鑾峰彇椤甸潰璇煶鏄惁寮�鍚�
+function checkPageVoiceStatus() {
+	var voiceStatus = getCookie('voice');
+	// 璁剧疆鍒濆璇煶鎾姤鐘舵��
+	voiceStatus = voiceStatus=='false'?false:true;
+	
+	return voiceStatus;
+}
\ No newline at end of file

--
Gitblit v1.9.1