From bf795fd7fcc76596a73b902edbb18723978964f7 Mon Sep 17 00:00:00 2001 From: taiyuan Date: Fri, 14 May 2021 16:40:46 +0800 Subject: [PATCH] 预约服务 --- packageA/pages/my_service/appment_main.js | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- packageA/pages/my_service/appment_main.wxml | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------- packageA/pages/my_service/appment_main.wxss | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 209 insertions(+), 34 deletions(-) diff --git a/packageA/pages/my_service/appment_main.js b/packageA/pages/my_service/appment_main.js index f2795f4..4d1054f 100644 --- a/packageA/pages/my_service/appment_main.js +++ b/packageA/pages/my_service/appment_main.js @@ -44,6 +44,14 @@ Page({ validay: "", //服务项目有效期 is_sub: 0, //判断是否重复提交 is_textea: 1, //备注是否是可输入 + + + // 拖拽参数 + writePosition: [80, 90], //默认定位参数 + writesize: [0, 0],// X Y 定位 + window: [0, 0], //屏幕尺寸 + write: [0, 0], //定位参数 + scrolltop: 0,//据顶部距离 }, //控制备注输入 check_text: function() { @@ -533,6 +541,10 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function(options) { + + + + var th = this; th.setData({ options, @@ -743,8 +755,66 @@ Page({ } }) - } - + }, + + + + //计算默认定位值 + getSysdata: function () { + var that = this; + wx.getSystemInfo({ + success: function (e) { + that.data.window = [e.windowWidth, e.windowHeight]; + var write = []; + write[0] = that.data.window[0] * that.data.writePosition[0] / 100; + write[1] = that.data.window[1] * that.data.writePosition[1] / 100; + console.log(write,45) + that.setData({ + write: write + }, function () { + // 获取元素宽高 + wx.createSelectorQuery().select('.td').boundingClientRect(function (res) { + // console.log('0x0x',res.width) + that.data.writesize = [res.width, res.height]; + }).exec(); + }) + }, + fail: function (e) { + console.log(e) + } + }); + }, + //开始拖拽 + touchmove: function (e) { + // console.log(123); + var that = this; + 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 + }); + this.getSysdata(); + }, + onPageScroll(e) { + this.data.scrolltop = e.scrollTop; + }, + scroll(e) { + // console.log('scroll', e); + }, + + rect() { + // console.log('click'); + // wx.createSelectorQuery().select('.td').boundingClientRect(function (res) { + // console.log('0x0x',res); + // }).exec(); + }, + + print(e) { + console.log('e', e); + wx.createSelectorQuery().select('.td').boundingClientRect(function (res) { + console.log('0x0x',res); + // that.data.writesize = [res.width, res.height]; + }).exec(); + }, }) \ 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 4b99d91..adaa301 100644 --- a/packageA/pages/my_service/appment_main.wxml +++ b/packageA/pages/my_service/appment_main.wxml @@ -1,10 +1,10 @@ - - + + - + @@ -17,54 +17,120 @@ + + + + + 时间 + 8:00 + 9:00 + + + + + 张三 + 100 + 200 + + + 张三 + 100 + 200 + + + 张三 + 100 + 200 + + + 张三 + 100 + 200 + + + 张三 + 100 + 200 + + + 张三 + 100 + 200 + + + 张三 + 100 + 200 + + + 1张三 + 300 + 300 + + + + + + + 项目1 + + + + 项目1 + + + + + + - + - + - - + + - + - + + + + - + - + - + + - + - + + - + -
+ + @@ -147,4 +213,6 @@ - \ No newline at end of file + + +我可以移动 \ No newline at end of file diff --git a/packageA/pages/my_service/appment_main.wxss b/packageA/pages/my_service/appment_main.wxss index ba5d2c1..bf3d869 100644 --- a/packageA/pages/my_service/appment_main.wxss +++ b/packageA/pages/my_service/appment_main.wxss @@ -286,3 +286,40 @@ button { height: 80rpx; color: rgb(159, 159, 159); } + + +.table { + background-color: white; + border-top: 2rpx solid rgba(218, 217, 217, 1); + border-left: 2rpx solid rgba(218, 217, 217, 1); +} +.blue { + background: rgba(241, 252, 255, 1); +} +.td { + width: 100rpx; + height: 100rpx; + display: flex; + align-items: center; + justify-content: center; + border-right: 2rpx solid rgba(218, 217, 217, 1); + border-bottom: 2rpx solid rgba(218, 217, 217, 1); +} + +.left { + box-shadow: 4px 0px 6px #e7e9eb; +} + +.right { + width: calc(100% - 102rpx); + padding-right: 102rpx; + box-sizing: border-box; +} + +.card { + position: fixed; + right: 0; + background-color: white; + box-shadow: 4px 0px 12px #e7e9eb; + border-radius: 8rpx; +} -- libgit2 0.21.4