agreement.page.js
1.95 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* /**
* 服务协议
* @author: zxr
* @date: 2016/10/27
*/
let $ = require('yoho-jquery');
let appVersion = $('input[name="app_version"]').val();
let yoho;
require('js/common');
yoho = require('js/yoho-app');
$('.pitch').on('click', function() {
if ($('.pitch').hasClass('select')) {
$(this).removeClass('select');
$(this).html('');
} else {
$(this).addClass('select');
$(this).html('');
}
});
$('.submit-btn').on('click', function() {
if ($('.pitch').hasClass('select')) {
if (appVersion === '1') {
let params = {
action: 'go.serviceClause',
params: {selected: 'Y'}
};
yoho.invokeMethod('go.serviceClause', params.params);
} else {
location.href = '//m.yohobuy.com/passport/reg/password' + window.location.search + '&selected=Y';
}
} else {
if (appVersion === '1') {
let params = {
action: 'go.serviceClause',
params: {selected: 'N'}
};
yoho.invokeMethod('go.serviceClause', params.params);
} else {
location.href = '//m.yohobuy.com/passport/reg/password' + window.location.search + '&selected=N';
}
}
});
$('.download-protocol-btn').on('click', function() {
let type = $(this).data('type');
let url = 'https://cdn.yoho.cn/yohobuy/pdf/YOHO!BUY用户服务协议.pdf';
if (type === 'privacy') {
url = 'https://cdn.yoho.cn/yohobuy/pdf/YOHO!BUY有货隐私条款.pdf';
}
if (appVersion === '1') {
let params = {
action: 'go.downloadProtocol',
params: {
url: url,
type: type
}
};
yoho.invokeMethod('go.downloadProtocol', params.params);
} else {
if (type === 'privacy') {
window.open(url);
} else {
window.open(url);
}
}
});