Commit 04bf170aef5b65db3da2d1e80cf52bc56c986322

Authored by yvan.ni
1 parent 2491cd77

浮动的按钮

packageA/pages/my_service2/appment_main.js
... ... @@ -44,8 +44,7 @@ Page({
44 44 validay: "", //服务项目有效期
45 45 is_sub: 0, //判断是否重复提交
46 46 is_textea: 1, //备注是否是可输入
47   -
48   -
  47 +
49 48 // 拖拽参数
50 49 writePosition: [], //默认定位参数
51 50 writesize: [0, 0],// X Y 定位
... ... @@ -55,10 +54,9 @@ Page({
55 54 v:{},
56 55  
57 56 project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'],
58   - md: ['美导1', '美导2', '美导3', '美导4', '美导5', '美导6', '美导7'],
  57 + md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},],
59 58 timeList: [],
60 59 deltaX: 0,
61   -
62 60 col_arr:[],
63 61 },
64 62 //控制备注输入
... ... @@ -550,9 +548,7 @@ Page({
550 548 */
551 549 onLoad: function(options) {
552 550  
553   - this.getTimeList(23, 30);
554   -
555   -
  551 + this.getTimeList(23, 30);
556 552 var th = this;
557 553 th.setData({
558 554 options,
... ... @@ -593,8 +589,8 @@ Page({
593 589 // 获取当前默认导购信息及归属门店信息
594 590 if(options.firstleader) {
595 591 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+a.stoid+"/"+options.firstleader,{}).then(res=>{
596   -        if(res.data.code==0){
597   -          getApp().globalData.guide_id=res.data.data.id;
  592 + if(res.data.code==0){
  593 + getApp().globalData.guide_id=res.data.data.id;
598 594  
599 595 getApp().request.promiseGet('/api/weshop/shoppingGuide/geIdStaffInfo', {
600 596 data: {
... ... @@ -605,23 +601,23 @@ Page({
605 601 }).then(res => {
606 602 console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode);
607 603 if(res.data.data.Tech) {
608   -
  604 +
609 605 var data={
610 606 store_name: res.data.data.StorageName,
611 607 beautician_name: res.data.data.StaffName,
612 608 beauticianID: res.data.data.StaffId,
613 609 StorageId: res.data.data.StorageId,
614 610 }
615   - th.check_firleader(data);
  611 + th.check_firleader(data);
616 612 }
617 613 });
618   -
619   -
620   -        };
  614 +
  615 +
  616 + };
621 617 });
622 618 };
623   -
624   -
  619 +
  620 +
625 621 },
626 622 //查询剩下可预约人数
627 623 query_more: function() {
... ... @@ -667,7 +663,7 @@ Page({
667 663 is_textea: 1
668 664 })
669 665 th.query_project();
670   -
  666 +
671 667 th.queryMultipleNodes();
672 668 },
673 669 //获取单个服务项目信息
... ... @@ -698,8 +694,8 @@ Page({
698 694 // var nav_b = th.selectComponent("#nav_b"); //组件的id
699 695 // nav_b.close_box();
700 696 // }
701   -
702   - //判断分享的导购是不是有门店,是不是该门店下又该会员
  697 +
  698 + //判断分享的导购是不是有门店,是不是该门店下又该会员
703 699 check_firleader(data){
704 700 var th=this;
705 701 var itemId = this.data.itemId; //服务id
... ... @@ -708,7 +704,7 @@ Page({
708 704 key_word = key_word.replace(/\s+/g, "");
709 705 getApp().request.promiseGet(url, {
710 706 data: {
711   - userId: th.data.options.userid,
  707 + userId: th.data.options.userid,
712 708 storeId: os.stoid,
713 709 serviceId: itemId,
714 710 latitude: th.data.lat,
... ... @@ -730,16 +726,16 @@ Page({
730 726 };
731 727 break;
732 728 }
733   - }
  729 + }
734 730 if(!store_data) return false;
735 731 th.setData(store_data)
736   -
  732 +
737 733 }else{
738 734 return false;
739 735 }
740   -
741   - //导购接口地址
742   - var url = "/api/weshop/marketing/reservation/staff/pagenew";
  736 +
  737 + //导购接口地址
  738 + var url = "/api/weshop/marketing/reservation/staff/pagenew";
743 739 return getApp().request.promiseGet(url, {
744 740 isShowLoading:1,
745 741 data: {
... ... @@ -757,108 +753,80 @@ Page({
757 753 if(item.staffid==data.beauticianID){
758 754 th.setData({
759 755 beautician_name:data.beautician_name,
760   - beauticianID:data.beauticianID,
  756 + beauticianID:data.beauticianID,
761 757 })
762 758 break;
763 759 }
764 760 }
765   -
  761 +
766 762 }
767 763 })
768 764 },
769   -
770   -
771   -
772   - //计算默认定位值
773   - // getSysdata: function () {
774   - // var that = this;
775   - // wx.getSystemInfo({
776   - // success: function (e) {
777   - // that.data.window = [e.windowWidth, e.windowHeight];
778   - // console.log('win', that.data.window);
779   - // var write = [];
780   - // write[0] = that.data.window[0] * that.data.writePosition[0] / 100;
781   - // write[1] = that.data.window[1] * that.data.writePosition[1] / 100;
782   - // console.log(write,45)
783   - // that.setData({
784   - // write: write
785   - // }, function () {
786   - // // 获取元素宽高
787   - // wx.createSelectorQuery().select('.td').boundingClientRect(function (res) {
788   - // // console.log('0x0x',res.width)
789   - // that.data.writesize = [res.width, res.height];
790   - // console.log('writesize', that.data.writesize);
791   - // }).exec();
792   - // })
793   - // },
794   - // fail: function (e) {
795   - // console.log(e)
796   - // }
797   - // });
798   - // },
799   -
800   -
801   - //开始拖拽
  765 +
  766 +
  767 + //开始拖拽
802 768 touchmove: function (e) {
  769 + if(!this.data.copy_btn) return false;
803 770 var that = this;
804   - var position = [e.touches[0].pageX + this.data.deltaX, e.touches[0].pageY];
  771 + var position = [e.touches[0].pageX + this.data.deltaX-15, e.touches[0].pageY-15];
805 772 that.setData({
806 773 write: position
807 774 });
808 775 },
809   -
810   -
811   - onPageScroll(e) {
812   - // console.log('滚动距离', e);
813   - this.data.scrolltop = e.scrollTop;
814   - },
815   -
816   -
817   -
818   -
819 776 touchend:function(e){
820 777 var that = this,th=that;
  778 + if(!that.data.copy_btn) return false;
821 779 var position =th.data.write;
822   - var arr=th.data.col_arr;
  780 + var arr=th.data.col_arr;
823 781 for(var i=0;i<this.data.md.length;i++){//i是列
824   - for(var j=0; j<this.data.timeArr.length;j++){//j是行
825   -
  782 + var item=this.data.md[i];
  783 + var nd=new Date();
  784 + var d_str=nd.getFullYear()+"-"+(nd.getMonth()+1)+"-"+nd.getDate()+" ";
  785 + var d_arr=item.time.split("-");
  786 + var t1=new Date(d_str+d_arr[0])
  787 + var t2=d_arr.length>1?new Date(d_str+d_arr[1]):0;
  788 +
  789 + for(var j=0; j<this.data.timeArr.length;j++){//j是行
826 790 if(arr.indexOf(j)!=-1) continue;
  791 + var tn=new Date(d_str+this.data.timeArr[j]);
  792 + //小于开始时间
  793 + if(tn<t1) continue;
  794 + //大于结束时间
  795 + if(tn>t2 && t2>0) continue;
827 796 //如果坐标在网格内
828   - if( position[0]>th.data.f_x+i*th.data.f_width && position[0]<th.data.f_x+ (i+1)*th.data.f_width &&
  797 + if( position[0]>th.data.f_x+i*th.data.f_width && position[0]<th.data.f_x+ (i+1)*th.data.f_width &&
829 798 position[1]>th.data.f_y +j*th.data.f_hei && position[1]<th.data.f_y+(j+1)*th.data.f_hei){
830   -
831   - var txt="v["+i+"]["+j+"]";
832   - wx.showToast({
833   - title:"222"+i+j,
834   -
835   - })
836   - // let obj = {};
837   - // obj.row = j;
838   - // obj.col = i;
839   - // var v = this.data.v;
840   - // v[i].col = j;
  799 +
  800 + var txt="v["+i+"]["+j+"]";
841 801 arr.push(j);
842   - console.log(arr);
843   -
844   -
845 802 th.setData({
846 803 [txt]: th.data.projectName,
847   - // [v[i].row]: i,
848   - // [v[i].col]: j,
849 804 col_arr:arr
850 805 });
851   -
852 806 break;
853 807 }
854   -
  808 +
855 809 }
856 810 }
857 811 th.setData({copy_btn:0})
858   -
859 812 },
860   -
861   -
  813 +
  814 +
  815 + close_this:function (e){
  816 + var txt=e.currentTarget.dataset.txt;
  817 + var sindex=parseInt(e.currentTarget.dataset.sindex);
  818 + var arr=this.data.col_arr;
  819 + var ind=arr.indexOf(sindex);
  820 + arr.splice(ind,1)
  821 + this.setData({[txt]:null,col_arr:arr})
  822 + },
  823 +
  824 + onPageScroll(e) {
  825 + // console.log('滚动距离', e);
  826 + this.data.scrolltop = e.scrollTop;
  827 + },
  828 +
  829 +
862 830 //声明节点查询的方法
863 831 queryMultipleNodes: function() {
864 832 var th=this;
... ... @@ -867,26 +835,26 @@ Page({
867 835 query.selectViewport().scrollOffset() // 这段代码的意思是获取页面滑动位置的查询请求
868 836 query.exec(res => {
869 837 console.log(res);
870   - th.data.f_x=res[0].left;
871   - th.data.f_y=res[0].top;
  838 + th.data.f_x=res[0].left;
  839 + th.data.f_y=res[0].top;
872 840 th.data.f_hei=res[0].height;
873 841 th.data.f_width=res[0].width;
874   -
  842 +
875 843 })
876 844 },
877   -
  845 +
878 846 getcopy(e) {
879 847 var that=this;
880 848 console.log('e', e);
881   - var position = [e.detail.x, e.detail.y];
882   - // var position = [e.detail.x - that.data.writesize[0] / 2, e.detail.y - that.data.writesize[1] / 2 - this.data.scrolltop];
  849 + var x=e.currentTarget.dataset.offsetLeft;
  850 + var y=e.currentTarget.dataset.offsetTop;
  851 + var position = [x, y];
883 852 that.setData({
884   - write: position,
885   - copy_btn:1
  853 + write: position,copy_btn:1
886 854 });
887   -
  855 +
888 856 },
889   -
  857 +
890 858 getName(e) {
891 859 // console.log('e1', e);
892 860 let name = e.currentTarget.dataset.name;
... ... @@ -894,37 +862,37 @@ Page({
894 862 projectName: name,
895 863 });
896 864 },
897   -
898   -
  865 +
  866 +
899 867 // 生成时间段
900   - getTimeList(hours, step) {
901   -   var minutes = 60;
902   -   var timeArr = [];
903   -   hours = hours;
904   -   step = step;
905   -      
906   -     for(var i = 8; i < hours; i++){
907   -         var str = '';
908   -         if(i < 10) {
909   -             str = 0 + '' + i;
910   -         } else {
911   -             str = '' + i;
912   -         };
913   -      
914   -         for(var j = 0; j < minutes; j++) {
915   -             if(j % step == 0){
916   -                 var s = j < 10 ? ':' + 0 + '' + j : ':' +  j;
917   -                 s = str + s;
918   -                 timeArr.push(s);
919   -             };
920   -         };
921   -     };
922   -     
  868 + getTimeList(hours,step) {
  869 + var minutes=60;
  870 + var timeArr = [];
  871 + hours = hours;
  872 + step = step;
  873 +
  874 + for(var i = 8; i < hours; i++){
  875 + var str = '';
  876 + if(i < 10) {
  877 + str = 0 + '' + i;
  878 + } else {
  879 + str = '' + i;
  880 + };
  881 +
  882 + for(var j = 0; j < minutes; j++) {
  883 + if(j % step == 0){
  884 + var s = j < 10 ? ':' + 0 + '' + j : ':' + j;
  885 + s = str + s;
  886 + timeArr.push(s);
  887 + };
  888 + };
  889 + };
  890 +
923 891 // console.log('timeArr', timeArr);
924 892 this.setData({
925 893 timeArr,
926 894 });
927   - //     return timeArr;
  895 +
928 896 },
929 897  
930 898  
... ...
packageA/pages/my_service2/appment_main.wxml
1 1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
2   -<movable-area class="area" catchtap="close" style="width: 100%;height: 100%;">
3   - <view class="btn-container">
  2 +<wxs module="fil" src="g_filter.wxs"></wxs>
  3 +
  4 +<view class="btn-container">
4 5 <navigator class="btn" url="/pages/user/my_service/tment_order_list">
5 6 <view>我的预约</view>
6 7 </navigator>
... ... @@ -11,8 +12,7 @@
11 12 </form>
12 13 </view>
13 14  
14   - <view class="card" bindlongtap="getcopy">
15   -
  15 +<view class="card" bindlongtap="getcopy">
16 16 <view class="t-c c-c7">
17 17 <text class="iconfont icon-sandian"></text>
18 18 </view>
... ... @@ -22,12 +22,11 @@
22 22 <view class="fs24">{{item}}</view>
23 23 </view>
24 24 </block>
25   -
26   - </view>
  25 +</view>
27 26  
28   - <image class="main" src="{{iurl}}/miniapp/images/yyservice/main.png"></image>
29   - <!-- Fram -->
30   - <view class="">
  27 +<image class="main" src="{{iurl}}/miniapp/images/yyservice/main.png"></image>
  28 +<!-- Fram -->
  29 +<view class="">
31 30 <!-- 选择门店 -->
32 31 <view class="flex-vertical pdv20 jc-center">
33 32 <!-- 门店 -->
... ... @@ -42,15 +41,13 @@
42 41 <view class="angle">∟</view>
43 42 </view>
44 43 </view>
45   -
46   -
47   - <view class="table flex fs26" style="width: 100%;height: 100%;">
  44 + <view class="table flex fs26" style="width: 100%;height: 100%;">
48 45 <view class="left t-c">
49   - <view class="td pr">
  46 + <view class="td pr" style="width: 120rpx">
50 47 <view class="time-box" bindtap="pickTime"><view class="time">时间</view></view>
51 48 <view class="md-box"><view class="md">美导</view></view>
52 49 </view>
53   - <view class="td" wx:for="{{timeArr}}">{{item}}</view>
  50 + <view class="td" style="width: 120rpx" wx:for="{{timeArr}}">{{item}}</view>
54 51 </view>
55 52 <scroll-view scroll-x class="right" bindscroll="scroll">
56 53 <view class="flex t-c">
... ... @@ -58,15 +55,16 @@
58 55 <view class="td bg-pink">张三</view>
59 56 <view class="td" wx:for="{{timeArr.length}}"></view>
60 57 </view> -->
61   -
62 58 <view wx:for="{{md}}">
63   - <view class="td bg-pink">{{item}}</view>
  59 + <view class="td bg-pink">{{item.name}}</view>
64 60 <!-- <view class="td content_view {{v[0][0]?'121':''}}">{{v[0][0]}}</view> -->
65   - <block wx:for="{{timeArr.length}}" wx:for-item="subitem" wx:for-index="subindex">
66   - <view class="td content_view {{v[index][subitem] ? 'active':''}} {{filters.in_arr(subitem,col_arr)?'notactive':''}}">{{v[index][subitem]}}</view>
  61 + <block wx:for="{{timeArr.length}}" wx:for-item="subitem" wx:for-index="subindex">
  62 + <view class="td content_view {{v[index][subindex] && v[index][subindex]? 'active':''}} {{filters.in_arr(subindex,col_arr) || fil.is_no_time(item,subindex,timeArr) ?'notactive':''}}">
  63 + {{v[index][subindex]?v[index][subindex]:''}}
  64 + <text wx:if="{{v[index][subindex]}}" catchtap="close_this" data-txt="v[{{index}}][{{subindex}}]" data-sindex="{{subindex}}" class="close_this">×</text>
  65 + </view>
67 66 </block>
68 67 </view>
69   -
70 68 </view>
71 69 </scroll-view>
72 70  
... ... @@ -149,11 +147,9 @@
149 147 </form> -->
150 148 <!-- </view> -->
151 149 </view>
152   -
153   -
154   -
155   - </view>
156   -</movable-area>
  150 +</view>
  151 +
  152 +
157 153 <!-- 门店列表显示 -->
158 154 <view wx:if="{{store}}" class="storeList fixed">
159 155 <view class="choice flex-vertical-between fs32 storeListpadd">
... ... @@ -205,14 +201,10 @@
205 201 <!-- 蒙尘 -->
206 202 <view wx:if="{{store}}" class="disgraceful" bindtap="onclickstore"></view>
207 203 <warn id="warn"></warn>
  204 +
208 205 <!-- 制作一个圆球导航 -->
209 206 <!-- <nav_b id="nav_b"></nav_b> -->
210 207  
211   -<!-- <view wx:if="{{copy_btn}}" style="position:absolute;z-index:999999;left:{{write[0]}}px;top:{{write[1]}}px;">
212   - <text class="iconfont icon-meirong fs40"></text>
213   - <view class="fs24">项目1</view>
214   -</view> -->
215   -
216 208 <view class="copy" wx:if="{{copy_btn}}" style="position:absolute;left:{{write[0]}}px;top:{{write[1]}}px;">
217 209 <text class="iconfont icon-meirong fs40"></text>
218 210 <view class="fs24">{{projectName}}</view>
... ...
packageA/pages/my_service2/appment_main.wxss
... ... @@ -310,13 +310,14 @@ button {
310 310 background-color: #FFDEF0;
311 311 }
312 312 .td {
313   - width: 100rpx;
314   - height: 100rpx;
  313 + width: 140rpx;
  314 + height: 120rpx;
315 315 display: flex;
316 316 align-items: center;
317 317 justify-content: center;
318 318 border-right: 2rpx solid rgba(218, 217, 217, 1);
319   - border-bottom: 2rpx solid rgba(218, 217, 217, 1);
  319 + border-bottom: 2rpx solid rgba(218, 217, 217, 1);
  320 + position: relative;
320 321 }
321 322  
322 323 .td.active {
... ... @@ -379,7 +380,7 @@ button {
379 380 .md-box {
380 381 width: 0;
381 382 height: 0;
382   - border-width: 50rpx;
  383 + border-width: 62rpx;
383 384 border-style: solid;
384 385 border-color: #FFDEF0 #FFDEF0 transparent transparent;
385 386 position: absolute;
... ... @@ -388,11 +389,11 @@ button {
388 389 }
389 390 .md {
390 391 position: absolute;
391   - top: -18px;
  392 + top: -30rpx;
392 393 width: 53rpx;
393 394 z-index: 999;
394   - right: -24px;
395   - font-size: 12px;
  395 + right: -52rpx;
  396 + font-size: 24rpxpx;
396 397 }
397 398  
398 399 .hover {
... ... @@ -421,5 +422,8 @@ button {
421 422 line-height: 1;
422 423 font-size: 26rpx;
423 424 }
  425 +.close_this{ position: absolute; width: 40rpx; display: flex;right: 0; top: 0; border-radius: 50%;
  426 + justify-content: center;align-items: center;
  427 + height: 40rpx; border: 1rpx solid #adadad; }
424 428  
425 429  
... ...