Commit 9f02c31a532e45d69fe1f3e3f042c17d19c125f7

Authored by 王强
1 parent f4376c6b

优选库——优选,分享出来的列表页,App外点击列表项目提示拉起App

src/pages/common/common.vue
... ... @@ -933,7 +933,11 @@
933 933 } else {
934 934  
935 935 // H5唤起App
936   - options.success(options.success_params.callApp, options.success_params.path, options.success_params.param);
  936 + if (options.success_params) {
  937 + options.success(options.success_params.callApp, options.success_params.path, options.success_params.param);
  938 + } else {
  939 + options.success();
  940 + }
937 941 }
938 942 },
939 943  
... ...
src/pages/discountList/discountList.vue
... ... @@ -474,15 +474,34 @@
474 474 */
475 475 toDetail(item) {
476 476  
477   - // 判断通用跳转函数是否存在
478   - if (typeof this.$parent.gotoDetail === 'function') {
  477 + // 判断App内
  478 + if (this.isCNLive.value) {
479 479  
  480 + // 判断通用跳转函数是否存在
  481 + if (typeof this.$parent.gotoDetail === 'function') {
  482 +
  483 +
  484 + console.log('toDetail', item);
  485 +
  486 +
  487 + // 通用跳转
  488 + this.$parent.gotoDetail(item);
  489 + }
  490 + } else {
480 491  
481   - console.log('toDetail', item);
  492 + this.$nextTick(() => {
482 493  
  494 + // 唤起App
  495 + if (typeof this.$parent.callAppModal === 'function' && typeof this.$refs.callApp === 'object') {
  496 +
  497 + // 设置唤起参数
  498 + let options = {
  499 + success: this.$refs.callApp.callApp
  500 + }
483 501  
484   - // 通用跳转
485   - this.$parent.gotoDetail(item);
  502 + this.$parent.callAppModal(options);
  503 + }
  504 + });
486 505 }
487 506 },
488 507 /**
... ... @@ -493,12 +512,6 @@
493 512 this.toDetail(item);
494 513 },
495 514  
496   -
497   -
498   -
499   -
500   -
501   -
502 515 /**
503 516 * 分享
504 517 */
... ...
src/pages/hotSaleList/hotSaleList.vue
... ... @@ -174,18 +174,37 @@
174 174 */
175 175 toDetail(item) {
176 176  
177   - // 判断通用跳转函数是否存在
178   - if (typeof this.$parent.gotoDetail === 'function') {
179   -
180   - // 跳转参数
181   - let params = {
182   - type: '2',
183   - to: item.id,
184   - shop_type: item.shop_type
185   - };
186   -
187   - // 通用跳转
188   - this.$parent.gotoDetail(params);
  177 + // 判断App内
  178 + if (this.isCNLive.value) {
  179 +
  180 + // 判断通用跳转函数是否存在
  181 + if (typeof this.$parent.gotoDetail === 'function') {
  182 +
  183 + // 跳转参数
  184 + let params = {
  185 + type: '2',
  186 + to: item.id,
  187 + shop_type: item.shop_type
  188 + };
  189 +
  190 + // 通用跳转
  191 + this.$parent.gotoDetail(params);
  192 + }
  193 + } else {
  194 +
  195 + this.$nextTick(() => {
  196 +
  197 + // 唤起App
  198 + if (typeof this.$parent.callAppModal === 'function' && typeof this.$refs.callApp === 'object') {
  199 +
  200 + // 设置唤起参数
  201 + let options = {
  202 + success: this.$refs.callApp.callApp
  203 + }
  204 +
  205 + this.$parent.callAppModal(options);
  206 + }
  207 + });
189 208 }
190 209 },
191 210  
... ...
src/pages/optimizationList/optimizationList.vue
... ... @@ -260,15 +260,34 @@
260 260 */
261 261 toDetail(item) {
262 262  
263   - // 判断通用跳转函数是否存在
264   - if (typeof this.$parent.gotoDetail === 'function') {
  263 + // 判断App内
  264 + if (this.isCNLive.value) {
265 265  
  266 + // 判断通用跳转函数是否存在
  267 + if (typeof this.$parent.gotoDetail === 'function') {
  268 +
  269 +
  270 + console.log('toDetail', item);
  271 +
  272 +
  273 + // 通用跳转
  274 + this.$parent.gotoDetail(item);
  275 + }
  276 + } else {
266 277  
267   - console.log('toDetail', item);
  278 + this.$nextTick(() => {
268 279  
  280 + // 唤起App
  281 + if (typeof this.$parent.callAppModal === 'function' && typeof this.$refs.callApp === 'object') {
  282 +
  283 + // 设置唤起参数
  284 + let options = {
  285 + success: this.$refs.callApp.callApp
  286 + }
269 287  
270   - // 通用跳转
271   - this.$parent.gotoDetail(item);
  288 + this.$parent.callAppModal(options);
  289 + }
  290 + });
272 291 }
273 292 },
274 293  
... ... @@ -280,12 +299,6 @@
280 299 this.toDetail(item);
281 300 },
282 301  
283   -
284   -
285   -
286   -
287   -
288   -
289 302 /**
290 303 * 分享
291 304 */
... ...