|
@@ -1,4 +1,5 @@
|
|
|
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=B349f0b32ef6e78b2e678f45cb9fddaf"></script>
|
|
|
+<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/o2o/jq-signature.min.js"></script>
|
|
|
<div>
|
|
|
<div id="header">
|
|
|
<div class="am-g">
|
|
@@ -82,18 +83,52 @@
|
|
|
</div>
|
|
|
<div class="am-g am-hide" id="come_container">
|
|
|
<div class="am-u-sm-12">
|
|
|
- <button class="am-btn am-btn-block am-btn-success" id="confirm_come">确认上门</button>
|
|
|
+ <button class="am-btn am-btn-block am-btn-primary" id="confirm_come">确认上门</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="am-g am-hide" id="has_come_container">
|
|
|
- <div class="am-u-sm-12">
|
|
|
- <button class="am-btn am-btn-block am-btn-primary am-disabled">已上门</button>
|
|
|
+ <div class="am-u-sm-12" >
|
|
|
+ <button class="am-btn am-btn-block am-btn-primary">已上门</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="am-g am-hide" id="has_come_success">
|
|
|
+ <div class="am-u-sm-12" >
|
|
|
+ <button class="am-btn am-btn-block am-btn-primary am-disabled">已完成</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+<div class="container" id="pics" style="position: fixed;width: 100%;background: #ffff00;top:0;">
|
|
|
+ <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="saveBtn" class="btn btn-default" onclick="saveSignature();" disabled>保存</button>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<script type="text/javascript">
|
|
|
+ $(document).on('ready', function () {
|
|
|
+ if ($('.js-signature').length) {
|
|
|
+ $('.js-signature').jqSignature();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('.js-signature').eq(0).on('jq.signature.changed', function () {
|
|
|
+ $('#saveBtn').attr('disabled', false);
|
|
|
+ });
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
<script type="text/javascript">
|
|
|
+ $('#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); ?>;
|
|
@@ -186,14 +221,29 @@ $(function() {
|
|
|
$('#setout_container').addClass('am-hide');
|
|
|
$('#come_container').addClass('am-hide');
|
|
|
$('#has_come_container').removeClass('am-hide');
|
|
|
+ $('#has_come_success').addClass('am-hide');
|
|
|
} else {
|
|
|
$.valert(data.msg);
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
});
|
|
|
+ //提上门
|
|
|
//已完成
|
|
|
- /* $('#success_come').click(function () {
|
|
|
+ $('#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(
|
|
@@ -218,6 +268,64 @@ $(function() {
|
|
|
});*/
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+ function putb64(){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var pic = url.replace("data:image/png;base64,"," ");
|
|
|
+ var uri = "http://odulcd8g1.bkt.clouddn.com";
|
|
|
+ var xhr = new XMLHttpRequest();
|
|
|
+ xhr.onreadystatechange=function() {
|
|
|
+ if (xhr.readyState == 4) {
|
|
|
+ $.post(
|
|
|
+ '/index.php?r=o2o/myOrder/techComplete',
|
|
|
+ {
|
|
|
+ order: order,
|
|
|
+ user: user,
|
|
|
+ o2oImage: xhr.responseText
|
|
|
+ },
|
|
|
+ function (res) {
|
|
|
+ $.vloading('close');
|
|
|
+ var data = $.parseJSON(res);
|
|
|
+ if (data.success) {
|
|
|
+ $('#setout_container').addClass('am-hide');
|
|
|
+ $('#come_container').addClass('am-hide');
|
|
|
+ $('#has_come_container').addClass('am-hide');
|
|
|
+ $('#has_come_success').removeClass('am-hide');
|
|
|
+ } else {
|
|
|
+ $.valert(data.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ xhr.open("POST", uri, true);
|
|
|
+ xhr.setRequestHeader("Content-Type", "application/octet-stream");
|
|
|
+ xhr.setRequestHeader("Authorization", "Kn8GNMFOLKTNMUaKZ6r1wnjsgTk4ideQifK3umUr:a-HCK5r5iPL8Bisb-mQLI21oZJM=:eyJzY29wZSI6ImF2YXRhcnMiLCJkZWFkbGluZSI6MTQ3NDQ1MTg0OTAwMDAwMDAwMH0=");
|
|
|
+ xhr.send(pic);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+function saveSignature() {
|
|
|
+ $('#signature').empty();
|
|
|
+ url = $('.js-signature').eq(0).jqSignature('getDataURL');
|
|
|
+ if (url != undefined){
|
|
|
+ $('#pics').css('display','none');
|
|
|
+ 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);
|
|
|
+}
|
|
|
function getOrderInfo(order, user) {
|
|
|
if (order.length == 0 || user.length == 0) {
|
|
|
$.valert('订单信息未录入');
|
|
@@ -242,7 +350,7 @@ function getOrderInfo(order, user) {
|
|
|
for(var j in content.technicians) {
|
|
|
if (content.technicians[j]['technician_id'] == user) {
|
|
|
console.log(content.status);
|
|
|
- if (content.status != 4 && content.status != 5 && $.inArray(content.status, [1, 2, 3]) != -1) {
|
|
|
+ if (content.status != 4 && content.status != 5&& content.status != 6 && $.inArray(content.status, [1, 2, 3]) != -1) {
|
|
|
$('#setout_container').removeClass('am-hide');
|
|
|
$('#come_container').addClass('am-hide');
|
|
|
$('#has_come_container').addClass('am-hide');
|
|
@@ -254,6 +362,11 @@ function getOrderInfo(order, user) {
|
|
|
$('#setout_container').addClass('am-hide');
|
|
|
$('#come_container').addClass('am-hide');
|
|
|
$('#has_come_container').removeClass('am-hide');
|
|
|
+ }else if (content.status == 6) {
|
|
|
+ $('#setout_container').addClass('am-hide');
|
|
|
+ $('#come_container').addClass('am-hide');
|
|
|
+ $('#has_come_container').addClass('am-hide');
|
|
|
+ $('#has_come_success').removeClass('am-hide');
|
|
|
}
|
|
|
break;
|
|
|
}
|