Przeglądaj źródła

commit -m 行为轨迹记录

zhengjinyi 2 lat temu
rodzic
commit
1417c96d7d

+ 1 - 2
pages/search/search-supplier.vue

@@ -128,7 +128,6 @@
 			},	
 			searchsupplierList(){//搜索
 				this.listQuery.pageNum=1
-				uni.setStorageSync('pageLabel',this.listQuery.keyword)
 				this.GetSearchSupplierList()
 				// 友盟埋点供应商搜索点击
 				if(process.env.NODE_ENV != 'development'){
@@ -140,6 +139,7 @@
 				}
 			},
 			GetSearchSupplierList(){//查询供应商列表	
+				uni.setStorageSync('pageLabel',this.listQuery.keyword)
 				this.ShopService.GetSearchSupplierList(this.listQuery).then(response =>{
 					let data = JSON.parse(response.data)
 					let dataList = data.items
@@ -190,7 +190,6 @@
 				}else{					
 					this.isShowClose = false
 					this.listQuery.pageNum=1
-					uni.setStorageSync('pageLabel',this.listQuery.keyword)
 					this.GetSearchSupplierList()
 				}
 			},

+ 6 - 5
pages/second/product/components/secondRecommend.vue

@@ -22,9 +22,9 @@
 	export default{
 		name:'recommend',
 		props:{
-			queryProductid: {
+			productId: {
 				// Unistars类型
-				type: String,
+				type: Number,
 			}
 		},
 		components:{
@@ -41,8 +41,9 @@
 			}
 		},
 		created() {
-			this.productID = this.queryProductid
-			this.infoRecommend(this.queryProductid)
+			this.productID = this.productId
+			console.log('productID',this.productID)
+			this.infoRecommend(this.productID)
 		},
 		methods:{
 			infoRecommend(id){
@@ -54,7 +55,7 @@
 						this.isEmpty = true
 					}
 				}).catch(error =>{
-					this.$util.msg(error.msg,2000)
+					console.log('error',error)
 				})
 			},
 			//轮播图切换修改背景色

+ 7 - 7
pages/second/product/product-details.vue

@@ -117,12 +117,12 @@
 						<!-- 相关推荐 -->
 						<view class="title"><view class="title-tab">相关推荐</view></view>
 						<view class="content hot">
-							<recommend :query-productId="product.productId" v-if="isRequest" ></recommend>
+							<recommend :productId="product.productId" v-if="isRequest" ></recommend>
 						</view>
 					</view>
 					<!-- 商品参数 -->
 					<tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
-						<view class="tui-popup-box clearfix">
+						<view class="tui-popup-box clearfix"> 
 							<view class="title">商品参数</view>
 						    <cm-parameter :product="product" :goodsData="goodsData" ></cm-parameter>
 							<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
@@ -195,8 +195,8 @@
 				isIphoneX:this.$store.state.isIphoneX,
 				windowHeight: '',
 				headerColor:false,
-				backPage:1,
-				nvabarData: {							 //顶部自定义导航
+				backPage:1, 
+				nvabarData: {					 		 //顶部自定义导航
 					showCapsule: 1, // 是否显示左上角图标   1表示显示    0表示不显示
 					title: ''		// 导航栏 中间的标题
 				},
@@ -230,17 +230,17 @@
 				this.SecondService.ProductDetail({productId:this.productId,userId:this.userId}).then(response =>{
 					this.skeletonShow = false
 					this.productImage=[]
-					this.shop = response.data.shop
 					this.product = response.data
 					uni.setStorageSync('pageLabel', `${response.data.brandName}`)
+					this.shop = response.data.shop
 					//处理商品图片列表
 					this.product.imageList.forEach(item =>{
 						this.productImage.push(item)
 					})
 					setTimeout(()=>{
 						this.getSectionProps()
+						this.isRequest = true
 					},2000)
-					this.isRequest = true
 				}).catch(error =>{
 					console.log(error)
 					this.skeletonShow = false
@@ -352,7 +352,7 @@
 			},
 			activeTab: debounce((top, _this)=> {//当滑动时也能同步激活tab
 				const { sectionTopRangeArr } = _this
-				if(sectionTopRangeArr.length > 0) {
+				if(sectionTopRangeArr.length > 0) { 
 					sectionTopRangeArr.forEach((item, index) => {
 						let splitItem = item.split('-'),
 							openInterval = Number(splitItem[0]),

+ 2 - 2
services/config.env.js

@@ -8,7 +8,7 @@ if(process.env.NODE_ENV === 'development'){
     // URL_CONFIG = 'https://core.caimei365.com'  
 }else{
     // 生产环境
-    // URL_CONFIG = 'https://core-b.caimei365.com'
-    URL_CONFIG = 'https://core.caimei365.com'
+    URL_CONFIG = 'https://core-b.caimei365.com'
+    // URL_CONFIG = 'https://core.caimei365.com'
 }
 export default URL_CONFIG

+ 8 - 4
utils/residence.js

@@ -21,7 +21,7 @@ const defaultParams = {
     accessDuration: 0, //浏览时长初始值为 0
     pageType: '', //页面类型
     pageLabel: '', //页面标签
-    userId: userSync ? userSync.userId : 0, //用户Id
+    userId: userSync.userId ? userSync.userId : 0, //用户Id
     productId: 0 //商品Id
 }
 
@@ -52,14 +52,18 @@ async function userBehavior(current, prev) {
         console.log('当前页面:', current.path)
         console.log('离开页面:', prev.path)
         // 接口参数设置
-		 const pageData = isIncludeType(prev.path)
+        const pageData = isIncludeType(prev.path)
         defaultParams.pagePath = prev.fullPath
         defaultParams.pageType = pageData ? pageData.pageType : ''
-        defaultParams.productId = prev.query.id ? prev.query.id : 0
+        if (prev.path === '/pages/goods/product' || prev.path === '/pages/second/product/product-details') {
+            defaultParams.productId = prev.query.id ? prev.query.id : 0
+        }
         defaultParams.pageLabel = uni.getStorageSync('pageLabel')
         // 调用接口
-        console.log('记录路径:', prev.path, '停留时间:', defaultParams.accessDuration,'ms','标签:', defaultParams.pageLabel)
+        console.log('记录路径:', prev.path, '停留时间:', defaultParams.accessDuration, 'ms', '标签:', defaultParams.pageLabel)
         await UserApi.userRecordStatistics(defaultParams)
+        // 删除标记标签名
+        uni.removeStorageSync('pageLabel')
         console.log('---用户行为轨迹记录成功---')
         console.log('------------------------')
         console.log('\n')