|
@@ -201,15 +201,14 @@ movable-view {
|
|
|
|
|
|
.selected-icon {
|
|
|
height: 38px;
|
|
|
- // width: 102px;
|
|
|
position: absolute;
|
|
|
- // background: '#AC8BE8';
|
|
|
+ background: #ac8be8;
|
|
|
+ border-radius: 30px;
|
|
|
background-size: 100% 100%;
|
|
|
z-index: 9999;
|
|
|
text-align: center;
|
|
|
- // transform-origin: 36px 54px; //偏移量决定的
|
|
|
- // img
|
|
|
label {
|
|
|
+ position: relative;
|
|
|
display: inline-block;
|
|
|
font-family: PingFang SC;
|
|
|
font-size: 14px;
|
|
@@ -219,6 +218,27 @@ movable-view {
|
|
|
letter-spacing: 0px;
|
|
|
text-align: center;
|
|
|
margin: 0 auto;
|
|
|
+ &:before {
|
|
|
+ position: absolute;
|
|
|
+ content: '';
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ top: 30px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%) rotate(90deg);
|
|
|
+ border-top: solid 10px transparent;
|
|
|
+ border-left: solid 10px #ac8be8;
|
|
|
+ border-bottom: solid 10px transparent;
|
|
|
+ border-top-width: 10px;
|
|
|
+ border-top-style: solid;
|
|
|
+ border-top-color: transparent;
|
|
|
+ border-left-width: 10px;
|
|
|
+ border-left-style: solid;
|
|
|
+ border-left-color: #ac8be8;
|
|
|
+ border-bottom-width: 10px;
|
|
|
+ border-bottom-style: solid;
|
|
|
+ border-bottom-color: transparent;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -373,7 +393,7 @@ movable-view {
|
|
|
class="selected-icon"
|
|
|
wx:if="{{selectArea}}"
|
|
|
mode="scaleToFill"
|
|
|
- :style="{width:(selectArea.selectIconWidth)+'px', top:(selectArea.top*mapScale+10)+'px',left:(selectArea.left*mapScale+(selectArea.width*mapScale/2)-selectArea.selectIconWidth/2)+'px', transform: 'rotate('+(selectArea.rotate)+'deg)',backgroundImage:'url('+(h5StaticPath)+'/page-map-icon/select-lanse.svg)'}"
|
|
|
+ :style="{width:(selectArea.selectIconWidth)+'px', top:(selectArea.top*mapScale+10)+'px',left:(selectArea.left*mapScale+(selectArea.width*mapScale/2)-selectArea.selectIconWidth/2)+'px', transform: 'rotate('+(selectArea.rotate)+'deg)'}"
|
|
|
>
|
|
|
<label>{{ selectArea.localName }}</label>
|
|
|
</div>
|
|
@@ -499,7 +519,7 @@ wepy.component({
|
|
|
currentSp: '', // 空间id 用于路由跳转
|
|
|
h5StaticPath,
|
|
|
mapAreasInfo: [],
|
|
|
- selectArea: {},
|
|
|
+ selectArea: null,
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
selectedBuilding: '',
|
|
@@ -722,17 +742,6 @@ wepy.component({
|
|
|
[selectedFloor]: area.id
|
|
|
};
|
|
|
},
|
|
|
- setCacheSelectedFloor(floorId) {
|
|
|
- const { selectArea } = this;
|
|
|
- wx.setStorage({
|
|
|
- key: 'SelectedASpace',
|
|
|
- data: {
|
|
|
- floorId: floorId,
|
|
|
- spaceId: selectArea.floorId == floorId ? selectArea.id : ''
|
|
|
- },
|
|
|
- success: function() {}
|
|
|
- });
|
|
|
- },
|
|
|
getHistorySelectedArea() {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
wx.getStorage({
|
|
@@ -762,30 +771,23 @@ wepy.component({
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ // 设置选中的路径
|
|
|
doSelectArea(area, sign) {
|
|
|
if (!area) {
|
|
|
return;
|
|
|
}
|
|
|
this.selectArea = area;
|
|
|
this.selectedFloor = area.floorId;
|
|
|
- // this.getSpaceTem();
|
|
|
- this.setCacheSelectedArea(area);
|
|
|
this.setAreaCenter(area);
|
|
|
if (!sign) {
|
|
|
// 如果是父亲传进来的areaId 不执行下面的触发
|
|
|
- this.$emit('mapChangeSpaceInfo', area.id); // 传给父组件,以请求数据
|
|
|
+ console.log('this.selectArea==', this.selectArea);
|
|
|
+ this.$emit('mapChangeSpaceInfo', area); // 传给父组件,以请求数据
|
|
|
}
|
|
|
},
|
|
|
+ // 获取选中的空间
|
|
|
selectAreaFun(currentSelect) {
|
|
|
- if (!currentSelect.canClick) {
|
|
|
- wx.showToast({
|
|
|
- title: '不可选区域',
|
|
|
- duration: 1000,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
+ this.selectArea = null;
|
|
|
this.doSelectArea(currentSelect);
|
|
|
},
|
|
|
setAreaCenter(area) {
|