- Added a new entry for user interaction habit analysis based on agent transcripts, summarizing key insights into communication styles and preferences. - Updated project indices to reflect the latest developments, including the addition of a wallet balance feature and enhancements to the mini program's user interface for better user experience. - Improved the handling of loading states in the chapters page, ensuring a smoother user experience during data retrieval. - Implemented a gift payment sharing feature, allowing users to share payment requests with friends for collaborative purchases.
26 lines
784 B
JavaScript
26 lines
784 B
JavaScript
const app = getApp()
|
||
|
||
/**
|
||
* 全局按钮/标签点击埋点
|
||
* @param {string} module 模块:home|chapters|read|my|vip|wallet|match|referral|search|settings|about
|
||
* @param {string} action 行为:tab_click|btn_click|nav_click|card_click|link_click 等
|
||
* @param {string} target 目标标识:按钮文案、章节ID、标签名等
|
||
* @param {object} [extra] 附加数据
|
||
*/
|
||
function trackClick(module, action, target, extra) {
|
||
const userId = app.globalData.userInfo?.id || ''
|
||
app.request({
|
||
url: '/api/miniprogram/track',
|
||
method: 'POST',
|
||
data: {
|
||
userId: userId || undefined,
|
||
action,
|
||
target,
|
||
extraData: Object.assign({ module, page: module }, extra || {})
|
||
},
|
||
silent: true
|
||
}).catch(() => {})
|
||
}
|
||
|
||
module.exports = { trackClick }
|