Browse Source

init

master
jiannibang 4 years ago
parent
commit
6d0246d771
  1. 36
      app.js
  2. 21
      getMapData.js
  3. 2
      pages/destination/destination.wxml
  4. 20
      pages/h5map/index.js
  5. 148
      pages/index/config.js
  6. 6
      pages/index/index.wxml
  7. 2
      pages/index/index.wxss
  8. 3
      project.private.config.json

36
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() {

21
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;

2
pages/destination/destination.wxml

@ -1,5 +1,5 @@
<view class="destination">
<image wx:if="{{shop.logoPath}}" mode="aspectFit" src="https://huiju.mapais.com/bjyj/{{shop.logoPath}}"></image>
<image wx:if="{{shop.logoPath}}" mode="aspectFit" src="https://huiju.mapais.com/wxyj/{{shop.logoPath}}"></image>
<view class="name {{!shop.logoPath?'noicon':''}}">{{shop.name}}</view>
<view class="meta {{!shop.logoPath?'noicon':''}}">{{shop.floorName}}<view wx:if="{{shop.floorName && shop.shopFormat}}" class="sep"></view>
{{shop.shopFormat}}</view>

20
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" : ""

148
pages/index/config.js

@ -19,161 +19,51 @@ 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",
poi_id: 37,
floor_id: "F1",
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,
},
{
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,
],
poi_id: 37,
floor_id: "F1",
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",
is_park: 0,
},
{
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地图之间的尺度变换
scale: 5.6, // 表示视觉地图与2D地图之间的尺度变换
transform_matrix: [1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0], // 表示视觉地图和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地图之间的尺度变换
// 与内容编辑平台绑定,从平台获取
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,
// 不为空表示支持蓝牙定位,否则不支持蓝牙定位;具体数值由百度方提供
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地图之间的尺度变换
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,
// 不为空表示支持蓝牙定位,否则不支持蓝牙定位;具体数值由百度方提供
ak: "",
},
],
// 有关渲染随屏箭头的配置

6
pages/index/index.wxml

@ -21,11 +21,7 @@
<text>为了更精确定位
请选择您当前所在楼层</text>
<view class="floors">
<view class="tabs">
<view class="tab {{selectMall?'active':''}}" bindtap="setSelectMall">商场</view>
<view class="tab {{!selectMall?'active':''}}" bindtap="setSelectPark">停车场</view>
</view>
<scroll-view class="list" scroll-y style="height: {{windowHeight - 152 - 120 - 96 - 30 - 50 - 77}}px">
<scroll-view class="list" scroll-y style="height: {{windowHeight - 152 - 120 - 96 - 30 - 50 - 77 + 52}}px">
<view class="item {{item.floorId===floorId?'active':''}}" id="{{index}}" wx:for="{{selectMall? filteredMallFloors:filteredParkFloors}}" wx:key="floorId" bindtap="setFloor">
{{item.name}}</view>
</scroll-view>

2
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);

3
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",

Loading…
Cancel
Save