Selaa lähdekoodia

Merge branch 'dev5.8.7' of Software/android-cloud-H5 into master

guocanfeng 8 kuukautta sitten
vanhempi
commit
7e71ef3066

+ 5 - 6
nuxt.config.js

@@ -146,17 +146,16 @@ export default {
   proxy: {
     [process.env.API_PREFIX]: {
       // target: 'http://gntest.phone.androidscloud.com:1280',
-      target: `http${process.env.API_HTTPS === 'true' ? 's' : ''}://${
-        process.env.API_HOST
-      }:${process.env.API_PORT}`,
+      target: `http${process.env.API_HTTPS === 'true' ? 's' : ''}://${process.env.API_HOST
+        }:${process.env.API_PORT}`,
       pathRewrite: {
         // '^/api': ''
       },
+      ws: false
     },
     '/file': {
-      target: `http${process.env.FILE_HTTPS === 'true' ? 's' : ''}://${
-        process.env.FILE_HOST
-      }:${process.env.FILE_PORT}`,
+      target: `http${process.env.FILE_HTTPS === 'true' ? 's' : ''}://${process.env.FILE_HOST
+        }:${process.env.FILE_PORT}`,
       pathRewrite: {
         '^/file': '',
       },

+ 222 - 0
static/rtcEngine/WXtrialInterface.html

@@ -0,0 +1,222 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>双子星云手机</title>
+    <link rel="stylesheet" href="./config/css/vant.css">
+    <link rel="stylesheet" href="./css/WXtrialInterface.css">
+    <script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/vConsole/3.12.1/vconsole.min.js"></script>
+    <script>
+        const vConsole = new VConsole();
+    </script>
+</head>
+
+<body @touchmove.prevent>
+    <div id="app" v-cloak>
+        <!-- 计时卡计时 -->
+        <div class="pfi flex timing" v-if="timingVisible" v-cloak>
+            <div>{{countdownTime}}</div>
+            <img class="wh22" src="../static/img/close.png" alt="" @click="handlecountdownTimeClose" />
+        </div>
+
+        <!-- 悬浮框 -->
+        <div class="levitated-sphere" :style="levitatedSpherePositionData" v-cloak
+            @click="levitatedSphereVisible = true">
+            <img src="../static/img/xuanfu_icon.png" alt="" @touchmove.prevent="touchmoveLevitatedSphere"
+                @touchend="touchendLevitatedSphere">
+        </div>
+
+        <div class="layout" :style="{height: height + 'px'}" v-cloak  @touchmove.prevent>
+            <!-- 云机位置 -->
+            <div class="layout-view" v-cloak @touchmove.prevent>
+                <video ref="rtcMediaPlayer" :style="rtcMediaPlayerStyle" width="100%" height="100%" autoplay
+                    webkit-playsinline="true" playsinline x-webkit-airplay="allow" x5-video-player-type="h5"
+                    x5-video-player-fullscreen="true" x5-video-orientation="portraint" id="playerVideo"
+                    class="videoRotate" :controls="false" @touchmove.prevent="(event) => {engine.touchClick(event, 2)}"
+                    @touchstart.prevent="(event) => {engine.touchClick(event, 0)}"
+                    @touchend.prevent="touchendRtcMediaPlayer" v-show="isShowVideo">
+                    当前浏览器暂不支持、请使用谷歌浏览器或前往双子星客户端使用</video>
+            </div>
+            <!-- 底部按钮 -->
+            <div class="layout-footer" v-cloak @touchmove.prevent>
+                <template v-for="item in footerBtn">
+                    <img :src="item.img" alt="" @click="footerBtnFun(item.key)">
+                </template>
+            </div>
+
+            <!-- 右侧弹框 -->
+            <van-popup v-model="levitatedSphereVisible" position="right" class="levitated-sphere-drawer"
+                overlay-class="levitated-sphere-overlay" v-cloak>
+                <div class="flex-column">
+                    <div class="flex-column-container">
+                        <div>
+                            <div v-for="item in definitionList" :key="item.key"
+                                :class="['tc drawer-item mb-15', {active: definitionValue === item.value}]"
+                                @click.prevent="definitionFun(item.value)">
+                                {{item.name}}
+                            </div>
+                            <div class="tc drawer-item mb-15" @click.prevent="resolutionRatio">
+                                分辨率
+                            </div>
+                            <div class="tc drawer-item mb-15" @click.prevent="volumeControl(24)">
+                                音量 +
+                            </div>
+                            <div class="tc drawer-item" @click.prevent="volumeControl(25)">
+                                音量 -
+                            </div>
+                        </div>
+                    </div>
+                    <div class="exit">
+                        <template v-for="(item, index) in exitList">
+                            <div :key="item.key" :class="['tc', {'mb-15': index !== exitList.length - 1}, item.key]"
+                                @click="exitFun(item.key)">
+                                <img :src="item.img" alt="">
+                                <div class="drawer-item">
+                                    {{item.name}}
+                                </div>
+                            </div>
+                        </template>
+                    </div>
+                </div>
+            </van-popup>
+
+            <!-- 分辨率 -->
+            <van-dialog v-model="resolutionRatioVisible" :show-confirm-button="false" class="resolution-ratio-modal"
+                v-cloak>
+                <div>
+                    <div>
+                        <div class="flex-jub resolution-ratio-btn">
+                            <div @click="resolutionRatioVisible = false">取消</div>
+                            <div @click="confirmResolution">确定</div>
+                        </div>
+                        <div class="resolution-ratio-list">
+                            <div v-for="(item, index) in resolutionRatioList" :key="item"
+                                :class="{active:  phoneSize.dpi === item.dpi}" @click="phoneSize = item">
+                                <div class="tc">
+                                    {{item.width}} x {{item.height}}
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </van-dialog>
+
+            <!-- 粘贴板 -->
+            <van-dialog v-model="pasteVersionVisible" :show-confirm-button="false" class="paste-version-modal" v-cloak>
+                <template v-if="pasteVersionList.length">
+                    <div class="tc paste-version-title pre">
+                        <span class="pab">粘贴版</span>
+                        <span class="pab paste-version-clear" @click="deletePasteVersion()">
+                            清空
+                        </span>
+                    </div>
+                    <div class="paste-version-list">
+                        <div v-for="(item,index) in pasteVersionList" :key="item"
+                            :class="[{'mb-5': index!==pasteVersionList.length - 1}]">
+                            <van-swipe-cell>
+                                <div :class="`copy-value-${index}, ellipsis`" @click="copyPasteVersiontext">
+                                    {{item.content}}
+                                </div>
+                                <template #right>
+                                    <div class="paste-version-delete" @click="deletePasteVersion(item.id)">
+                                        删除
+                                    </div>
+                                </template>
+                            </van-swipe-cell>
+                        </div>
+                    </div>
+                </template>
+                <template v-else>
+                    <div class="paste-version-empty flex-center-all h100">
+                        <div>
+                            <img src="./img/jianqieban_pic@2x.png" alt="">
+                            <div class="tc">
+                                剪贴板为空
+                            </div>
+                        </div>
+                    </div>
+                </template>
+                <img class="pab paste-version-close" src="./img/guanbi_icon@2x.png" alt=""
+                    @click="pasteVersionVisible = false" />
+            </van-dialog>
+
+            <!-- 增加复制粘贴板 -->
+            <van-dialog v-model="copyTextVisible" class="copy-text-modal" confirm-button-text="确定" show-cancel-button
+                confirm-button-color="#3cc51f" v-cloak :before-close="beforeCloseCopy">
+                <div class="tc">
+                    读取剪贴板失败
+                </div>
+                <div>
+                    <van-field v-model="copyTextValue" placeholder="请输入复制到剪切板的内容" />
+                </div>
+            </van-dialog>
+
+
+            <!-- 计费规则  -->
+            <van-dialog v-model="billingRulesVisible" :show-confirm-button="false" class="billing-rules-modal" v-cloak>
+                <div class="tc">
+                    <img class="billing-rules-img" src="./img/countdown.png" />
+                </div>
+                <div class="tc billing-rules-title">
+                    计费规则
+                </div>
+                <div class="tc">进入云机开始计时,点击退出并下机停止计时。点击退出云机仍处于计时状态。</div>
+                <div class="tc billing-rules-tips">云机时长剩余:<span class="billing-rules-time">{{countdownTime}}</span>
+                </div>
+                <div class="billing-rules-btn" @click="getRecommend">我知道了</div>
+            </van-dialog>
+
+            <!-- 应用推荐 -->
+            <van-dialog v-model="applyRecommendVisible" :show-confirm-button="false" class="apply-recommend-modal"
+                v-cloak>
+                <div>
+                    <div class="tc apply-recommend-title">
+                        应用推荐
+                    </div>
+                    <div class="apply-recommend-list">
+                        <div v-for="(item, index) in recommendList" :key="item.id"
+                            :class="['flex w100', {'mt-16': index !== 0}]">
+                            <div class="left flex-align-c">
+                                <img :src="item.imageUrl" alt="">
+                                <div>
+                                    <div class="title ellipsis">{{item.filename}}</div>
+                                    <div class="download-num">有{{item.installNum}}个人下载</div>
+                                </div>
+                            </div>
+                            <div class="right flex-align-c" @click="downAndInstallApk(item)">
+                                <div>
+                                    下载
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="apply-recommend-btn tc" @click="getRecommend">
+                        换一批
+                    </div>
+                </div>
+                <img class="apply-recommend-close pab" src="./img/close.png" alt=""
+                    @click="applyRecommendVisible = false" />
+            </van-dialog>
+
+            <!-- 超过指定触碰时间的弹窗提示 -->
+            <van-dialog v-model="noOperationSetTimeoutTimeVisible" title="提示" show-cancel-button
+                message="由于您长时间未操作,将自动断开视频链接(不影响云手机内应用运行)" :confirm-button-text="confirmButtonText"
+                confirm-button-color="#3cc51f" cancel-button-text="继续操作" @cancel="noOperationSetTimeout('cancel')"
+                @confirm="noOperationSetTimeout('cancel'), exit(), noOperationSetTimeoutTimeVisible = false" v-cloak>
+            </van-dialog>
+        </div>
+    </div>
+</body>
+<script src="./config/js/jweixin.js"></script>
+<script src="./config/js/clipboard.js"></script>
+<script type="text/javascript" src="../static/js/uni.webview.1.5.2.js"></script>
+<script src="./config/js/vue.js"></script>
+<script src="./config/js/vant.js"></script>
+<script src="./config/js/axios.js"></script>
+<script src="./config/js/rtcEngine.min.js"></script>
+<script src="../static/lib/qs.js"></script>
+<script type="module" src="./js/WXtrialInterface.js"></script>
+
+</html>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
static/rtcEngine/config/css/vant.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 2 - 0
static/rtcEngine/config/js/axios.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 7 - 0
static/rtcEngine/config/js/clipboard.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
static/rtcEngine/config/js/jweixin.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 299 - 0
static/rtcEngine/config/js/rtcEngine.min.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 7 - 0
static/rtcEngine/config/js/vant.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 11 - 0
static/rtcEngine/config/js/vue.js


+ 486 - 0
static/rtcEngine/css/WXtrialInterface.css

@@ -0,0 +1,486 @@
+html {
+  font-size: 26.6666666667vw;
+}
+@media screen and (max-width: 320px) {
+  html {
+    font-size: 80px;
+  }
+}
+@media screen and (min-width: 750px) {
+  html {
+    font-size: 120px;
+  }
+}
+
+.flex-center-all {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.flex-align-c {
+  display: flex;
+  align-items: center;
+}
+
+.tc {
+  text-align: center;
+}
+
+.pfi {
+  position: fixed;
+}
+
+.pab {
+  position: absolute;
+}
+
+.pre {
+  position: relative;
+}
+
+.flex {
+  display: flex;
+}
+
+.flex-1 {
+  flex: 1;
+}
+
+.flex-column {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+}
+
+.flex-column-container {
+  flex: 1;
+  overflow-y: auto;
+}
+
+.flex-jub {
+  display: flex;
+  justify-content: space-between;
+}
+
+.mb-20 {
+  margin-bottom: 0.2rem;
+}
+
+.mb-15 {
+  margin-bottom: 0.15rem;
+}
+
+[v-cloak] {
+  display: none;
+}
+
+.ellipsis {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.w100 {
+  width: 100%;
+}
+
+.h100 {
+  height: 100%;
+}
+
+.fl {
+  float: left;
+}
+
+.fr {
+  float: right;
+}
+
+.mt-16 {
+  margin-top: 0.16rem;
+}
+
+.mb-5 {
+  margin-bottom: 0.05rem;
+}
+
+#app {
+  font-size: 0.12rem;
+  color: #fff;
+}
+
+.layout {
+  background-color: #000;
+  font-size: 0.12rem;
+}
+.layout .layout-view {
+  height: calc(100% - 0.6rem);
+  width: 100%;
+  position: relative;
+}
+.layout .layout-view .videoRotate {
+  position: absolute;
+  left: 0;
+  top: 0;
+  display: block;
+  object-fit: fill;
+}
+.layout .layout-footer {
+  display: grid;
+  grid-template-columns: repeat(3, 1fr);
+  text-align: center;
+  height: 0.6rem;
+}
+.layout .layout-footer img {
+  margin: auto;
+  width: 0.3rem;
+  height: 0.3rem;
+}
+.layout .levitated-sphere-overlay {
+  height: calc(100% - 0.6rem);
+  background-color: transparent;
+}
+.layout .levitated-sphere-drawer {
+  top: 45.5%;
+  height: calc(100% - 0.6rem);
+  max-height: none !important;
+  min-width: 0.7rem;
+  color: #fff;
+  background-color: rgba(2, 2, 6, 0.5);
+  padding: 0.3rem 0.1rem 0;
+  box-sizing: border-box;
+}
+.layout .levitated-sphere-drawer .drawer-item {
+  line-height: 0.3rem;
+  border-radius: 0.03rem;
+  -moz-user-select: none;
+  -webkit-user-select: none;
+  -ms-user-select: none;
+  -khtml-user-select: none;
+  user-select: none;
+}
+.layout .levitated-sphere-drawer .drawer-item.active {
+  background: rgb(255, 255, 255);
+  color: #000;
+}
+.layout .levitated-sphere-drawer .exit {
+  line-height: 0.3rem;
+}
+.layout .levitated-sphere-drawer .exit img {
+  width: 0.24rem;
+  height: 0.24rem;
+}
+.layout .billing-rules-modal {
+  text-align: center;
+  font-size: 0.14rem;
+  color: #757580;
+  text-align: center;
+}
+.layout .billing-rules-modal .van-dialog__content {
+  padding: 0 0.28rem 0.28rem;
+}
+.layout .billing-rules-modal .billing-rules-img {
+  width: 1.04rem;
+  height: 1.4rem;
+}
+.layout .billing-rules-modal .billing-rules-title {
+  font-size: 0.18rem;
+  font-weight: 600;
+  color: #363636;
+  margin-bottom: 0.05rem;
+}
+.layout .billing-rules-modal .billing-rules-tips {
+  margin-top: 0.05rem;
+}
+.layout .billing-rules-modal .billing-rules-time {
+  color: #00DB88;
+  font-size: 0.15rem;
+}
+.layout .billing-rules-modal .billing-rules-btn {
+  height: 0.5rem;
+  line-height: 0.5rem;
+  text-align: center;
+  margin-top: 0.24rem;
+  background: linear-gradient(90deg, #00A3FF 0%, #04F79A 100%);
+  border-radius: 0.08rem;
+  font-size: 0.12rem;
+  color: #FFFFFF;
+}
+.layout .apply-recommend-modal {
+  overflow: visible;
+}
+.layout .apply-recommend-modal .van-dialog__content {
+  padding: 0.1rem 0.28rem 0.28rem;
+}
+.layout .apply-recommend-modal .van-dialog__content > div {
+  height: 3.5rem;
+  display: flex;
+  flex-direction: column;
+}
+.layout .apply-recommend-modal .van-dialog__content > div .apply-recommend-title {
+  font-size: 0.16rem;
+  font-weight: 500;
+  color: #363636;
+}
+.layout .apply-recommend-modal .van-dialog__content > div .apply-recommend-list {
+  flex: 1;
+  overflow-y: auto;
+  margin-top: 0.16rem;
+}
+.layout .apply-recommend-modal .van-dialog__content > div .apply-recommend-list::-webkit-scrollbar {
+  display: none;
+}
+.layout .apply-recommend-modal .van-dialog__content > div .apply-recommend-list .left {
+  width: calc(100% - 0.68rem);
+}
+.layout .apply-recommend-modal .van-dialog__content > div .apply-recommend-list .left > img {
+  width: 0.36rem;
+  height: 0.36rem;
+}
+.layout .apply-recommend-modal .van-dialog__content > div .apply-recommend-list .left > div {
+  width: calc(100% - 0.36rem);
+  padding-left: 0.1rem;
+  box-sizing: border-box;
+}
+.layout .apply-recommend-modal .van-dialog__content > div .apply-recommend-list .left .title {
+  width: 100%;
+  font-size: 0.16rem;
+  color: #363636;
+  max-width: 100%;
+}
+.layout .apply-recommend-modal .van-dialog__content > div .apply-recommend-list .left .download-num {
+  font-size: 0.12rem;
+  color: #757580;
+}
+.layout .apply-recommend-modal .van-dialog__content > div .apply-recommend-list .right > div {
+  width: 0.68rem;
+  height: 0.3rem;
+  line-height: 0.3rem;
+  text-align: center;
+  background: linear-gradient(90deg, #00A3FF 0%, #04F79A 100%);
+  border-radius: 0.08rem;
+  font-size: 0.12rem;
+  color: #FFFFFF;
+}
+.layout .apply-recommend-modal .van-dialog__content > div .apply-recommend-btn {
+  height: 0.5rem;
+  line-height: 0.5rem;
+  margin-top: 0.14rem;
+  background: linear-gradient(225deg, #FF62F8 0%, #FF9D5C 100%);
+  border-radius: 0.08rem;
+  font-size: 0.12rem;
+  color: #FFFFFF;
+}
+.layout .apply-recommend-modal .van-dialog__content .apply-recommend-close {
+  bottom: -12%;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 0.38rem;
+  height: 0.38rem;
+}
+.layout .paste-version-modal {
+  background-color: transparent;
+  overflow: visible;
+}
+.layout .paste-version-modal .van-dialog__content {
+  background-color: rgba(0, 0, 0, 0.6);
+  display: flex;
+  flex-direction: column;
+  height: 2.7rem;
+  padding-bottom: 0.28rem;
+  border-radius: 0.16rem;
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-title {
+  height: 0.48rem;
+  line-height: 0.48rem;
+  font-size: 0.16rem;
+  margin: 0 0.18rem;
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-title > span:first-child {
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-title .paste-version-clear {
+  position: absolute;
+  top: 52%;
+  transform: translateY(-52%);
+  right: 0;
+  height: 0.2rem;
+  line-height: 0.2rem;
+  padding: 0 0.1rem;
+  font-size: 0.12rem;
+  background: #3666f2;
+  border-radius: 0.03rem;
+  color: #ffffff;
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-list {
+  flex: 1;
+  overflow-y: auto;
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-list .van-swipe-cell {
+  margin: 0 0.18rem;
+  box-sizing: border-box;
+  height: 0.32rem;
+  line-height: 0.32rem;
+  text-align: center;
+  font-size: 0.13rem;
+  color: #666;
+  background-color: #fff;
+  border-radius: 0.05rem;
+  overflow: hidden;
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-list .van-swipe-cell .van-swipe-cell__wrapper {
+  width: 100%;
+  height: 100%;
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-list .van-swipe-cell .ellipsis {
+  width: 100%;
+  height: 100%;
+  padding: 0 0.1rem;
+  box-sizing: border-box;
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-list::-webkit-scrollbar {
+  display: none;
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-list .paste-version-delete {
+  width: 0.4rem;
+  height: 100%;
+  border: none;
+  background: #f04646;
+  color: #fff;
+  font-size: 0.12rem;
+  text-align: center;
+  border-radius: 0 0.05rem 0.05rem 0;
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-close {
+  width: 0.38rem;
+  height: 0.38rem;
+  bottom: -20%;
+  left: 50%;
+  transform: translateX(-50%);
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-empty img {
+  width: 1.28rem;
+  height: 1.6rem;
+}
+.layout .paste-version-modal .van-dialog__content .paste-version-empty > div > div {
+  margin-top: 0.09rem;
+  font-size: 0.15rem;
+}
+.layout .resolution-ratio-modal {
+  background-color: transparent;
+}
+.layout .resolution-ratio-modal .van-dialog__content > div {
+  padding: 0.01rem;
+  background: linear-gradient(180deg, rgb(118, 204, 255), rgb(195, 40, 255));
+  overflow: hidden;
+  border-radius: 0.2rem;
+}
+.layout .resolution-ratio-modal .van-dialog__content > div > div {
+  height: 100%;
+  padding: 0;
+  display: flex;
+  flex-direction: column;
+  overflow: hidden;
+  border-radius: 0.2rem;
+  color: rgba(255, 255, 255, 0.6);
+  background-color: #000000;
+  font-size: 0.16rem;
+}
+.layout .resolution-ratio-modal .van-dialog__content > div > div .resolution-ratio-btn {
+  padding: 0.1rem 0.19rem;
+  border-bottom: 0.01rem solid rgba(255, 255, 255, 0.2);
+}
+.layout .resolution-ratio-modal .van-dialog__content > div > div .resolution-ratio-btn > div:last-child {
+  color: #fff;
+}
+.layout .resolution-ratio-modal .van-dialog__content > div > div .resolution-ratio-list {
+  padding: 0.15rem 0;
+  font-size: 0.14rem;
+}
+.layout .resolution-ratio-modal .van-dialog__content > div > div .resolution-ratio-list > div {
+  display: flex;
+  line-height: 0.43rem;
+  justify-content: center;
+}
+.layout .resolution-ratio-modal .van-dialog__content > div > div .resolution-ratio-list > div.active {
+  font-size: 0.16rem;
+  color: #fff;
+  background: url(../../static/img/phone-size-active.png) no-repeat center center;
+  background-size: 60% 100%;
+}
+.layout .renewal-duration-modal img {
+  width: 1.04rem;
+  height: 1.4rem;
+}
+.layout .renewal-duration-modal .renewal-duration-title {
+  margin-top: 0.07rem;
+  font-size: 0.18rem;
+  font-weight: 600;
+  color: #363636;
+}
+.layout .renewal-duration-modal .renewal-duration-tip {
+  margin-top: 0.07rem;
+  font-size: 0.14rem;
+  color: #757580;
+}
+.layout .renewal-duration-modal .renewal-duration-btn {
+  height: 0.5rem;
+  line-height: 0.5rem;
+  text-align: center;
+  background: linear-gradient(90deg, #00A3FF 0%, #04F79A 100%);
+  border-radius: 0.08rem;
+  font-size: 0.12rem;
+  color: #FFFFFF;
+  margin: 0.28rem;
+}
+.layout .copy-text-modal {
+  color: #000;
+  padding: 0.1rem;
+}
+.layout .copy-text-modal .van-field__control {
+  border: 0.01rem solid rgba(214, 209, 209, 0.4941176471);
+  border-radius: 0.16rem;
+  padding: 0.1rem;
+}
+
+.timing {
+  top: 2%;
+  right: 5%;
+  padding: 0.06rem 0.05rem 0.06rem 0.09rem;
+  background: rgba(0, 0, 0, 0.6);
+  border-radius: 0.3rem;
+  font-size: 0.14rem;
+  z-index: 1;
+}
+.timing > div {
+  vertical-align: middle;
+  height: 0.2rem;
+  line-height: 0.2rem;
+}
+.timing > div::after {
+  border-right: 0.01rem solid #FFFFFF;
+  content: "";
+  width: 0.02rem;
+  height: 45%;
+  display: inline-block;
+  vertical-align: middle;
+  margin-bottom: 0.03rem;
+  padding: 0 0.03rem;
+  opacity: 0.3;
+}
+.timing > img {
+  width: 0.2rem;
+  height: 0.2rem;
+}
+
+.levitated-sphere {
+  position: fixed;
+  z-index: 1;
+}
+.levitated-sphere img {
+  width: 0.42rem;
+  height: 0.42rem;
+}

BIN
static/rtcEngine/img/close.png


BIN
static/rtcEngine/img/countdown.png


BIN
static/rtcEngine/img/guanbi_icon@2x.png


BIN
static/rtcEngine/img/jianqieban_pic@2x.png


BIN
static/rtcEngine/img/smallBell.png


+ 804 - 0
static/rtcEngine/js/WXtrialInterface.js

@@ -0,0 +1,804 @@
+
+import request from './request.js'
+import { clickCopyText, pasteText } from './common.js'
+// 禁止双击缩放
+document.addEventListener('dblclick', function (e) {
+    e.preventDefault();
+});
+const { Dialog, Toast } = vant
+Toast.setDefaultOptions({ duration: 2000 });
+// 从 CLOUD_GAME_SDK 结构中解构必要的函数和常量
+const RtcEngineSDK = window.rtc_sdk.CloudGameSdk
+// 业务通道定时标识
+let doConnectDirectivesIntervalerPing = null
+// 获取云机数据定时标识
+let getUserCardInfoTimerInterval = null
+let getUserCardInfoRequestNum = 1
+let doConnectDirectivesRequestNum = 1
+let doConnectDirectivesTimerInterval = null
+// 触碰间隔定时标识
+let noOperationSetTimeoutTimeInterval = null
+let noOperationSetIntervalTimeInterval = null
+// 倒计时定时标识
+let countdownTimeInterval = null
+// let vc = new VConsole()
+const app = new Vue({
+    el: '#app',
+    data: {
+        // 底部按钮
+        footerBtn: [{
+            key: 'task',
+            img: '../static/img/wx/gengduo_icon.png'
+        }, {
+            key: 'home',
+            img: '../static/img/wx/home_icon.png'
+        }, {
+            key: 'onBack',
+            img: '../static/img/wx/fanhui_icon.png'
+        }],
+        // 宽高
+        width: 0,
+        height: 0,
+        // webRtc实例
+        engine: {},
+        // 横竖屏幕 false是竖
+        isLandscape: false,
+        // 悬浮球位置
+        levitatedSpherePositionData: {},
+        // 右侧弹窗
+        levitatedSphereVisible: false,
+        // 清晰度数据
+        definitionList: [{
+            name: '高清',
+            value: 2800
+        }, {
+            name: '标清',
+            value: 2200,
+        }, {
+            name: '极速',
+            value: 1800,
+        }],
+        // 选中的清晰度
+        definitionValue: '',
+        // 分辨率
+        resolutionRatioVisible: false,
+        resolutionRatioList: [],
+        // 需要用到的参数
+        parametersData: {},
+        // 屏幕分辨率
+        phoneSize: {},
+        // 业务指令通道实例
+        doConnectDirectivesWs: null,
+        // 粘贴版
+        pasteVersionVisible: false,
+        pasteVersionList: [],
+        // 复制内容
+        copyTextValue: '',
+        copyTextVisible: false,
+        // 卡数据
+        userCardInfoData: {},
+        // 是否显示计时
+        timingVisible: false,
+        // 计费规则
+        billingRulesVisible: false,
+        applyRecommendVisible: false,
+        // 是否是启动不操作自动退出云机功能
+        isFiringNoOperationSetTimeout: false,
+        // 超过指定触碰时间的弹窗
+        noOperationSetTimeoutTimeVisible: false,
+        // 超过指定触碰时间的弹窗文案
+        confirmButtonText: '',
+        // 云机剩余时长
+        countdownTime: 0,
+        // 是否支持webRTC
+        isSupportRtc: !!(
+            typeof RTCPeerConnection !== 'undefined' &&
+            typeof RTCIceCandidate !== 'undefined' &&
+            typeof RTCSessionDescription !== 'undefined'
+        ),
+        // 推荐列表
+        recommendList: [],
+        layoutViewWidth: null,
+        layoutViewHeight: null,
+        // 是否显示video
+        isShowVideo: false,
+        plugFlowStartTime: null,
+        obtainCardInfoStartTime: null
+    },
+    created() {
+        this.initConfig()
+    },
+    mounted() {
+        this.getUserCardInfo()
+    },
+    computed: {
+        // 右侧弹框退出相关按钮
+        exitList() {
+            let arr = [{
+                name: '剪贴版',
+                key: "shearplate",
+                img: '../static/img/wx/jianqieban_icon.png'
+            }, {
+                name: '退出',
+                key: 'signout',
+                img: '../static/img/wx/tuichu_icon.png'
+            }]
+            if ([1, 2, 3].includes(+this.parametersData.userCardType)) {
+                arr.push({
+                    name: '退出并下机',
+                    key: 'dormant',
+                    img: '../static/img/wx/tuichu_icon.png'
+                })
+            }
+            return arr
+        },
+
+        rtcMediaPlayerStyle() {
+            let obj = {
+                objectFit: "fill"
+            }
+            if (this.isLandscape) {
+                obj = {
+                    width: `${this.layoutViewHeight}px`,
+                    height: `${this.layoutViewWidth}px`,
+                    left: '50%',
+                    top: '50%',
+                    transform: 'translate(-50%, -50%) rotate(90deg)'
+                }
+            }
+
+            return obj
+        }
+    },
+    methods: {
+        // 初始化
+        initConfig() {
+            // 获取窗口尺寸
+            this.getInitSize()
+            let levitatedSpherePositionData = localStorage.getItem('levitatedSpherePositionData')
+            let definitionValue = localStorage.getItem('definitionValue')
+            // 悬浮球位置
+            this.levitatedSpherePositionData = levitatedSpherePositionData ? JSON.parse(levitatedSpherePositionData) : { right: '15px', top: '15px' }
+            // 清晰度
+            this.definitionValue = definitionValue ? +definitionValue : 2200
+            // 获取参数
+            this.parametersData = getParameters()
+            let { token, validTime } = this.parametersData
+            // 给api增加需要的参数
+            request.defaults.headers.Authorization = token
+            request.defaults.headers.versionname = '5.8.7'
+            window.onresize = () => {
+                this.getInitSize()
+            }
+        },
+
+        // 连接webRTC
+        connectWebRtc() {
+            console.time('获取推流响应消耗时间:')
+            this.plugFlowStartTime = +new Date()
+            const { sn: topic, cardToken: authToken, internetHttps, internetHttp, webrtcTransferCmnet, webrtcTransferTelecom, webrtcTransferUnicom } = this.userCardInfoData;
+            const isWss = location.protocol === 'https:'
+            const url = `${isWss ? 'wss://' : 'ws://'}${isWss ? internetHttps : internetHttp}/nats`;
+            const ICEServerUrl = [
+                { "CMNET": webrtcTransferCmnet || '' }, // 移动
+                { 'CHINANET-GD': webrtcTransferTelecom || '' }, // 电信
+                { 'UNICOM-GD': webrtcTransferUnicom || '' }, // 联通
+            ];
+            const connection = {
+                name: "猪猪令是猪",
+                topic, // 云机ID 必填
+                url,  //信令服务地址  必填
+                ICEServerUrl,
+                width: 720, // 推流视频宽度  必填
+                height: 1280,  // 推流视频高度  必填
+                // cardWidth: this.phoneSize.width || 1080,  // 云机系统分辨率 宽  必填
+                // cardHeight: this.phoneSize.height || 1920, // 云机系统分辨率 高  必填
+                // cardDensity: this.phoneSize.dpi || 480, // 云机系统显示 密度  必填
+                cardWidth: 0,  // 云机系统分辨率 宽  必填
+                cardHeight: 0, // 云机系统分辨率 高  必填
+                cardDensity: 0, // 云机系统显示 密度  必填
+                authToken,  //拉流鉴权 token  必填
+                bitrate: 6000,  //码率 必填
+                fps: 30, //必填
+                callback: this.statusCallBack,//回调函数 必填
+            };
+            // 初始化 SDK
+            this.engine = new RtcEngineSDK(connection);
+            this.engine.RtcEngine()
+        },
+
+        // webRTC状态回调
+        statusCallBack(event) {
+            if (event.type !== 'StreamStates') {
+                // console.log("链接的状态", event, event.val);
+            }
+            switch (event.type) {
+                case "screenChange":
+                    // 0:横屏 1:竖屏
+                    console.log("屏幕方向变化事件:" + event.val);
+                    this.isLandscape = event.val === 0;
+                    break;
+                case "wsState":
+                    // “TIMEOUT”:nats链接超时
+                    // success 链接成功
+                    const status = ["TIMEOUT", "failed"]
+                    if (status.includes(event.val)) {
+                        Dialog.alert({
+                            title: '提示',
+                            message: '链接超时',
+                            confirmButtonText: '确定',
+                            confirmButtonColor: '#3cc51f',
+                            beforeClose: (action, done) => {
+                                this.exit()
+                                done()
+                            }
+                        })
+                    }
+                    break;
+                case "rtcState":
+                    // “connected”:rtc链接成功 “failed”:rtc链接失败 “closed”:rtc链接关闭 “disconnected”:rtc链接超时
+                    if (event.val === "connected") {
+                        Toast.clear();
+                        this.doConnectDirectives()
+                        this.isShowVideo = true
+                        this.$refs.rtcMediaPlayer.muted = true
+                        this.$refs.rtcMediaPlayer.play()
+                        let ms = +new Date - this.plugFlowStartTime
+                        console.timeEnd('获取推流响应消耗时间:')
+                        console.log(`获取推流响应消耗时间:${ms / 1000}秒`)
+                        this.definitionFun(this.definitionValue)
+                        this.pushflowPopup()
+                        this.getResidueTime()
+                        return
+                    }
+                    if (event.val === "connecting") return
+                    this.exit()
+                    break;
+                case "AuthenticationStatus":
+                    console.log(`鉴权${event.val === "success" ? '成功' : '失败'}`);
+                    break;
+                case "StreamStates":
+                    // “currentRoundTripTime”:延迟 “lostRate”:丢包率 “seconds_KBytes”:带宽 “framesPerSecond”:帧率
+                    // ballPosition.value = event.val
+                    // console.log(event.val)
+                    break;
+                case 'videoResolution': // 云机视频分辨率
+                    // console.log(event.val, '分辨率')
+                    break
+                case 'networkService': // 获取三网信息
+                    console.log("三网信息:", event.val);
+                    break
+                case 'networkServiceURL': // 获取三网信息
+                    console.log("三网IP地址:", event.val);
+                    break
+            }
+        },
+
+        // 悬浮球移动
+        touchmoveLevitatedSphere(e) {
+            let { pageX, pageY } = e.targetTouches[0]
+            let min = 20
+            let MaxPageX = this.width - 20
+            let MaxPageY = this.height - 20
+            pageX = pageX <= min ? min : (pageX >= MaxPageX ? MaxPageX : pageX)
+            pageY = pageY <= min ? min : (pageY >= MaxPageY ? MaxPageY : pageY)
+            this.levitatedSpherePositionData = {
+                left: `${pageX}px`,
+                top: `${pageY}px`,
+                transform: 'translate(-50%, -50%)'
+            }
+        },
+        touchendLevitatedSphere(e) {
+            localStorage.setItem('levitatedSpherePositionData', JSON.stringify(this.levitatedSpherePositionData))
+        },
+
+        // 清晰度
+        definitionFun(value) {
+            this.definitionValue = value
+            this.engine.makeBitrate && this.engine.makeBitrate(value)
+            localStorage.setItem('definitionValue', value)
+            this.levitatedSphereVisible = false
+        },
+
+        // 修改分辨率
+        resolutionRatio() {
+            request.get('/api/resources/v5/machine/resolution/getResolvingPower', { params: { userCardId: this.parametersData.userCardId } }).then(res => {
+                if (res.success) {
+                    this.resolutionRatioList = res.data.map(item => {
+                        item.height = item.high
+                        return item
+                    })
+                    this.levitatedSphereVisible = false
+                    this.resolutionRatioVisible = true
+                }
+            })
+        },
+
+        // 确定修改分辨率
+        confirmResolution() {
+            let { width, height, dpi: density } = this.phoneSize
+            this.engine.makeResolution && this.engine.makeResolution({ width, height, density })
+            this.resolutionRatioVisible = false
+        },
+
+        // 退出相关按钮操作
+        exitFun(key) {
+            switch (key) {
+                case 'dormant':
+                    Dialog.alert({
+                        title: '提示',
+                        message: '确定退出云手机并下机',
+                        confirmButtonText: '确定',
+                        confirmButtonColor: '#3cc51f',
+                        showCancelButton: true,
+                        beforeClose: (action, done) => {
+                            if (action === 'cancel') done()
+                            if (action === 'confirm') {
+                                this.downline(done)
+                            }
+                        }
+                    })
+                    break;
+                case 'shearplate':
+                    this.copyTextValue = ''
+                    pasteText().then(content => {
+                        typeof content !== 'boolean' ? this.openPasteboard(content) : this.copyTextVisible = true
+                    }, err => {
+                        this.copyTextVisible = true
+                    })
+                    break;
+                case 'signout':
+                    this.exit()
+                    break;
+            }
+        },
+
+        // 业务指令
+        doConnectDirectives() {
+            let { internetHttps, localIp, cardToken } = this.userCardInfoData
+            let cUrl = `wss://${internetHttps}/businessChannel?cardIp=${localIp}&token=${cardToken}&type=directives`
+            this.doConnectDirectivesWs = new WebSocket(cUrl);
+            this.doConnectDirectivesWs.binaryType = 'arraybuffer'
+            clearInterval(doConnectDirectivesIntervalerPing)
+
+            // 链接成功
+            this.doConnectDirectivesWs.onopen = (e) => {
+                doConnectDirectivesIntervalerPing = setInterval(() => {
+                    if (this.doConnectDirectivesWs.readyState === 1) {
+                        this.doConnectDirectivesWs.send(JSON.stringify({ type: 'ping' }));
+                    } else {
+                        clearInterval(doConnectDirectivesIntervalerPing);
+                    }
+
+                }, 3000)
+                this.doConnectDirectivesWs.send(JSON.stringify({ type: 'getVsStatus' }))
+                this.doConnectDirectivesWs.send(JSON.stringify({ type: 'bitRate', data: { bitRate: 1243000 } }))
+                this.doConnectDirectivesWs.send(JSON.stringify({ type: 'InputMethod', data: { type: 2 } }))
+                this.doConnectDirectivesWs.send(JSON.stringify({ type: 'getPhoneSize' }))
+            }
+
+            // 接受到的消息
+            this.doConnectDirectivesWs.onmessage = res => {
+                const result = typeof res.data === 'string' ? JSON.parse(res.data) : res.data;
+                switch (result.type) {
+                    // 分辨率
+                    case 'getPhoneSize':
+                    case 'setPhoneSize':
+                        let data = JSON.parse(JSON.stringify(result.data))
+                        let { width, height } = data
+                        if (width > height) {
+                            data.width = height
+                            data.height = width
+                        }
+                        this.phoneSize = data
+                        break
+                    // 云机复制过来的文本
+                    case 'reProduceText':
+                        if (navigator.clipboard) {
+                            navigator.clipboard.writeText(result.data.text);
+                        }
+                        break
+                    case 'downAdnInstallRep':
+                        Toast(result.data.msg)
+                        break
+                }
+            }
+
+            // 链接报错的回调
+            this.doConnectDirectivesWs.onerror = res => {
+                clearInterval(doConnectDirectivesTimerInterval)
+                if (doConnectDirectivesRequestNum > 6) {
+                    this.exit()
+                    return
+                }
+                doConnectDirectivesRequestNum++
+                this.doConnectDirectives()
+            }
+
+
+
+        },
+
+        // 粘贴版相关接口
+        shearContent({ type, params, queryStr }) {
+            let url = '/api/public/v5/shear/content'
+            if (queryStr) url += queryStr
+            return request[type](url, params)
+        },
+
+        // 清空全部、清除某条
+        deletePasteVersion(ids) {
+            if (!ids) {
+                Dialog.alert({
+                    title: '提示',
+                    message: '确定清空剪贴板?',
+                    confirmButtonText: '确定',
+                    confirmButtonColor: '#3cc51f',
+                    showCancelButton: true,
+                    beforeClose: (action, done) => {
+                        if (action === 'cancel') done()
+                        if (action === 'confirm') {
+                            fun.bind(this)(done)
+                        }
+                    }
+                })
+                return
+            }
+            fun.bind(this)()
+            function fun(callBack = () => { }) {
+                this.shearContent({
+                    type: 'delete', queryStr: Qs.stringify(
+                        {
+                            ids: ids ? [ids] : this.pasteVersionList.map((v) => v.id),
+                        },
+                        { arrayFormat: 'repeat', addQueryPrefix: true },
+                    )
+                }).then(res => {
+                    if (res.status === 0) {
+                        this.getPasteVersion()
+                        callBack(true)
+                    } else {
+                        callBack(false)
+                        Toast(res.msg)
+                    }
+                }).catch(() => {
+                    callBack(false)
+                })
+            }
+        },
+
+        // 获取粘贴版数据
+        getPasteVersion(callBack = () => { }) {
+            this.shearContent({ type: 'get' }).then(res => {
+                this.pasteVersionList = res.data
+                callBack(true)
+            }).catch(() => {
+                callBack(false)
+            }).finally(() => { })
+        },
+
+        // 复制弹窗是否关闭
+        beforeCloseCopy(action, done) {
+            if (action !== 'confirm') {
+                // 获取剪切板
+                this.getPasteVersion(() => {
+                    this.pasteVersionVisible = true
+                    this.levitatedSphereVisible = false
+                    done()
+                })
+                return
+            }
+            if (!this.copyTextValue) {
+                Toast('请输入复制到剪切板的内容')
+                done(false)
+                return
+            }
+
+            this.openPasteboard(this.copyTextValue, done)
+        },
+
+        // 打开粘贴板
+        async openPasteboard(content, callBack = () => { }) {
+            this.shearContent({ type: 'post', params: { content } }).then().finally(() => {
+                callBack()
+                // 获取剪切板
+                this.getPasteVersion(() => {
+                    this.pasteVersionVisible = true
+                    this.levitatedSphereVisible = false
+                })
+            })
+        },
+
+        // 复制粘贴某条数据
+        copyPasteVersiontext(e) {
+            clickCopyText(e, (event) => {
+                this.doConnectDirectivesWs.send(JSON.stringify({
+                    type: 'cutting',
+                    data: {
+                        str: event.text,
+                    },
+                }))
+                Toast('复制成功')
+            }, () => {
+                Toast('复制失败')
+            })
+        },
+
+        // 获取卡信息
+        getUserCardInfo() {
+            Toast.loading({
+                duration: 0, // 持续展示 toast
+                message: '数据加载中...',
+            });
+            this.obtainCardInfoStartTime = + new Date()
+            console.time('获取卡信息响应消耗时间:')
+            let { userCardId } = this.parametersData
+            userCardId = +userCardId
+            const statusTips = {
+                5200: '网络异常,请稍后重试',
+                5220: '云手机正在一键修复中',
+                5203: '正在排队中,请稍等',
+                5204: '云机异常,正在为你重新分配云机'
+            }
+            request.post('/api/resources/user/cloud/connect', { userCardId }).then(async res => {
+                const { isWeixin } = this.parametersData;
+                switch (res.status) {
+                    case 0:
+                        getUserCardInfoRequestNum = 1
+                        // 不支持webRTC跳转到指定的页面
+                        if (!res.data.isWebrtc) {
+                            location.replace(`${location.origin}/h5/webRtcYJ/WXtrialInterface.html${location.search}`)
+                            return
+                        }
+                        if (!this.isSupportRtc) {
+                            Dialog.alert({
+                                title: '提示',
+                                message: `${+isWeixin ? '微信小程序' : ''}当前版本暂不支持使用,可下载谷歌浏览器或双子星客户端进行使用`,
+                                confirmButtonText: '确定',
+                                confirmButtonColor: '#3cc51f',
+                                beforeClose: (action, done) => {
+                                    this.exit()
+                                    done()
+                                }
+                            })
+                            return
+                        }
+                        this.userCardInfoData = res.data
+                        let ms = + new Date() - this.obtainCardInfoStartTime
+                        console.timeEnd('获取卡信息响应消耗时间:')
+                        console.log(`获取卡信息响应消耗时间:${ms / 1000}秒`)
+                        this.connectWebRtc()
+                        return
+                    case 5200:
+                    case 5220:
+                    case 5203:
+                    case 5204:
+                        if (res.status === 5200) {
+                            reconnect.bind(this)()
+                            return
+                        }
+                        Toast(statusTips[res.status])
+                        break
+                    default:
+                        Toast('画面异常,请重新进入')
+                        break
+                }
+                setTimeout(() => {
+                    this.exit()
+                }, 3000)
+            })
+
+            function reconnect() {
+                if (getUserCardInfoRequestNum > 6) {
+                    Toast('网络异常,请稍后重试')
+                    clearTimeout(getUserCardInfoTimerInterval)
+                    setTimeout(() => {
+                        this.exit()
+                    }, 3000)
+                    return
+                }
+
+                getUserCardInfoTimerInterval = setTimeout(() => {
+                    this.getUserCardInfo()
+                    getUserCardInfoRequestNum++
+                }, 3000)
+            }
+        },
+
+        // 超过指定触碰时间是否提示关闭链接
+        pushflowPopup() {
+            request.get('/api/public/v5/pushflow/popup').then(res => {
+                if (res.success) {
+                    this.isFiringNoOperationSetTimeout = res.data
+                    this.noOperationSetTimeout()
+                }
+            })
+        },
+
+        // 退出功能
+        exit() {
+            this.engine.disconnect && this.engine.disconnect();
+            this.doConnectDirectivesWs && this.doConnectDirectivesWs.close()
+            uni.reLaunch({
+                url: '/pages/index/index'
+            });
+        },
+
+        // 不触碰屏幕显示退出链接弹窗
+        noOperationSetTimeout(key) {
+            if (!this.isFiringNoOperationSetTimeout) return
+            clearTimeout(noOperationSetTimeoutTimeInterval)
+            if (key === 'cancel') {
+                clearInterval(noOperationSetIntervalTimeInterval)
+                this.noOperationSetTimeoutTimeVisible = false
+                this.noOperationSetTimeout()
+                return
+            }
+            noOperationSetTimeoutTimeInterval = setTimeout(() => {
+                let index = 9
+                this.confirmButtonText = '退出(10秒)'
+                this.noOperationSetTimeoutTimeVisible = true
+                noOperationSetIntervalTimeInterval = setInterval(() => {
+                    this.confirmButtonText = `退出${index ? `(${index}秒)` : ''}`
+                    index--
+                    if (index < 0) {
+                        this.noOperationSetTimeout('cancel')
+                        this.exit()
+                    }
+                }, 1000)
+            }, 300000)
+        },
+
+        // 获取云机剩余时长
+        async getResidueTime() {
+            clearInterval(countdownTimeInterval)
+            const { userCardType, isShowCountdown, isShowRule } = this.parametersData
+            const { userCardId } = this.userCardInfoData
+            if (![1, 2, 3].includes(+userCardType)) return
+            const res = await request.get(`/api/resources/yearMember/getResidueTime?userCardId=${userCardId}`)
+            let time = res.data;
+            if (!res.status) {
+                this.countdownTime = residueTimeStamp(time)
+                await request.get(`/api/resources/yearMember/startTime?userCardId=${userCardId}`)
+                if (+isShowCountdown) this.timingVisible = true
+                if (+isShowRule) this.billingRulesVisible = true
+                countdownTimeInterval = setInterval(() => {
+                    if (time <= 0) {
+                        clearInterval(countdownTimeInterval)
+                        this.downline()
+                        return
+                    }
+                    time--
+                    this.countdownTime = residueTimeStamp(time)
+                }, 1000)
+            }
+        },
+
+
+        // 关闭倒计时弹窗
+        handlecountdownTimeClose() {
+            const { userCardId } = this.userCardInfoData
+            request.get(`/api/resources/yearMember/closeRemind?userCardId=${userCardId}`).then(res => {
+                if (!res.status) {
+                    clearInterval(countdownTimeInterval)
+                    this.timingVisible = false
+                    return
+                }
+                Toast(res.msg);
+            })
+        },
+
+        // 退出并下机
+        downline(fun = () => { }) {
+            const { userCardId } = this.userCardInfoData
+            request.get(`/api/resources/yearMember/downline?userCardId=${userCardId}`).then(res => {
+                if (!res.status) {
+                    fun(true)
+                    // 通信给h5项目告知是退出并下机
+                    parent.postMessage(
+                        {
+                            type: 'exit',
+                        },
+                        '*',
+                    );
+                    uni.postMessage({
+                        data: {
+                            type: 'exit'
+                        }
+                    });
+                    this.exit()
+                    return
+                }
+                fun(false)
+                Toast(res.msg);
+            })
+        },
+
+        // 获取推荐列表
+        getRecommend() {
+            const { userCardId } = this.userCardInfoData
+            request.get(`/api/public/v1/market/get/recommend?userCardId=${userCardId}`).then(res => {
+                if (!res.status) {
+                    this.billingRulesVisible = false
+                    this.recommendList = res.data
+                    this.recommendList.length && (this.applyRecommendVisible = true)
+                }
+            })
+        },
+
+        // 下载apk
+        downAndInstallApk({ downloadUrl: apkUrl, id: taskUid }) {
+            this.doConnectDirectivesWs.send(JSON.stringify({
+                type: 'downAndInstallApk',
+                data: {
+                    apkUrl,
+                    taskUid
+                },
+            }))
+        },
+        // 移开手指时会发生的回调
+        touchendRtcMediaPlayer(event) {
+            this.engine.touchClick && this.engine.touchClick(event, 1, true)
+            this.noOperationSetTimeout()
+        },
+
+        // 返回、主页、任务器
+        footerBtnFun(key) {
+            this.engine[key] && this.engine[key]()
+            this.noOperationSetTimeout()
+        },
+
+        // 获取初始化尺寸
+        getInitSize() {
+            // 高度、悬浮球相关配置
+            this.height = window.innerHeight
+            this.width = window.innerWidth
+            this.$nextTick(() => {
+                // 云机画面宽高
+                let layoutView = document.querySelector('.layout-view')
+                this.layoutViewWidth = layoutView.offsetWidth
+                this.layoutViewHeight = layoutView.offsetHeight
+            })
+        },
+
+        // 音量
+        volumeControl(value) {
+            this.engine.ExexuteKeyBoard && this.engine.ExexuteKeyBoard(value)
+            this.$refs.rtcMediaPlayer && (this.$refs.rtcMediaPlayer.muted = false)
+        }
+    }
+})
+
+
+// 获取URL参数
+function getParameters() {
+    let arr = location.search.split('?')
+    let obj = {}
+    if (arr[1]) {
+        arr = arr[1].split('&')
+        arr.forEach(item => {
+            let [key, value = ''] = item.split('=')
+            obj[key] = value
+        })
+    }
+    return obj
+}
+
+// 倒计时处理的时间
+function residueTimeStamp(value) {
+    let theTime = value;//秒
+    let middle = 0;//分
+    let hour = 0;//小时
+    if (theTime > 59) {
+        middle = parseInt(theTime / 60);
+        theTime = parseInt(theTime % 60);
+    }
+    if (middle > 59) {
+        hour = parseInt(middle / 60);
+        middle = parseInt(middle % 60);
+    }
+    theTime < 10 ? theTime = '0' + theTime : theTime = theTime
+    middle < 10 ? middle = '0' + middle : middle = middle
+    hour < 10 ? hour = '0' + hour : hour = hour
+    return hour + ':' + middle + ':' + theTime
+}

+ 23 - 0
static/rtcEngine/js/common.js

@@ -0,0 +1,23 @@
+
+
+// 点击复制文本
+export function clickCopyText(event, success, error) {
+    var clipboard = new ClipboardJS(event.target, {
+        text: function () {
+            return event.target.innerText;
+        },
+    });
+    clipboard.on('success', (e) => {
+        success(e)
+        clipboard.destroy()
+    });
+
+    clipboard.on('error', error);
+    clipboard.onClick(event)
+}
+
+// 粘贴文本
+export function pasteText(e) {
+    if (window.navigator.clipboard) return window.navigator.clipboard.readText()
+    return Promise.resolve(false)
+}

+ 22 - 0
static/rtcEngine/js/request.js

@@ -0,0 +1,22 @@
+// htmll里面已经引入了axios
+const instance = axios.create({});
+
+// 添加请求拦截器
+instance.interceptors.request.use(function (config) {
+    // 在发送请求之前做些什么
+    return config;
+}, function (error) {
+    // 对请求错误做些什么
+    return Promise.reject(error);
+});
+
+// 添加响应拦截器
+instance.interceptors.response.use(function (response) {
+    // 对响应数据做点什么
+    return response.data;
+}, function (error) {
+    // 对响应错误做点什么
+    return Promise.reject(error);
+});
+
+export default instance

+ 580 - 0
static/rtcEngine/scss/WXtrialInterface.scss

@@ -0,0 +1,580 @@
+@function toREM($px) {
+    @return $px/100*1rem
+}
+
+$uiwidth: 375;
+
+html {
+    font-size: (100/$uiwidth) * 100vw;
+
+    @media screen and (max-width: 320px) {
+        font-size: 80px;
+    }
+
+    @media screen and (min-width: 750px) {
+        font-size: 120px;
+    }
+}
+
+.flex-center-all {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.flex-align-c {
+    display: flex;
+    align-items: center;
+}
+
+.tc {
+    text-align: center;
+}
+
+.pfi {
+    position: fixed;
+}
+
+.pab {
+    position: absolute
+}
+
+.pre {
+    position: relative;
+}
+
+.flex {
+    display: flex;
+}
+
+.flex-1 {
+    flex: 1;
+}
+
+.flex-column {
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+}
+
+.flex-column-container {
+    flex: 1;
+    overflow-y: auto;
+}
+
+.flex-jub {
+    display: flex;
+    justify-content: space-between;
+}
+
+.mb-20 {
+    margin-bottom: toREM(20);
+}
+
+.mb-15 {
+    margin-bottom: toREM(15);
+}
+
+[v-cloak] {
+    display: none;
+}
+
+.ellipsis {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+
+.w100 {
+    width: 100%;
+}
+
+.h100 {
+    height: 100%;
+}
+
+.fl {
+    float: left;
+}
+
+.fr {
+    float: right;
+}
+
+.mt-16 {
+    margin-top: toREM(16);
+}
+
+.mb-5 {
+    margin-bottom: toREM(5);
+}
+
+#app {
+    font-size: toREM(12);
+    color: #fff;
+}
+
+.layout {
+    background-color: #000;
+    font-size: toREM(12);
+
+    .layout-view {
+        height: calc(100% - toREM(60));
+        width: 100%;
+        position: relative;
+
+        .videoRotate {
+            position: absolute;
+            left: 0;
+            top: 0;
+            display: block;
+            object-fit: fill;
+        }
+    }
+
+    .layout-footer {
+        display: grid;
+        grid-template-columns: repeat(3, 1fr);
+        text-align: center;
+        height: toREM(60);
+
+        img {
+            margin: auto;
+            width: toREM(30);
+            height: toREM(30);
+        }
+    }
+
+    // 右侧抽屉框
+    .levitated-sphere-overlay {
+        height: calc(100% - toREM(60));
+        background-color: transparent;
+    }
+
+    .levitated-sphere-drawer {
+        top: 45.5%;
+        height: calc(100% - toREM(60));
+        max-height: none !important;
+        min-width: toREM(70);
+        color: #fff;
+        background-color: rgba(2, 2, 6, .5);
+        padding: toREM(30) toREM(10) 0;
+        box-sizing: border-box;
+
+        .drawer-item {
+            line-height: toREM(30);
+            border-radius: toREM(3);
+            -moz-user-select: none;
+            -webkit-user-select: none;
+            -ms-user-select: none;
+            -khtml-user-select: none;
+            user-select: none;
+
+            &.active {
+                background: rgba(255, 255, 255, 1);
+                color: #000;
+            }
+        }
+
+        .exit {
+            line-height: toREM(30);
+
+            img {
+                width: toREM(24);
+                height: toREM(24);
+            }
+        }
+    }
+
+    // 计时规则
+    .billing-rules-modal {
+        text-align: center;
+        font-size: toREM(14);
+        color: #757580;
+        text-align: center;
+
+        .van-dialog__content {
+            padding: 0 toREM(28) toREM(28);
+        }
+
+        .billing-rules-img {
+            width: toREM(104);
+            height: toREM(140);
+        }
+
+        .billing-rules-title {
+            font-size: toREM(18);
+            font-weight: 600;
+            color: #363636;
+            margin-bottom: toREM(5);
+        }
+
+        .billing-rules-tips {
+            margin-top: toREM(5);
+        }
+
+        .billing-rules-time {
+            color: #00DB88;
+            font-size: toREM(15);
+        }
+
+        .billing-rules-btn {
+            height: toREM(50);
+            line-height: toREM(50);
+            text-align: center;
+            margin-top: toREM(24);
+            background: linear-gradient(90deg, #00A3FF 0%, #04F79A 100%);
+            border-radius: toREM(8);
+            font-size: toREM(12);
+            color: #FFFFFF;
+        }
+    }
+
+    // 应用推荐
+    .apply-recommend-modal {
+        overflow: visible;
+
+        .van-dialog__content {
+            padding: toREM(10) toREM(28) toREM(28);
+
+            &>div {
+                height: toREM(350);
+                display: flex;
+                flex-direction: column;
+
+                .apply-recommend-title {
+                    font-size: toREM(16);
+                    font-weight: 500;
+                    color: #363636;
+                }
+
+
+                .apply-recommend-list {
+                    flex: 1;
+                    overflow-y: auto;
+                    margin-top: toREM(16);
+
+                    &::-webkit-scrollbar {
+                        display: none;
+                    }
+
+                    .left {
+                        width: calc(100% - toREM(68));
+
+                        &>img {
+                            width: toREM(36);
+                            height: toREM(36);
+                        }
+
+                        &>div {
+                            width: calc(100% - toREM(36));
+                            padding-left: toREM(10);
+                            box-sizing: border-box;
+                        }
+
+                        .title {
+                            width: 100%;
+                            font-size: toREM(16);
+                            color: #363636;
+                            max-width: 100%;
+                        }
+
+                        .download-num {
+                            font-size: toREM(12);
+                            color: #757580;
+                        }
+
+
+                    }
+
+                    .right {
+                        &>div {
+                            width: toREM(68);
+                            height: toREM(30);
+                            line-height: toREM(30);
+                            text-align: center;
+                            background: linear-gradient(90deg, #00A3FF 0%, #04F79A 100%);
+                            border-radius: toREM(8);
+                            font-size: toREM(12);
+                            color: #FFFFFF;
+                        }
+                    }
+                }
+
+                .apply-recommend-btn {
+                    height: toREM(50);
+                    line-height: toREM(50);
+                    margin-top: toREM(14);
+                    background: linear-gradient(225deg, #FF62F8 0%, #FF9D5C 100%);
+                    border-radius: toREM(8);
+                    font-size: toREM(12);
+                    color: #FFFFFF;
+                }
+
+            }
+
+
+            .apply-recommend-close {
+                bottom: -12%;
+                left: 50%;
+                transform: translateX(-50%);
+                width: toREM(38);
+                height: toREM(38);
+            }
+        }
+    }
+
+    // 粘贴版
+    .paste-version-modal {
+        background-color: transparent;
+        overflow: visible;
+
+        .van-dialog__content {
+            background-color: rgba(0, 0, 0, 0.6);
+            display: flex;
+            flex-direction: column;
+            height: toREM(270);
+            padding-bottom: toREM(28);
+            border-radius: toREM(16);
+
+            .paste-version-title {
+                height: toREM(48);
+                line-height: toREM(48);
+                font-size: toREM(16);
+                margin: 0 toREM(18);
+
+                &>span:first-child {
+                    top: 50%;
+                    left: 50%;
+                    transform: translate(-50%, -50%);
+                }
+
+                .paste-version-clear {
+                    position: absolute;
+                    top: 52%;
+                    transform: translateY(-52%);
+                    right: 0;
+                    height: toREM(20);
+                    line-height: toREM(20);
+                    padding: 0 toREM(10);
+                    font-size: toREM(12);
+                    background: #3666f2;
+                    border-radius: toREM(3);
+                    color: #ffffff;
+                }
+            }
+
+            .paste-version-list {
+                flex: 1;
+                overflow-y: auto;
+
+                & .van-swipe-cell {
+                    margin: 0 toREM(18);
+                    box-sizing: border-box;
+                    height: toREM(32);
+                    line-height: toREM(32);
+                    text-align: center;
+                    font-size: toREM(13);
+                    color: #666;
+                    background-color: #fff;
+                    border-radius: toREM(5);
+                    overflow: hidden;
+
+                    .van-swipe-cell__wrapper {
+                        width: 100%;
+                        height: 100%;
+                    }
+
+                    .ellipsis {
+                        width: 100%;
+                        height: 100%;
+                        padding: 0 toREM(10);
+                        box-sizing: border-box;
+                    }
+                }
+
+                &::-webkit-scrollbar {
+                    display: none;
+                }
+
+
+                .paste-version-delete {
+                    width: toREM(40);
+                    height: 100%;
+                    border: none;
+                    background: #f04646;
+                    color: #fff;
+                    font-size: toREM(12);
+                    text-align: center;
+                    border-radius: 0 toREM(5) toREM(5) 0;
+                }
+            }
+
+            .paste-version-close {
+                width: toREM(38);
+                height: toREM(38);
+                bottom: -20%;
+                left: 50%;
+                transform: translateX(-50%);
+            }
+
+            .paste-version-empty {
+                img {
+                    width: toREM(128);
+                    height: toREM(160);
+                }
+
+                &>div>div {
+                    margin-top: toREM(9);
+                    font-size: toREM(15);
+                }
+            }
+        }
+    }
+
+    // 分辨率
+    .resolution-ratio-modal {
+        background-color: transparent;
+
+        .van-dialog__content {
+            &>div {
+                padding: toREM(1);
+                background: linear-gradient(180deg, rgba(118, 204, 255, 1), rgba(195, 40, 255, 1));
+                overflow: hidden;
+                border-radius: toREM(20);
+
+                &>div {
+                    height: 100%;
+                    padding: 0;
+                    display: flex;
+                    flex-direction: column;
+                    overflow: hidden;
+                    border-radius: toREM(20);
+                    color: rgba(255, 255, 255, 0.6);
+                    background-color: #000000;
+                    font-size: toREM(16);
+
+                    .resolution-ratio-btn {
+                        padding: toREM(10) toREM(19);
+                        border-bottom: toREM(1) solid rgba(255, 255, 255, 0.2);
+
+                        &>div:last-child {
+                            color: #fff;
+                        }
+                    }
+
+                    .resolution-ratio-list {
+                        padding: toREM(15) 0;
+                        font-size: toREM(14);
+
+                        &>div {
+                            display: flex;
+                            line-height: toREM(43);
+                            justify-content: center;
+
+                            &.active {
+                                font-size: toREM(16);
+                                color: #fff;
+                                background: url(../../static/img/phone-size-active.png) no-repeat center center;
+                                background-size: 60% 100%;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+    }
+
+    // 续费时长
+    .renewal-duration-modal {
+
+        // display: flex;
+        // flex-direction: column;
+        // align-items: center;
+        img {
+            width: toREM(104);
+            height: toREM(140);
+        }
+
+        .renewal-duration-title {
+            margin-top: toREM(7);
+            font-size: toREM(18);
+            font-weight: 600;
+            color: #363636;
+        }
+
+        .renewal-duration-tip {
+            margin-top: toREM(7);
+            font-size: toREM(14);
+            color: #757580;
+        }
+
+        .renewal-duration-btn {
+            height: toREM(50);
+            line-height: toREM(50);
+            text-align: center;
+            background: linear-gradient(90deg, #00A3FF 0%, #04F79A 100%);
+            border-radius: toREM(8);
+            font-size: toREM(12);
+            color: #FFFFFF;
+            margin: toREM(28);
+        }
+    }
+
+    .copy-text-modal {
+        color: #000;
+        padding: toREM(10);
+
+        .van-field__control {
+            border: toREM(1) solid #d6d1d17e;
+            border-radius: toREM(16);
+            padding: toREM(10);
+        }
+    }
+}
+
+// 顶部计时样式
+.timing {
+    top: 2%;
+    right: 5%;
+    padding: toREM(6) toREM(5) toREM(6) toREM(9);
+    background: rgba(0, 0, 0, 0.6);
+    border-radius: toREM(30);
+    font-size: toREM(14);
+    z-index: 1;
+
+    &>div {
+        vertical-align: middle;
+        height: toREM(20);
+        line-height: toREM(20);
+    }
+
+    &>div::after {
+        border-right: toREM(1) solid #FFFFFF;
+        content: '';
+        width: toREM(2);
+        height: 45%;
+        display: inline-block;
+        vertical-align: middle;
+        margin-bottom: toREM(3);
+        padding: 0 toREM(3);
+        opacity: .3;
+    }
+
+    &>img {
+        width: toREM(20);
+        height: toREM(20);
+    }
+}
+
+// 悬浮框
+.levitated-sphere {
+    position: fixed;
+    z-index: 1;
+
+    img {
+        width: toREM(42);
+        height: toREM(42);
+    }
+}

+ 1 - 2
static/webRtcYJ/WXdraw.js

@@ -106,7 +106,7 @@ function doConnectDirectives() {
     // 获取虚拟场景状态
     intervalerPing = setInterval(() => {
       if (wsss.readyState === 1) {
-        wsss.send('ping');
+        wsss.send(JSON.stringify({type: 'ping'}));
       } else {
         clearInterval(intervalerPing);
       }
@@ -453,7 +453,6 @@ $('.PictureQuality').on('click', function () {
   decodeWoker.postMessage(cmd); //通知解码器worker切换分辨率
   var buffer = makeSharpness(Number(id));
   webSocketWorker.postMessage(buffer);
-  engine && engine.switchShapness(Number(id))
   $('.control-right-img').attr({
     'data-id': '1',
   });

+ 2 - 104
static/webRtcYJ/WXtrialInterface.html

@@ -87,9 +87,6 @@
     </div>
     <div id="wine">
       <div id="box">
-        <!-- 默认webRTC是关闭状态的 -->
-        <video muted poster="" autoplay="autoplay" webkit-playsinline="" playsinline=""
-          style="object-fit: contain; display: none" id="playVideo"></video>
         <canvas id="playCanvas" width="450" height="800"></canvas>
       </div>
       <div class="count-view" id="countView">
@@ -351,23 +348,6 @@
     // let vc = new VConsole()
     let webSocketWorker = null
     let getResidueTimeBool = true
-    // 判断是否是苹果手机
-    let isiPhone = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent);
-    // 判断是否支持webRTC
-    let isVideo = !!(
-      typeof RTCPeerConnection !== 'undefined' &&
-      typeof RTCIceCandidate !== 'undefined' &&
-      typeof RTCSessionDescription !== 'undefined'
-    );
-    // 判断是否是uc浏览器
-    let isUc = navigator.userAgent.indexOf('UCBrowser') > -1;
-    // 判断是否是QQ浏览器
-    let isQQ = navigator.userAgent.indexOf('MQQBrowser') > -1;
-    // 判断是否是Safari浏览器
-    let isSafari = navigator.userAgent.indexOf("Safari") > -1;
-    // 如果是苹果手机、且是uc浏览器或者是QQ浏览器或者是Safari浏览器,就不显示webRTC
-    let isShowiPhoneWebRTC = isiPhone && (isUc || isQQ || isSafari)
-    let engine = null;
     // 开发环境
     var isDev =
       /^192\.168\./.test(location.host) || /^localhost/.test(location.host);
@@ -387,7 +367,6 @@
     var username = parameters['username'];
     var connectStatus = parameters['connectStatus'];
     var isTips = +parameters['isTips'];
-    var isWeixin = +parameters['isWeixin'];
     var videoTimer = null,
       videoTime = 0,
       adType = 0,
@@ -484,7 +463,7 @@
 
       request.onsuccess = function (event) {
         console.log('主键查询结果: ', request.result);
-        if (request.result && !isVideo) {
+        if (request.result) {
           socketURL = request.result.socketURL;
           cUrl = request.result.cUrl;
           cardToken = request.result.cardToken;
@@ -1219,86 +1198,8 @@
       }
       return obj;
     }
-    //状态回调以及处理
-    function statusCallBack(event) {
-      if (event.type == 'open') {
-        $('.weui-mask_transparent').hide();
-        $('.weui-toast').hide();
-        // $('.loading').hide();
-        console.log('流已经打开');
-      }
-
-      if (event.type == 'screenChange') {
-        console.log('横竖屏切换事件:' + event.val);
-      }
-
-      if (event.type == 'verifyFailed') {
-        console.log('鉴权失败');
-      }
-    }
-    function successCallback() {
-      console.log('webRTC请求成功了');
-      // 如果支持webRTC,就直接切换成webRTC的画面显示
-      $('#playVideo').show();
-      $('#playCanvas').hide();
-    }
     let extranetIp, extranetPort, connectClearSetInterval, numberOfTimes = 1;
     function doConnectBusiness(res) {
-      if (isVideo && !isShowiPhoneWebRTC && !isWeixin) {
-        var url0 = url[0]; //协议
-        let ip = res.data.internetIp; //服务器拿到的ip
-        let port = res.data.internetVideoPort; //服务器拿到的端口
-        extranetIp = res.data.internetIp;
-        extranetPort = res.data.internetVideoPort;
-
-        let rtcUrl, wsUrl;
-        if (url0 == 'https:') {
-          rtcUrl =
-            'https://' +
-            res.data.internetHttps +
-            '/webrtc?cardIp=' +
-            res.data.localIp;
-          wsUrl =
-            'wss://' +
-            res.data.internetHttps +
-            '/plugflow?cardIp=' +
-            res.data.localIp;
-        } else {
-          rtcUrl =
-            'http://' +
-            ip +
-            ':' +
-            port +
-            '/index/api/webrtc?app=live&stream=h264&type=play';
-          wsUrl = 'ws://' + ip + ':' + port + '/plugflow';
-        }
-        let token = res.data.cardToken;
-        let videoId = 'playVideo';
-        let mode = 'webrtc'; //指定解码模式, 目前支持mse、webrtc
-        // let ip = res.data.internetIp; //服务器拿到的ip
-        // let port = res.data.internetVideoPort; //服务器拿到的端口
-        // let rtcUrl = "http://" + ip + ":" + port + "/index/api/webrtc?app=live&stream=test&type=play";
-        // let wsUrl = "ws://" + ip + ":" + port + '/plugflow';
-        // let token = res.data.cardToken;
-        // let videoId = "playCanvas";
-        // let mode = "webrtc"; //指定解码模式, 目前支持mse、webrtc
-        let option = {
-          url: wsUrl, //websocket url
-          rtcUrl: rtcUrl, //webrtc 推流地址,webrtc 推流时必须要填
-          token: token, //用于校验的token
-          videoId: videoId, //视频标签ID
-          mode: mode, //可选,默认为自动切换,可以强行指定模式
-          debug: true, //可选
-          callback: statusCallBack, //回调函数
-          successCallback, // 成功请求WEBRTC回调
-        };
-        engine = new RtcEngine(option);
-        let myVideo = document.getElementById('playVideo');
-        // 禁用 <video> 元素的默认控件(例如播放按钮、进度条等)
-        myVideo.controls = false;
-        // 启动视频流连接过程。这将根据之前配置的参数建立与服务器的 WebSocket 连接,并开始视频流的传输和播放。
-        engine.connect();
-      }
       webSocketWorker = new Worker(
         'websocket.js?socketURL=' +
         encodeURIComponent(socketURL) +
@@ -1308,7 +1209,7 @@
       window.webSocketWorker = webSocketWorker;
       webSocketWorker.onmessage = function (event) {
         var input = event.data;
-        if (input[0] == 0xff && isAudioPlay && !isVideo) {
+        if (input[0] == 0xff && isAudioPlay) {
           decodeAAC(input);
         }
         if (
@@ -1339,7 +1240,6 @@
                   return
                 }
                 numberOfTimes++
-                engine && engine.disconnect();
                 wsss && wsss.close();
                 webSocketWorker && webSocketWorker.postMessage('endRequest');
                 decodeWoker && decodeWoker.postMessage('close');
@@ -1426,7 +1326,6 @@
           type: 'get',
           dataType: 'json',
           success: function (res) {
-            console.log(res);
             let obj = res.data;
             if (res.status === 0) {
               resolve(obj);
@@ -1903,7 +1802,6 @@
     let quitBool = true
     function quit() {
       // 退出云机页时,把所有链接都关闭掉
-      engine && engine.disconnect();
       wsss && wsss.close();
       decodeWoker && decodeWoker.postMessage('close');
       decodeWoker && decodeWoker.terminate();