Browse Source

新上传

wang_chenxi 5 years ago
parent
commit
9b30f2708c
1 changed files with 30 additions and 14 deletions
  1. 30 14
      src/pages/card/card.vue

+ 30 - 14
src/pages/card/card.vue

@@ -1,8 +1,7 @@
 <template>
-<!-- asjd -->
     <div class="cx-card">
         <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">
             </movable-view>
             <div class="subject">
@@ -315,7 +314,11 @@
         },
 
         onLoad() {
-            
+            // let obj=wx.createSelectorQuery();
+            // obj.selectAll('.moveMenuBox').boundingClientRect();
+            // obj.exec(function (rect) {
+            //     console.log(rect);
+            // });
         },
 
         methods: {
@@ -352,17 +355,31 @@
                 //     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;
                 width: 50rpx;
                 height: 50rpx;
-                background: rgba(0, 0, 0, .2);
                 .moveMenuPic {
                     width: 100%;
                     height: 100%;