feat: 校园旧版,东区缴费初始化

This commit is contained in:
2025-05-19 20:47:23 +08:00
parent 4ff043228b
commit 67aae16733
105 changed files with 20039 additions and 0 deletions
@@ -0,0 +1,968 @@
//需要引入jquery
var JKEventHandler = {
callNativeFunction: function (nativeMethodName, params, callBackID, callBack) {
var message;
if (!callBack) {
message = {'methodName': nativeMethodName, 'params': params};
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else {
message = {'methodName': nativeMethodName, 'params': params, 'callBackID': callBackID};
if (!JKBridgeEvent._listeners[callBackID]) {
JKBridgeEvent.addEvent(callBackID, function (data) {
callBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
}
},
newCallNativeFunction: function (nativeMethodName, params, callBackID, successCallBack, failureCallBack) {
var message;
if (successCallBack && failureCallBack) {
var successCallBackID = callBackID;
successCallBackID += 'successCallBack';
var failureCallBackID = callBackID;
failureCallBackID += 'failureCallBack';
message = {
'type': 'NewJSFunction',
'methodName': nativeMethodName,
'params': params,
'successCallBackID': successCallBackID,
'failureCallBackID': failureCallBackID
};
if (!JKBridgeEvent._listeners[successCallBackID]) {
JKBridgeEvent.addEvent(successCallBackID, function (data) {
successCallBack(data);
});
}
if (!JKBridgeEvent._listeners[failureCallBackID]) {
JKBridgeEvent.addEvent(failureCallBackID, function (data) {
failureCallBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else if (successCallBack && !failureCallBack) {
var successCallBackID = callBackID;
successCallBackID += 'successCallBack';
message = {
'type': 'NewJSFunction',
'methodName': nativeMethodName,
'params': params,
'successCallBackID': successCallBackID
};
if (!JKBridgeEvent._listeners[successCallBackID]) {
JKBridgeEvent.addEvent(successCallBackID, function (data) {
successCallBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else if (failureCallBack && !successCallBack) {
var failureCallBackID = callBackID;
failureCallBackID += 'failureCallBack';
message = {
'type': 'NewJSFunction',
'methodName': nativeMethodName,
'params': params,
'failureCallBackID': failureCallBackID
};
if (!JKBridgeEvent._listeners[failureCallBackID]) {
JKBridgeEvent.addEvent(failureCallBackID, function (data) {
failureCallBack(data);
});
}
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
} else {
message = {'type': 'NewJSFunction', 'methodName': nativeMethodName, 'params': params};
window.webkit.messageHandlers.JKEventHandler.postMessage(message);
}
},
callBack: function (callBackID, data) {
JKBridgeEvent.fireEvent(callBackID, data);
},
removeAllCallBacks: function (data) {
JKBridgeEvent._listeners = {};
}
};
var JKBridgeEvent = {
_listeners: {},
addEvent: function (type, fn) {
if (typeof this._listeners[type] === "undefined") {
this._listeners[type] = [];
}
if (typeof fn === "function") {
this._listeners[type].push(fn);
}
return this;
},
fireEvent: function (type, param) {
var arrayEvent = this._listeners[type];
if (arrayEvent instanceof Array) {
for (var i = 0, length = arrayEvent.length; i < length; i += 1) {
if (typeof arrayEvent[i] === "function") {
arrayEvent[i](param);
}
}
}
return this;
},
removeEvent: function (type, fn) {
var arrayEvent = this._listeners[type];
if (typeof type === "string" && arrayEvent instanceof Array) {
if (typeof fn === "function") {
for (var i = 0, length = arrayEvent.length; i < length; i += 1) {
if (arrayEvent[i] === fn) {
this._listeners[type].splice(i, 1);
break;
}
}
} else {
delete this._listeners[type];
}
}
return this;
}
};
$.extend({
// app公共方法
//获取basicinfo,需传入回调方法
initGetAppBasicInfo: function (fun) {
var sys = $.initGetAppSys();
var basicInfo;
try {
if (sys == 1) {
basicInfo = androidIntent.getBasicInfo();
basicInfo = JSON.parse(basicInfo)
fun(basicInfo)
} else if (sys == 2) {
try {
basicInfo = getBasicInfo();
basicInfo = JSON.parse(basicInfo)
fun(basicInfo)
} catch (e) {
JKEventHandler.callNativeFunction('getBasicInfo', null, 'getBasicInfoCallback', function (data) {
basicInfo = data;
basicInfo = JSON.parse(basicInfo)
basicInfo.centerId = basicInfo.centerid;
fun(basicInfo)
JKEventHandler.removeAllCallBacks()
});
}
} else {
fun(basicInfo)
}
} catch (e) {
fun(basicInfo)
}
// basicInfo = {
// userId:'',
// nickname:'',
// getIsLogin:1,1表示登录
// longitude:'',
// imei:'',
// latitude:'',
// version:'版本4.2.5',
// loginToken:'',
// userType:3,
// loginType:3,1、手机,2、微信,3、qq
// }
},
//判断系统类型
initGetAppSys: function () {
var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
return 1;
}
if (isIOS) {
return 2;
}
return 3;
},
//调起登录页面
initToAppLogin: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentlogin()
} else if (sys == 2) {
try {
intentlogin()
} catch (e) {
JKEventHandler.callNativeFunction('intentlogin', {}, null, null);
}
}
} catch (e) {
}
},
initAppendRefresh(bgColor, infoBgColor, btnBgColor, btnColor, imgUrl, btnText) {
// bgColor-整个背景,infoBgColor-中间框背景色,btnBgColor-按钮背景色,btnColor-按钮字体颜色,imgUrl-图片路径 btnText-按钮文字
$('body').prepend('<div style="position:fixed;left:0;bottom:0;width:100vw;height:100vh;z-index:999;background: ' + (bgColor || "transparent") +
'"><div style="position:absolute;width:80%;left:50%;top: 50%;padding:20px 10px;border-radius:8px;background:' + (infoBgColor || '#fff') +
';transform: translate(-50%,-50%)">\n' +
' <img src="' + imgUrl +
'" alt="" style="display:block;width:100px;margin:0 auto 20px;">\n' +
' <a href="javascript:location.reload();" style="width:120px;text-align:center;display:block;margin:0 auto;padding: 0 6px;border-radius:4px;line-height:30px;font-size: 14px;background:' + (btnBgColor || 'red') +
';color:' + (btnColor || '#fff') +
'">' + (btnText || '登录成功') +
'</a></div></div>')
},
//调绑定手机号页面
initToBindPhone: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentBindMobilePhone()
} else if (sys == 2) {
try {
intentBindMobilePhone()
} catch (e) {
JKEventHandler.callNativeFunction('intentBindMobilePhone', {}, null, null);
}
}
} catch (e) {
}
},
//是否登录app
initIsLoginApp: function (basicInfo) {
if (basicInfo.getIsLogin && basicInfo.getIsLogin == 1) {
return true
} else {
return false
}
},
//是否在app内
initIsInApp: function (basicInfo) {
if (basicInfo) {
return true
} else {
return false
}
},
//更新app的token
initUploadAppToken: function (token) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.getRefreshLoginTokenFromH5(token)
} else if (sys == 2) {
try {
getRefreshLoginTokenFromH5(token)
} catch (e) {
JKEventHandler.callNativeFunction('getRefreshLoginTokenFromH5', token, null, null);
}
}
} catch (e) {
}
},
//新开APP窗口
initOpenNewWebview: function (url, title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentWebViewActivity(url, (title || ''))
} else if (sys == 2) {
try {
intentWebViewActivity(url, title)
} catch (e) {
JKEventHandler.callNativeFunction('intentWebViewActivity', {title: title, url: url}, null, null);
}
}
} catch (e) {
location.href = url
}
},
//重定义app title
initTitleModify: function (title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentSetTitle(title);
} else if (sys == 2) {
try {
updateTitle(title);
} catch (e) {
JKEventHandler.callNativeFunction('updateTitle', title, null, null);
}
}
} catch (e) {
$('title').text(title)
}
},
//判断版本
initJudgeVersion: function (basc) {
var sys = $.initGetAppSys();
if (basc) {
var version = basc.version;
if (sys == 1) {
if (parseInt(version.replace(/\./g, '')) < 425) {
$.initAppendVersionMask('4.2.5')
}
} else if (sys == 2) {
if (parseInt(version.replace(/\./g, '')) < 435) {
$.initAppendVersionMask('4.35')
}
}
}
},
initAppendVersionMask: function (ver) {
// $('body').append('<div id="initVersionMask" style="position: fixed;background-color:rgba(0,0,0,.6);left: 0;top: 0;z-index: 99;width: 100%;height: 100%;"><div style="background-color: #ffffff;width: 4.6rem;padding: .3rem;font-size: .3rem;line-height: .62rem;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);border-radius: .2rem"><img style="display: block;width: 2rem;margin: 0 auto" src="http://h5.scrstv.com/html/commonJs/thank.jpg" alt=""><p style="text-align: center">您的APP版本过低,需要您升级到版本' + ver + '以上,请您升级成功后重新登录,感谢您的理解!</p><div style="text-align: center;font-size: 0;margin: .2rem 0;"><span style="display: inline-block;line-height: .6rem;width: 1.8rem;margin: 0 .1rem;font-size: .28rem;color: #333;border: 1px solid #333;" onclick="$.initCloseVerisionMask()">以后再说</span><span style="display: inline-block;line-height: .6rem;width: 1.8rem;margin: 0 .1rem;font-size: .28rem;color: #fff;border: 1px solid #e44c4c;background-color: #e44c4c">立即升级</span></div></div></div>')
$('body').append('<div id="initVersionMask" style="position: fixed;background-color:rgba(0,0,0,.6);left: 0;top: 0;z-index: 99;width: 100%;height: 100%;"><div style="background-color: #ffffff;width: 4.6rem;padding: .3rem;font-size: .3rem;line-height: .62rem;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);border-radius: .2rem"><img style="display: block;width: 2rem;margin: 0 auto" src="http://h5.scrstv.com/html/commonJs/thank.jpg" alt=""><p style="text-align: center">您的APP版本过低,需要您升级到版本' + ver + '以上,请您升级成功后重新登录,感谢您的理解!</p></div></div>')
},
//关闭更新提示
initCloseVerisionMask: function () {
$('#initVersionMask').remove();
return false
},
//跳转到升级页面
initToUpgradePage: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentSystenSetting("1");
} else if (sys == 2) {
try {
intentSystenSetting("1")
} catch (e) {
JKEventHandler.callNativeFunction('intentSystenSetting', '1', null, null);
}
}
} catch (e) {
}
},
//唤起群组聊天界面
initJoinGroupWithChat: function (title, groupId) {
// 0表示招聘者,1表示求职者
var sys = $.initGetAppSys();
var obj = {
title: title,
groupId: groupId
};
try {
if (sys == 1) {
androidIntent.intentJoinGroupWithChat(groupId)
} else if (sys == 2) {
try {
intentJoinGroupWithChat(obj)
} catch (e) {
JKEventHandler.callNativeFunction('intentJoinGroupWithChat', groupId, null, null);
}
}
} catch (e) {
}
},
initOpenAppActivity: function (json) {
//json {"appInterfaceType":"activity:\/\/newsListPage","mannerId":"3","columnId":"13"} h5需要调用方法openAppActivity()将json作为参数传入
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.openAppActivity(json)
} else if (sys == 2) {
try {
openAppActivity(json)
} catch (e) {
JKEventHandler.callNativeFunction('openAppActivity', json, null, null);
}
}
} catch (e) {
}
},
//关闭当前页面
initBackToRoot: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.closeActivity()
} else if (sys == 2) {
try {
backToTop()
} catch (e) {
try {
JKEventHandler.callNativeFunction('backToTop', {}, null, null);
} catch (e) {
}
}
}
} catch (e) {
}
},
//关闭下拉刷新功能
initCloseUpdate: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.closeHeaderUpdate()
} else if (sys == 2) {
try {
closeHeaderUpdate()
} catch (e) {
JKEventHandler.callNativeFunction('closeHeaderUpdate', {}, null, null);
}
}
} catch (e) {
}
},
//开启下拉刷新功能
initOpenUpdate: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.openHeaderUpdate()
} else if (sys == 2) {
try {
openHeaderUpdate()
} catch (e) {
JKEventHandler.callNativeFunction('openHeaderUpdate', {}, null, null);
}
}
} catch (e) {
}
},
//唤起APP聊天界面
initSingleChat: function (userId, title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentChat(title || '', userId)
} else if (sys == 2) {
try {
intentSingleChat(userId)
} catch (e) {
JKEventHandler.callNativeFunction('intentSingleChat', userId, null, null);
}
}
} catch (e) {
}
},
//唤起APP聊天界面
initEvokeChat: function (interviewerId, joberType, positionId) {
// 0表示招聘者,1表示求职者
var sys = $.initGetAppSys();
var obj = {
interviewerId: interviewerId,
joberType: joberType,
positionId: positionId
};
try {
if (sys == 1) {
androidIntent.intentJobMessage(JSON.stringify(obj))
} else if (sys == 2) {
try {
intentJobMessage(JSON.stringify(obj))
} catch (e) {
JKEventHandler.callNativeFunction('intentJobMessage', JSON.stringify(obj), null, null);
}
}
} catch (e) {
}
},
//唤起求职列表
initGetChatList: function (joberType) {
// 0表示招聘者,1表示求职者
var sys = $.initGetAppSys();
try {
// alert(sys)
if (sys == 1) {
androidIntent.intentJobMessageList(joberType)
} else if (sys == 2) {
try {
intentJobMessageList(joberType)
} catch (e) {
JKEventHandler.callNativeFunction('intentJobMessageList', joberType, null, null);
}
}
} catch (e) {
}
},
//发起群聊
intentGroupChat: function (groupId) {
// groupId 两微一端的群id 字符串
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentJoinGroupWithChat(groupId)
} else if (sys == 2) {
try {
intentJoinGroupWithChat(groupId)
} catch (e) {
JKEventHandler.callNativeFunction('intentJoinGroupWithChat', groupId, null, null);
}
}
} catch (e) {
}
},
//调起扫一扫
initToScan: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentScan()
} else if (sys == 2) {
try {
intentScan()
} catch (e) {
JKEventHandler.callNativeFunction('intentScan', {}, null, null);
}
}
} catch (e) {
}
},
// 进入腾讯云课堂
initIntoCloudClassRoom(obj) {
// 房间号 serial
// 密码 password
// 用户昵称 nickname
// 地址 host
// 主机 server
// 端口号 port
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentCloudClassRoom(obj)
} else if (sys == 2) {
try {
intentCloudClassRoom(obj)
} catch (e) {
JKEventHandler.callNativeFunction('intentCloudClassRoom', obj, null, null);
}
}
} catch (e) {
}
},
// 关闭侧滑返回
initCloseSlideBack: function () {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.swipeBackEnable()
} else if (sys == 2) {
try {
notAllowRightSlideTurnBack()
} catch (e) {
JKEventHandler.callNativeFunction('notAllowRightSlideTurnBack', {}, null, null);
}
}
} catch (e) {
}
},
downloadImageWithUrl: function (urlStr) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.downloadImageWithUrl(urlStr);
} else if (sys == 2) {
try {
downloadImageWithUrl(urlStr);
} catch (e) {
JKEventHandler.callNativeFunction('downloadImageWithUrl', urlStr, null, null);
}
}
} catch (e) {
}
},
initHideTopRightTool: function (type) {
//0 不显示右上角功能(会开启原生左上角的返回按钮)
// 1 不显示分享按钮
//2 不显示关闭按钮 (会开启原生左上角的返回按钮)
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.rightViewChange(type + '')
} else if (sys == 2) {
try {
rightViewChange(type + '')
} catch (e) {
JKEventHandler.callNativeFunction('rightViewChange', type + '', null, null);
}
}
} catch (e) {
}
},
//拨打电话
initAppCallPhone: function (number) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentCallPhone(number);
} else if (sys == 2) {
try {
intentCallPhone(number);
} catch (e) {
JKEventHandler.callNativeFunction('intentCallPhone', number, null, null);
}
}
} catch (e) {
}
},
//跳详情页面
initIntoDetailsView: function (id) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.intentNewsDetail(id);
} else if (sys == 2) {
try {
intentNewsDetail(id);
} catch (e) {
JKEventHandler.callNativeFunction('intentNewsDetail', id, null, null);
}
}
} catch (e) {
}
},
//分享
initOpenAppShare: function (title, icon, des, url) {
var sys = $.initGetAppSys();
if (sys == 1) {
try {
androidShare.shareWebView(JSON.stringify({
title: title,
icon: icon,
descript: des,
shareUrl: url
}));
} catch (e) {
}
} else if (sys == 2) {
try {
littleShare({
title: title,
icon: icon,
descript: des,
shareUrl: url
});
} catch (e) {
JKEventHandler.callNativeFunction('littleShare', {
title: title,
icon: icon,
descript: des,
shareUrl: url
}, 'littleShareCallback', function (data) {
});
}
}
},
//实时获取定位
initGetLocation: function (fun) {
// ios:5.0.3 安卓:5.1.0及以后有这个方法 需在全局定义一个方法jsAppLocationCallback接收参数
// 安卓返回对象 IOS为字符串 {longitude:'',latitude:''}
var sys = $.initGetAppSys();
var coordinate;
try {
if (sys == 1) {
androidIntent.getAppLocation();
// JKEventHandler.callNativeFunction('getAppLocation', null, 'jsAppLocationCallback', function (data) {
// coordinate = data;
// fun(coordinate)
// });
} else if (sys == 2) {
JKEventHandler.callNativeFunction('getAppLocation', null, 'jsAppLocationCallback', function (data) {
coordinate = data;
fun(coordinate)
});
} else {
fun(coordinate)
}
} catch (e) {
fun(coordinate)
}
},
//禁止返回上一页
initReturnToPreviousPage: function (type) {
// 禁止返回上一页,参数传1为禁止,0为允许
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidIntent.noReturnToPreviousPage(type);
} else if (sys == 2) {
JKEventHandler.callNativeFunction('noReturnToPreviousPage', type, 'noReturnToPreviousPageCallback', function (data) {
});
} else {
}
} catch (e) {
}
},
// IOS允许视频非全屏播放
initIosVideoPlayInline: function (str) {
// str 值为true或者false字符串
var sys = $.initGetAppSys();
if (sys == 2) {
try {
JKEventHandler.callNativeFunction('allowsInlineMediaPlayback', str, 'allowsInlineMediaPlaybackCallback', function (data) {
});
} catch (e) {
}
}
},
//采编APP 自定义右上角按钮 点击回调方法名称:publishMessage
initOpinionsToolbar: function (title) {
var sys = $.initGetAppSys();
try {
if (sys == 1) {
androidShare.settingTitleBar(title)
} else if (sys == 2) {
try {
settingTitleBar(title)
} catch (e) {
JKEventHandler.callNativeFunction('settingTitleBar', title, null, null);
}
}
} catch (e) {
}
},
//获取两微一端用户信息
initGetUserInfo: function (root, id, async) {
var obj;
$.ajax({
url: root + '/a/userRelation/getStatisticsByUserId',
data: {
userId: id,
},
async: async || false,
success: function (res) {
try {
res = JSON.parse(res)
} catch (e) {
}
obj = res;
}
})
return obj;
},
initGetUrl: function (etcenter) {
// etcenter 1富顺 2宣汉 3仁寿 4古蔺 6荣县 7高坪 8雷波 9南充 12东坡 14南溪 88公司sass环境
var initMedia,//媒资地址
initCdn,//媒资加速地址
initMicro,//两微一端
initDown,//下载APP地址
initLogo;//logo
etcenter = parseInt(etcenter);
switch (etcenter) {
case 1:
initMedia = 'http://fsunifiedrelease-api.yd-data.com:8064';
initCdn = '';
initMicro = 'http://fsmpfc.yd-data.com:8360';
initDown = 'http://fsmpfc.yd-data.com:8090/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/fushun.png';
break;
case 2:
initMedia = 'http://222.215.99.149:8064';
initCdn = '';
initMicro = 'http://cityreception.yd-data.com:8074';
initDown = 'http://country.yd-data.com/xh_html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/xuanhan.png';
break;
case 3:
// initMedia = 'http://rscmjrp.yd-data.com:8064';
initMedia = 'https://meizi.scrstv.com';
initCdn = 'http://svod.scrstv.com';
initMicro = 'https://lwyd.scrstv.com';
initDown = 'https://h5.scrstv.com/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/renshou.jpg';
break;
case 4:
initMedia = 'https://glmmp.gulinrongmei.com';
initCdn = '';
initMicro = 'https://lwyd8073.gulinrongmei.com';
initDown = 'https://h5.gulinrongmei.com/gl_html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/gulin.jpg';
break;
case 6:
initMedia = 'http://rxmmp.rongxianwang.net:8064';
initCdn = '';
initMicro = 'http://www.rongxianwang.net:8073';
initDown = 'http://110.189.172.134:8082/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/rongxian.png';
break;
case 7:
initMedia = 'https://mz.scgpnews.com.cn';
initCdn = '';
initMicro = 'https://lwyd.scgpnews.com.cn';
initDown = 'http://h5.scgpnews.com.cn/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/gaoping.jpg';
break;
case 8:
initMedia = 'http://lbiomp.lbxww.gov.cn:8064';
initCdn = '';
initMicro = 'http://lbiomp.lbxww.gov.cn:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/leibo.png';
break;
case 9:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?areaId=9&centerId=9';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nanchong.png';
break;
case 29:
initMedia = 'https://mz.baqrm.com';
initCdn = '';
initMicro = 'https://lwyd.baqrm.com';
initDown = 'https://cdnbah5.baqrm.com/html/app/download.html';
initLogo = 'https://cdnbah5.baqrm.com/html/hotnews/code/images/barm.png';
break;
case 9901:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?centerId=9&areaId=901';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nc-shunqing.png';
break;
case 9903:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?centerId=9&areaId=903';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nc-jialing.png';
break;
case 9904:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = 'http://nciomp.cnncw.cn:8073';
initDown = 'http://h5.cnncw.cn/html/app/download.html?centerId=9&areaId=904';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/langzhong.png';
break;
case 9905:
initMedia = 'http://ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=905';
initLogo = '//h5.scrstv.com/html/commonJs/images/mc-yingshan.png';
break;
case 9906:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=906';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-nanbu.png';
break;
case 9907:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=907';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-xichong.png';
break;
case 9908:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//nciomp.cnncw.cn:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=908';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-yilong.png';
break;
case 9909:
initMedia = '//ncmmp.cnncw.cn:8064';
initCdn = '';
initMicro = '//47.108.86.0:8073';
initDown = '//h5.cnncw.cn/html/app/download.html?centerId=9&areaId=909';
initLogo = '//h5.scrstv.com/html/commonJs/images/nc-pengzhou.png';
break;
case 12:
initMedia = 'http://dprm.info:8064';
initCdn = '';
initMicro = 'http://lwyd.dprm.info:8073';
initDown = 'http://vms.dprm.info/html/app/download.html';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/dongpo.png';
break;
case 14:
initMedia = 'http://125.64.247.157:8064';
initCdn = '';
initMicro = 'http://125.64.247.157:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/nanxi.png';
break;
case 888802:
initMedia = 'http://182.139.182.174:8064';
initCdn = '';
initMicro = 'http://182.139.182.174:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/';
break;
case 888803:
initMedia = 'http://182.139.182.174:8064';
initCdn = '';
initMicro = 'http://182.139.182.174:8073';
initDown = '';
initLogo = 'http://h5.scrstv.com/html/commonJs/images/';
break;
default:
break
}
return {
mediaUrl: initMedia,
cdnUrl: initCdn,
microUrl: initMicro,
downloadUrl: initDown,
logoUrl: initLogo
}
},
initAddLog: function (userId, loginToken, areaId, mobile) {
$.ajax({
url: 'https://h5.yd-data.com:8098/log',
data: {
url: decodeURIComponent(location.href),
userId: userId,
loginToken: loginToken,
areaId: areaId,
mobile: mobile
},
success: function (data) {
}
})
},
// 设置支付域名
setReferer: function (url) {
var sys = $.initGetAppSys();
console.log("000")
try {
if (sys == 1) {
console.log(111)
androidShare.intentSetReferer(url)
console.log(222)
} else if (sys == 2) {
}
} catch (e) {
}
}
})
File diff suppressed because one or more lines are too long
+383
View File
@@ -0,0 +1,383 @@
function _typeof(e) {
return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
})(e)
}
!function () {
function t(e) {
if (-1 === navigator.userAgent.indexOf("MAGAPP")) console.log("当前环境不支持"); else if (!window.MagAndroidClient) {
if (window.WebViewJavascriptBridge) return e(window.WebViewJavascriptBridge);
if (document.addEventListener("WebViewJavascriptBridgeReady", function () {
e(window.WebViewJavascriptBridge)
}, !1), window.WVJBCallbacks) return window.WVJBCallbacks.push(e);
window.WVJBCallbacks = [e];
var c = document.createElement("iframe");
c.style.display = "none", c.src = "https://__bridge_loaded__", document.documentElement.appendChild(c), setTimeout(function () {
document.documentElement.removeChild(c)
}, 0)
}
}
function a(c, e) {
var s = null == e ? "" : "object" === _typeof(e) ? JSON.stringify(e) : e;
window.MagAndroidClient && (window.MagAndroidClient[c] && "function" == typeof window.MagAndroidClient[c] ? window.MagAndroidClient[c](s) : console.warn("Android 不支持 " + c + " 方法")), t(function (e) {
e.callHandler(c, s, function () {
})
})
}
function c(c) {
window.MagAndroidClient && (window.MagAndroidClient[c] && "function" == typeof window.MagAndroidClient[c] ? window.MagAndroidClient[c]() : console.warn("Android 不支持 " + c + " 方法")), t(function (e) {
e.callHandler(c, "", function () {
})
})
}
t(function (e) {
e.init && "function" == typeof e.init && e.init(function () {
}), e.registerHandler("jsCallBack", function (e) {
var e = JSON.parse(e), c = e.id, e = e.val, c = n.callbacks[c];
c && (c.type && "json" == c.type && (e = e && JSON.parse(e)), c.success(e))
})
});
var n = {
VERSION: "1.4.1", ready: function (e) {
t(function () {
e()
}), window.MagAndroidClient && e()
}, callbacks: {}, iosConnect: t, jsCallBack: function (e, c) {
e = n.callbacks[e];
e && (e.type && "json" == e.type && (c = c && JSON.parse(c)), e.success(c))
}, getLocation: function (e) {
e && (n.callbacks.getLocation = {type: "json", success: e}), c("getLocation")
}, showLocation: function (e) {
a("showLocation", e)
}, mapPick: function (e) {
e && (n.callbacks.mapPick = {type: "json", success: e}), c("mapPick")
}, closeWin: function () {
c("closeWin")
}, previewImage: function (e) {
a("previewImage", e)
}, picPick: function (e) {
e && "object" === _typeof(e) && (e.preview && (n.callbacks.picPickPreview = {
type: "json",
success: e.preview
}), e.success && (n.callbacks.picPickSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.picPickFail = {type: "json", success: e.fail}), a("picPick", e)
}, previewFile: function (e) {
a("previewFile", e)
}, filePick: function (e) {
e && "object" === _typeof(e) && (e.preview && (n.callbacks.filePickPreview = {
type: "json",
success: e.preview
}), e.success && (n.callbacks.filePickSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.filePickFail = {type: "json", success: e.fail}), a("filePick", e)
}, camera: function (e) {
e && "object" === _typeof(e) && (e.preview && (n.callbacks.cameraPreview = {
type: "json",
success: e.preview
}), e.success && (n.callbacks.cameraSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.cameraFail = {type: "json", success: e.fail}), a("camera", e)
}, recordIdentifyVideo: function (e) {
e && "object" === _typeof(e) && (e.preview && (n.callbacks.identifyVideoPreview = {
type: "json",
success: e.preview
}), e.success && (n.callbacks.identifyVideoSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.identifyVideoFail = {type: "json", success: e.fail}), a("recordIdentifyVideo", e)
}, setData: function (e) {
a("setData", e)
}, setShareCallback: function (e) {
e && "object" === _typeof(e) && (e.pageShareSuccess && (n.callbacks.pageShareSuccess = {
type: "",
success: e.pageShareSuccess
}), e.pageShareFailed) && (n.callbacks.pageShareFailed = {type: "", success: e.pageShareFailed})
}, share: function (e, c, s) {
c && (n.callbacks.shareSuccess = {type: "", success: c}), s && (n.callbacks.shareFailed = {
type: "",
success: s
}), a("share", e)
}, shareCard: function (e, c, s) {
c && (n.callbacks.shareSuccess = {type: "", success: c}), s && (n.callbacks.shareFailed = {
type: "",
success: s
}), a("shareCard", e)
}, socialBind: function (e, c, s) {
c && (n.callbacks.bindOnSuccess = {type: "json", success: c}), s && (n.callbacks.bindOnFail = {
type: "json",
success: s
}), a("socialBind", e)
}, report: function (e) {
a("report", e)
}, scanQR: function (e) {
e && (n.callbacks.scanQR = {type: "", success: e}), c("scanQR")
}, actionSheet: function (e, c) {
c && (n.callbacks.actionSheet = {type: "json", success: c}), a("actionSheet", e)
}, toast: function (e) {
a("toast", e)
}, dialog: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.dialogSuccess = {
type: "json",
success: e.success
}), e.cancel) && (n.callbacks.dialogCancel = {type: "json", success: e.cancel}), a("dialog", e)
}, progress: function () {
c("progress")
}, hideProgress: function () {
c("hideProgress")
}, setTitle: function (e) {
a("setTitle", e)
}, showNavigation: function () {
c("showNavigation")
}, hideNavigation: function () {
c("hideNavigation")
}, setNavigationColor: function (e) {
a("setNavigationColor", e)
}, emailBind: function (e) {
e && (n.callbacks.emailBindSuccess = {type: "string", success: e}), c("emailBind")
}, hideMore: function () {
c("hideMore")
}, showMore: function () {
c("showMore")
}, tel: function (e) {
a("tel", e)
}, sms: function (e, c) {
a("sms", {phone: e, content: c})
}, toLogin: function (e) {
e && (n.callbacks.loginSuccess = {type: "json", success: e}), c("toLogin")
}, toUserHome: function (e) {
a("toUserHome", e)
}, addRedPacket: function (e) {
a("addRedPacket", e)
}, setNavigationBarStyle: function (e) {
a("setNavigationBarStyle", e)
}, showApplaud: function (e) {
a("showApplaud", e)
}, toUserHomeByName: function (e) {
e && a("toUserHomeByName", e)
}, commentBar: function (e) {
e && "object" === _typeof(e) && (e.onComment && (n.callbacks.commentBar = {
type: "json",
success: e.onComment
}), e.onCommentShow && (n.callbacks.onCommentShow = {
type: "",
success: e.onCommentShow
}), e.onPageSelect && (n.callbacks.pageSelect = {
type: "json",
success: e.onPageSelect
}), e.onApplaud && (n.callbacks.applaud = {
type: "json",
success: e.onApplaud
}), e.has_reply_red_packet) && (n.callbacks.has_reply_red_packet = {
type: "json",
success: e.has_reply_red_packet
}), a("commentBar", e)
}, toComment: function (e) {
e && "object" === _typeof(e) && e.success && (n.callbacks.comment = {
type: "json",
success: e.success
}), a("toComment", e)
}, newWin: function (e, c) {
for (var s in e.indexOf("?") < 0 && (e += "?"), c) e += "&" + s + "=" + c[s];
a("newWin", e)
}, setPageLife: function (e) {
e && "object" === _typeof(e) && (e.pageAppear && (n.callbacks.pageAppear = {
type: "",
success: e.pageAppear
}), e.pageDisappear) && (n.callbacks.pageDisappear = {type: "", success: e.pageDisappear})
}, followAuthorFromNative: function (e) {
e && "object" === _typeof(e) && (n.callbacks.followAuthorFromNative = {
type: "",
success: e.followAuthorFromNative
})
}, availableSharePlatform: function (e) {
e && "object" === _typeof(e) && e.availableSharePlatform && (n.callbacks.availableSharePlatform = {
type: "json",
success: e.availableSharePlatform
}), c("availableSharePlatform")
}, pay: function (e, c, s) {
c && (n.callbacks.payOnSuccess = {type: "", success: c}), s && (n.callbacks.payOnFail = {
type: "",
success: s
}), a("pay", e)
}, alipay: function (e, c, s) {
e && (c && (n.callbacks.alipayOnSuccess = {type: "", success: c}, n.callbacks.alipaySuccess = {
type: "",
success: c
}), s && (n.callbacks.alipayOnFail = {type: "", success: s}), a("alipay", e))
}, inAppPay: function (e, c, s) {
c && (n.callbacks.inAppPaySuccess = {type: "", success: c}), s && (n.callbacks.inAppPayOnFail = {
type: "",
success: s
}), a("inAppPay", e)
}, deviceLogin: function (e) {
e && (n.callbacks.loginSuccess = {type: "json", success: e}), c("deviceLogin")
}, phoneBind: function (e) {
e && (n.callbacks.phoneBindSuccess = {type: "string", success: e}), c("phoneBind")
}, qqConnectLogin: function (e) {
a("qqConnectLogin", e)
}, bounceEnable: function (e) {
a("bounceEnable", e)
}, showNaviAuthor: function () {
c("showNaviAuthor")
}, hideNaviAuthor: function () {
c("hideNaviAuthor")
}, followAuthorFromWeb: function (e) {
a("followAuthorFromWeb", e)
}, addRefreshComponent: function () {
c("addRefreshComponent")
}, sappHome: function (e) {
a("sappHome", e)
}, chat: function (e) {
a("chat", e)
}, newExternalWin: function (e) {
a("newExternalWin", e)
}, getAppAuthKey: function (e) {
e && (n.callbacks.getAppAuthKey = {type: "json", success: e}), c("getAppAuthKey")
}, sendGift: function (e, c) {
c && (n.callbacks.giftSendSuccess = {type: "json", success: c}), a("sendGift", e)
}, showPhoneSettings: function () {
c("showPhoneSettings")
}, getNotificationStatus: function (e) {
e && (n.callbacks.getNotificationStatus = {type: "string", success: e}), c("getNotificationStatus")
}, downloadAttachment: function (e) {
a("downloadAttachment", e)
}, getNetworkState: function (e) {
e && (n.callbacks.getNetworkState = {type: "string", success: e}), c("getNetworkState")
}, getDeviceId: function (e) {
e && (n.callbacks.getDeviceId = {type: "string", success: e}), c("getDeviceId")
}, getNavigationHeight: function (e) {
e && (n.callbacks.getNavigationHeight = {type: "json", success: e}), c("getNavigationHeight")
}, showTaskVideoAd: function (e, c, s) {
c && (n.callbacks.rewardOnEffective = {type: "", success: c}), s && (n.callbacks.rewardOnFailure = {
type: "json",
success: s
}), a("showTaskVideoAd", e)
}, showNativeVideoAd: function (e, c, s) {
c && (n.callbacks.rewardOnEffective = {type: "", success: c}), s && (n.callbacks.rewardOnFailure = {
type: "json",
success: s
}), a("showNativeVideoAd", e)
}, getOaid: function (e) {
e && (n.callbacks.getOaid = {type: "string", success: e}), c("getOaid")
}, getAndroidVersion: function (e) {
e && (n.callbacks.getAndroidVersion = {type: "string", success: e}), c("getAndroidVersion")
}, getImei1: function (e) {
e && (n.callbacks.getImei1 = {type: "string", success: e}), c("getImei1")
}, rewardToast: function (e) {
a("rewardToast", e)
}, showCommentRewardDetail: function (e) {
a("showCommentRewardDetail", e)
}, addEmotionGroup: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.addEmotionGroupSuccess = {
type: "",
success: e.success
}), e.fail) && (n.callbacks.addEmotionGroupFail = {type: "", success: e.fail}), a("addEmotionGroup", e)
}, getEmotionGroupState: function (e) {
e && "object" === _typeof(e) && e.success && (n.callbacks.getEmotionGroupState = {
type: "",
success: e.success
}), a("getEmotionGroupState", e)
}, recognizeUserFace: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.recognizeUserFaceSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.recognizeUserFaceFail = {type: "json", success: e.fail}), c("recognizeUserFace")
}, verifyPhoneBind: function (e) {
a("verifyPhoneBind", e)
}, omiseCreditCardPayCallback: function (e) {
a("omiseCreditCardPayCallback", e)
}, alibcTradeLogin: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.alibcTradeLoginSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.alibcTradeLoginFail = {type: "json", success: e.fail}), c("alibcTradeLogin")
}, alibcTradeLogout: function () {
c("alibcTradeLogout")
}, alibcTradeAuthorize: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.alibcTradeAuthorizeSuccess = {
type: "json",
success: e.success
}), e.fail) && (n.callbacks.alibcTradeAuthorizeFail = {type: "json", success: e.fail}), c("alibcTradeAuthorize")
}, setSkymapCallback: function (e) {
e && "object" === _typeof(e) && (e.centerAndZoom && (n.callbacks.centerAndZoom = {
type: "",
success: e.centerAndZoom
}), e.pageDisappear) && (n.callbacks.pageDisappear = {type: "", success: e.pageDisappear})
}, setSkymapLocation: function (e) {
a("setSkymapLocation", e)
}, switchTab: function (e) {
a("switchTab", e = e || {index: 0})
}, impactFeedback: function () {
a("impactFeedback")
}, vibrate: function () {
a("vibrate")
}, startSpeeking: function (e) {
e && "object" === _typeof(e) && (e.onNext && (n.callbacks.startSpeekingOnNext = {
type: "json",
success: e.onNext
}), e.onPlayFinish && (n.callbacks.startSpeekingOnPlayFinish = {
type: "json",
success: e.onPlayFinish
}), e.onStatus) && (n.callbacks.startSpeekingOnStatus = {
type: "json",
success: e.onStatus
}), a("startSpeeking", e)
}, stopSpeeking: function (e) {
(e = "function" == typeof e ? {success: e} : e) && "object" === _typeof(e) && e.success && (n.callbacks.stopSpeakingOnSuccess = {
type: "",
success: e.success
}), a("stopSpeeking", e)
}, openChat: function (e) {
e && "object" === _typeof(e) && (e.query && (n.callbacks.openChatOnQuery = {
type: "json",
success: e.query
}), e.stop && (n.callbacks.openChatOnStop = {
type: "json",
success: e.stop
}), e.close && (n.callbacks.openChatOnClose = {
type: "json",
success: e.close
}), e.error) && (n.callbacks.openChatOnError = {type: "json", success: e.error});
var c = {};
a("openChat", c = "object" === _typeof(e.params) ? e.params : c)
}, answerAI: function (e) {
a("answerAI", e)
}, startAsrRecord: function (e) {
e && "object" === _typeof(e) && (e.success && (n.callbacks.startAsrRecordOnSuccess = {
type: "json",
success: e.success
}), e.error && (n.callbacks.startAsrRecordOnError = {
type: "json",
success: e.error
}), e.onVolume) && (n.callbacks.startAsrRecordOnVolume = {type: "", success: e.onVolume}), a("startAsrRecord", e)
}, stopAsrRecord: function (e) {
(e = "function" == typeof e ? {success: e} : e) && "object" === _typeof(e) && e.success && (n.callbacks.stopAsrRecordOnSuccess = {
type: "",
success: e.success
}), a("stopAsrRecord", e)
}, initChatSpeaking: function (e) {
a("initChatSpeaking", e)
}, startChatSpeaking: function (e) {
e && "object" === _typeof(e) && e.onFinish && (n.callbacks.startChatSpeakingOnFinish = {
type: "",
success: e.onFinish
}), a("startChatSpeaking", e)
}, stopChatSpeaking: function (e) {
(e = "function" == typeof e ? {success: e} : e) && "object" === _typeof(e) && e.success && (n.callbacks.stopChatSpeakingOnSuccess = {
type: "",
success: e.success
}), a("stopChatSpeaking", e)
}
};
window.mag = n
}();
File diff suppressed because it is too large Load Diff