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
c7d02181
提交
c7d02181
authored
4月 13, 2026
作者:
姚志忠
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1
父级
f280f663
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
410 行增加
和
58 行删除
+410
-58
app.js
+51
-0
components/empty/index.wxml
+2
-1
components/lang-btn/index.js
+4
-1
components/lang-btn/index.wxml
+0
-1
pages/index/index.js
+42
-13
pages/index/index.less
+79
-7
pages/index/index.wxml
+2
-1
pages/login/index.js
+57
-30
pages/nav-end/index.js
+4
-0
pages/nav-end/index.less
+5
-0
pages/nav-end/index.wxml
+7
-0
pages/search/index.js
+1
-0
pages/search/index.wxml
+1
-1
pages/search/search-result/arrowright.png
+0
-0
pages/search/search-result/index.js
+0
-0
pages/search/search-result/index.less
+91
-1
pages/search/search-result/index.wxml
+23
-0
pages/shop/index.js
+17
-0
util.js
+24
-2
没有找到文件。
app.js
查看文件 @
c7d02181
...
...
@@ -14,6 +14,8 @@ import { CollectionApi, PhotoApi, ItineraryApi, CardApi, PoiApi } from "./api";
const
plugin
=
requirePlugin
(
"indoormap"
);
const
mapKey
=
"QUIBZ-OTL6U-T2MVM-GMPIT-EON66-LGBCU"
;
const
SUPPORTED_CHINESE_LANGUAGES
=
[
"zh_CN"
,
"zh_TW"
,
"zh_HK"
];
const
TRANSLATE_GUIDE_SHOWN_KEY
=
"TRANSLATE_GUIDE_SHOWN"
;
const
buildings
=
[
{
name
:
"六区"
,
...
...
@@ -412,6 +414,15 @@ App({
events
:
new
EventEmitter
(),
isIOS
:
wx
.
getDeviceInfo
().
platform
===
"ios"
,
onLaunch
()
{
const
appBaseInfo
=
wx
.
getAppBaseInfo
();
const
language
=
appBaseInfo
.
language
;
const
hasShownTranslateGuide
=
wx
.
getStorageSync
(
TRANSLATE_GUIDE_SHOWN_KEY
);
const
needTranslateGuide
=
!
SUPPORTED_CHINESE_LANGUAGES
.
includes
(
language
)
&&
!
hasShownTranslateGuide
;
this
.
globalData
.
needTranslateGuide
=
needTranslateGuide
;
this
.
globalData
.
userLang
=
this
.
getLangName
(
language
);
this
.
collectionApi
=
new
CollectionApi
(
this
);
this
.
photoApi
=
new
PhotoApi
(
this
);
this
.
itineraryApi
=
new
ItineraryApi
(
this
);
...
...
@@ -431,6 +442,26 @@ App({
const
callback
=
(
res
)
=>
console
.
log
(
"userTriggerTranslation"
,
res
);
wx
.
onUserTriggerTranslation
(
callback
);
},
getLangName
(
wechatLang
)
{
// 核心语言映射表(中文)
const
langMap
=
{
'zh_CN'
:
'简体中文'
,
'zh_TW'
:
'繁体中文(台湾)'
,
'zh_HK'
:
'繁体中文(香港)'
,
'en'
:
'英语'
,
'ja'
:
'日语'
,
'ko'
:
'韩语'
,
'fr'
:
'法语'
,
'de'
:
'德语'
,
'es'
:
'西班牙语'
,
'ru'
:
'俄语'
,
'pt'
:
'葡萄牙语'
,
'it'
:
'意大利语'
,
'ar'
:
'阿拉伯语'
};
// 找不到时默认返回简体中文
return
langMap
[
wechatLang
]
||
'简体中文'
;
},
/**
* 首次启动时,根据 GPS 定位自动切换到用户所在的区
*/
...
...
@@ -832,6 +863,18 @@ App({
}
this
.
userLocation
=
el
;
this
.
events
.
emit
(
"userLocation"
,
this
.
userLocation
);
if
(
el
&&
el
.
buildingId
)
{
const
targetBuilding
=
this
.
buildings
.
find
(
(
b
)
=>
b
.
buildingId
===
el
.
buildingId
);
// 如果找到了对应的楼栋配置,且与当前楼栋不同,则执行切换
if
(
targetBuilding
&&
this
.
currentBuilding
.
buildingId
!==
el
.
buildingId
)
{
console
.
log
(
'室内定位触发楼栋切换:'
,
targetBuilding
.
name
);
this
.
setBuilding
(
targetBuilding
);
}
}
},
});
}
...
...
@@ -904,5 +947,12 @@ App({
?
wx
.
getStorageSync
(
"user"
)
:
null
,
isPluginInited
:
false
,
needTranslateGuide
:
false
,
userLang
:
"zh_CN"
,
boothNo
:
null
,
},
markTranslateGuideShown
()
{
this
.
globalData
.
needTranslateGuide
=
false
;
wx
.
setStorageSync
(
TRANSLATE_GUIDE_SHOWN_KEY
,
true
);
},
});
\ No newline at end of file
components/empty/index.wxml
查看文件 @
c7d02181
<view class="empty">
<image src="./empty.png" class="icon" mode="" />
{{isEn?'No information available yet':'还没有任何信息'}}
<text>{{isEn ? 'No shops found. Check out these featured merchants:' : '没有搜索到商铺,可查看以下实力商家'}}</text>
</view>
\ No newline at end of file
components/lang-btn/index.js
查看文件 @
c7d02181
...
...
@@ -24,6 +24,7 @@ Component({
behaviors
:
[
langBehavior
,
buildingBehavior
],
properties
:
{
type
:
String
,
},
/**
...
...
@@ -42,7 +43,8 @@ Component({
*/
methods
:
{
handleLang
()
{
this
.
setData
({
showOptions
:
true
});
// this.setData({ showOptions: true });
this
.
setData
({
showTip
:
true
});
},
closeOptions
()
{
this
.
setData
({
showOptions
:
false
});
...
...
@@ -83,4 +85,5 @@ Component({
});
},
},
});
components/lang-btn/index.wxml
查看文件 @
c7d02181
...
...
@@ -37,7 +37,6 @@
</view>
</view>
<scroll-view wx:else scroll-x enhanced show-scrollbar="{{false}}" class="langs">
<view class="grid">
<view class="item" wx:for="{{langs}}" wx:key="*this" bind:tap="chooseLang" id="{{item}}">{{item}}
<image wx:if="{{item==='简体中文'&&!isEn||item==='English'&&isEn}}" src="./tick.png" class="tick" mode="" />
...
...
pages/index/index.js
查看文件 @
c7d02181
...
...
@@ -49,6 +49,8 @@ Page({
getLocationSuccess
:
false
,
hasAuth
:
false
,
cardId
:
null
,
needTranslateGuide
:
false
,
userLang
:
''
},
handleTab
({
detail
:
tab
})
{
if
(
tab
.
text
===
"我的"
||
tab
.
text
===
"探索"
)
...
...
@@ -194,32 +196,58 @@ Page({
this
.
setData
({
banners
,
showBanner
:
banners
.
length
>
0
});
getApp
().
bannerShowed
=
true
;
},
async
closeBanner
()
{
this
.
setData
({
showBanner
:
false
});
},
handleBanner
()
{
const
ad
=
this
.
data
.
banners
[
0
];
if
(
(
ad
.
link_type
===
"app_web"
||
ad
.
link_type
===
"link"
)
&&
ad
.
link_content
)
{
if
(
!
ad
)
return
;
// 埋点
getApp
().
sensors
?.
track
(
"MLVajraAreaClick"
,
{
menu_name
:
ad
.
name
||
"首页广告"
,
});
// 需要登录
if
(
ad
.
need_login
==
1
)
{
if
(
!
getApp
().
checkUser
())
{
wx
.
setStorageSync
(
'AFTER_LOGIN_REDIRECT_URL'
,
ad
.
link_content
);
wx
.
setStorageSync
(
'AFTER_LOGIN_REDIRECT_TYPE'
,
ad
.
link_type
);
// 跳去登录页(你自己的登录路径)
wx
.
navigateTo
({
url
:
"/pages/login/login"
});
return
;
}
}
// 已登录,直接跳转
this
.
doBannerJump
(
ad
);
},
// 抽出来跳转方法
doBannerJump
(
ad
)
{
if
([
"app_web"
,
"link"
].
includes
(
ad
.
link_type
)
&&
ad
.
link_content
)
{
wx
.
navigateTo
({
url
:
`/pages/wap/index?url=
${
encodeURIComponent
(
ad
.
link_content
)}
`
,
});
}
else
if
(
ad
.
link_type
===
"mini_program"
&&
ad
.
link_content
&&
ad
.
link_path
)
{
wx
.
navigateToMiniProgram
({
appId
:
ad
.
link_content
,
path
:
ad
.
link_path
});
}
else
if
(
ad
.
link_type
===
"mini_program"
&&
ad
.
link_content
&&
ad
.
link_path
)
{
wx
.
navigateToMiniProgram
({
appId
:
ad
.
link_content
,
path
:
ad
.
link_path
,
});
}
},
async
closeBanner
()
{
this
.
setData
({
showBanner
:
false
});
},
handleBannerIndex
({
detail
:
{
current
}
})
{
this
.
setData
({
bannerIndex
:
current
});
},
async
onLoad
(
options
)
{
const
app
=
getApp
();
this
.
setData
({
needTranslateGuide
:
getApp
().
globalData
.
needTranslateGuide
,
userLang
:
getApp
().
globalData
.
userLang
});
console
.
log
(
this
.
data
.
needTranslateGuide
,
'globalData'
);
// ================= 1. 参数预处理 =================
let
{
shopId
,
facilityId
,
actId
,
q
,
fromshare
,
mode
,
scene
}
=
options
;
...
...
@@ -286,6 +314,7 @@ Page({
this
.
getFloor
();
}
},
onUnload
()
{
app
.
events
.
off
(
"userLocation"
,
this
.
_onLocationChange
);
app
.
events
.
off
(
"building"
,
this
.
_onBuildingChange
);
...
...
pages/index/index.less
查看文件 @
c7d02181
...
...
@@ -47,14 +47,79 @@
}
}
}
.
go
{
.
translate-guide
{
position: absolute;
top: 0;
left: 0;
right: 0;
height: 200px;
z-index: 2;
background: #fff;
top: 12px;
right: 14px;
z-index: 3;
display: flex;
flex-direction: column;
align-items: flex-end;
animation: translateGuideEnter 260ms ease-out;
.translate-guide__bubble {
width: 240px;
padding: 14px 14px 12px;
border-radius: 18px;
background: linear-gradient(180deg, rgba(31, 41, 55, 0.96) 0%, rgba(17, 24, 39, 0.96) 100%);
box-shadow: 0 14px 36px rgba(15, 23, 42, 0.28);
color: #fff;
}
.translate-guide__eyebrow {
font-size: 11px;
line-height: 16px;
letter-spacing: 0.8px;
text-transform: uppercase;
color: #93c5fd;
}
.translate-guide__title {
margin-top: 4px;
font-size: 15px;
line-height: 21px;
font-weight: 600;
}
.translate-guide__desc {
margin-top: 6px;
font-size: 12px;
line-height: 18px;
color: rgba(255, 255, 255, 0.82);
}
.translate-guide__lang {
margin-top: 10px;
font-size: 11px;
line-height: 16px;
color: rgba(191, 219, 254, 0.95);
}
.translate-guide__action {
margin-top: 12px;
margin-left: auto;
padding: 6px 12px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.14);
font-size: 12px;
line-height: 16px;
font-weight: 600;
color: #fff;
}
.translate-guide__tail {
width: 0;
height: 0;
margin-top: -2px;
margin-right: 18px;
border-left: 10px solid transparent;
border-right: 4px solid transparent;
border-top: 14px solid rgba(17, 24, 39, 0.96);
transform: rotate(-10deg);
}
}
@keyframes translateGuideEnter {
from {
opacity: 0;
transform: translateY(-8px) scale(0.96);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.banner {
position: fixed;
...
...
@@ -221,4 +286,11 @@
height: 56px;
z-index: 2;
}
.translate-guide {
color: #333;
padding: 8px 16px;
text-align: center;
font-size: 14px;
border-bottom: 1px solid #eee;
}
}
pages/index/index.wxml
查看文件 @
c7d02181
<view class="index">
<map-wrapper type="{{isIndex?'index':'surroundings'}}" viewstate="{{viewstate}}" user-location="{{userLocation}}" acts="{{acts}}" reset-count="{{resetCount}}" floor-name="{{floorName}}" facilities="{{currentFloorFacilities}}" bind:poi="handlePoi" bind:act="handleAct" bind:buildchange="handleMapBuildChange"></map-wrapper>
<lang-btn wx:if="{{!(isIndex&&viewstate==='fullscreen')}}" type="index"></lang-btn>
<lang-btn wx:if="{{!(isIndex&&viewstate==='fullscreen')}}"
type="index"></lang-btn>
<bottom-hud-index wx:if="{{isIndex}}" bind:viewstate="handleBottomHudViewstate" bind:search="handleSearch" bind:ai="handleAi" bind:poi="handlePoi">
<floors never-authed="{{neverAuthed}}" show-success="{{getLocationSuccess}}" refreshing="{{gettingLocation}}" wx:if="{{viewstate!=='fullscreen'&&!focusedPoi}}" floors="{{currentBuilding.floors}}" floor-name="{{floorName}}" bind:floorname="handleFloor" bind:resetmap="handleReset"></floors>
</bottom-hud-index>
...
...
pages/login/index.js
查看文件 @
c7d02181
...
...
@@ -11,7 +11,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{},
onLoad
(
options
)
{
},
checkPrivacy
()
{
this
.
setData
({
checked
:
!
this
.
data
.
checked
});
},
...
...
@@ -57,27 +57,23 @@ Page({
async
getRedPocketOpenid
()
{
try
{
const
{
marketurl
,
post
,
globalData
}
=
getApp
();
const
{
data
:
{
code
,
message
},
}
=
await
post
(
const
{
data
:
{
code
,
message
}
}
=
await
post
(
`
${
marketurl
}
/rpt/user/openId`
,
{
returnUrl
:
`https://h5.chinagoods.com/verify-openid/?targetPath=
${
encodeURIComponent
(
"/pages/verify-openId/index"
)}
`
,
returnUrl
:
`https://h5.chinqgoods.com/verify-openid/...`
,
},
{
Authorization
:
`Bearer
${
globalData
.
user
.
access_token
}
`
,
}
);
if
(
code
===
20000
)
{
wx
.
redirectTo
({
url
:
`/pages/wap/index?url=
${
encodeURIComponent
(
message
)}
`
,
});
return
false
;
}
else
return
true
;
}
else
{
return
true
;
}
}
catch
(
error
)
{
console
.
log
(
error
);
return
true
;
}
},
...
...
@@ -87,29 +83,40 @@ Page({
closeModal
()
{
this
.
setData
({
showModal
:
false
});
},
async
handleGetPhone
({
detail
:
{
code
}
})
{
this
.
setData
({
phoneLock
:
true
});
try
{
if
(
code
)
{
const
response
=
await
getApp
().
login
(
code
);
if
(
!
response
)
return
wx
.
showToast
({
title
:
"登录失败"
,
icon
:
"none"
,
});
if
(
!
response
)
{
wx
.
showToast
({
title
:
"登录失败"
,
icon
:
"none"
});
return
;
}
if
(
response
.
code
===
20000
)
{
const
redirectUrl
=
wx
.
getStorageSync
(
'AFTER_LOGIN_REDIRECT_URL'
);
const
redirectType
=
wx
.
getStorageSync
(
'AFTER_LOGIN_REDIRECT_TYPE'
);
if
(
redirectUrl
)
{
// 有广告跳转 → 执行广告跳转
this
.
afterLoginGoBanner
();
return
;
}
// 无广告跳转 → 按原有逻辑处理
const
hasOpenid
=
await
this
.
checkRedPocketOpenid
();
if
(
hasOpenid
)
this
.
back
();
else
{
if
(
hasOpenid
)
{
this
.
back
();
}
else
{
await
this
.
getRedPocketOpenid
();
this
.
afterLoginGoBanner
();
}
}
else
if
(
response
.
code
===
88051
)
{
return
this
.
setData
({
bindingModalData
:
response
.
data
});
this
.
setData
({
bindingModalData
:
response
.
data
});
}
else
{
return
wx
.
showToast
({
title
:
response
.
message
,
icon
:
"none"
,
});
wx
.
showToast
({
title
:
response
.
message
,
icon
:
"none"
});
}
}
}
catch
(
error
)
{
...
...
@@ -118,41 +125,61 @@ Page({
this
.
setData
({
phoneLock
:
false
});
}
},
afterLoginGoBanner
()
{
// 取出广告跳转信息
const
url
=
wx
.
getStorageSync
(
'AFTER_LOGIN_REDIRECT_URL'
);
const
type
=
wx
.
getStorageSync
(
'AFTER_LOGIN_REDIRECT_TYPE'
);
if
(
!
url
)
{
// 没有记录 → 返回上一页
wx
.
navigateBack
();
return
;
}
// 清除缓存(避免重复跳转)
wx
.
removeStorageSync
(
'AFTER_LOGIN_REDIRECT_URL'
);
wx
.
removeStorageSync
(
'AFTER_LOGIN_REDIRECT_TYPE'
);
// 直接跳转到广告链接
wx
.
redirectTo
({
url
:
`/pages/wap/index?url=
${
encodeURIComponent
(
url
)}
`
,
});
},
closeBindingModal
()
{
this
.
setData
({
bindingModalData
:
null
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
()
{},
onReady
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{},
onShow
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
()
{},
onHide
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
()
{},
onUnload
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
()
{},
onPullDownRefresh
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
()
{},
onReachBottom
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{},
onShareAppMessage
()
{
},
});
pages/nav-end/index.js
查看文件 @
c7d02181
...
...
@@ -16,12 +16,16 @@ Page({
poi
:
null
,
lastNav
:
null
,
kcal
:
null
,
boothNo
:
''
,
},
/**
* 生命周期函数--监听页面加载
*/
async
onLoad
(
options
)
{
// 从 options 中获取商位号
this
.
setData
({
boothNo
:
options
.
boothNo
||
''
});
console
.
log
(
this
.
data
.
boothNo
,
"boothNo"
);
const
{
lastNav
}
=
getApp
().
globalData
;
if
(
!
lastNav
)
return
this
.
toIndex
();
this
.
setData
({
lastNav
});
...
...
pages/nav-end/index.less
查看文件 @
c7d02181
...
...
@@ -43,6 +43,11 @@
display: flex;
align-items: center;
justify-content: space-between;
&.booth-row {
.left {
padding-left: 12px;
}
}
.left {
display: inline-flex;
flex-shrink: 0;
...
...
pages/nav-end/index.wxml
查看文件 @
c7d02181
...
...
@@ -25,6 +25,13 @@
<view>{{lastNav.endPoint.floorName}}</view>
</view>
</view>
<view class="border" wx:if="{{boothNo}}"></view>
<view class="row booth-row" wx:if="{{boothNo}}">
<view class="left">商位号</view>
<view class="right end">
<view>{{boothNo}}</view>
</view>
</view>
</view>
<view class="r3">
<view class="col">
...
...
pages/search/index.js
查看文件 @
c7d02181
...
...
@@ -43,6 +43,7 @@ Page({
url
:
"/pages/aisearch/index"
,
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
...
...
pages/search/index.wxml
查看文件 @
c7d02181
<view class="search">
<search-bar q="{{q}}" bind:q="handleQ" bind:ai="handleAi"></search-bar>
<search-default wx:if="{{!q}}" fac-types="{{facTypes}}" bind:q="handleQ" bind:showbluetoothmodal="openBluetoothModal" bind:showlocationmodal="openLocationModal" bind:showauthmodal="openAuthModal"></search-default>
<search-result wx:if="{{q}}" q="{{q}}" user-location="{{userLocation}}" bind:showbluetoothmodal="openBluetoothModal" bind:showlocationmodal="openLocationModal" bind:showauthmodal="openAuthModal"></search-result>
<search-result wx:if="{{q}}" q="{{q}}" user-location="{{userLocation}}" bind:showbluetoothmodal="openBluetoothModal" bind:showlocationmodal="openLocationModal" bind:showauthmodal="openAuthModal"
></search-result>
<bluetooth-modal wx:if="{{showBluetoothModal}}" bind:close="closeBluetoothModal"></bluetooth-modal>
<location-modal wx:if="{{showLocationModal}}" bind:close="closeLocationModal"></location-modal>
<auth-modal wx:if="{{showAuthModal}}" bind:close="closeAuthModal"></auth-modal>
...
...
pages/search/search-result/arrowright.png
0 → 100644
查看文件 @
c7d02181
336 Bytes
pages/search/search-result/index.js
查看文件 @
c7d02181
差异被折叠。
点击展开。
pages/search/search-result/index.less
查看文件 @
c7d02181
.search-result {
width: 100vw;
flex: 1;
height: calc(100vh - 68px);
.list {
...
...
@@ -88,7 +89,7 @@
}
}
.empty {
padding-top: calc(
50vh - 88px - 6
8px);
padding-top: calc(
13vh - 88px -
8px);
}
.size-16 {
width: 16px;
...
...
@@ -98,4 +99,93 @@
width: 32px;
height: 32px;
}
.empty-container {
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
.empty-tip {
font-size: 14px;
color: #666;
margin-bottom: 20px;
text-align: center;
line-height: 1.5;
}
.featured-list {
width: 100%;
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); // 添加轻微阴影,增加立体感
margin-top: 12px; // 增加与提示语的距离
border-top-left-radius: 32rpx;
border-top-right-radius: 32rpx;
}
.featured-item {
display: flex;
align-items: center;
padding: 12px;
border-bottom: 1px solid #f5f5f5;
}
.featured-item {
display: flex;
align-items: center;
padding: 12px;
border-bottom: 1px solid #f5f5f5;
&:first-child {
margin-top: 16rpx;
}
&:last-child {
border-bottom: none;
}
}
.featured-avatar {
width: 50px;
height: 50px;
border-radius: 4px;
margin-right: 12px;
background-color: #eee;
// 可选:添加圆角边框
border: 1px solid #eee;
}
.featured-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
.featured-name {
font-size: 15px;
color: #333;
font-weight: 500;
margin-bottom: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.featured-addr {
font-size: 12px;
color: #999;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.arrow-icon {
width: 16px;
height: 16px;
margin-left: 8px;
opacity: 0.5;
}
}
pages/search/search-result/index.wxml
查看文件 @
c7d02181
<scroll-view scroll-y class="search-result" bindscrolltolower="handleScrollToLower" lower-threshold="200">
<loading wx:if="{{isLoading}}"></loading>
<!-- 有搜索结果:展示结果列表 -->
<view class="list" wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index">
<view class="border" wx:if="{{index>0}}"></view>
...
...
@@ -51,7 +53,27 @@
</block>
<end wx:if="{{!isLoading&&list.length}}"></end>
</view>
<!-- 无搜索结果:展示实力商家(有则展示,无则展示 empty) -->
<view class="empty" wx:if="{{!isLoading&&list.length===0}}">
<empty></empty>
<!-- 实力商家列表 -->
<view class="featured-list" wx:if="{{featuredShops.length > 0}}">
<block wx:for="{{featuredShops}}" wx:key="shopId">
<view class="featured-item" bind:tap="handleFeaturedShopTap" data-shopid="{{item.shopId}}">
<image class="featured-avatar" src="{{item.ywZh.cover}}" mode="aspectFill" />
<view class="featured-info">
<view class="featured-name">
<text>{{isEn && item.ywEn ? item.ywEn.name : item.ywZh.name}}</text>
</view>
<view class="featured-addr">
<text>{{item.ywZh.marketNameDtl}} {{item.ywZh.addrFloor}}F {{item.ywZh.boothNo}}</text>
</view>
</view>
<image class="arrow-icon" src="./arrowright.png" mode="aspectFit" />
</view>
</block>
</view>
</view>
</scroll-view>
\ No newline at end of file
pages/shop/index.js
查看文件 @
c7d02181
...
...
@@ -40,6 +40,23 @@ Page({
const
{
isEn
}
=
this
.
data
;
const
shop
=
await
app
.
poiApi
.
getOne
({
shopType
:
"1"
,
shopId
});
if
(
!
shop
)
return
this
.
back
();
const
fixCoverUrl
=
(
url
)
=>
{
if
(
!
url
)
return
''
;
// 将 200x 替换为 空
return
url
.
replace
(
'/200x'
,
''
);
};
// 处理中文信息中的 cover
if
(
shop
.
ywZh
&&
shop
.
ywZh
.
cover
)
{
shop
.
ywZh
.
cover
=
fixCoverUrl
(
shop
.
ywZh
.
cover
);
}
// 处理英文信息中的 cover
if
(
shop
.
ywEn
&&
shop
.
ywEn
.
cover
)
{
shop
.
ywEn
.
cover
=
fixCoverUrl
(
shop
.
ywEn
.
cover
);
}
const
boothNo
=
shop
.
ywZh
?.
boothNo
;
try
{
let
{
...
...
util.js
查看文件 @
c7d02181
...
...
@@ -242,6 +242,9 @@ export const toRoutePlan = async (poi, isEn) => {
poi_fl_name
:
floorName
,
bld_id
,
}
=
poi
.
tx
;
console
.
log
(
poi
,
"poi"
);
// 1. 【新增】获取商位号
const
boothNo
=
poi
.
ywZh
?.
boothNo
||
poi
.
ywEn
?.
boothNo
||
''
;
const
destPoint
=
encodeURIComponent
(
JSON
.
stringify
({
...
...
@@ -253,8 +256,11 @@ export const toRoutePlan = async (poi, isEn) => {
buildingName
:
"义乌国际商贸城"
,
}),
);
// 2. 【关键修改】构建带参数的 navEndPageUrl
const
navEndPageUrl
=
`/pages/nav-end/index?boothNo=
${
encodeURIComponent
(
boothNo
)}
`
;
wx
.
navigateTo
({
url
:
`plugin://indoormap/routeplan?banNav=false&transitDisable=true&buildingId=
${
bld_id
}
&buildingName=义乌国际商贸城&destPoint=
${
destPoint
}
`
,
url
:
`plugin://indoormap/routeplan?banNav=false&transitDisable=true&buildingId=
${
bld_id
}
&buildingName=义乌国际商贸城&destPoint=
${
destPoint
}
&navEndPageUrl=
${
encodeURIComponent
(
navEndPageUrl
)}
`
,
});
}
catch
(
error
)
{
console
.
error
(
error
);
...
...
@@ -290,6 +296,19 @@ export const actToRoutePlan = async (act) => {
return
"showLocationModal"
;
if
(
!
getApp
().
checkUser
())
return
"login needed"
;
getApp
().
ensurePluginInit
();
// 1. 【新增】从 act 对象中获取 shopId 并查询完整 POI 以获取商位号
let
boothNo
=
''
;
if
(
act
.
shopId
)
{
try
{
const
poi
=
await
getApp
().
poiApi
.
getOne
({
shopType
:
"1"
,
shopId
:
act
.
shopId
});
boothNo
=
poi
?.
ywZh
?.
boothNo
||
poi
?.
ywEn
?.
boothNo
||
''
;
}
catch
(
error
)
{
console
.
warn
(
'获取活动商铺详情失败,无法传递商位号'
,
error
);
}
}
const
{
name
,
latitude
,
longitude
,
floor_name
,
building_id
}
=
act
;
const
destPoint
=
encodeURIComponent
(
...
...
@@ -302,8 +321,11 @@ export const actToRoutePlan = async (act) => {
buildingName
:
"义乌国际商贸城"
,
}),
);
// 2. 【关键修改】构建带参数的 navEndPageUrl
const
navEndPageUrl
=
`/pages/nav-end/index?boothNo=
${
encodeURIComponent
(
boothNo
)}
`
;
wx
.
navigateTo
({
url
:
`plugin://indoormap/routeplan?banNav=false&transitDisable=true&buildingId=
${
building_id
}
&buildingName=义乌国际商贸城&destPoint=
${
destPoint
}
`
,
url
:
`plugin://indoormap/routeplan?banNav=false&transitDisable=true&buildingId=
${
building_id
}
&buildingName=义乌国际商贸城&destPoint=
${
destPoint
}
&navEndPageUrl=
${
encodeURIComponent
(
navEndPageUrl
)}
`
,
});
}
catch
(
error
)
{
console
.
error
(
error
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论