Quellcode durchsuchen

转发朋友圈携带参数

DELL vor 3 Jahren
Ursprung
Commit
e512da312b

+ 22 - 21
src/App.vue

@@ -13,31 +13,32 @@
 		methods: {
 			updateManager() {
 				const updateManager = uni.getUpdateManager();
-				updateManager.onCheckForUpdate(res => {
+				if(updateManager){
+					updateManager.onCheckForUpdate(res => {
 					// 请求完新版本信息的回调
-					// console.log(res.hasUpdate)
-				})
-				updateManager.onUpdateReady(() => {
-					uni.showModal({
-						title: '更新提示',
-						content: '新版本已经准备好,即将重启应用',
-						showCancel: false,
-						success(res) {
-							if (res.confirm) {
-								// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
-								updateManager.applyUpdate()
+					})
+					updateManager.onUpdateReady(() => {
+						uni.showModal({
+							title: '更新提示',
+							content: '新版本已经准备好,即将重启应用',
+							showCancel: false,
+							success(res) {
+								if (res.confirm) {
+									// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+									updateManager.applyUpdate()
+								}
 							}
-						}
+						})
 					})
-				})
-				updateManager.onUpdateFailed(() => {
-					// 新的版本下载失败
-					uni.showModal({
-						title: '更新提示',
-						content: '新版本下载失败',
-						showCancel: false
+					updateManager.onUpdateFailed(() => {
+						// 新的版本下载失败
+						uni.showModal({
+							title: '更新提示',
+							content: '新版本下载失败',
+							showCancel: false
+						})
 					})
-				})
+				}
 			},
 		}
 	}

+ 0 - 1
src/components/pay-popup/pay-popup.vue

@@ -84,7 +84,6 @@
 					res => {
 						if (res.code == 0) {
 							this.total = res.total
-							console.log(res);
 						}
 					}).catch(() => {
 				})

+ 7 - 2
src/packageOperate/activity/index.vue

@@ -348,7 +348,6 @@
 			//立即参与抽奖
 			exChangeCode(){
 				$http.post(`/api/v1/mp/user/marketing/generateCode/${this.id}`, {}).then( res => {
-					console.log(res);
 					if(res.code == 0){
 						this.getDetail()
 						setTimeout(()=>{
@@ -393,8 +392,14 @@
 		onShareTimeline() {
 			return {
 				title: '超值宝贝免费抽,参与活动仅需3秒',
-				path: `/packageOperate/activity/index?marketingId=${ this.info.id }&inviteCode=${ this.inviteCode }&userId=${ this.userInfo.userId }&type=1`,
 				imageUrl: 'https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/v2/free_draw_bkg.jpeg',
+				// query: { 
+				// 	marketingId:this.info.id,
+				// 	inviteCode: this.inviteCode,
+				// 	userId: this.userInfo.userId,
+				// 	type: 1,
+				// 	}
+				query: `marketingId=${ this.info.id }&inviteCode=${ this.inviteCode }&userId=${ this.userInfo.userId }&type=1`
 			}
 		}
 	}

+ 3 - 2
src/pages/activity/index.vue

@@ -97,7 +97,6 @@
 			if (opthios.type) {
 				uni.setStorageSync('shareType', opthios.type)
 			}
-			this.getBaseInfo()
 		},
 		onShow() {
 			if(uni.getStorageSync('token')) {
@@ -175,7 +174,9 @@
 		onShareTimeline() {
 			return {
 				title: '盲票,玩的就是有趣',
-				path: `/pages/index/index?userId=${ this.userInfo.userId }&type=1`
+				// query: { userId: this.userInfo.userId,
+				// 		type: 1, }
+				query: `userId=${ this.userInfo.userId }&type=1`
 			}
 		}
 	}

+ 7 - 4
src/pages/core/index.vue

@@ -223,6 +223,7 @@
 					},
 				],
 				userInfo: '',
+				loginState: '',
 			};
 		},
 		onLoad(opthios) {
@@ -236,12 +237,12 @@
 			this.getExclusive()
 			this.getClassify()
 			this.getSwiper()
-			
 		},
 		onShow() {
-			if(uni.getStorageSync('token')) {
-				this.getBaseInfo()
+			this.loginState = uni.getStorageSync('token') ? true : false
+			if (this.loginState) {
 				this.getBean()
+				this.getBaseInfo()
 			}
 		},
 		onPageScroll: function(e) {
@@ -508,7 +509,9 @@
 		onShareTimeline() {
 			return {
 				title: '盲票,玩的就是有趣',
-				path: `/pages/index/index?userId=${ this.userInfo.userId }&type=1`
+				// query: { userId: this.userInfo.userId,
+				// 		type: 1, }
+				query: `userId=${ this.userInfo.userId }&type=1`
 			}
 		}
 	}

+ 11 - 9
src/pages/index/index.vue

@@ -158,6 +158,13 @@
 			};
 		},
 		onLoad(opthios) {
+			console.log(opthios);
+			if (opthios.userId) {
+				uni.setStorageSync('shareUid', opthios.userId)
+			}
+			if (opthios.type) {
+				uni.setStorageSync('shareType', opthios.type)
+			}
 			/**
 			 * 票赢天下小程序分享盲票跳转接受的参数
 			 * shareUid: 用户ID
@@ -179,13 +186,6 @@
 				uni.setStorageSync('shareUid', opthios.uid)
 				uni.setStorageSync('shareType', opthios.t)
 			}
-			if (opthios.userId) {
-				uni.setStorageSync('shareUid', opthios.userId)
-			}
-			if (opthios.type) {
-				uni.setStorageSync('shareType', opthios.type)
-			}
-			
 			// #ifdef MP-WEIXIN
 			const res = uni.getMenuButtonBoundingClientRect()
 			this.statusHeight = res.top //胶囊距离顶部
@@ -205,7 +205,7 @@
 			
 			this.getList()
 		},
-		onShow(opthios) {
+		onShow() {
 			this.loginState = uni.getStorageSync('token') ? true : false
 			if (this.loginState) {
 				this.getBaseInfo()
@@ -537,7 +537,9 @@
 		onShareTimeline() {
 			return {
 				title: '盲票,玩的就是有趣',
-				path: `/pages/index/index?userId=${ this.userInfo.userId }&type=1`
+				// query: { userId: this.userInfo.userId,
+				// 		type: 1, },
+				query: `userId=${ this.userInfo.userId }&type=1`
 			}
 		}
 	}

+ 8 - 4
src/pages/ticketBox/detail.vue

@@ -199,13 +199,14 @@
 		
 		onShow() {
 			this.loginState = uni.getStorageSync('token') ? true : false
+			if(this.loginState) {
+				this.getBaseInfo()
+			}
 			this.pagesNum = getCurrentPages().length
 			if (this.boxId) {
 				this.getDetail()
 			}
-			if(this.loginState) {
-				this.getBaseInfo()
-			}
+			
 		},
 
 		methods: {
@@ -362,7 +363,10 @@
 		onShareTimeline() {
 			return {
 				title: '一起来刮盲票吧',
-				path: `/pages/ticketBox/detail?boxId=${ this.info.boxId }&userId=${ this.userInfo.userId }&type=1`,
+				// query: { userId: this.userInfo.userId,
+				// 		type: 1, },
+				query: `userId=${ this.userInfo.userId }&type=1`
+						
 			}
 		}
 	}

+ 4 - 9
src/pages/user/index.vue

@@ -119,14 +119,7 @@
 				userInfo: '',
 			};
 		},
-		onLoad(opthios) {
-			if (opthios.userId) {
-				uni.setStorageSync('shareUid', opthios.userId)
-			}
-			if (opthios.type) {
-				uni.setStorageSync('shareType', opthios.type)
-			}
-		},
+
 		onShow() {
 			this.loginState = uni.getStorageSync('token') ? true : false
 			if (this.loginState) {
@@ -246,7 +239,9 @@
 		onShareTimeline() {
 			return {
 				title: '盲票,玩的就是有趣',
-				path: `/pages/index/index?userId=${ this.userInfo.userId }&type=1`
+				// query: { userId: this.userInfo.userId,
+				// 		type: 1, },
+				query: `userId=${ this.userInfo.userId }&type=1`
 			}
 		}
 	}