Przeglądaj źródła

分辨率相关代码解除注释

leo 9 miesięcy temu
rodzic
commit
49aed13df5

+ 4 - 4
static/rtcEngine/WXtrialInterface.html

@@ -57,9 +57,9 @@
                                 @click="definitionFun(item.value)">
                                 {{item.name}}
                             </div>
-                            <!-- <div class="tc drawer-item" @click="resolutionRatio">
+                            <div class="tc drawer-item" @click="resolutionRatio">
                                 分辨率
-                            </div> -->
+                            </div>
                         </div>
                     </div>
                     <div class="exit">
@@ -76,7 +76,7 @@
                 </div>
             </van-popup>
 
-            <!-- 分辨率
+            <!-- 分辨率 -->
             <van-dialog v-model="resolutionRatioVisible" :show-confirm-button="false" class="resolution-ratio-modal"
                 v-cloak>
                 <div>
@@ -95,7 +95,7 @@
                         </div>
                     </div>
                 </div>
-            </van-dialog> -->
+            </van-dialog>
 
             <!-- 粘贴板 -->
             <van-dialog v-model="pasteVersionVisible" :show-confirm-button="false" class="paste-version-modal" v-cloak>

+ 16 - 14
static/rtcEngine/js/WXtrialInterface.js

@@ -61,7 +61,7 @@ const app = new Vue({
         // 选中的清晰度
         definitionValue: '',
         // 分辨率
-        // resolutionRatioVisible: false,
+        resolutionRatioVisible: false,
         resolutionRatioList: [],
         // 需要用到的参数
         parametersData: {},
@@ -245,6 +245,7 @@ const app = new Vue({
                     // “connected”:rtc链接成功 “failed”:rtc链接失败 “closed”:rtc链接关闭 “disconnected”:rtc链接超时
                     if (event.val === "connected") {
                         Toast.clear();
+                        this.confirmResolution()
                         playOnBtn.bind(this)()
                         this.pushflowPopup()
                         this.getResidueTime()
@@ -298,24 +299,25 @@ const app = new Vue({
                         return item
                     })
                     this.levitatedSphereVisible = false
-                    // this.resolutionRatioVisible = true
+                    this.resolutionRatioVisible = true
                 }
             })
         },
 
         // 确定修改分辨率
-        // confirmResolution() {
-        //     let { width, height, dpi } = this.phoneSize
-        //     this.doConnectDirectivesWs.send(JSON.stringify({
-        //         type: "setPhoneSize",
-        //         data: {
-        //             width,
-        //             height,
-        //             dpi
-        //         }
-        //     }))
-        //     // this.resolutionRatioVisible = false
-        // },
+        confirmResolution() {
+            if(!Object.keys(this.phoneSize).length) return
+            let { width, height, dpi } = this.phoneSize
+            this.doConnectDirectivesWs.send(JSON.stringify({
+                type: "setPhoneSize",
+                data: {
+                    width,
+                    height,
+                    dpi
+                }
+            }))
+            this.resolutionRatioVisible = false
+        },
 
         // 退出相关按钮操作
         exitFun(key) {