laosan2382995021@163.com 3 gadi atpakaļ
vecāks
revīzija
f10db1c234

+ 2 - 35
public/aipay.html

@@ -1,42 +1,9 @@
 <!DOCTYPE html>
 <html><head>
     <meta http-equiv="content-type" content="text/html; charset=gbk">
-    <title>Video Test 10: RTSP Streaming</title>
-    <script>
-
-        function rotateMe() {
-            i = 0;
-            int = setInterval(
-                function () {
-                    video.style.WebkitTransform = 'rotate(' + (i++ %360) + 'deg)';
-                    video.style.MozTransform = 'rotate(' + (i++ %360) + 'deg)';
-                    video.style.OTransform = 'rotate(' + (i++ %360) + 'deg)';
-                }, 50);
-        }
-
-        function resetRotation() {
-            video.style.WebkitTransform = 'rotate(0)';
-            video.style.MozTransform = 'rotate(0)';
-            video.style.OTransform = 'rotate(0)';
-        }
-
-    </script>
+    <title>音乐</title>
 </head>
-
 <body>
-
+<audio controls src="http://www.xyxywxh.com/user/xyxygyw/webimg/mp3/danqu/02春江花月夜.mp3"></audio>
 </body>
-<script>
-
-    var ws = new WebSocket('ws://60.232.192.24:559/openUrl/RDygh56');
-
-    ws.onopen = function () {
-        console.log('链接成功');
-    }
-
-    ws.onmessage = function (evt) {
-        console.log(evt);
-    }
-
-</script>
 </html>

+ 103 - 0
src/layout/layout-order-item/mixins/time.ts

@@ -0,0 +1,103 @@
+import {OrderPayStatus} from "$utils/control/order/const/order";
+
+export default {
+
+    // 倒计时
+    data(){
+        return {
+            timeFormat:'',
+            format:['天','时','分','秒'],
+            OrderPayStatus
+        }
+    },
+
+    watch:{
+      item:{
+          handler(){
+              this.createdStatusTime(this.item)
+          },
+          immediate:true
+      }
+    },
+
+    methods:{
+
+        createdStatusTime(item){
+            this.statusConfig && clearTimeout(this.statusConfig.callTime);
+            // 如果为进行中触发
+            if (item.oid && item.status === OrderPayStatus.have) {
+
+                let localTime = Math.floor(new Date().getTime() / 1000);
+
+                let receive_time = item.receive_time;
+                if (receive_time === 0) {
+                    receive_time = localTime;
+                }
+
+                this.statusConfig = {
+                    callTime:null,
+                    endTime:receive_time + (item.num * 3600),
+                    localTime: Math.floor(new Date().getTime() / 1000),
+                };
+                this.triggerCallTime();
+            }
+
+        },
+
+        triggerCallUseTime() {
+            this.statusConfig.callTime = setTimeout(()=> this.triggerCallTime(),1000);
+            return true;
+        },
+
+        triggerCallTime(){
+
+            // 获取差值
+            let diff = this.statusConfig.endTime - this.statusConfig.localTime;
+
+            // 当前时间
+            this.statusConfig.localTime = Math.floor(new Date().getTime() / 1000);
+            if(diff > 0) {
+                let useTimeData = [];
+                // 计算 天
+                useTimeData.push(Math.floor(diff / 60 / 60 / 24));
+                // 计算小时
+                useTimeData.push(Math.floor(diff / 60 / 60 % 24));
+                // 计算分钟
+                useTimeData.push(Math.floor(diff/ 60 % 60));
+                // 计算秒
+                useTimeData.push(Math.floor(diff % 60));
+
+                let timeFormat = '';
+
+                this.format.map((item,index)=>{
+
+                    if (index ===0 && useTimeData[index] <=0) return;
+                    else {
+                        timeFormat+= (useTimeData[index]<10?'0'+useTimeData[index]:useTimeData[index])+item;
+                    }
+
+                });
+
+                this.timeFormat = timeFormat;
+
+                return this.triggerCallUseTime();
+            } else {
+                return this.triggerEndCall();
+            }
+
+        },
+
+        triggerEndCall(){
+            this.timeFormat = '';
+            return false;
+        }
+
+    },
+
+
+    beforeUnmount() {
+        this.statusConfig && clearTimeout(this.statusConfig.callTime);
+    }
+
+
+}

+ 8 - 0
src/pages/talking/mixins/handle.ts

@@ -257,11 +257,19 @@ export default <LibMixins>{
     created(){
         // new WebIM().install(this.$store.state.user.user);
         this.roomInfo = this.$params || {};
+
+        // @ts-ignore
+        document.body.onbeforeunload =  (event)=> {
+            // 执行退出房间
+            event.returnValue='确认离开此网站吗?';
+        }
     },
 
     beforeUnmount() {
         // 执行退出房间
         this.outHome();
+        // @ts-ignore
+        document.body.onbeforeunload = undefined;
     }
 
 

+ 40 - 0
src/store/modules/config.ts

@@ -0,0 +1,40 @@
+import {Module} from "vuex";
+
+import $request from '$utils/request';
+
+export default <Module<any,any>>{
+
+    state:{
+        config:{}
+    },
+
+
+    mutations:{
+
+        setConfig(state,data){
+            state.config = data;
+        }
+
+    },
+
+    actions:{
+        getConfigPromise({commit,state},failMessage:boolean=false){
+            return new Promise((resolve, reject)=>{
+
+                let requestData:Record<string, any> = {
+                    url:'api/get_system_base_config',
+                    cache:true
+                };
+                if (failMessage) {
+                    requestData.failMessage = failMessage;
+                }
+                // @ts-ignore
+                $request(requestData).then((data)=>{
+                    commit('setConfig',data.data);
+                    resolve(state.config);
+                }).catch(reject);
+            });
+        }
+    }
+
+}