diff --git a/packageA/pages/my_service2/appment_main.js b/packageA/pages/my_service2/appment_main.js index 0a68875..db8bc9b 100644 --- a/packageA/pages/my_service2/appment_main.js +++ b/packageA/pages/my_service2/appment_main.js @@ -44,8 +44,7 @@ Page({ validay: "", //服务项目有效期 is_sub: 0, //判断是否重复提交 is_textea: 1, //备注是否是可输入 - - + // 拖拽参数 writePosition: [], //默认定位参数 writesize: [0, 0],// X Y 定位 @@ -55,10 +54,9 @@ Page({ v:{}, project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'], - md: ['美导1', '美导2', '美导3', '美导4', '美导5', '美导6', '美导7'], + md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},], timeList: [], deltaX: 0, - col_arr:[], }, //控制备注输入 @@ -550,9 +548,7 @@ Page({ */ onLoad: function(options) { - this.getTimeList(23, 30); - - + this.getTimeList(23, 30); var th = this; th.setData({ options, @@ -593,8 +589,8 @@ Page({ // 获取当前默认导购信息及归属门店信息 if(options.firstleader) { getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+a.stoid+"/"+options.firstleader,{}).then(res=>{ -        if(res.data.code==0){ -          getApp().globalData.guide_id=res.data.data.id; + if(res.data.code==0){ + getApp().globalData.guide_id=res.data.data.id; getApp().request.promiseGet('/api/weshop/shoppingGuide/geIdStaffInfo', { data: { @@ -605,23 +601,23 @@ Page({ }).then(res => { console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode); if(res.data.data.Tech) { - + var data={ store_name: res.data.data.StorageName, beautician_name: res.data.data.StaffName, beauticianID: res.data.data.StaffId, StorageId: res.data.data.StorageId, } - th.check_firleader(data); + th.check_firleader(data); } }); - - -        }; + + + }; }); }; - - + + }, //查询剩下可预约人数 query_more: function() { @@ -667,7 +663,7 @@ Page({ is_textea: 1 }) th.query_project(); - + th.queryMultipleNodes(); }, //获取单个服务项目信息 @@ -698,8 +694,8 @@ Page({ // var nav_b = th.selectComponent("#nav_b"); //组件的id // nav_b.close_box(); // } - - //判断分享的导购是不是有门店,是不是该门店下又该会员 + + //判断分享的导购是不是有门店,是不是该门店下又该会员 check_firleader(data){ var th=this; var itemId = this.data.itemId; //服务id @@ -708,7 +704,7 @@ Page({ key_word = key_word.replace(/\s+/g, ""); getApp().request.promiseGet(url, { data: { - userId: th.data.options.userid, + userId: th.data.options.userid, storeId: os.stoid, serviceId: itemId, latitude: th.data.lat, @@ -730,16 +726,16 @@ Page({ }; break; } - } + } if(!store_data) return false; th.setData(store_data) - + }else{ return false; } - - //导购接口地址 - var url = "/api/weshop/marketing/reservation/staff/pagenew"; + + //导购接口地址 + var url = "/api/weshop/marketing/reservation/staff/pagenew"; return getApp().request.promiseGet(url, { isShowLoading:1, data: { @@ -757,108 +753,80 @@ Page({ if(item.staffid==data.beauticianID){ th.setData({ beautician_name:data.beautician_name, - beauticianID:data.beauticianID, + beauticianID:data.beauticianID, }) break; } } - + } }) }, - - - - //计算默认定位值 - // getSysdata: function () { - // var that = this; - // wx.getSystemInfo({ - // success: function (e) { - // that.data.window = [e.windowWidth, e.windowHeight]; - // console.log('win', that.data.window); - // 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]; - // console.log('writesize', that.data.writesize); - // }).exec(); - // }) - // }, - // fail: function (e) { - // console.log(e) - // } - // }); - // }, - - - //开始拖拽 + + + //开始拖拽 touchmove: function (e) { + if(!this.data.copy_btn) return false; var that = this; - var position = [e.touches[0].pageX + this.data.deltaX, e.touches[0].pageY]; + var position = [e.touches[0].pageX + this.data.deltaX-15, e.touches[0].pageY-15]; that.setData({ write: position }); }, - - - onPageScroll(e) { - // console.log('滚动距离', e); - this.data.scrolltop = e.scrollTop; - }, - - - - touchend:function(e){ var that = this,th=that; + if(!that.data.copy_btn) return false; var position =th.data.write; - var arr=th.data.col_arr; + var arr=th.data.col_arr; for(var i=0;i1?new Date(d_str+d_arr[1]):0; + + for(var j=0; jt2 && t2>0) continue; //如果坐标在网格内 - if( position[0]>th.data.f_x+i*th.data.f_width && 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_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; - + }) }, - + getcopy(e) { var that=this; console.log('e', e); - var position = [e.detail.x, e.detail.y]; - // var position = [e.detail.x - that.data.writesize[0] / 2, e.detail.y - that.data.writesize[1] / 2 - this.data.scrolltop]; + var x=e.currentTarget.dataset.offsetLeft; + var y=e.currentTarget.dataset.offsetTop; + var position = [x, y]; that.setData({ - write: position, - copy_btn:1 + write: position,copy_btn:1 }); - + }, - + getName(e) { // console.log('e1', e); let name = e.currentTarget.dataset.name; @@ -894,37 +862,37 @@ Page({ projectName: name, }); }, - - + + // 生成时间段 - getTimeList(hours, step) { -   var minutes = 60; -   var timeArr = []; -   hours = hours; -   step = step; -       -     for(var i = 8; i < hours; i++){ -         var str = ''; -         if(i < 10) { -             str = 0 + '' + i; -         } else { -             str = '' + i; -         }; -       -         for(var j = 0; j < minutes; j++) { -             if(j % step == 0){ -                 var s = j < 10 ? ':' + 0 + '' + j : ':' +  j; -                 s = str + s; -                 timeArr.push(s); -             }; -         }; -     }; -      + getTimeList(hours,step) { + var minutes=60; + var timeArr = []; + hours = hours; + step = step; + + for(var i = 8; i < hours; i++){ + var str = ''; + if(i < 10) { + str = 0 + '' + i; + } else { + str = '' + i; + }; + + for(var j = 0; j < minutes; j++) { + if(j % step == 0){ + var s = j < 10 ? ':' + 0 + '' + j : ':' + j; + s = str + s; + timeArr.push(s); + }; + }; + }; + // console.log('timeArr', timeArr); this.setData({ timeArr, }); - //     return timeArr; + }, diff --git a/packageA/pages/my_service2/appment_main.wxml b/packageA/pages/my_service2/appment_main.wxml index 2aa4f63..012ea2e 100644 --- a/packageA/pages/my_service2/appment_main.wxml +++ b/packageA/pages/my_service2/appment_main.wxml @@ -1,6 +1,7 @@ - - + + + 我的预约 @@ -11,8 +12,7 @@ - - + @@ -22,12 +22,11 @@ {{item}} - - + - - - + + + @@ -42,15 +41,13 @@ - - - + - + 时间 美导 - {{item}} + {{item}} @@ -58,15 +55,16 @@ 张三 --> - - {{item}} + {{item.name}} - - {{v[index][subitem]}} + + + {{v[index][subindex]?v[index][subindex]:''}} + × + - @@ -149,11 +147,9 @@ --> - - - - - + + + @@ -205,14 +201,10 @@ + - - {{projectName}} diff --git a/packageA/pages/my_service2/appment_main.wxss b/packageA/pages/my_service2/appment_main.wxss index 82592c5..34a7edb 100644 --- a/packageA/pages/my_service2/appment_main.wxss +++ b/packageA/pages/my_service2/appment_main.wxss @@ -310,13 +310,14 @@ button { background-color: #FFDEF0; } .td { - width: 100rpx; - height: 100rpx; + width: 140rpx; + height: 120rpx; 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); + border-bottom: 2rpx solid rgba(218, 217, 217, 1); + position: relative; } .td.active { @@ -379,7 +380,7 @@ button { .md-box { width: 0; height: 0; - border-width: 50rpx; + border-width: 62rpx; border-style: solid; border-color: #FFDEF0 #FFDEF0 transparent transparent; position: absolute; @@ -388,11 +389,11 @@ button { } .md { position: absolute; - top: -18px; + top: -30rpx; width: 53rpx; z-index: 999; - right: -24px; - font-size: 12px; + right: -52rpx; + font-size: 24rpxpx; } .hover { @@ -421,5 +422,8 @@ button { line-height: 1; font-size: 26rpx; } +.close_this{ position: absolute; width: 40rpx; display: flex;right: 0; top: 0; border-radius: 50%; + justify-content: center;align-items: center; + height: 40rpx; border: 1rpx solid #adadad; }