|
@@ -1,8 +1,7 @@
|
|
<template>
|
|
<template>
|
|
-<!-- asjd -->
|
|
|
|
<div class="cx-card">
|
|
<div class="cx-card">
|
|
<movable-area class="moveMenuBox">
|
|
<movable-area class="moveMenuBox">
|
|
- <movable-view class="moveMenuCont" :x="tran" :y="vert" @touchend="handleTouchEnd" direction="all">
|
|
|
|
|
|
+ <movable-view class="moveMenuCont" :x="tran" :y="vert" @touchend="handleTouchEnd" direction="all" damping="30" friction="5" @change="handleChange">
|
|
<img class="moveMenuPic" src="/static/images/moreOptions.svg">
|
|
<img class="moveMenuPic" src="/static/images/moreOptions.svg">
|
|
</movable-view>
|
|
</movable-view>
|
|
<div class="subject">
|
|
<div class="subject">
|
|
@@ -315,7 +314,11 @@
|
|
},
|
|
},
|
|
|
|
|
|
onLoad() {
|
|
onLoad() {
|
|
-
|
|
|
|
|
|
+ // let obj=wx.createSelectorQuery();
|
|
|
|
+ // obj.selectAll('.moveMenuBox').boundingClientRect();
|
|
|
|
+ // obj.exec(function (rect) {
|
|
|
|
+ // console.log(rect);
|
|
|
|
+ // });
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
@@ -352,17 +355,31 @@
|
|
// this.vert = yNum;
|
|
// this.vert = yNum;
|
|
// }
|
|
// }
|
|
|
|
|
|
- this.tran = e.mp.changedTouches[0].pageX;
|
|
|
|
- this.vert = e.mp.changedTouches[0].pageY - 15;
|
|
|
|
|
|
+ // this.tran = e.mp.changedTouches[0].pageX;
|
|
|
|
+ // this.vert = e.mp.changedTouches[0].pageY - 15;
|
|
|
|
|
|
- if (this.tran <= 188) {
|
|
|
|
- console.log('超过中间线了');
|
|
|
|
- this.tran = 0;
|
|
|
|
- } else {
|
|
|
|
- this.tran = 350;
|
|
|
|
- }
|
|
|
|
- console.log('X: ', this.tran);
|
|
|
|
- console.log('Y: ', this.vert);
|
|
|
|
|
|
+ // if (this.tran <= 188) {
|
|
|
|
+ // console.log('超过中间线了');
|
|
|
|
+ // this.tran = 0;
|
|
|
|
+ // } else {
|
|
|
|
+ // this.tran = 350;
|
|
|
|
+ // }
|
|
|
|
+ // console.log('X:', this.tran);
|
|
|
|
+ // console.log('Y:', this.vert);
|
|
|
|
+ // console.log(wx.getSystemInfoSync());
|
|
|
|
+ },
|
|
|
|
+ handleChange(e) {
|
|
|
|
+ console.log(e);
|
|
|
|
+ this.tran = e.detail.x;
|
|
|
|
+ this.vert = e.detail.y;
|
|
|
|
+ if (this.tran <= 188) {
|
|
|
|
+ console.log('超过中间线了');
|
|
|
|
+ this.tran = 0;
|
|
|
|
+ } else {
|
|
|
|
+ this.tran = 350;
|
|
|
|
+ }
|
|
|
|
+ console.log('X:', this.tran);
|
|
|
|
+ console.log('Y:', this.vert);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -379,7 +396,6 @@
|
|
z-index: 999;
|
|
z-index: 999;
|
|
width: 50rpx;
|
|
width: 50rpx;
|
|
height: 50rpx;
|
|
height: 50rpx;
|
|
- background: rgba(0, 0, 0, .2);
|
|
|
|
.moveMenuPic {
|
|
.moveMenuPic {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|