分享房间:解决ios无法跳转房间问题

This commit is contained in:
Dragon
2022-10-28 16:21:11 +08:00
parent aa0bc47671
commit 8e56c229ec
2 changed files with 15 additions and 35 deletions

View File

@@ -33,7 +33,7 @@
<p class="user-name"></p>
<p class="user-room">邀请你进入 <span></span> 的房间</p>
<p class="user-id">房间ID <span></span> </p>
<a href="" class="linkedme" id="bomlinkdomload"></a>
<a href="" class="linkedme domload" id="bomlinkdomload"></a>
</div>
<div class="code" style="display: none;">
<img src="./images/share_bg_whrite.png" alt="">

View File

@@ -2,6 +2,7 @@
/* eslint-disable dot-notation */
/* eslint-disable eqeqeq */
/* eslint-disable no-undef */
var browser = checkVersion();
var share = {
title: 'peko带你进入声优的世界',
link: window.location.href,
@@ -30,6 +31,9 @@ $(function () {
user.find('.user-name').html(decodeURIComponent(locateObj.share_name));
user.find('.user-room span').html(decodeURIComponent(locateObj.room_name));
user.find('.user-id span').html(locateObj.room_id);
var roomNewUid = decodeURIComponent(locateObj.uid)
console.log("roomNewUid:", roomNewUid);
console.log("uid:", locateObj.uid);
var share_room = {};
share_room["roomuid"] = locateObj.uid;
@@ -92,41 +96,17 @@ $(function () {
workAuthor = get_param('workAuthor')
workAuthorId = get_param('workAuthorId')
roomuid = get_param('uid')
if (browser.ios) {
$('.domload').attr('href', `pekoApp://room?type=2&uid=${roomNewUid}`)
} else {
MobLink([{
el: '#bomlinkdomload',
path: '',
params: { mobLinkType: 1, roomuid, uid, mobid, ROOM_UID, fromType, enterType, workAuthor, workAuthorId, type: 2 }
}
]);
// var url = encodeURIComponent(location.href.split('#')[0]);
// var data = "url=" + url;
// console.log(data);
// $.ajax({
// type: 'GET',
// url: '/wx/config',
// data: data,
// asyc: true,
// success: function (data) {
// if (data.code = 200) {
// wx.config({
// debug: false,
// appId: 'wx009d793f92c24eec',
// timestamp: data.data.timestamp,
// nonceStr: data.data.nonceStr,
// signature: data.data.signature,
// jsApiList: data.data.jsApiList
// });
// wx.error(function (res) {
// console.log('config error,msg:' + res);
// });
// }
// },
// error: function (res) {
// console.log('config error,msg:' + res);
// }
// })
if (browser.ios) {
window.location.href = `pekoApp://room?type=2&uid=${roomuid}'`;
}
});