Selaa lähdekoodia

添加统计分享接口

306132416@qq.com 5 vuotta sitten
vanhempi
commit
a8ee2867ea
1 muutettua tiedostoa jossa 44 lisäystä ja 24 poistoa
  1. 44 24
      pages/index/index.vue

+ 44 - 24
pages/index/index.vue

@@ -82,30 +82,30 @@
 				pageInfo:{},
 				isAuth:getApp().globalData.isAuth,
 				productList:[
-					{   
-						id:'1',
-						imgUrl:'/static/bed-bg.png',
-						productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
-						price:'13999'
-					},
-					{   
-						id:'2',
-						imgUrl:'/static/bed2-bg.png',
-						productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
-						price:'15999'
-					},
-					{   
-						id:'3',
-						imgUrl:'/static/bed-bg.png',
-						productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
-						price:'16999'
-					},
-					{   
-						id:'4',
-						imgUrl:'/static/bed2-bg.png',
-						productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
-						price:'18999'
-					}
+					// {   
+					// 	id:'1',
+					// 	imgUrl:'/static/bed-bg.png',
+					// 	productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
+					// 	price:'13999'
+					// },
+					// {   
+					// 	id:'2',
+					// 	imgUrl:'/static/bed2-bg.png',
+					// 	productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
+					// 	price:'15999'
+					// },
+					// {   
+					// 	id:'3',
+					// 	imgUrl:'/static/bed-bg.png',
+					// 	productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
+					// 	price:'16999'
+					// },
+					// {   
+					// 	id:'4',
+					// 	imgUrl:'/static/bed2-bg.png',
+					// 	productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
+					// 	price:'18999'
+					// }
 				]
 			}
 		},
@@ -125,6 +125,25 @@
 			    }
 		},
 		methods: {
+			getShareInfo(uid){
+				uni.request({
+					url: getApp().globalData.shareUrl, //需要设置为全局
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						method: 'addShare',
+						timestamp: getApp().globalData.globalTimestamp, //Date.now()
+						shangjiid:getApp().globalData.lastId || uid,
+						userid:uid,
+						sign: md5('addShare' + getApp().globalData.globalTimestamp)
+					},
+					success: res => {
+						console.log(res)
+					}
+				});
+			},
 			 loginRequest(){
 				 	uni.login({
 				 		success: (res) => {
@@ -155,6 +174,7 @@
 									// getApp().globalData.total_times = res.data.msg.total_times;
 									this.isAuth = getApp().globalData.isAuth;
 									this.getPageInfo(res.data.msg.id);
+									this.getShareInfo(res.data.msg.id)
 				 				}
 				 			});
 				 	}