-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJUMP_CLOSE.js
More file actions
56 lines (49 loc) · 1.52 KB
/
JUMP_CLOSE.js
File metadata and controls
56 lines (49 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
'use strict';
/**
* @api JUMP_CLOSE(url) JUMP_CLOSE
* @apiGroup APP
* @apiVersion 1.0.0
* @apiParam {string} url 目标URL地址
* @apiDescription APP 关闭当前页面并跳转下一页,下一页可为 h5 或原生
* @apiUse APPNpm
* @apiUse APPJs
* @apiParamExample {string} 例子
* JUMP_CLOSE() 关闭当前页面
* JUMP_CLOSE('https://www.baidu.com') 外部地址
* JUMP_CLOSE('https://gift.yingyinglicai.com/activity/invite/???') 活动地址
* JUMP_CLOSE('tab.ly/???') 原生地址
* @apiParamExample {string} 返回值
* 无
**/
/**
* todo JUMP
*/
Object.defineProperty(exports, "__esModule", {
value: true
});
var _config = require('./APP/config');
var _BROWSER = require('./BROWSER');
var _BROWSER2 = _interopRequireDefault(_BROWSER);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var name = 'JUMP_CLOSE';
var JUMP_CLOSE = function JUMP_CLOSE(url) {
if (!url) {
(0, _config.WinJSDec)(function (_) {
window.WinJSBridge.call('webview', 'close');
});
} else {
if (typeof url !== 'string') {
throw new TypeError('[' + name + '] not a string');
}
if (_BROWSER2.default.isClient) {
/^(page.ly|tab.ly).*/.test(url) ? url = 'yylc://app.yingyinglicai.com/' + url : void 0;
(0, _config.WinJSDec)(function (_) {
window.WinJSBridge.call('navigation', 'jumpAndClosePage', { url: url });
});
} else {
window.location.href = url;
}
}
};
exports.default = JUMP_CLOSE;
//# sourceMappingURL=JUMP_CLOSE.js.map