Просмотр исходного кода

Merge branch 'master' of http://192.168.1.218:3000/liyingqu/cyzh-SoundOfMusic-H5

lyqu 4 лет назад
Родитель
Сommit
4125002db3
3 измененных файлов с 68 добавлено и 59 удалено
  1. 63 59
      common/utils/mixin.js
  2. 2 0
      pages/activityList/activity/authorBoost.vue
  3. 3 0
      pages/index/index.vue

+ 63 - 59
common/utils/mixin.js

@@ -2,65 +2,69 @@
  * 全局注入器
  */
 let page = {
-  data() {
-    return {
-		
-    }
-  },
-  methods: {
-    
-  },
-  onLoad(options) {
-	  if (!this.$u.test.isEmpty(options.activityId)) {
-		  console.log("**********************activityId",options.activityId);
-		  this.$u.api.activity.detail({id: options.activityId}).then(res => {
-		  	let userId=uni.getStorageSync("userId")
-			console.log("**********************userId",userId);
-		  	if (!this.$u.test.isEmpty(userId)) {
-					  let link=window.location.href
-		  			  if (link.indexOf("?")!=-1) {
-		  			  	 link=link+"&agenterId="+userId
-		  			  }else{
-		  				  link=link+"?agenterId="+userId
-		  			  }
-		  			  let obj={
-		  				  link,
-		  				  title:res.shareTitle,
-		  				  desc:res.shareDesc,
-						  imgUrl: res.shareImg
-		  			  }
-					  console.log("**********************obj",obj);
-		  			  this.$shareConfig(obj,this)
-		  	}
-		  	if (!this.$u.test.isEmpty(options.agenterId)) {
-				uni.setStorageSync("agenterId",options.agenterId)
-				let url=window.location.href
-				let len=url.indexOf("agenterId=")-1
-				let tmp= url.substring(0,len)
-				window.location.href=tmp
-		  	}
-		  })
-	  }else{
-		  let userId=uni.getStorageSync("userId")
-		  if (!this.$u.test.isEmpty(userId)) {
-		  		  let link=window.location.href
-		  		  if (link.indexOf("?")!=-1) {
-		  		  	 link=link+"&agenterId="+userId
-		  		  }else{
-		  			  link=link+"?agenterId="+userId
-		  		  }
-		  		  let obj={
-		  			  link,
-					  title: '',
-					  desc: link,
-		  		  }
-		  		  this.$shareConfig(obj,this)
-		  }
-		  if (!this.$u.test.isEmpty(options.agenterId)) {
-		  		  uni.setStorageSync("agenterId",options.agenterId)
-		  }
-	  }
-  }
+	data() {
+		return {
+
+		}
+	},
+	methods: {
+
+	},
+	onLoad(options) {
+		if (!this.$u.test.isEmpty(options.activityId)) {
+			this.$u.api.activity.detail({
+				id: options.activityId
+			}).then(res => {
+				let userId = uni.getStorageSync("userId")
+				if (!this.$u.test.isEmpty(userId)) {
+					let link = window.location.href
+					if (link.indexOf("?") != -1) {
+						link = link + "&agenterId=" + userId
+					} else {
+						link = link + "?agenterId=" + userId
+					}
+					let obj = {
+						link,
+						title: res.shareTitle,
+						desc: res.shareDesc,
+						imgUrl: res.shareImg
+					}
+					console.log("**********************obj", obj);
+					this.$shareConfig(obj, this)
+				}
+				if (!this.$u.test.isEmpty(options.agenterId)) {
+					uni.setStorageSync("agenterId", options.agenterId)
+					let url = window.location.href
+					let len = url.indexOf("agenterId=") - 1
+					let tmp = url.substring(0, len)
+					window.location.href = tmp
+				}
+			})
+		} else {
+			let userId = uni.getStorageSync("userId")
+			if (!this.$u.test.isEmpty(userId)) {
+				let link = window.location.href
+				if (link.indexOf("?") != -1) {
+					link = link + "&agenterId=" + userId
+				} else {
+					link = link + "?agenterId=" + userId
+				}
+				let obj = {
+					link,
+					title: '',
+					desc: link,
+				}
+				this.$shareConfig(obj, this)
+			}
+			if (!this.$u.test.isEmpty(options.agenterId)) {
+				uni.setStorageSync("agenterId", options.agenterId)
+				let url = window.location.href
+				let len = url.indexOf("agenterId=") - 1
+				let tmp = url.substring(0, len)
+				window.location.href = tmp
+			}
+		}
+	}
 }
 
 export default page

+ 2 - 0
pages/activityList/activity/authorBoost.vue

@@ -187,11 +187,13 @@
 			this.activityId = options.activityId;
 			this.senderId = uni.getStorageSync("userId");
 			this.receiverId = options.receiverId;
+			console.log(this.senderId);
 			if (!this.$u.test.isEmpty(this.senderId)) {
 				this.val = "https://music.nanyue6688.comm/vote-h5/index.html#/pages/activityList/activity/authorBoost?activityId=" + this.activityId + '&receiverId=' + this.receiverId + "&agenterId=" + this.senderId;
 			} else {
 				this.val = "https://music.nanyue6688.comm/vote-h5/index.html#/pages/activityList/activity/authorBoost?activityId=" + this.activityId + '&receiverId=' + this.receiverId;
 			}
+			console.log("*********************=>",this.val);
 			this.getBoostDetail(options.activityId, options.receiverId);
 			this.authorization();
 			

+ 3 - 0
pages/index/index.vue

@@ -29,6 +29,9 @@
 				
 			}
 		},
+		onLoad() {
+			// uni.setStorageSync("userId","1413461510759485442")
+		},
 		methods: {
 			change(index) {
 				this.current = index;