Przeglądaj źródła

排行榜卡片分享

lyb 4 lat temu
rodzic
commit
48f77de06c
1 zmienionych plików z 24 dodań i 0 usunięć
  1. 24 0
      pages/rank/rank.vue

+ 24 - 0
pages/rank/rank.vue

@@ -165,6 +165,7 @@
 			// #endif
 
 			// #ifdef H5
+			this.getActivityParams();
 			this.isH5 = true
 			//h5端要延时才能获取到mescroll对象
 			setTimeout(() => {
@@ -173,6 +174,29 @@
 			// #endif
 		},
 		methods: {
+			/**
+			 * 获取活动参数
+			 */
+			async getActivityParams() {
+				if(this.$isNotEmpty(this.vuex_active_setting)){ //有缓存直接从缓存获取
+					this.vuex_active_setting.shareParam.link = window.location.href
+					this.$shareConfig.H5Share(this.vuex_active_setting.shareParam)
+				}else{
+					let params = {
+						activeId: this.activeId,
+						platformSettingEnum: 'ACTIVE_SETTING'
+					}
+					let activeSetting = JSON.parse((await this.$api.platform.getPlatformValue(params)).data.data);
+					if (this.$isNotEmpty(activeSetting.shareParam)) {
+						let shareParam=activeSetting.shareParam
+						shareParam.link=window.location.href
+						this.$shareConfig.H5Share(shareParam)
+					}
+					activeSetting.defaultActiveId = this.activeId
+					this.$u.vuex('vuex_active_setting', activeSetting);
+				}
+				
+			},
 			downCallback() {
 				setTimeout(() => {
 					this.mescroll.resetUpScroll();