...
|
...
|
@@ -413,7 +413,14 @@ |
|
|
</if>
|
|
|
</foreach>
|
|
|
<div class="shuju_zongshu">搜索结果为<span class="count">{:count($arr2)}</span>条</div>
|
|
|
<div class="view_img" style="padding: 0 0.3rem">
|
|
|
<div class="goods" style="overflow: hidden">
|
|
|
<foreach name="$goods_count" item="g_c">
|
|
|
<div class="shuju_zongshu" style="float: left;width: 50%;height: 20px;">
|
|
|
<span style="width: 70%;height:20px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;float: left;">{$g_c.book_name}</span>:{$g_c.number_sum}
|
|
|
</div>
|
|
|
</foreach>
|
|
|
</div>
|
|
|
<div class="view_img" style="padding: 0 0.3rem;display:none;">
|
|
|
<div class="log_three_select_one log_three_select_btn down" href="javascript:;" id="view_cavans">查看订单截图</div>
|
|
|
</div>
|
|
|
<!-- 列表内容 -->
|
...
|
...
|
@@ -985,9 +992,10 @@ |
|
|
'type': "GET",
|
|
|
'data': {'school': school, 'grade': grade, 'state': state, 'is_courier': is_courier},
|
|
|
'success': (function (data) {
|
|
|
console.log(data);
|
|
|
var index = $('.log_three_tab_top div').index($('.aaa'));
|
|
|
if (data.code == 1) {
|
|
|
var result = data.data;
|
|
|
var result = data.data.data;
|
|
|
if (result.length == 0) {
|
|
|
var html = "<div style=\"text-align: center;width: 100%;height:100%;margin:0 auto;\">暂无数据</div>";
|
|
|
} else {
|
...
|
...
|
@@ -1143,6 +1151,15 @@ |
|
|
$('.count').html(i);
|
|
|
$('.log_three_list_contant').eq(index).html(html);
|
|
|
update();
|
|
|
var goods_count = data.data.goods_count;
|
|
|
var goods_count_html = '';
|
|
|
$(goods_count).each(function(key,g_c){
|
|
|
console.log(g_c);
|
|
|
goods_count_html += "<div class=\"shuju_zongshu\" style=\"float: left;width: 50%;height: 20px;\">\n" +
|
|
|
" <span style=\"width: 70%;height:20px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: block;float: left;\">"+g_c.book_name+"</span>:"+g_c.number_sum+"\n" +
|
|
|
" </div>"
|
|
|
})
|
|
|
$('.goods').html(goods_count_html)
|
|
|
} else {
|
|
|
alert('未知错误');
|
|
|
}
|
...
|
...
|
@@ -1255,6 +1272,8 @@ |
|
|
var count = Number($('.count').text());
|
|
|
if (count > 0) {
|
|
|
count--;
|
|
|
}else{
|
|
|
$('.view_img').hide();
|
|
|
}
|
|
|
$(".count").text(count);
|
|
|
alert(res.msg)
|
...
|
...
|
@@ -1405,43 +1424,47 @@ |
|
|
}
|
|
|
</script>
|
|
|
<script>
|
|
|
var img_url = '';
|
|
|
var k= $("#orderlist").offset().top;
|
|
|
var canvas2 = document.createElement("canvas");
|
|
|
let
|
|
|
_canvas = document.querySelector('#orderlist');
|
|
|
var w = parseInt(window.getComputedStyle(_canvas).width);
|
|
|
var h = parseInt(window.getComputedStyle(_canvas).height);
|
|
|
//将canvas画布放大若干倍,然后盛放在较小的容器内,就显得不模糊了
|
|
|
canvas2.width = w * 2;
|
|
|
canvas2.height = (h + 400) * 2;
|
|
|
canvas2.style.width = w + "px";
|
|
|
canvas2.style.height = h + "px";
|
|
|
//可以按照自己的需求,对context的参数修改,translate指的是偏移量
|
|
|
// var context = canvas.getContext("2d");
|
|
|
// context.translate(0,0);
|
|
|
var context = canvas2.getContext("2d");
|
|
|
context.scale(2, 2);
|
|
|
html2canvas(document.querySelector('#orderlist'), { canvas: canvas2 }).then(function(canvas) {
|
|
|
//document.body.appendChild(canvas);
|
|
|
//canvas转换成url,然后利用a标签的download属性,直接下载,绕过上传服务器再下载
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: "{:url('upload_img')}",
|
|
|
data: {img:canvas.toDataURL(),top:k},
|
|
|
dataType: 'json',
|
|
|
success: function (res) {
|
|
|
img_url = res.data
|
|
|
}
|
|
|
});
|
|
|
// document.querySelector(".down").setAttribute('href', canvas.toDataURL());
|
|
|
});
|
|
|
$('#view_cavans').click(function(){
|
|
|
wx.previewImage({
|
|
|
current: img_url, // 当前显示图片的http链接
|
|
|
urls: [img_url] // 需要预览的图片http链接列表
|
|
|
var count = "{$count}";
|
|
|
if(count > 0) {
|
|
|
var img_url = '';
|
|
|
var k= $("#orderlist").offset().top;
|
|
|
var canvas2 = document.createElement("canvas");
|
|
|
let
|
|
|
_canvas = document.querySelector('#orderlist');
|
|
|
var w = parseInt(window.getComputedStyle(_canvas).width);
|
|
|
var h = parseInt(window.getComputedStyle(_canvas).height);
|
|
|
//将canvas画布放大若干倍,然后盛放在较小的容器内,就显得不模糊了
|
|
|
canvas2.width = w * 2;
|
|
|
canvas2.height = (h + 400) * 2;
|
|
|
canvas2.style.width = w + "px";
|
|
|
canvas2.style.height = h + "px";
|
|
|
//可以按照自己的需求,对context的参数修改,translate指的是偏移量
|
|
|
// var context = canvas.getContext("2d");
|
|
|
// context.translate(0,0);
|
|
|
var context = canvas2.getContext("2d");
|
|
|
context.scale(2, 2);
|
|
|
html2canvas(document.querySelector('#orderlist'), { canvas: canvas2 }).then(function(canvas) {
|
|
|
//document.body.appendChild(canvas);
|
|
|
//canvas转换成url,然后利用a标签的download属性,直接下载,绕过上传服务器再下载
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: "{:url('upload_img')}",
|
|
|
data: {img:canvas.toDataURL(),top:k},
|
|
|
dataType: 'json',
|
|
|
success: function (res) {
|
|
|
img_url = res.data;
|
|
|
$('.view_img').css('display','block');
|
|
|
}
|
|
|
});
|
|
|
// document.querySelector(".down").setAttribute('href', canvas.toDataURL());
|
|
|
});
|
|
|
})
|
|
|
$('#view_cavans').click(function(){
|
|
|
wx.previewImage({
|
|
|
current: img_url, // 当前显示图片的http链接
|
|
|
urls: [img_url] // 需要预览的图片http链接列表
|
|
|
});
|
|
|
})
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
</body>
|
...
|
...
|
|