|
@@ -17,7 +17,7 @@
|
|
|
<LeftMenuPopup
|
|
|
ref="leftMenuPopupRef"
|
|
|
:engine="engine"
|
|
|
- :userCardId="this.parametersData.userCardId"
|
|
|
+ :userCardId="activeCloud.userCardId"
|
|
|
:levitatedSphereVisible.sync="levitatedSphereVisible"
|
|
|
:latency="rtcNetwork.currentRoundTripTime"
|
|
|
:groupList="groupList"
|
|
@@ -25,11 +25,12 @@
|
|
|
:mealTypeObj="mealTypeObj"
|
|
|
:imgFun="imgFun"
|
|
|
@funcHandle="funcHandle"
|
|
|
+ @changeCloud="changeCloudHandle"
|
|
|
@exit="exit"
|
|
|
/>
|
|
|
|
|
|
<!-- 右侧popup -->
|
|
|
- <!-- <RightPopup ref="rightPopupRef" :engine="engine" :userCardId="this.parametersData.userCardId" :levitatedSphereVisible.sync="levitatedSphereVisible" @shearplate="shearplate" @exit="exit"/> -->
|
|
|
+ <!-- <RightPopup ref="rightPopupRef" :engine="engine" :userCardId="activeCloud.userCardId" :levitatedSphereVisible.sync="levitatedSphereVisible" @shearplate="shearplate" @exit="exit"/> -->
|
|
|
|
|
|
<!-- 输入并复制到粘贴板 -->
|
|
|
<InputCopy ref="inputCopyRef" @openPasteboard="openPasteboard"/>
|
|
@@ -41,7 +42,7 @@
|
|
|
<TimeoutNoOps ref="timeoutNoOpsRef" />
|
|
|
|
|
|
<!-- 计时卡计时 | 计费规则 | 应用推荐 -->
|
|
|
- <TimeBalance ref="timeBalanceRef" :parametersData="parametersData" @downline="$refs.rightPopupRef.downline()"/>
|
|
|
+ <TimeBalance ref="timeBalanceRef" :parametersData="parametersData" :userCardId="activeCloud.userCardId" :userCardType="parametersData.userCardType" @downline="$refs.rightPopupRef.downline()"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -153,10 +154,10 @@ export default {
|
|
|
/**
|
|
|
* @description: 传递的参数
|
|
|
* @param {String} record 数据id
|
|
|
- * @param {Number} userCardId 云机的id
|
|
|
+ * @param {Number} userCardId 必传 云机的id
|
|
|
* @param {String} mealType 云机套餐类型 eg: VIP、STARBALL...
|
|
|
* @param {Number} sourceType 云机来源: 0:购买 1试用 2:免费激活码 3:免费活动抽奖 4:ar app注册 5:9.9元套餐年卡 ',
|
|
|
- * @param {Number} userCardType 云机的类型 0 普通套餐 1、2、3:年卡、普通计时、自动续费普通计时
|
|
|
+ * @param {Number} userCardType 必传 云机的类型 0 普通套餐 1、2、3:年卡、普通计时、自动续费普通计时
|
|
|
* @param {Number} validTime 卡的有效期
|
|
|
* @param {String} rm 卡所在的机房
|
|
|
* @param {Number} isShowCountdown 是否显示倒计时 0:否 1:是
|
|
@@ -165,12 +166,16 @@ export default {
|
|
|
* @param {String} isFirstConnect 是否是首次连接
|
|
|
* @param {Number} authPhone 0自身购买的云手机 1获取得到的云手机
|
|
|
* @param {String} username 用户名
|
|
|
- * @param {String} token token
|
|
|
- * @param {Number} isTips 是否显示提示 0:否 1:是
|
|
|
- * @param {Number} isWeixin 是否是微信小程序环境 0:否 1:是
|
|
|
- * @param {String} merchantSign 商户标识
|
|
|
+ * @param {String} token 必传 token
|
|
|
+ * @param {Number} isTips 必传 是否显示提示 0:否 1:是
|
|
|
+ * @param {Number} isWeixin 必传 是否是微信小程序环境 0:否 1:是
|
|
|
+ * @param {String} merchantSign 必传 商户标识
|
|
|
*/
|
|
|
},
|
|
|
+
|
|
|
+ // 当前使用的云机数据
|
|
|
+ activeCloud: {},
|
|
|
+
|
|
|
// 卡的连接信息
|
|
|
connectData: {},
|
|
|
// 云手机引擎 播放器实例
|
|
@@ -193,7 +198,11 @@ export default {
|
|
|
this.parametersData = this.$route.query;
|
|
|
|
|
|
// 获取用户所有云机列表
|
|
|
- this.getCloudList();
|
|
|
+ await this.getCloudList();
|
|
|
+
|
|
|
+ // 获取当前云机信息
|
|
|
+ this.activeCloud = this.cloudList.find(item => item.userCardId === +this.parametersData.userCardId);
|
|
|
+
|
|
|
// 获取所有云机套餐信息
|
|
|
this.getMealIconInfo();
|
|
|
// 获取云机分组
|
|
@@ -208,8 +217,9 @@ export default {
|
|
|
created() {
|
|
|
this.$toast.loading({
|
|
|
duration: 0, // 持续展示 toast
|
|
|
- message: '数据加载中...',
|
|
|
+ message: `设备(${this.activeCloud.userCardId})正在获取...`,
|
|
|
});
|
|
|
+
|
|
|
// 设置html标签的背景为黑色
|
|
|
document.body.style.background = '#000';
|
|
|
|
|
@@ -329,14 +339,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 获取卡的信息
|
|
|
- async getConnectData(params) {
|
|
|
- let userCardId = params.userCardId;
|
|
|
+ async getConnectData({isWeixin, merchantSign}) {
|
|
|
+ let userCardId = this.activeCloud.userCardId;
|
|
|
try {
|
|
|
// 设置上报参数
|
|
|
this.logReportObj.setParams({userCardId});
|
|
|
|
|
|
let isWx = this.$userAgent.isWx;
|
|
|
- let { isWeixin } = params;
|
|
|
let clientType = (+isWeixin || isWx) ? 'wx' : undefined;
|
|
|
|
|
|
// 设置上报参数
|
|
@@ -345,7 +354,7 @@ export default {
|
|
|
|
|
|
const res = await this.$axios.$post('/resources/user/cloud/connect', { userCardId }, {
|
|
|
headers: {
|
|
|
- merchantSign: params.merchantSign,
|
|
|
+ merchantSign,
|
|
|
},
|
|
|
});
|
|
|
if (!res.success) {
|
|
@@ -476,7 +485,7 @@ export default {
|
|
|
`webRtc连接,获取请求中转地址为空:
|
|
|
url: /api/resources/user/cloud/connect
|
|
|
method: post
|
|
|
- 参数: ${JSON.stringify({ userCardId: this.parametersData.userCardId })}
|
|
|
+ 参数: ${JSON.stringify({ userCardId: this.activeCloud.userCardId })}
|
|
|
响应: ${JSON.stringify(res)}`
|
|
|
);
|
|
|
return Promise.reject(new Error('网络分析请求地址不存在'));
|
|
@@ -750,6 +759,15 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
+ // 切换云机
|
|
|
+ async changeCloudHandle(cloudData) {
|
|
|
+ try {
|
|
|
+ // 保存当前云机数据
|
|
|
+ this.activeCloud = cloudData;
|
|
|
+ } catch (error) {
|
|
|
+ console.log('changeCloud error', error);
|
|
|
+ }
|
|
|
+ },
|
|
|
// 重新设置视频尺寸
|
|
|
changeVideoStyle() {
|
|
|
this.$nextTick(() => {
|