From 55a6f38e999af8fe019677850ff6b54c163f73a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Mon, 2 Feb 2026 15:25:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=B8=AA=E8=BF=B9=E8=AE=B0=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/evaluate2/one.js | 17 +++++++++++++++++ pages/goods-detail/goods-detail.js | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/pages/evaluate2/one.js b/pages/evaluate2/one.js index 93182d2..50c28d1 100644 --- a/pages/evaluate2/one.js +++ b/pages/evaluate2/one.js @@ -482,6 +482,23 @@ Page({ return; } + // 记录用户点击分类的踪迹 + const API = require('../../utils/api'); + const traceData = { + action: 'click_category', + category: category, + timestamp: new Date().toISOString(), + page: 'evaluate2/one' + }; + + // 调用用户踪迹记录API + API.addUserTrace(traceData).then(res => { + console.log('用户分类点击记录成功:', res); + }).catch(err => { + console.error('用户分类点击记录失败:', err); + // 即使记录失败,也不影响主流程 + }); + // 跳过合作状态检查,直接跳转到商品列表页面 // 跳转到商品列表页面,并传递分类参数 diff --git a/pages/goods-detail/goods-detail.js b/pages/goods-detail/goods-detail.js index b0c4eaa..68a9fd3 100644 --- a/pages/goods-detail/goods-detail.js +++ b/pages/goods-detail/goods-detail.js @@ -3046,6 +3046,23 @@ Page({ return; } + // 记录用户点击对比价格的踪迹 + const traceData = { + action: 'click_compare_price', + productId: this.data.goodsDetail.productId || this.data.goodsDetail.id, + productName: this.data.goodsDetail.name || '', + timestamp: new Date().toISOString(), + page: 'goods-detail/goods-detail' + }; + + // 调用用户踪迹记录API + API.addUserTrace(traceData).then(res => { + console.log('用户对比价格点击记录成功:', res); + }).catch(err => { + console.error('用户对比价格点击记录失败:', err); + // 即使记录失败,也不影响主流程 + }); + // 检查用户身份证认证状态 let idcardstatus = 0; const users = wx.getStorageSync('users') || {};