浏览代码

分享朋友圈携带uid

DELL 3 年之前
父节点
当前提交
394713b6ce
共有 5 个文件被更改,包括 59 次插入7 次删除
  1. 11 1
      src/pages/activity/index.vue
  2. 11 1
      src/pages/core/index.vue
  3. 15 4
      src/pages/index/index.vue
  4. 7 0
      src/pages/ticketBox/detail.vue
  5. 15 1
      src/pages/user/index.vue

+ 11 - 1
src/pages/activity/index.vue

@@ -84,12 +84,14 @@
 					disabled: true
 				}],
 				triggerStatus: 0,
+				userInfo: '',
 			}
 		},
 		onLoad(opthios) {
 			if (opthios.triggerStatus) {
 				this.triggerStatus = opthios.triggerStatus
 			}
+			this.getBaseInfo()
 		},
 		onShow() {
 			this.pageList()
@@ -143,6 +145,14 @@
 					this.loading = false
 				})
 			},
+			getBaseInfo() {
+				$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
+					uni.hideLoading();
+					if (res.code == 0) {
+						this.userInfo = res.data
+					}
+				})
+			},
 
 		},
 		//分享好友
@@ -156,7 +166,7 @@
 		onShareTimeline() {
 			return {
 				title: '盲票,玩的就是有趣',
-				path: '/pages/index/index'
+				path: `/pages/index/index?userId=${ this.userInfo.userId }&type=1`
 			}
 		}
 	}

+ 11 - 1
src/pages/core/index.vue

@@ -222,6 +222,7 @@
 						desc: '以上'
 					},
 				],
+				userInfo: '',
 			};
 		},
 		onLoad() {
@@ -229,6 +230,7 @@
 			this.getExclusive()
 			this.getClassify()
 			this.getSwiper()
+			this.getBaseInfo()
 		},
 		onShow() {
 			if(uni.getStorageSync('token')) {
@@ -467,6 +469,14 @@
 					url: `/packageGoods/goods/list?name=${ item.name }&categoryId=${ item.categoryId ? item.categoryId : '' }`
 				})
 			},
+			getBaseInfo() {
+				$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
+					uni.hideLoading();
+					if (res.code == 0) {
+						this.userInfo = res.data
+					}
+				})
+			},
 		},
 		onReachBottom() {
 			// 判断是否有数据
@@ -491,7 +501,7 @@
 		onShareTimeline() {
 			return {
 				title: '盲票,玩的就是有趣',
-				path: '/pages/index/index'
+				path: `/pages/index/index?userId=${ this.userInfo.userId }&type=1`
 			}
 		}
 	}

+ 15 - 4
src/pages/index/index.vue

@@ -153,7 +153,8 @@
 				filterActivityList: [],
 				activityTime: null,
 				ticketInfo: {},
-				clickLoading: true
+				clickLoading: true,
+				userInfo: '',
 			};
 		},
 		onLoad(opthios) {
@@ -194,7 +195,8 @@
 			
 			let num = Math.round(100 / this.list.length)
 			this.percentage = num
-
+			
+			this.getBaseInfo()
 			this.getList()
 		},
 		onShow(opthios) {
@@ -504,7 +506,16 @@
 				uni.navigateTo({
 					url: '/packageOther/rule/index'
 				})
-			}
+			},
+			
+			getBaseInfo() {
+				$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
+					uni.hideLoading();
+					if (res.code == 0) {
+						this.userInfo = res.data
+					}
+				})
+			},
 		},
 		//分享好友
 		onShareAppMessage(res) {
@@ -517,7 +528,7 @@
 		onShareTimeline() {
 			return {
 				title: '盲票,玩的就是有趣',
-				path: '/pages/index/index'
+				path: `/pages/index/index?userId=${ this.userInfo.userId }&type=1`
 			}
 		}
 	}

+ 7 - 0
src/pages/ticketBox/detail.vue

@@ -358,6 +358,13 @@
 				path: `/pages/ticketBox/detail?boxId=${ this.info.boxId }&userId=${ this.userInfo.userId }&type=1`,
 				type: 2,
 			}
+		},
+		//分享朋友圈
+		onShareTimeline() {
+			return {
+				title: '一起来刮盲票吧',
+				path: `/pages/ticketBox/detail?boxId=${ this.info.boxId }&userId=${ this.userInfo.userId }&type=1`,
+			}
 		}
 	}
 </script>

+ 15 - 1
src/pages/user/index.vue

@@ -116,8 +116,13 @@
 				info: {},
 				authShow: false,
 				initData: {},
+				userInfo: '',
 			};
 		},
+		
+		onLoad() {
+			this.getBaseInfo()
+		},
 
 		onShow() {
 			this.loginState = uni.getStorageSync('token') ? true : false
@@ -226,6 +231,15 @@
 				})
 				// #endif
 			},
+			
+			getBaseInfo() {
+				$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
+					uni.hideLoading();
+					if (res.code == 0) {
+						this.userInfo = res.data
+					}
+				})
+			},
 		},
 		//分享好友
 		onShareAppMessage(res) {
@@ -238,7 +252,7 @@
 		onShareTimeline() {
 			return {
 				title: '盲票,玩的就是有趣',
-				path: '/pages/index/index'
+				path: `/pages/index/index?userId=${ this.userInfo.userId }&type=1`
 			}
 		}
 	}