Commit fa9cc451a815a1da61f02ac2993b9ca0cc48fa0d

Authored by 王强
1 parent 99922a00

购好物,从getOpenApp函数处理渠道码传值~

Showing 1 changed file with 14 additions and 0 deletions
src/pages/common/common.vue
@@ -650,6 +650,20 @@ @@ -650,6 +650,20 @@
650 // 判断非App内 650 // 判断非App内
651 if (!this.isCNLive.value) { 651 if (!this.isCNLive.value) {
652 652
  653 + // 判断是否有渠道参数,如果有,添加到ext参数中
  654 + if (this.$route.query && this.$route.query.cnlive_union_activity_id && (!params.ext || !params.ext.cnlive_union_activity_id)) {
  655 +
  656 + // 判断ext参数是否存在,如果不存在,初始化params.ext
  657 + if (!params.ext) {
  658 +
  659 + // 初始化params.ext
  660 + this.$set(params, 'ext', {});
  661 + }
  662 +
  663 + // 设置渠道参数到ext参数中
  664 + this.$set(params.ext, 'cnlive_union_activity_id', this.$route.query.cnlive_union_activity_id);
  665 + }
  666 +
653 // 处理扩展参数转为字符串传参 667 // 处理扩展参数转为字符串传参
654 if (params.ext && typeof params.ext === "object") { 668 if (params.ext && typeof params.ext === "object") {
655 this.$set(params, "ext", JSON.stringify(params.ext)); 669 this.$set(params, "ext", JSON.stringify(params.ext));