From ab76f4d7eb7b0ecb67702e5eb285fbfef7c5e3e9 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Sat, 15 May 2021 08:53:01 +0800 Subject: [PATCH] 移动的原理 --- packageA/pages/my_service/appment_main.js | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ packageA/pages/my_service/appment_main.wxml | 8 ++++---- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/packageA/pages/my_service/appment_main.js b/packageA/pages/my_service/appment_main.js index 4d1054f..fd6d46b 100644 --- a/packageA/pages/my_service/appment_main.js +++ b/packageA/pages/my_service/appment_main.js @@ -659,6 +659,11 @@ Page({ is_textea: 1 }) th.query_project(); + + th.queryMultipleNodes(); + + + }, //获取单个服务项目信息 query_project: function() { @@ -816,5 +821,53 @@ Page({ // that.data.writesize = [res.width, res.height]; }).exec(); }, + + //开始拖拽 + touchmove: function (e) { + var that = this,th=that; + var position = [e.touches[0].pageX - that.data.writesize[0] / 2, e.touches[0].pageY - that.data.writesize[1] / 2 - this.data.scrolltop]; + that.setData({ + write: position + }); + + }, + + + touchend:function(e){ + var that = this,th=that; + var position =th.data.write; + for(var i=0;i<7;i++){ + for(var j=0; j<2;j++){ + //如果坐标在网格内 + if( position[0]>th.data.f_x+i*th.data.f_width && position[0]th.data.f_y +j*th.data.f_hei && position[1] { + console.log(res); + th.data.f_x=res[0].left; + th.data.f_y=res[0].top; + th.data.f_hei=res[0].height; + th.data.f_width=res[0].width; + + }) + } + }) \ No newline at end of file diff --git a/packageA/pages/my_service/appment_main.wxml b/packageA/pages/my_service/appment_main.wxml index adaa301..96ff7a5 100644 --- a/packageA/pages/my_service/appment_main.wxml +++ b/packageA/pages/my_service/appment_main.wxml @@ -29,8 +29,8 @@ 张三 - 100 - 200 + {{v[0][0]}} + {{v[0][1]}} 张三 @@ -63,7 +63,7 @@ 200 - 1张三 + 张三 300 300 @@ -215,4 +215,4 @@ -我可以移动 \ No newline at end of file +我可以移动 \ No newline at end of file -- libgit2 0.21.4