|
@@ -87,12 +87,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="am-g am-hide" id="has_come_container">
|
|
|
- <div class="am-u-sm-12" >
|
|
|
+ <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" >
|
|
|
+ <div class="am-u-sm-12">
|
|
|
<button class="am-btn am-btn-block am-btn-primary am-disabled">已完成</button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -126,157 +126,153 @@
|
|
|
<script type="text/javascript">
|
|
|
$('#pics').height($(window).height());//设置底层div高度
|
|
|
$("canvas").width($(window).width());//设置手写板宽度
|
|
|
- $("canvas").height($(window).height()-($('#saveBtn').height()));//设置手写板高度
|
|
|
+ $("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 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 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: []
|
|
|
- }
|
|
|
-});
|
|
|
+ var v_order = new Vue({
|
|
|
+ el: '#info',
|
|
|
+ data: {
|
|
|
+ info: []
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
-$(function() {
|
|
|
- getOrderInfo(order, user);
|
|
|
+ $(function () {
|
|
|
+ getOrderInfo(order, user);
|
|
|
|
|
|
- // 显示地图
|
|
|
- $('#showMap').click(function() {
|
|
|
- address = v_order.info.address;
|
|
|
- position = address.position;
|
|
|
- if (!position) {
|
|
|
- $.valert('定位信息未记录');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ // 显示地图
|
|
|
+ $('#showMap').click(function () {
|
|
|
+ address = v_order.info.address;
|
|
|
+ position = address.position;
|
|
|
+ if (!position) {
|
|
|
+ $.valert('定位信息未记录');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- $('#map_box').show();
|
|
|
+ $('#map_box').show();
|
|
|
|
|
|
- map = new BMap.Map('map_container');
|
|
|
- point = new BMap.Point(position[0], position[1]);
|
|
|
- marker = new BMap.Marker(point);
|
|
|
- map.addOverlay(marker);
|
|
|
- map.centerAndZoom(point, 15);
|
|
|
+ map = new BMap.Map('map_container');
|
|
|
+ point = new BMap.Point(position[0], position[1]);
|
|
|
+ marker = new BMap.Marker(point);
|
|
|
+ map.addOverlay(marker);
|
|
|
+ map.centerAndZoom(point, 15);
|
|
|
|
|
|
- windowOpts = {
|
|
|
- width: 200,
|
|
|
- height: 100,
|
|
|
- title: address.area
|
|
|
- }
|
|
|
- infoWindow = new BMap.InfoWindow(address.detail, windowOpts);
|
|
|
- marker.addEventListener("click", function() {
|
|
|
- map.openInfoWindow(infoWindow,point);
|
|
|
- });
|
|
|
+ windowOpts = {
|
|
|
+ width: 200,
|
|
|
+ height: 100,
|
|
|
+ title: address.area
|
|
|
+ }
|
|
|
+ infoWindow = new BMap.InfoWindow(address.detail, windowOpts);
|
|
|
+ marker.addEventListener("click", function () {
|
|
|
+ map.openInfoWindow(infoWindow, point);
|
|
|
+ });
|
|
|
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
- // 隐藏地图
|
|
|
- $('#hideMap').click(function() {
|
|
|
- $('#map_box').hide();
|
|
|
- });
|
|
|
+ // 隐藏地图
|
|
|
+ $('#hideMap').click(function () {
|
|
|
+ $('#map_box').hide();
|
|
|
+ });
|
|
|
|
|
|
- // 确认出发
|
|
|
- $('#confirm_set_out').click(function () {
|
|
|
- $.vloading('open');
|
|
|
- $.post(
|
|
|
- '/index.php?r=o2o/myOrder/techSetout',
|
|
|
- {
|
|
|
- order: order,
|
|
|
- user: user
|
|
|
- },
|
|
|
- function (res) {
|
|
|
- $.vloading('close');
|
|
|
- var data = $.parseJSON(res);
|
|
|
- if (data.success) {
|
|
|
- $('#setout_container').addClass('am-hide');
|
|
|
- $('#come_container').removeClass('am-hide');
|
|
|
- $('#has_come_container').addClass('am-hide');
|
|
|
- } else {
|
|
|
- $.valert(data.msg);
|
|
|
+ // 确认出发
|
|
|
+ $('#confirm_set_out').click(function () {
|
|
|
+ $.vloading('open');
|
|
|
+ $.post(
|
|
|
+ '/index.php?r=o2o/myOrder/techSetout',
|
|
|
+ {
|
|
|
+ order: order,
|
|
|
+ user: user
|
|
|
+ },
|
|
|
+ function (res) {
|
|
|
+ $.vloading('close');
|
|
|
+ var data = $.parseJSON(res);
|
|
|
+ if (data.success) {
|
|
|
+ $('#setout_container').addClass('am-hide');
|
|
|
+ $('#come_container').removeClass('am-hide');
|
|
|
+ $('#has_come_container').addClass('am-hide');
|
|
|
+ } else {
|
|
|
+ $.valert(data.msg);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- );
|
|
|
- });
|
|
|
+ );
|
|
|
+ });
|
|
|
|
|
|
- // 确认上门
|
|
|
- $('#confirm_come').click(function () {
|
|
|
- $.vloading('open');
|
|
|
- $.post(
|
|
|
- '/index.php?r=o2o/myOrder/techCome',
|
|
|
- {
|
|
|
- order: order,
|
|
|
- user: user
|
|
|
- },
|
|
|
- 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');
|
|
|
- $('#has_come_success').addClass('am-hide');
|
|
|
- } else {
|
|
|
- $.valert(data.msg);
|
|
|
+ // 确认上门
|
|
|
+ $('#confirm_come').click(function () {
|
|
|
+ $.vloading('open');
|
|
|
+ $.post(
|
|
|
+ '/index.php?r=o2o/myOrder/techCome',
|
|
|
+ {
|
|
|
+ order: order,
|
|
|
+ user: user
|
|
|
+ },
|
|
|
+ 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');
|
|
|
+ $('#has_come_success').addClass('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);
|
|
|
+ );
|
|
|
});
|
|
|
+ //提上门
|
|
|
+ //已完成
|
|
|
+ $('#has_come_container').click(function () {
|
|
|
|
|
|
- //$.vloading('open');
|
|
|
+ /*调出手写板*/
|
|
|
+ $('#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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });*/
|
|
|
});
|
|
|
- /* $('#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,"," ");
|
|
|
- var uri = "http://odulcd8g1.bkt.clouddn.com";
|
|
|
+ function putb64() {
|
|
|
+ var pic = url.replace("data:image/png;base64,", "");//需要提交的base64
|
|
|
+ var uri = "http://up.qiniu.com/putb64/-1";//提交地址
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
- xhr.onreadystatechange=function() {
|
|
|
+ xhr.onreadystatechange = function () {
|
|
|
if (xhr.readyState == 4) {
|
|
|
$.post(
|
|
|
'/index.php?r=o2o/myOrder/techComplete',
|
|
@@ -302,78 +298,78 @@ $(function() {
|
|
|
}
|
|
|
xhr.open("POST", uri, true);
|
|
|
xhr.setRequestHeader("Content-Type", "application/octet-stream");
|
|
|
- xhr.setRequestHeader("Authorization", "Kn8GNMFOLKTNMUaKZ6r1wnjsgTk4ideQifK3umUr:a-HCK5r5iPL8Bisb-mQLI21oZJM=:eyJzY29wZSI6ImF2YXRhcnMiLCJkZWFkbGluZSI6MTQ3NDQ1MTg0OTAwMDAwMDAwMH0=");
|
|
|
+ xhr.setRequestHeader("Authorization", "UpToken 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();
|
|
|
+ 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() {
|
|
|
+ //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('订单信息未录入');
|
|
|
- return false;
|
|
|
+ $('.js-signature').eq(0).jqSignature('clearCanvas');
|
|
|
+ $('#saveBtn').attr('disabled', true);
|
|
|
}
|
|
|
+ function getOrderInfo(order, user) {
|
|
|
+ if (order.length == 0 || user.length == 0) {
|
|
|
+ $.valert('订单信息未录入');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- $.vloading('open');
|
|
|
- $.post(
|
|
|
- '/index.php?r=o2o/o2oApp/getOrderInfo',
|
|
|
- {
|
|
|
- id: order,
|
|
|
- user: user
|
|
|
- },
|
|
|
- function(res) {
|
|
|
- $.vloading('close');
|
|
|
- var data = $.parseJSON(res);
|
|
|
- if (data.success == false) {
|
|
|
- $.valert(data.msg);
|
|
|
- } else {
|
|
|
- var content = data.content;
|
|
|
- v_order.info = content;
|
|
|
- for(var j in content.technicians) {
|
|
|
- if (content.technicians[j]['technician_id'] == user) {
|
|
|
- console.log(content.status);
|
|
|
- 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');
|
|
|
- } else if (content.status == 4) {
|
|
|
- $('#setout_container').addClass('am-hide');
|
|
|
- $('#come_container').removeClass('am-hide');
|
|
|
- $('#has_come_container').addClass('am-hide');
|
|
|
- } else if (content.status == 5) {
|
|
|
- $('#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');
|
|
|
+ $.vloading('open');
|
|
|
+ $.post(
|
|
|
+ '/index.php?r=o2o/o2oApp/getOrderInfo',
|
|
|
+ {
|
|
|
+ id: order,
|
|
|
+ user: user
|
|
|
+ },
|
|
|
+ function (res) {
|
|
|
+ $.vloading('close');
|
|
|
+ var data = $.parseJSON(res);
|
|
|
+ if (data.success == false) {
|
|
|
+ $.valert(data.msg);
|
|
|
+ } else {
|
|
|
+ var content = data.content;
|
|
|
+ v_order.info = content;
|
|
|
+ for (var j in content.technicians) {
|
|
|
+ if (content.technicians[j]['technician_id'] == user) {
|
|
|
+ console.log(content.status);
|
|
|
+ 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');
|
|
|
+ } else if (content.status == 4) {
|
|
|
+ $('#setout_container').addClass('am-hide');
|
|
|
+ $('#come_container').removeClass('am-hide');
|
|
|
+ $('#has_come_container').addClass('am-hide');
|
|
|
+ } else if (content.status == 5) {
|
|
|
+ $('#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;
|
|
|
}
|
|
|
- break;
|
|
|
}
|
|
|
+ $('#info_content').show();
|
|
|
}
|
|
|
- $('#info_content').show();
|
|
|
}
|
|
|
- }
|
|
|
- );
|
|
|
-}
|
|
|
+ );
|
|
|
+ }
|
|
|
</script>
|