Browse Source

完善手写板功能

海涛 8 years ago
parent
commit
1690d96bd1
1 changed files with 10 additions and 55 deletions
  1. 10 55
      www/protected/modules/o2o/views/myOrder/info.php

+ 10 - 55
www/protected/modules/o2o/views/myOrder/info.php

@@ -99,13 +99,13 @@
         </div>
     </div>
 </div>
-<div class="container" id="pics" style="position: fixed;width: 100%;background: #ffff00;top:0;">
+<div class="container" id="pics" style="position: fixed;width: 100%;background: #ffff00;top:0;display: none;">
     <div class="row">
         <div class="col-xs-12">
             <div class="js-signature"></div>
         </div>
         <p style="margin: 0">
-            <button id="clearBtn" class="btn btn-default" onclick="clearCanvas();">清</button>
+            <button id="clearBtn" class="btn btn-default" onclick="clearCanvas();">清</button>
             &nbsp;
             <button id="saveBtn" class="btn btn-default" onclick="saveSignature();" disabled>保存</button>
         </p>
@@ -127,27 +127,22 @@
     $('#pics').height($(window).height());//设置底层div高度
     $("canvas").width($(window).width());//设置手写板宽度
     $("canvas").height($(window).height() - ($('#saveBtn').height()));//设置手写板高度
-
     var url;
     document.title = '我的订单-详情';
     var order = <?php echo json_encode($order); ?>;
     var user = <?php echo json_encode($user); ?>;
     var showMap = false;
-
     var w_height = $(window).height();
     var map_height = w_height * 0.6;
     $('#map_container').css({height: map_height + 'px'});
-
     var v_order = new Vue({
         el: '#info',
         data: {
             info: []
         }
     });
-
     $(function () {
         getOrderInfo(order, user);
-
         // 显示地图
         $('#showMap').click(function () {
             address = v_order.info.address;
@@ -176,12 +171,10 @@
             });
 
         });
-
         // 隐藏地图
         $('#hideMap').click(function () {
             $('#map_box').hide();
         });
-
         // 确认出发
         $('#confirm_set_out').click(function () {
             $.vloading('open');
@@ -204,10 +197,13 @@
                 }
             );
         });
-
         // 确认上门
         $('#confirm_come').click(function () {
-            $.vloading('open');
+            $('#pics').css('display', 'block');
+            $('.js-signature').eq(0).on('jq.signature.changed', function () {
+                $('#saveBtn').attr('disabled', false);
+            });
+            /*$.vloading('open');
             $.post(
                 '/index.php?r=o2o/myOrder/techCome',
                 {
@@ -220,54 +216,20 @@
                     if (data.success) {
                         $('#setout_container').addClass('am-hide');
                         $('#come_container').addClass('am-hide');
-                        $('#has_come_container').removeClass('am-hide');
-                        $('#has_come_success').addClass('am-hide');
+                        $('#has_come_container').addClass('am-hide');
+//                        $('#has_come_success').removeClass('am-hide');
                     } else {
                         $.valert(data.msg);
                     }
                 }
-            );
+            );*/
         });
-        //提上门
         //已完成
         $('#has_come_container').click(function () {
-
             /*调出手写板*/
-            $('#pics').css('display', 'block');
-            $('.js-signature').eq(0).on('jq.signature.changed', function () {
-                $('#saveBtn').attr('disabled', false);
-            });
-
-            //$.vloading('open');
-
 
         });
-        /*  $('#success_come').click(function () {
-         $.vloading('open');
-         //签字页面 签字 上传七牛 获得一个链接
-         $.post(
-         '/index.php?r=o2o/myOrder/techCome',
-         {
-         order: order,
-         user: user,
-         o2oImage : ''
-         },
-         function (res) {
-         $.vloading('close');
-         var data = $.parseJSON(res);
-         if (data.success) {
-         $('#setout_container').addClass('am-hide');
-         $('#come_container').addClass('am-hide');
-         $('#has_come_container').removeClass('am-hide');
-         } else {
-         $.valert(data.msg);
-         }
-         }
-         );
-         });*/
     });
-
-
     function putb64() {
         var pic = url.replace("data:image/png;base64,", "");//需要提交的base64
         var uri = "http://up.qiniu.com/putb64/-1";//提交地址
@@ -301,8 +263,6 @@
         xhr.setRequestHeader("Authorization", "UpToken Kn8GNMFOLKTNMUaKZ6r1wnjsgTk4ideQifK3umUr:a-HCK5r5iPL8Bisb-mQLI21oZJM=:eyJzY29wZSI6ImF2YXRhcnMiLCJkZWFkbGluZSI6MTQ3NDQ1MTg0OTAwMDAwMDAwMH0=");
         xhr.send(pic);
     }
-
-
     function saveSignature() {
         $('#signature').empty();
         url = $('.js-signature').eq(0).jqSignature('getDataURL');
@@ -311,14 +271,9 @@
             console.log(url);
             //七牛上传照片
             putb64();
-
-
         }
-
-        //return dataUrl;
     }
     function clearCanvas() {
-//    $('#signature').html('<p><em>Your signature will appear here when you click "Save Signature"</em></p>');
         $('.js-signature').eq(0).jqSignature('clearCanvas');
         $('#saveBtn').attr('disabled', true);
     }