|
@@ -8,12 +8,12 @@ |
|
@@ -8,12 +8,12 @@ |
8
|
*
|
8
|
*
|
9
|
* 希望能与 微信 JS-SDK 一样方便
|
9
|
* 希望能与 微信 JS-SDK 一样方便
|
10
|
*/
|
10
|
*/
|
11
|
-const $ = require('yoho-jquery');
|
11
|
+
|
12
|
const tip = require('common/tip');
|
12
|
const tip = require('common/tip');
|
13
|
const native = window.yohoInterface;
|
13
|
const native = window.yohoInterface;
|
14
|
|
14
|
|
15
|
window.yohoWapInterface = {
|
15
|
window.yohoWapInterface = {
|
16
|
- headerRightTopBtn: $.loop()
|
16
|
+ headerRightTopBtn: function() {}
|
17
|
};
|
17
|
};
|
18
|
|
18
|
|
19
|
const yoho = {
|
19
|
const yoho = {
|
|
@@ -35,7 +35,7 @@ const yoho = { |
|
@@ -35,7 +35,7 @@ const yoho = { |
35
|
*/
|
35
|
*/
|
36
|
goTap(args, success, fail) {
|
36
|
goTap(args, success, fail) {
|
37
|
if (this.isApp) {
|
37
|
if (this.isApp) {
|
38
|
- native.triggerEvent(success || $.loop(), fail || $.loop(), {
|
38
|
+ native.triggerEvent(success || function() {}, fail || function() {}, {
|
39
|
method: 'go.tab',
|
39
|
method: 'go.tab',
|
40
|
arguments: args
|
40
|
arguments: args
|
41
|
});
|
41
|
});
|
|
@@ -52,7 +52,7 @@ const yoho = { |
|
@@ -52,7 +52,7 @@ const yoho = { |
52
|
*/
|
52
|
*/
|
53
|
goLogin(args, success, fail) {
|
53
|
goLogin(args, success, fail) {
|
54
|
if (this.isApp) {
|
54
|
if (this.isApp) {
|
55
|
- native.triggerEvent(success || $.loop(), fail || $.loop(), {
|
55
|
+ native.triggerEvent(success || function() {}, fail || function() {}, {
|
56
|
method: 'go.login',
|
56
|
method: 'go.login',
|
57
|
arguments: args
|
57
|
arguments: args
|
58
|
});
|
58
|
});
|
|
@@ -69,7 +69,7 @@ const yoho = { |
|
@@ -69,7 +69,7 @@ const yoho = { |
69
|
*/
|
69
|
*/
|
70
|
goShopingCart(args, success, fail) {
|
70
|
goShopingCart(args, success, fail) {
|
71
|
if (this.isApp) {
|
71
|
if (this.isApp) {
|
72
|
- native.triggerEvent(success || $.loop(), fail || $.loop(), {
|
72
|
+ native.triggerEvent(success || function() {}, fail || function() {}, {
|
73
|
method: 'go.shopingCart',
|
73
|
method: 'go.shopingCart',
|
74
|
arguments: args
|
74
|
arguments: args
|
75
|
});
|
75
|
});
|
|
@@ -86,7 +86,7 @@ const yoho = { |
|
@@ -86,7 +86,7 @@ const yoho = { |
86
|
*/
|
86
|
*/
|
87
|
goAddress(args, success, fail) {
|
87
|
goAddress(args, success, fail) {
|
88
|
if (this.isApp) {
|
88
|
if (this.isApp) {
|
89
|
- native.triggerEvent(success || $.loop(), fail || $.loop(), {
|
89
|
+ native.triggerEvent(success || function() {}, fail || function() {}, {
|
90
|
method: 'go.address',
|
90
|
method: 'go.address',
|
91
|
arguments: args
|
91
|
arguments: args
|
92
|
});
|
92
|
});
|
|
@@ -103,7 +103,7 @@ const yoho = { |
|
@@ -103,7 +103,7 @@ const yoho = { |
103
|
*/
|
103
|
*/
|
104
|
goImageBrowser(args, success, fail) {
|
104
|
goImageBrowser(args, success, fail) {
|
105
|
if (this.isApp) {
|
105
|
if (this.isApp) {
|
106
|
- native.triggerEvent(success || $.loop(), fail || $.loop(), {
|
106
|
+ native.triggerEvent(success || function() {}, fail || function() {}, {
|
107
|
method: 'go.imageBrowser',
|
107
|
method: 'go.imageBrowser',
|
108
|
arguments: args
|
108
|
arguments: args
|
109
|
});
|
109
|
});
|
|
@@ -120,7 +120,7 @@ const yoho = { |
|
@@ -120,7 +120,7 @@ const yoho = { |
120
|
*/
|
120
|
*/
|
121
|
goNewPage(args, success, fail) {
|
121
|
goNewPage(args, success, fail) {
|
122
|
if (this.isApp) {
|
122
|
if (this.isApp) {
|
123
|
- native.triggerEvent(success || $.loop(), fail || $.loop(), {
|
123
|
+ native.triggerEvent(success || function() {}, fail || function() {}, {
|
124
|
method: 'go.newPage',
|
124
|
method: 'go.newPage',
|
125
|
arguments: args
|
125
|
arguments: args
|
126
|
});
|
126
|
});
|
|
@@ -137,7 +137,7 @@ const yoho = { |
|
@@ -137,7 +137,7 @@ const yoho = { |
137
|
*/
|
137
|
*/
|
138
|
goPay(args, success, fail) {
|
138
|
goPay(args, success, fail) {
|
139
|
if (this.isApp) {
|
139
|
if (this.isApp) {
|
140
|
- native.triggerEvent(success || $.loop(), fail || $.loop(), {
|
140
|
+ native.triggerEvent(success || function() {}, fail || function() {}, {
|
141
|
method: 'go.pay',
|
141
|
method: 'go.pay',
|
142
|
arguments: args
|
142
|
arguments: args
|
143
|
});
|
143
|
});
|
|
@@ -147,6 +147,40 @@ const yoho = { |
|
@@ -147,6 +147,40 @@ const yoho = { |
147
|
},
|
147
|
},
|
148
|
|
148
|
|
149
|
/**
|
149
|
/**
|
|
|
150
|
+ * 回到上一个原生界面
|
|
|
151
|
+ * @param args
|
|
|
152
|
+ * @param success
|
|
|
153
|
+ * @param fail
|
|
|
154
|
+ */
|
|
|
155
|
+ goBack(args, success, fail) {
|
|
|
156
|
+ if (this.isApp) {
|
|
|
157
|
+ native.triggerEvent(success || function() {}, fail || function() {}, {
|
|
|
158
|
+ method: 'go.back',
|
|
|
159
|
+ arguments: args
|
|
|
160
|
+ });
|
|
|
161
|
+ } else {
|
|
|
162
|
+ tip('暂不支持,请在BLK应用中打开');
|
|
|
163
|
+ }
|
|
|
164
|
+ },
|
|
|
165
|
+
|
|
|
166
|
+ /**
|
|
|
167
|
+ * 分享
|
|
|
168
|
+ * @param args
|
|
|
169
|
+ * @param success
|
|
|
170
|
+ * @param fail
|
|
|
171
|
+ */
|
|
|
172
|
+ goShare(args, success, fail) {
|
|
|
173
|
+ if (this.isApp) {
|
|
|
174
|
+ native.triggerEvent(success || function() {}, fail || function() {}, {
|
|
|
175
|
+ method: 'go.share',
|
|
|
176
|
+ arguments: args
|
|
|
177
|
+ });
|
|
|
178
|
+ } else {
|
|
|
179
|
+ tip('暂不支持,请在BLK应用中打开');
|
|
|
180
|
+ }
|
|
|
181
|
+ },
|
|
|
182
|
+
|
|
|
183
|
+ /**
|
150
|
* 原生调用 JS 方法
|
184
|
* 原生调用 JS 方法
|
151
|
* @param name 方法名
|
185
|
* @param name 方法名
|
152
|
* @param callback 回调
|
186
|
* @param callback 回调
|