Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xiaoshangaihuida
概览
Overview
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
姚志忠
xiaoshangaihuida
Commits
f82bf773
提交
f82bf773
authored
3月 31, 2026
作者:
姚志忠
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改
父级
cdb00d7a
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
17 行增加
和
2 行删除
+17
-2
app.js
+17
-2
没有找到文件。
app.js
查看文件 @
f82bf773
import
{
import
{
EventEmitter
,
EventEmitter
,
get
,
get
,
post
,
post
,
...
@@ -370,7 +370,7 @@ export const salt = "chinagoods2024";
...
@@ -370,7 +370,7 @@ export const salt = "chinagoods2024";
sensors
.
init
({
sensors
.
init
({
server_url
:
server_url
:
"https://event-tracking.chinagoods.com/sa.gif?project=market_navigation_t&remark=online"
,
"https://event-tracking.chinagoods.com/sa.gif?project=market_navigation_t&remark=online"
,
show_log
:
false
,
//鏄惁寮€鍚棩蹇?
show_log
:
false
,
name
:
"sensors"
,
name
:
"sensors"
,
allow_amend_share_path
:
true
,
allow_amend_share_path
:
true
,
global_properties
:
{
global_properties
:
{
...
@@ -422,6 +422,7 @@ App({
...
@@ -422,6 +422,7 @@ App({
this
.
refreshItinerary
();
this
.
refreshItinerary
();
this
.
checkUpdate
();
this
.
checkUpdate
();
this
.
initBuildingByLocation
();
this
.
initBuildingByLocation
();
this
.
updateSensorsMarketCode
(
this
.
currentBuilding
);
const
callback
=
(
res
)
=>
console
.
log
(
"userTriggerTranslation"
,
res
);
const
callback
=
(
res
)
=>
console
.
log
(
"userTriggerTranslation"
,
res
);
wx
.
onUserTriggerTranslation
(
callback
);
wx
.
onUserTriggerTranslation
(
callback
);
...
@@ -451,6 +452,7 @@ App({
...
@@ -451,6 +452,7 @@ App({
if
(
this
.
currentBuilding
.
name
!==
nearest
.
name
)
{
if
(
this
.
currentBuilding
.
name
!==
nearest
.
name
)
{
this
.
currentBuilding
=
nearest
;
this
.
currentBuilding
=
nearest
;
console
.
log
(
'initBuildingByLocation 切换到:'
,
nearest
.
name
);
console
.
log
(
'initBuildingByLocation 切换到:'
,
nearest
.
name
);
this
.
updateSensorsMarketCode
(
nearest
);
this
.
events
.
emit
(
'building'
,
nearest
);
this
.
events
.
emit
(
'building'
,
nearest
);
}
}
}
else
{
}
else
{
...
@@ -656,6 +658,18 @@ App({
...
@@ -656,6 +658,18 @@ App({
title
:
this
.
globalData
.
isEn
?
"Chinagoods Nav"
:
"小商AI导航"
,
title
:
this
.
globalData
.
isEn
?
"Chinagoods Nav"
:
"小商AI导航"
,
});
});
},
},
/**
* 更新神策埋点全局参数 inner_market_code(市场编号)
* 若当前建筑有 marketCode 则注册,否则传空字符串(场外留空)
*/
updateSensorsMarketCode
(
building
)
{
try
{
const
code
=
building
&&
building
.
marketCode
?
building
.
marketCode
:
""
;
sensors
.
registerApp
({
inner_market_code
:
code
});
}
catch
(
e
)
{
console
.
error
(
"updateSensorsMarketCode error"
,
e
);
}
},
setBuilding
(
currentBuilding
)
{
setBuilding
(
currentBuilding
)
{
const
now
=
Date
.
now
();
const
now
=
Date
.
now
();
if
(
this
.
lastSetBuildingTime
&&
now
-
this
.
lastSetBuildingTime
<
1000
)
{
if
(
this
.
lastSetBuildingTime
&&
now
-
this
.
lastSetBuildingTime
<
1000
)
{
...
@@ -666,6 +680,7 @@ App({
...
@@ -666,6 +680,7 @@ App({
this
.
currentBuilding
=
currentBuilding
;
this
.
currentBuilding
=
currentBuilding
;
console
.
log
(
this
.
currentBuilding
,
"setBuilding"
);
console
.
log
(
this
.
currentBuilding
,
"setBuilding"
);
this
.
lastSetBuildingTime
=
now
;
this
.
lastSetBuildingTime
=
now
;
this
.
updateSensorsMarketCode
(
currentBuilding
);
this
.
events
.
emit
(
"building"
,
currentBuilding
);
this
.
events
.
emit
(
"building"
,
currentBuilding
);
return
true
;
return
true
;
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论