Commit 89e8e489f5659b22783e9d6b77a49ed62f558f5d

Authored by 王强
1 parent c7a224c1

购好物,返回搜索页面时刷新页面数据~

Showing 1 changed file with 27 additions and 16 deletions
src/pages/search/search.vue
@@ -719,24 +719,29 @@ @@ -719,24 +719,29 @@
719 */ 719 */
720 toDarenProfile(item) { 720 toDarenProfile(item) {
721 721
722 - // 全部跳转H5达人相关页面,达人个人主页连接  
723 - if (item.id) {  
724 - window.location.href = (this.mode == "prod") ? "https://managemall.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?id=" + item.id + "&from=redirect" + (this.getStore("uid") ? "&uid=" + this.getStore("uid") : "") : "https://wjjshop.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?id=" + item.id + "&from=redirect" + (this.getStore("uid") ? "&uid=" + this.getStore("uid") : "");  
725 - } 722 + // 判断是否在App内
  723 + if (this.isCNLive.value) {
726 724
727 - // // 判断并调用通用跳转  
728 - // if (typeof this.$parent.gotoDetail === "function") { 725 + // 判断并调用通用跳转
  726 + if (typeof this.$parent.gotoDetail === "function" && item.id) {
  727 +
  728 + // 构造跳转参数
  729 + let options = {
  730 + type: "5",
  731 + to: (this.mode == "prod") ? "https://managemall.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?id=" + item.id + "&from=redirect" + (this.getStore("uid") ? "&uid=" + this.getStore("uid") : "") : "https://wjjshop.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?id=" + item.id + "&from=redirect" + (this.getStore("uid") ? "&uid=" + this.getStore("uid") : ""),
  732 + shop_type: ""
  733 + }
729 734
730 - // // 构造跳转参数  
731 - // let options = {  
732 - // type: "24",  
733 - // to: item.id,  
734 - // shop_type: ""  
735 - // } 735 + // 调用通用跳转
  736 + this.$parent.gotoDetail(options);
  737 + }
  738 + } else {
736 739
737 - // // 调用通用跳转  
738 - // this.$parent.gotoDetail(options);  
739 - // } 740 + // 全部跳转H5达人相关页面,达人个人主页连接
  741 + if (item.id) {
  742 + window.location.href = (this.mode == "prod") ? "https://managemall.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?id=" + item.id + "&from=redirect" + (this.getStore("uid") ? "&uid=" + this.getStore("uid") : "") : "https://wjjshop.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?id=" + item.id + "&from=redirect" + (this.getStore("uid") ? "&uid=" + this.getStore("uid") : "");
  743 + }
  744 + }
740 }, 745 },
741 746
742 /** 747 /**
@@ -949,18 +954,24 @@ @@ -949,18 +954,24 @@
949 // this.$parent.helper.getLocation(this.positionCallback, this.positionErrorCallback, this.initPage); 954 // this.$parent.helper.getLocation(this.positionCallback, this.positionErrorCallback, this.initPage);
950 // } 955 // }
951 956
952 -  
953 // 页面切换可见状态监听 957 // 页面切换可见状态监听
954 document.addEventListener('visibilitychange', () => { 958 document.addEventListener('visibilitychange', () => {
955 959
956 // 页面显示出来了 960 // 页面显示出来了
957 if (document.hidden === false && this.$route.name == 'search') { 961 if (document.hidden === false && this.$route.name == 'search') {
958 962
  963 + // 判断设备和浏览器类型
  964 + let ua = window.navigator.userAgent.toLowerCase();
  965 +
959 // 判断UA,如果是华为手机或者荣耀手机,重新初始化页面 966 // 判断UA,如果是华为手机或者荣耀手机,重新初始化页面
960 if(ua.match(/HUAWEI/i) == "huawei" || ua.match(/HONOR/i) == "honor") { 967 if(ua.match(/HUAWEI/i) == "huawei" || ua.match(/HONOR/i) == "honor") {
961 968
962 // 初始化页面 969 // 初始化页面
963 this.initPage(); 970 this.initPage();
  971 + } else {
  972 +
  973 + // 初始化页面
  974 + this.initPage();
964 } 975 }
965 } 976 }
966 }); 977 });