提交 349de62b 作者: 姚志忠

新增需求修改

父级 c7d02181
......@@ -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(
(acc, nxt) => ({ ...acc, [nxt.buildingId]: nxt.name }),
......
......@@ -45,6 +45,7 @@ Component({
handleLang() {
// this.setData({ showOptions: true });
this.setData({ showTip: true });
},
closeOptions() {
this.setData({ showOptions: false });
......
......@@ -23,10 +23,20 @@ Page({
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
// 从 options 中获取商位号
this.setData({ boothNo: options.boothNo || '' });
console.log(this.data.boothNo, "boothNo");
// 现场联调:确认是否从插件 navEndPageUrl 带回 boothNo
console.error(
"[NavEndPage] onLoad options:",
JSON.parse(JSON.stringify(options || {})),
);
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();
this.setData({ lastNav });
try {
......@@ -36,12 +46,13 @@ Page({
} catch (error) {
console.error("设置卡路里失败", error);
}
const poi = this.getEndPoi();
console.log("导航结束页面poi", poi);
const poi = await this.getEndPoi();
if (poi) {
console.log("导航结束页面poi", poi);
this.setData({ poi });
}
// 自动收藏
// if (poi) this.collectPoi(poi);
this.setData({ poi });
if (getApp().isCardNav) {
getApp().isCardNav = false;
const checkInResult = await this.checkIn(poi);
......@@ -61,15 +72,15 @@ Page({
getApp().sensors?.track("ExposureActivityCoupon", {
...(poi.facilityId
? {
booth_floor: poi.tx.poi_fl_seq,
}
booth_floor: poi.tx.poi_fl_seq,
}
: {
short_market_name: poi.ywZh.marketNameDtl,
booth_addr_street: poi.ywZh.boothAddrStreet,
booth_no: poi.ywZh.boothNo,
industry: poi.ywZh.frontIndustryCategory,
booth_floor: poi.ywZh.addrFloor,
}),
short_market_name: poi.ywZh.marketNameDtl,
booth_addr_street: poi.ywZh.boothAddrStreet,
booth_no: poi.ywZh.boothNo,
industry: poi.ywZh.frontIndustryCategory,
booth_floor: poi.ywZh.addrFloor,
}),
});
} catch (error) {
console.error("埋点失败", error);
......@@ -237,7 +248,7 @@ Page({
floorName,
indexData,
);
const baseInfo = txQmMap?.[shineiId];
const baseInfo = txQmMap?.[shineiId];
// 2. 没找到基础信息,直接返回
if (!baseInfo) return null;
......@@ -248,9 +259,14 @@ Page({
shopType: baseInfo.facilityId ? "2" : "1",
shopId: baseInfo.shopId || baseInfo.facilityId,
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;
} catch (error) {
console.error("getEndPoi error:", error);
......@@ -293,14 +309,14 @@ Page({
coupon_record_id: couponId,
...(poi.facilityId
? {
booth_floor: poi.tx.poi_fl_seq,
}
booth_floor: poi.tx.poi_fl_seq,
}
: {
short_market_name: poi.ywZh.marketNameDtl,
booth_addr_street: poi.ywZh.boothAddrStreet,
industry: poi.ywZh.frontIndustryCategory,
booth_floor: poi.ywZh.addrFloor,
}),
short_market_name: poi.ywZh.marketNameDtl,
booth_addr_street: poi.ywZh.boothAddrStreet,
industry: poi.ywZh.frontIndustryCategory,
booth_floor: poi.ywZh.addrFloor,
}),
});
} catch (error) {
console.error("埋点失败", error);
......@@ -341,14 +357,14 @@ Page({
coupon_record_id: couponId,
...(poi.facilityId
? {
booth_floor: poi.tx.poi_fl_seq,
}
booth_floor: poi.tx.poi_fl_seq,
}
: {
short_market_name: poi.ywZh.marketNameDtl,
booth_addr_street: poi.ywZh.boothAddrStreet,
industry: poi.ywZh.frontIndustryCategory,
booth_floor: poi.ywZh.addrFloor,
}),
short_market_name: poi.ywZh.marketNameDtl,
booth_addr_street: poi.ywZh.boothAddrStreet,
industry: poi.ywZh.frontIndustryCategory,
booth_floor: poi.ywZh.addrFloor,
}),
});
} catch (error) {
console.error("埋点失败", error);
......@@ -361,18 +377,18 @@ Page({
closePois() {
this.setData({ pois: null });
},
doNothing() {},
onReady() {},
doNothing() { },
onReady() { },
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
onShow() { },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
onHide() { },
/**
* 生命周期函数--监听页面卸载
......@@ -384,12 +400,12 @@ Page({
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
onPullDownRefresh() { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
onReachBottom() { },
/**
* 用户点击右上角分享
......
......@@ -11,7 +11,7 @@
}
.content {
position: absolute;
top: 306px;
top: 256px;
left: 0;
right: 0;
bottom: 0;
......@@ -73,6 +73,12 @@
border-radius: 50%;
background: #fe5252;
}
.yellow{
width: 6px;
height: 6px;
border-radius: 50%;
background: #bcfe52;
}
}
.right {
display: inline-flex;
......
......@@ -26,10 +26,14 @@
</view>
</view>
<view class="border" wx:if="{{boothNo}}"></view>
<view class="row booth-row" wx:if="{{boothNo}}">
<view class="left">商位号</view>
<view class="row" wx:if="{{boothNo}}">
<view class="left">
<view class="yellow"></view>
商位号
</view>
<view class="right end">
<view>{{boothNo}}</view>
<view>{{lastNav.endPoint.floorName}}</view>
</view>
</view>
</view>
......@@ -54,7 +58,6 @@
<view class="r41" bind:tap="toIndex">返回首页</view>
<button class="r42" open-type="share">邀请好友使用</button>
</view>
</view>
<view class="tip1" wx:if="{{showTip1}}">
<view class="t1">积分领取成功!</view>
......
......@@ -44,7 +44,7 @@ Page({
const fixCoverUrl = (url) => {
if (!url) return '';
// 将 200x 替换为 空
return url.replace('/200x', '');
return url.replace('/200x', '/600x');
};
// 处理中文信息中的 cover
......
......@@ -133,6 +133,7 @@ const handleNavStart = async (options) => {
? {
nav_target_type: poi.facility.name,
booth_floor: poi.tx.poi_fl_seq,
booth_cover_img: poi.ywZh.cover,
}
: {
main_product_arr: poi.ywZh.mainGoods,
......@@ -151,7 +152,11 @@ const handleNavStart = async (options) => {
const handleNavEnd = async (options) => {
const poi = await getPoiByPoint(options.endPoint);
const boothNo = poi?.ywZh?.boothNo || poi?.ywEn?.boothNo || "";
console.log("导航结束poi", poi);
// 现场联调日志:确认结束时 POI 及 boothNo 是否取到
console.error("[NavEnd] endPoint:", options?.endPoint);
console.error("[NavEnd] boothNo(from poi)=", boothNo);
if (!poi) return;
const { lastNavHistoryId, buildingIdNameMap } = getApp();
if (!lastNavHistoryId) return console.error("未获取到开始导航的历史id");
......@@ -177,6 +182,7 @@ const handleNavEnd = async (options) => {
? {
nav_target_type: poi.facility.name,
booth_floor: poi.tx.poi_fl_seq,
booth_cover_img: poi.ywZh.cover,
}
: {
main_product_arr: poi.ywZh.mainGoods,
......@@ -204,8 +210,13 @@ module.exports = {
// type 类型(start_navigation/end_navigation)
// location 用户当前位置
// isArrive 是否到达目的地结束导航
report(options) {
console.error("report 上报:", options);
async report(options) {
// 现场联调日志:确认结束回调结构
console.error("[NavReport] report 上报(type):", options?.type);
console.error(
"[NavReport] report 上报(完整options):",
JSON.parse(JSON.stringify(options || {})),
);
if (options.type === "start_navigation") {
getApp().lastNavHistoryId = null;
handleNavStart(options);
......@@ -213,7 +224,16 @@ module.exports = {
if (options.type === "end_navigation") {
handleNavEnd(options);
if (options.isArrive) {
getApp().globalData.lastNav = options;
// 现场联调:把 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;
console.error("[NavReport] 写入 globalData.lastNav 失败(仅写 options)", e);
}
}
}
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论