完成邀请好友页面,联调第三方充值,迁移星级厨房页面

This commit is contained in:
Dragon
2022-10-20 16:28:50 +08:00
parent 9743ac86b1
commit 7931c60a68
102 changed files with 1903 additions and 2371 deletions

View File

@@ -5,12 +5,12 @@ if (env == 'test') {
new VConsole();
}
const productUrlNew = 'https://api.99park.cn'; // 正式环境
const testUrlNew = 'http://beta.99park.cn'; // 测试环境
const productUrlNew = 'https://api.pekolive.com'; // 正式环境
const testUrlNew = 'https://beta.api.pekolive.com'; // 测试环境
//获取新域名前缀
function getUrlPrefixNew() {
if (!EnvCheck()) return undefined;
return EnvCheck() === 'live' ? productUrlNew : testUrlNew;
function getUrlPrefixNew () {
if (!EnvCheck()) return undefined;
return EnvCheck() === 'live' ? productUrlNew : testUrlNew;
}
const urlPrefixNew = getUrlPrefixNew()
@@ -22,7 +22,7 @@ const showLoading = (content = '加載中...') => {
type: 2,
shadeClose: false,
content,
success(e) {
success (e) {
layerIndex = $(e).attr('index')
}
})
@@ -44,14 +44,15 @@ const getUserInfo = () => {
networkRequest({
type: 'GET',
url: urlPrefix + `/user/get?uid=${queryObj.shareUid}`,
success(res) {
if(res.code === 200){
success (res) {
if (res.code === 200) {
// $('.avatar').find('img').attr('src', res.data.avatar)
}else{
$('.avatar img').attr('src',res.data.avatar)
} else {
toastMsg(res.message)
}
},
error(){
error () {
toastMsg('網絡錯誤')
}
})
@@ -59,66 +60,95 @@ const getUserInfo = () => {
$(function(){
$(function () {
getInfoFromClient()
setTimeout(() => {
getUserInfo()
}, 50)
if (browser.app) {
if (browser.android) {
let channel = JSON.parse(pubInfo.deviceInfo).channel
if (channel.indexOf('toutiao') != -1 || channel.indexOf('kuaishou') != -1) {
$('.avatar img').attr('src', './images/logo-yy.png')
$('.bottom img').attr('src', './images/logo-yy.png')
$('.appName').html('peko')
}
}
}
// if (browser.app) {
// if (browser.android) {
// let channel = JSON.parse(pubInfo.deviceInfo).channel
// if (channel.indexOf('toutiao') != -1 || channel.indexOf('kuaishou') != -1) {
// $('.avatar img').attr('src', './images/logo-yy.png')
// $('.bottom img').attr('src', './images/logo-yy.png')
// $('.appName').html('peko')
// }
// }
// }
setTimeout(() => {
$('body').show()
}, 0)
$('.invite-code').html(`${queryObj.inviteCode}`)
$('.verify-btn').on('click', function(){
$('.verify-btn').on('click', function () {
$('#int').val(`${queryObj.inviteCode}`)
let clipboard = new Clipboard('.verify-btn')
clipboard.on('success', function(e){
clipboard.on('success', function (e) {
toastMsg('已复制邀请码')
e.clearSelection();
})
})
// 创建深度链接
let linkedKey = '6ba9e9d9760b8acc50b2b499cfd557da'
let paramsObj = {
inviteCode: queryObj.inviteCode
}
let jsonStr = JSON.stringify(paramsObj)
let linkedObj = {
type: EnvCheck(),
params: jsonStr
}
if(queryObj.enterprise){
linkedKey = 'af4f58541a86d5f6c4193349f675419a'
}
linkedme.init(linkedKey, { type: EnvCheck() }, null)
linkedme.link(linkedObj, function(err, response){
if(err){
// 生成深度链接失败返回错误对象err
console.log('err:', err);
}else{
$('.register-btn').on('click', function(){
linkedme.trigger_deeplink(response.url);
})
$('.register-btn').attr('href', response.url)
// // 创建深度链接
// let linkedKey = '6ba9e9d9760b8acc50b2b499cfd557da'
// let paramsObj = {
// inviteCode: queryObj.inviteCode
// }
// let jsonStr = JSON.stringify(paramsObj)
// let linkedObj = {
// type: EnvCheck(),
// params: jsonStr
// }
// if(queryObj.enterprise){
// linkedKey = 'af4f58541a86d5f6c4193349f675419a'
// }
// linkedme.init(linkedKey, { type: EnvCheck() }, null)
// linkedme.link(linkedObj, function(err, response){
// if(err){
// // 生成深度链接失败返回错误对象err
// console.log('err:', err);
// }else{
// $('.register-btn').on('click', function(){
// linkedme.trigger_deeplink(response.url);
// })
// $('.register-btn').attr('href', response.url)
$('.download').on('click', function(){
linkedme.trigger_deeplink(response.url);
})
$('.download').attr('href', response.url)
// $('.download').on('click', function(){
// linkedme.trigger_deeplink(response.url);
// })
// $('.download').attr('href', response.url)
// }
// }, false)
function get_param (param) {
var query = location.search.substring(1).split('&');
for (var i = 0; i < query.length; i++) {
var kv = query[i].split('=');
if (kv[0] == param) {
return kv[1];
}
}
}, false)
return null;
}
uid = get_param('uid');
mobid = get_param('mobid');
ROOM_UID = get_param('ROOM_UID')
fromType = get_param('fromType')
enterType = get_param('enterType')
workAuthor = get_param('workAuthor')
workAuthorId = get_param('workAuthorId')
roomuid = get_param('uid')
MobLink([{
el: '#bomlinkdomload',
path: '',
params: { mobLinkType: 1, inviteCode: queryObj.inviteCode, roomuid, uid, mobid, ROOM_UID, fromType, enterType, workAuthor, workAuthorId }
},
{
el: '#bomlinkdomload1',
path: '',
params: { mobLinkType: 2, inviteCode: queryObj.inviteCode, roomuid, uid, mobid, ROOM_UID, fromType, enterType, workAuthor, workAuthorId }
}
]);
})