From 6d0246d771cc65518c181914f86628d91c551ea2 Mon Sep 17 00:00:00 2001 From: jiannibang <271381693@qq.com> Date: Mon, 17 Oct 2022 17:56:29 +0800 Subject: [PATCH] init --- app.js | 36 +++--- getMapData.js | 21 ++-- pages/destination/destination.wxml | 2 +- pages/h5map/index.js | 20 +-- pages/index/config.js | 194 +++++++---------------------- pages/index/index.wxml | 6 +- pages/index/index.wxss | 2 +- project.private.config.json | 3 +- 8 files changed, 75 insertions(+), 209 deletions(-) diff --git a/app.js b/app.js index 814b880..500b1ad 100644 --- a/app.js +++ b/app.js @@ -2,7 +2,7 @@ import { getMapData } from "./getMapData"; export const post = (url, data) => new Promise((resolve, reject) => { wx.request({ - url: "https://huiju.mapais.com/bjyj" + url, + url: "https://huiju.mapais.com/wxyj" + url, method: "POST", data, success({ data, statusCode }) { @@ -13,47 +13,41 @@ export const post = (url, data) => }); const floors = [ { - name: "-3F", + name: "L1", floorOrder: 0, url: true, - floorId: "B3", - isPark: true, + floorId: "L1", + isPark: false, }, { - name: "-2F", + name: "L2", floorOrder: 1, url: true, - floorId: "B2", - isPark: true, + floorId: "L2", + isPark: false, }, { - name: "-1F", + name: "L3", floorOrder: 2, url: true, - floorId: "B1", - isPark: true, + floorId: "L3", + isPark: false, }, { - name: "1F", + name: "L4", floorOrder: 3, url: true, - floorId: "F1", + floorId: "L4", isPark: false, }, { - name: "2F", + name: "L5", floorOrder: 4, url: true, - floorId: "F2", - isPark: false, - }, - { - name: "3F", - floorOrder: 5, - url: true, - floorId: "F3", + floorId: "L5", isPark: false, }, + ]; App({ async onLaunch() { diff --git a/getMapData.js b/getMapData.js index 3d97220..871df53 100644 --- a/getMapData.js +++ b/getMapData.js @@ -6,24 +6,23 @@ export const mall = { name: "荟聚", city: "无锡", code: "ef2c0bd1-6751-41be-86b7-df4b9ef49bad", - mapFileUrl: `https://hjcdn.cdn.bcebos.com/livatbeijing/Aeditor/Aeditor.json?t=${new Date().getTime()}`, - mapDataUrl: "https://huiju.mapais.com/bjyj/api/CDN/GetMapInfo", - shopInfoUrl: `https://hjcdn.cdn.bcebos.com/livatbeijing/QueryShopListForMap/QueryShopListForMap.json?t=${new Date().getTime()}`, - groundFloorIndex: 1, + mapFileUrl: `https://hjcdn.cdn.bcebos.com/livatwuxi/Aeditor/Aeditor.json?t=${new Date().getTime()}`, + mapDataUrl: "https://huiju.mapais.com/wxyj/api/CDN/GetMapInfo", + shopInfoUrl: `https://hjcdn.cdn.bcebos.com/livatwuxi/QueryShopListForMap/QueryShopListForMap.json?t=${new Date().getTime()}`, + groundFloorIndex: 0, floors: [ - [true, "-3F"], - [true, "-2F"], - [true, "-1F"], - [true, "1F"], - [true, "2F"], - [true, "3F"], + [true, "L1"], + [true, "L2"], + [true, "L3"], + [true, "L4"], + [true, "L5"], ], }; export const getMapData = async () => { if (mapDataAndShop) return mapDataAndShop; try { const { mapUrl, shopUrl } = await get( - `https://hjcdn.cdn.bcebos.com/livatbeijing/config.json?t=${new Date().getTime()}` + `https://hjcdn.cdn.bcebos.com/livatwuxi/config.json?t=${new Date().getTime()}` ); if (mapUrl) mall.mapFileUrl = mapUrl; if (shopUrl) mall.shopInfoUrl = shopUrl; diff --git a/pages/destination/destination.wxml b/pages/destination/destination.wxml index ce1dee6..e2f65eb 100644 --- a/pages/destination/destination.wxml +++ b/pages/destination/destination.wxml @@ -1,5 +1,5 @@ - + {{shop.name}} {{shop.floorName}} {{shop.shopFormat}} diff --git a/pages/h5map/index.js b/pages/h5map/index.js index adbe94b..afd8755 100644 --- a/pages/h5map/index.js +++ b/pages/h5map/index.js @@ -1,5 +1,5 @@ import { post } from "../../app"; -const baseUrl = "https://huiju.mapais.com/livatbeijing/"; +const baseUrl = "https://huiju.mapais.com/livatwuxi/"; Page({ /** * 页面的初始数据 @@ -12,20 +12,6 @@ Page({ * 生命周期函数--监听页面加载 */ async onLoad({ q = "", e = "", s = "", fe, plate = "" }) { - let range = "unauth"; - try { - const { latitude, longitude } = await wx.getLocation(); - if ( - latitude < 39.7411 || - latitude > 39.83099 || - longitude < 116.2608 || - longitude > 116.37891 - ) - range = "out"; - else range = "in"; - } catch (error) { - console.log(error); - } if (q) { q = decodeURIComponent(q); const kvs = q @@ -45,7 +31,7 @@ Page({ url: `/pages/agreement/index?q=${q}&e=${e}&s=${s}&plate=${plate}`, }); this.setData({ - url: `${baseUrl}?t=${new Date().getTime()}#/?openid=${openid}&range=${range}${ + url: `${baseUrl}?t=${new Date().getTime()}#/?openid=${openid}${ e ? "&e=" + e : "" }${e && s ? "&s=" + s : ""}${plate ? "&plate=" + plate : ""}${ fe ? "&fe=true" : "" @@ -59,7 +45,7 @@ Page({ url: `/pages/agreement/index?q=${q}&e=${e}&s=${s}&plate=${plate}`, }); this.setData({ - url: `${baseUrl}?t=${new Date().getTime()}#/?openid=${openid}&range=${range}${ + url: `${baseUrl}?t=${new Date().getTime()}#/?openid=${openid}${ e ? "&e=" + e : "" }${e && s ? "&s=" + s : ""}${plate ? "&plate=" + plate : ""}${ fe ? "&fe=true" : "" diff --git a/pages/index/config.js b/pages/index/config.js index 3561cd8..3d16fe1 100644 --- a/pages/index/config.js +++ b/pages/index/config.js @@ -19,162 +19,52 @@ module.exports = { { app_id: 0, map_id: 193, - poi_id: 25, - floor_id: "B3", - transform_matrix: [1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0], // 表示视觉地图和2D地图之间的转换矩阵 - geo_map_transform_matrix: [ - 0.0000117466936564, - 0.000000189887476, - 0, - -0.0000002456396239, - 0.0000090804973974, - 0, - 0, - 0, - 1, - 116.32584837, - 39.78784125, - 0, - ], - scale: 5.6, // 表示视觉地图与2D地图之间的尺度变换 - // 0:表示非车库,1表示为车库 - is_park: 1, - // 不为空表示支持蓝牙定位,否则不支持蓝牙定位;具体数值由百度方提供 - ak: "4HLHLEsOD3OpdwlO", - case_id: "23", - }, - { - app_id: 0, - map_id: 193, - poi_id: 25, - floor_id: "B2", - transform_matrix: [1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0], // 表示视觉地图和2D地图之间的转换矩阵 - geo_map_transform_matrix: [ - 0.0000117257737436, - 0.000000195171089, - 0, - -0.0000002146964509, - 0.0000090049708756, - 0, - 0, - 0, - 1, - 116.32584014, - 39.7879071, - 0, - ], - scale: 5.6, // 表示视觉地图与2D地图之间的尺度变换 - // 0:表示非车库,1表示为车库 - is_park: 1, - // 不为空表示支持蓝牙定位,否则不支持蓝牙定位;具体数值由百度方提供 - ak: "4HLHLEsOD3OpdwlO", - // case_id: "22", - case_id: "58", - }, - { - app_id: 0, - map_id: 193, - poi_id: 25, - floor_id: "B1", - transform_matrix: [1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0], // 表示视觉地图和2D地图之间的转换矩阵 - geo_map_transform_matrix: [ - 0.0000115390412537, - 0.0000001639865905, - 0, - -0.0000002121341793, - 0.0000089200542687, - 0, - 0, - 0, - 1, - 116.32581195, - 39.78789641, - 0, - ], - scale: 5.6, // 表示视觉地图与2D地图之间的尺度变换 - // 0:表示非车库,1表示为车库 - is_park: 1, - // 不为空表示支持蓝牙定位,否则不支持蓝牙定位;具体数值由百度方提供 - ak: "4HLHLEsOD3OpdwlO", - case_id: "21", - }, - { - app_id: 0, - map_id: 193, - poi_id: 25, + poi_id: 37, floor_id: "F1", - transform_matrix: [ - -0.9650306770413328, - -0.2621369574920047, - 0, - -0.2621369574920047, - 0.9650306770413328, - 0, - 0, - 0, - 1, - 421.28192787, - 31.53136436, - 0, - ], // 表示视觉地图和2D地图之间的转换矩阵 - scale: 5.788425061257576, // 表示视觉地图与2D地图之间的尺度变换 - // 0:表示非车库,1表示为车库 - is_park: 0, - // 不为空表示支持蓝牙定位,否则不支持蓝牙定位;具体数值由百度方提供 - ak: "", - case_id: "66", - }, - { - app_id: 0, - map_id: 193, - poi_id: 25, - floor_id: "F2", - transform_matrix: [ - 0.8891579162272474, - 0.4576004900572795, - 0, - 0.4576004900572795, - -0.8891579162272474, - 0, - 0, - 0, - 1, - 571.10078532, - -245.82877513, - 0, - ], // 表示视觉地图和2D地图之间的转换矩阵 - scale: 5.862545391362199, // 表示视觉地图与2D地图之间的尺度变换 - // 与内容编辑平台绑定,从平台获取 - // 0:表示非车库,1表示为车库 + scale: 0.998141, // 表示视觉地图与2D地图之间的尺度变换 + transform_matrix: [0.00120721, -0.060926, 0 ,0.00120721 ,0.999216 ,0.0395764, 0 ,0.060926 ,-0.0395764, 0.997357, 0 ,0 ,0, 0, 1], // 表示视觉地图和2D地图之间的转换矩阵 is_park: 0, - // 不为空表示支持蓝牙定位,否则不支持蓝牙定位;具体数值由百度方提供 - ak: "", }, { - app_id: 0, - map_id: 193, - poi_id: 25, - floor_id: "F3", - transform_matrix: [ - 0.8148392200653999, - 0.5796870180613556, - 0, - 0.5796870180613556, - -0.8148392200653999, - 0, - 0, - 0, - 1, - 583.57528358, - -239.44318034, - 0, - ], // 表示视觉地图和2D地图之间的转换矩阵 - scale: 5.858752899058012, // 表示视觉地图与2D地图之间的尺度变换 - // 0:表示非车库,1表示为车库 - is_park: 0, - // 不为空表示支持蓝牙定位,否则不支持蓝牙定位;具体数值由百度方提供 - ak: "", - }, + app_id: 0, + map_id: 193, + poi_id: 37, + floor_id: "F1", + scale: 5.6, // 表示视觉地图与2D地图之间的尺度变换 + transform_matrix: [1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0], // 表示视觉地图和2D地图之间的转换矩阵 + // 0:表示非车库,1表示为车库 + is_park: 0, + }, + { + app_id: 0, + map_id: 193, + poi_id: 37, + floor_id: "F1", + scale: 5.6, // 表示视觉地图与2D地图之间的尺度变换 + transform_matrix: [1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0], // 表示视觉地图和2D地图之间的转换矩阵 + // 0:表示非车库,1表示为车库 + is_park: 0, + }, + { + app_id: 0, + map_id: 193, + poi_id: 37, + floor_id: "F1", + scale: 5.6, // 表示视觉地图与2D地图之间的尺度变换 + transform_matrix: [1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0], // 表示视觉地图和2D地图之间的转换矩阵 + // 0:表示非车库,1表示为车库 + is_park: 0, + }, + { + app_id: 0, + map_id: 193, + poi_id: 37, + floor_id: "F1", + scale: 5.6, // 表示视觉地图与2D地图之间的尺度变换 + transform_matrix: [1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0], // 表示视觉地图和2D地图之间的转换矩阵 + // 0:表示非车库,1表示为车库 + is_park: 0, + }, ], // 有关渲染随屏箭头的配置 ArrowRenderMode: { diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 10ca951..34cd88d 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -21,11 +21,7 @@ 为了更精确定位 请选择您当前所在楼层 - - 商场 - 停车场 - - + {{item.name}} diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 7756991..9b16a7b 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -199,7 +199,7 @@ } .content > .floors > .list { position: absolute; - top: 96px; + top: 44px; left: 16px; right: 16px; width: calc(100vw - 32px); diff --git a/project.private.config.json b/project.private.config.json index c1547a6..8e20a80 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,6 +1,7 @@ { "setting": { - "compileHotReLoad": true + "compileHotReLoad": true, + "urlCheck": false }, "condition": {}, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",