luke 6 tahun lalu
induk
melakukan
73ff71921f

+ 11 - 2
service_exe/src/renderer/App.vue

@@ -8,6 +8,7 @@
 
 <script>
   import Vue from 'vue';
+  import receiveAPP from '../../static/audio/receive.wav'
   export default {
     name: 'App',
     data(){
@@ -19,6 +20,7 @@
         serverTimeoutObj:null,
         apiToken:'',
         linkfailure:true,
+        receiveMuisc:receiveAPP
       }
     },
     methods:{
@@ -263,8 +265,8 @@
       /*******************************************/
       // 接收消息音频提示
       receiveAudio() {
-        let receive = new Audio()
-        receive.src = "../static/audio/receive.wav";
+        let receive = new Audio();
+        receive.src = this.receiveMuisc;
         receive.play();
       },
       /***************************************/
@@ -302,6 +304,13 @@
       Vue.prototype.$socket_open = false;
       this.apiToken = this.$md5('customer-service'+window.location.origin)
       this.initWebSocket(this.apiToken);
+
+      // 关闭浏览器窗口的时候清空浏览器缓存在localStorage的数据
+      window.onbeforeunload = function (e) {
+        var storage = window.localStorage;
+        storage.clear()
+      }
+
       // 获取系统时间
       //let t = new Date().getTime();
       //this.get('api'+this.$ports.TIME+'?t='+t).then(res => {

+ 12 - 12
service_exe/src/renderer/components/leftNav.vue

@@ -78,7 +78,6 @@
 					path = "/" + str
 				}
 				if(str == 'TheCurrentSession'){
-					this.megnum = 0;
 					this.$store.dispatch("SET_MEG", false);
 				}else {
 					this.$store.dispatch("SET_MEG", true);
@@ -90,20 +89,21 @@
 			}
 		},
 
-		computed: {
-			getTitleActive() {
-				return this.$store.getters.get_megnum
-			}
-		},
-		watch: {
-			getTitleActive(val){
-				this.megnum = val;
-			}
-		},
+		// computed: {
+		// 	getTitleActive() {
+		// 		return this.$store.getters.get_megnum
+		// 	}
+		// },
+		// watch: {
+		// 	getTitleActive(val){
+		// 		this.megnum = val;
+		// 	}
+		// },
 		mounted() {
 			this.titleActive = this.$store.getters.get_navState;
 			this.logo = sessionStorage.getItem('logo');
-			this.showMeg = this.$store.getters.get_meg
+			this.showMeg = this.$store.getters.get_meg;
+			this.megnum = this.$store.getters.get_megnum
 		},
 	};
 </script>

+ 6 - 5
service_exe/src/renderer/pages/TheCurrentSession.vue

@@ -18,10 +18,10 @@
 								 v-for="(item,index) in sessionList">
 								<div class="row allAlignment item-center">
 									<span style="font-weight:bold;color:#666;font-size:14px;">{{item.name}}</span>
-									<span style="color:#999;font-size:.12px;">{{item.intime}}</span>
+									<span style="color:#999;font-size:12px;">{{item.intime}}</span>
 								</div>
 								<div class="row allAlignment item-center">
-									<div style="width:90%;font-size:.12px;" class="ellipsis">
+									<div style="width:90%;font-size:12px;" class="ellipsis">
 										<span v-html="item.text"></span>
 									</div>
 									<span v-if="item.num > 0" class="markNumber">{{item.num}}</span>
@@ -103,7 +103,7 @@
 
 							<!-- 用户消息 -->
 							<div style="padding:0 10px;margin-top:20px;" v-if="item.type == 'user'">
-								<div style="height:37px;font-size:.12px;color:#bbb;"
+								<div style="height:37px; font-size:12px; color:#bbb;"
 									 class="row item-center"
 								>{{item.time}}
 								</div>
@@ -334,7 +334,7 @@
 	import leftNav from "@/components/leftNav";
 	import hader from "@/components/hader";
 	import messageCenter from "@/components/messageCenter";
-
+	import sendAPP from '../../../static/audio/send.wav'
 	export default {
 		name: "TheCurrentSession",
 		data() {
@@ -376,6 +376,7 @@
 				showHistoryList: false,
 				historyList: [],
 				historyTime:'',
+				sendMuisc: sendAPP
 			}
 		},
 		methods: {
@@ -744,7 +745,7 @@
 			// 消息发送声音提示
 			sendAudio() {
 				let send = new Audio()
-				send.src = "../../static/audio/send.wav"
+				send.src = this.sendMuisc
 				send.play()
 			},