提交 349de62b 作者: 姚志忠

新增需求修改

父级 c7d02181
...@@ -352,6 +352,56 @@ const buildings = [ ...@@ -352,6 +352,56 @@ const buildings = [
}, },
], ],
}, },
{
name: "三区",
nameEn: "District 3",
displayName: "国际商贸城三区",
displayNameEn: "International Trade City District 3",
marketCode: "1004",
zone: "03",
buildingId: "3307001557131",
latlng: { lat: 29.340763, lng: 120.110371 },
floors: ["-1F", "1F", "2F","3F", "4F", "5F"],
scale: 18.6,
formats: [
{ name: "年画挂历对联(-1F)", key: "N_03_-1_NHGLDL", nameEn: "New Year paintings, calendars, couplets" },
{ name: "笔墨用品/纸制品", key: "N_03_1_BMYP_ZZP", nameEn: "Writing and drawing supplies / Paper products" },
{ name: "年画挂历对联(1F)",key: "N_03_1_NHGLDL",nameEn: "New Year paintings, calendars, couplets",},
{ name: "眼镜", key: "N_03_1_YJ", nameEn: "Glasses" },
{ name: "办公学习用品", key: "N_03_2_BGXXYP", nameEn: "Office study supplies" },
{ name: "运动器材/体育休闲用品",key: "N_03_2_YDQC_TYXXYP",nameEn: "Sports equipment / Sports and leisure products",},
{ name: "化妆品", key: "N_03_3_HZP", nameEn: "Cosmetics" },
{ name: "纽扣/拉链/服装辅料", key: "N_03_3_NK_LL_FZFL", nameEn: "Buttons / zippers / garment accessories" },
{ name: "生产企业直销中心",key: "N_03_4_HZP",nameEn: "Direct sales center of the manufacturing enterprise",},
{ name: "装饰画",key: "N_03_5_ZSH",nameEn: "Decorative painting",},
],
},
{
name: "五区",
nameEn: "District 5",
displayName: "国际商贸城五区",
displayNameEn: "International Trade City District 5",
marketCode: "1007",
zone: "05",
buildingId: "3307001915188",
latlng: { lat: 29.340690, lng: 120.120676 },
floors: ["1F", "2F","3F", "4F", "5F"],
scale: 18.6,
formats: [
{ name: "义乌中国进口商品城", key: "N_05_1_XSPPS", nameEn: "Yiwu China Import Commodities City" },
{ name: "宠物(水族)用品", key: "N_05_2_CWSZYP", nameEn: "Pet (aquarium) supplies" },
{ name: "床上用品",key: "N_05_2_CSYP",nameEn: "Bedding",},
{ name: "发制品", key: "N_05_2_FZP", nameEn: "Hair extensions" },
{ name: "婚庆用品(2F)", key: "N_05_2_HQYP", nameEn: "Wedding supplies" },
{ name: "针织布(窗帘布)",key: "N_05_3_CLBL",nameEn: "Knitted fabric (curtain fabric)",},
{ name: "婚庆用品(3F)", key: "N_05_3_HQYP", nameEn: "Wedding supplies" },
{ name: "酒店用品", key: "N_05_3_JDYP", nameEn: "Hotel supplies" },
{ name: "针棉布(窗帘布)",key: "N_05_3_ZFBL",nameEn: "Cotton fabric (curtain fabric)",},
{ name: "针织原材料",key: "N_05_3_ZZYCL",nameEn: "Knitted raw materials",},
{ name: "汽车用品及配件",key: "N_05_4_QCMTCPJ",nameEn: "Automotive supplies and accessories",},
{ name: "网商服务区", key: "N_05_5_WSFWQ", nameEn: "Online Business Service Area" },
],
},
]; ];
const buildingIdNameMap = buildings.reduce( const buildingIdNameMap = buildings.reduce(
(acc, nxt) => ({ ...acc, [nxt.buildingId]: nxt.name }), (acc, nxt) => ({ ...acc, [nxt.buildingId]: nxt.name }),
......
...@@ -45,6 +45,7 @@ Component({ ...@@ -45,6 +45,7 @@ Component({
handleLang() { handleLang() {
// this.setData({ showOptions: true }); // this.setData({ showOptions: true });
this.setData({ showTip: true }); this.setData({ showTip: true });
}, },
closeOptions() { closeOptions() {
this.setData({ showOptions: false }); this.setData({ showOptions: false });
......
...@@ -23,10 +23,20 @@ Page({ ...@@ -23,10 +23,20 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
async onLoad(options) { async onLoad(options) {
// 从 options 中获取商位号 // 现场联调:确认是否从插件 navEndPageUrl 带回 boothNo
this.setData({ boothNo: options.boothNo || '' }); console.error(
console.log(this.data.boothNo, "boothNo"); "[NavEndPage] onLoad options:",
JSON.parse(JSON.stringify(options || {})),
);
const { lastNav } = getApp().globalData; const { lastNav } = getApp().globalData;
// boothNo 优先取 URL 参数,其次兜底取 lastNav.boothNo
const boothNo = options.boothNo || lastNav?.boothNo || "";
this.setData({ boothNo });
console.error("[NavEndPage] boothNo(final)=", this.data.boothNo);
console.error("[NavEndPage] globalData.lastNav.boothNo=", lastNav?.boothNo);
if (!lastNav) return this.toIndex(); if (!lastNav) return this.toIndex();
this.setData({ lastNav }); this.setData({ lastNav });
try { try {
...@@ -36,12 +46,13 @@ Page({ ...@@ -36,12 +46,13 @@ Page({
} catch (error) { } catch (error) {
console.error("设置卡路里失败", error); console.error("设置卡路里失败", error);
} }
const poi = this.getEndPoi(); const poi = await this.getEndPoi();
if (poi) {
console.log("导航结束页面poi", poi); console.log("导航结束页面poi", poi);
this.setData({ poi });
}
// 自动收藏 // 自动收藏
// if (poi) this.collectPoi(poi); // if (poi) this.collectPoi(poi);
this.setData({ poi });
if (getApp().isCardNav) { if (getApp().isCardNav) {
getApp().isCardNav = false; getApp().isCardNav = false;
const checkInResult = await this.checkIn(poi); const checkInResult = await this.checkIn(poi);
...@@ -248,9 +259,14 @@ Page({ ...@@ -248,9 +259,14 @@ Page({
shopType: baseInfo.facilityId ? "2" : "1", shopType: baseInfo.facilityId ? "2" : "1",
shopId: baseInfo.shopId || baseInfo.facilityId, shopId: baseInfo.shopId || baseInfo.facilityId,
boothNo: baseInfo.boothNo, boothNo: baseInfo.boothNo,
ywZh: baseInfo.ywZh ? baseInfo.ywZh : '',
}); });
console.log("getEndPoi result:", poi); if (poi?.ywZh?.cover && typeof poi.ywZh.cover === 'string') {
poi.ywZh.cover = poi.ywZh.cover.replace('/200x', '/700x');
}
console.log("getEndPoi result:", poi.ywZh ? poi.ywZh.cover : poi.ywZh);
return poi; return poi;
} catch (error) { } catch (error) {
console.error("getEndPoi error:", error); console.error("getEndPoi error:", error);
...@@ -361,18 +377,18 @@ Page({ ...@@ -361,18 +377,18 @@ Page({
closePois() { closePois() {
this.setData({ pois: null }); this.setData({ pois: null });
}, },
doNothing() {}, doNothing() { },
onReady() {}, onReady() { },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() {}, onShow() { },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() {}, onHide() { },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
...@@ -384,12 +400,12 @@ Page({ ...@@ -384,12 +400,12 @@ Page({
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() {}, onPullDownRefresh() { },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() {}, onReachBottom() { },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
} }
.content { .content {
position: absolute; position: absolute;
top: 306px; top: 256px;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
...@@ -73,6 +73,12 @@ ...@@ -73,6 +73,12 @@
border-radius: 50%; border-radius: 50%;
background: #fe5252; background: #fe5252;
} }
.yellow{
width: 6px;
height: 6px;
border-radius: 50%;
background: #bcfe52;
}
} }
.right { .right {
display: inline-flex; display: inline-flex;
......
...@@ -26,10 +26,14 @@ ...@@ -26,10 +26,14 @@
</view> </view>
</view> </view>
<view class="border" wx:if="{{boothNo}}"></view> <view class="border" wx:if="{{boothNo}}"></view>
<view class="row booth-row" wx:if="{{boothNo}}"> <view class="row" wx:if="{{boothNo}}">
<view class="left">商位号</view> <view class="left">
<view class="yellow"></view>
商位号
</view>
<view class="right end"> <view class="right end">
<view>{{boothNo}}</view> <view>{{boothNo}}</view>
<view>{{lastNav.endPoint.floorName}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -54,7 +58,6 @@ ...@@ -54,7 +58,6 @@
<view class="r41" bind:tap="toIndex">返回首页</view> <view class="r41" bind:tap="toIndex">返回首页</view>
<button class="r42" open-type="share">邀请好友使用</button> <button class="r42" open-type="share">邀请好友使用</button>
</view> </view>
</view> </view>
<view class="tip1" wx:if="{{showTip1}}"> <view class="tip1" wx:if="{{showTip1}}">
<view class="t1">积分领取成功!</view> <view class="t1">积分领取成功!</view>
......
...@@ -44,7 +44,7 @@ Page({ ...@@ -44,7 +44,7 @@ Page({
const fixCoverUrl = (url) => { const fixCoverUrl = (url) => {
if (!url) return ''; if (!url) return '';
// 将 200x 替换为 空 // 将 200x 替换为 空
return url.replace('/200x', ''); return url.replace('/200x', '/600x');
}; };
// 处理中文信息中的 cover // 处理中文信息中的 cover
......
...@@ -133,6 +133,7 @@ const handleNavStart = async (options) => { ...@@ -133,6 +133,7 @@ const handleNavStart = async (options) => {
? { ? {
nav_target_type: poi.facility.name, nav_target_type: poi.facility.name,
booth_floor: poi.tx.poi_fl_seq, booth_floor: poi.tx.poi_fl_seq,
booth_cover_img: poi.ywZh.cover,
} }
: { : {
main_product_arr: poi.ywZh.mainGoods, main_product_arr: poi.ywZh.mainGoods,
...@@ -151,7 +152,11 @@ const handleNavStart = async (options) => { ...@@ -151,7 +152,11 @@ const handleNavStart = async (options) => {
const handleNavEnd = async (options) => { const handleNavEnd = async (options) => {
const poi = await getPoiByPoint(options.endPoint); const poi = await getPoiByPoint(options.endPoint);
const boothNo = poi?.ywZh?.boothNo || poi?.ywEn?.boothNo || "";
console.log("导航结束poi", poi); console.log("导航结束poi", poi);
// 现场联调日志:确认结束时 POI 及 boothNo 是否取到
console.error("[NavEnd] endPoint:", options?.endPoint);
console.error("[NavEnd] boothNo(from poi)=", boothNo);
if (!poi) return; if (!poi) return;
const { lastNavHistoryId, buildingIdNameMap } = getApp(); const { lastNavHistoryId, buildingIdNameMap } = getApp();
if (!lastNavHistoryId) return console.error("未获取到开始导航的历史id"); if (!lastNavHistoryId) return console.error("未获取到开始导航的历史id");
...@@ -177,6 +182,7 @@ const handleNavEnd = async (options) => { ...@@ -177,6 +182,7 @@ const handleNavEnd = async (options) => {
? { ? {
nav_target_type: poi.facility.name, nav_target_type: poi.facility.name,
booth_floor: poi.tx.poi_fl_seq, booth_floor: poi.tx.poi_fl_seq,
booth_cover_img: poi.ywZh.cover,
} }
: { : {
main_product_arr: poi.ywZh.mainGoods, main_product_arr: poi.ywZh.mainGoods,
...@@ -204,8 +210,13 @@ module.exports = { ...@@ -204,8 +210,13 @@ module.exports = {
// type 类型(start_navigation/end_navigation) // type 类型(start_navigation/end_navigation)
// location 用户当前位置 // location 用户当前位置
// isArrive 是否到达目的地结束导航 // isArrive 是否到达目的地结束导航
report(options) { async report(options) {
console.error("report 上报:", options); // 现场联调日志:确认结束回调结构
console.error("[NavReport] report 上报(type):", options?.type);
console.error(
"[NavReport] report 上报(完整options):",
JSON.parse(JSON.stringify(options || {})),
);
if (options.type === "start_navigation") { if (options.type === "start_navigation") {
getApp().lastNavHistoryId = null; getApp().lastNavHistoryId = null;
handleNavStart(options); handleNavStart(options);
...@@ -213,7 +224,16 @@ module.exports = { ...@@ -213,7 +224,16 @@ module.exports = {
if (options.type === "end_navigation") { if (options.type === "end_navigation") {
handleNavEnd(options); handleNavEnd(options);
if (options.isArrive) { if (options.isArrive) {
// 现场联调:把 boothNo 一并塞入 lastNav,便于结束页对照 options.boothNo
try {
const poi = await getPoiByPoint(options.endPoint);
const boothNo = poi?.ywZh?.boothNo || poi?.ywEn?.boothNo || "";
getApp().globalData.lastNav = { ...options, boothNo };
console.error("[NavReport] 已写入 globalData.lastNav,boothNo=", boothNo);
} catch (e) {
getApp().globalData.lastNav = options; getApp().globalData.lastNav = options;
console.error("[NavReport] 写入 globalData.lastNav 失败(仅写 options)", e);
}
} }
} }
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论