|
|
@ -18,6 +18,9 @@ |
|
|
|
border-radius: 10px; |
|
|
|
box-shadow:0 4px 30px 2px rgba(223, 225, 230, 0.5) !important; |
|
|
|
} |
|
|
|
.logistic { |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
input { |
|
|
|
width: 50%; |
|
|
|
} |
|
|
@ -50,110 +53,45 @@ |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
<div class="box shipped-box"> |
|
|
|
<h5>已发货商品</h5> |
|
|
|
<?php |
|
|
|
if (!empty($deliveryGoods['shipped'])) { |
|
|
|
echo '<h5>已发货商品</h5>'; |
|
|
|
foreach ($deliveryGoods['shipped'] as $shipped) { |
|
|
|
echo '<div class="logistic"> 快递公司:'; |
|
|
|
echo "【{$shipped['logisticInfo']['exp_name']}】"; |
|
|
|
echo '    运单号:'; |
|
|
|
echo "【{$shipped['logisticInfo']['invoice_no']}】"; |
|
|
|
echo '    创建时间:'; |
|
|
|
echo "【{$shipped['logisticInfo']['created_at']}】"; |
|
|
|
echo '</div>'; |
|
|
|
|
|
|
|
echo |
|
|
|
'<table class="table shipped-table">' . |
|
|
|
'<tr>' . |
|
|
|
'<th>商品ID</th>' . |
|
|
|
'<th>商品名称</th>' . |
|
|
|
'<th>商品sku</th>' . |
|
|
|
'<th>发货数量</th>' . |
|
|
|
'</tr>'; |
|
|
|
|
|
|
|
foreach ($shipped['goodsInfo'] as $goodsInfo) { |
|
|
|
echo '<tr>' . |
|
|
|
"<td> {$goodsInfo['goods_id']} </td>" . |
|
|
|
"<td> {$goodsInfo['goods_name']} </td>" . |
|
|
|
"<td> {$goodsInfo['sku_value']} </td>" . |
|
|
|
"<td> {$goodsInfo['delivery_number']} </td>" . |
|
|
|
'</tr>'; |
|
|
|
} |
|
|
|
echo '</table>'; |
|
|
|
} |
|
|
|
} |
|
|
|
?>
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<?php |
|
|
|
//$js = <<<SCRIPT
|
|
|
|
////初始化订单商品数据
|
|
|
|
/* var data = "<?php echo json_encode($deliveryGoods) ?>";*/ |
|
|
|
// console.log(data);
|
|
|
|
// var unShipped = {};
|
|
|
|
// function init() {
|
|
|
|
//<!-- unShipped = data.unShipped;-->
|
|
|
|
//<!-- showUnShipped(unShipped);-->
|
|
|
|
//<!-- if(data.shipped){-->
|
|
|
|
//<!-- var shipped = data.shipped;-->
|
|
|
|
//<!-- showShipped(shipped)-->
|
|
|
|
//<!-- }-->
|
|
|
|
// unShipped = JSON.stringify(unShipped);
|
|
|
|
// $('#deliveryGoods').val(unShipped)
|
|
|
|
// }
|
|
|
|
// init();
|
|
|
|
//
|
|
|
|
// //编辑发货数量
|
|
|
|
// function updateGoods(ref){
|
|
|
|
// ref = $(ref)[0].target;
|
|
|
|
// $(ref).hide();
|
|
|
|
// $(ref).next().show();
|
|
|
|
// $(ref).parent().parent().find('.goods_count').removeAttr('disabled')
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// //保存编辑
|
|
|
|
// function saveGoods(ref) {
|
|
|
|
// if(typeof unShipped =='string'){
|
|
|
|
// unShipped = JSON.parse(unShipped)
|
|
|
|
// }
|
|
|
|
// ref = $(ref)[0].target;
|
|
|
|
// var tr = $(ref).parent().parent();
|
|
|
|
// tr.find('.goods_count').attr('disabled', 'disabled');
|
|
|
|
// var index = tr.attr('data-index');
|
|
|
|
// var number = tr.find('.goods_count').val();
|
|
|
|
// if (number < 0) {
|
|
|
|
// alert('发货数量不能低于0');
|
|
|
|
// tr.find('.goods_count').val(0);
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
// unShipped[index].goods_count = number;
|
|
|
|
// unShipped = JSON.stringify(unShipped);
|
|
|
|
// $('#deliveryGoods').val(unShipped);
|
|
|
|
// $(ref).hide();
|
|
|
|
// $(ref).prev().show();
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// //显示未发货商品
|
|
|
|
// function showUnShipped(unShipped) {
|
|
|
|
// unShipped.forEach(function (item,index) {
|
|
|
|
// var tr = "<tr data-index='" + index +"'>" +
|
|
|
|
// "<td class='goods_id' name='goodsId[]'>" + item.goods_id + "</td>" +
|
|
|
|
// "<td class='goods_name'>" + item.goods_name + "</td>" +
|
|
|
|
// "<td class='goods_sku'>" + item.sku_value + "</td>" +
|
|
|
|
// "<td class='lack_number'>" + item.lack_number + "</td>" +
|
|
|
|
// "<td><input type='text' class='goods_count' value='"+item.lack_number+"' name='deliveryGoods' disabled/></td>" +
|
|
|
|
// "<td>" +
|
|
|
|
// "<input type='button' class='btn btn-primary btn-update' value='编辑'/>" +
|
|
|
|
// "<input type='button' class='btn btn-primary btn-save' value='保存' style='display: none' />" +
|
|
|
|
// "</td>" +
|
|
|
|
// "</tr>";
|
|
|
|
// $('.unShipped-table').append(tr)
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// //显示已发货商品
|
|
|
|
// function showShipped(shipped) {
|
|
|
|
// shipped.forEach(function(item,index) {
|
|
|
|
// var table = ' <table class="table shipped-table">' +
|
|
|
|
// '<tr>' +
|
|
|
|
// '<th>商品名称</th>' +
|
|
|
|
// '<th>商品sku</th>' +
|
|
|
|
// '<th>发货数量</th>' +
|
|
|
|
// '</tr>' +
|
|
|
|
// '</table>';
|
|
|
|
// // var div = document.createElement('div');
|
|
|
|
// // div.innerText = '运单号:' + item.logisticInfo.invoice_no + '快递公司:'+ item.logisticInfo.exp_name;
|
|
|
|
// // $('.shipped-box').append(div);
|
|
|
|
// $('.shipped-box').append(table);
|
|
|
|
// table = $('.shipped-table').eq(index);
|
|
|
|
// item.goodsInfo.forEach(function (item,index) {
|
|
|
|
// var tr = "<tr data-index='" + index +"'>" +
|
|
|
|
// "<td class='goods_name'>" + item.goods_name + "</td>" +
|
|
|
|
// "<td class='goods_sku'>" + item.sku_value + "</td>" +
|
|
|
|
// "<td class='goods_count'>" + item.delivery_number + "</td>" +
|
|
|
|
// "</tr>";
|
|
|
|
// $(table).append(tr);
|
|
|
|
// });
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// var btnUpdate = $('.btn-update');
|
|
|
|
// var btnSave = $('.btn-save');
|
|
|
|
// for (i = 0; i < btnUpdate.length; i++) {
|
|
|
|
// btnUpdate[i].addEventListener("click", updateGoods);
|
|
|
|
// btnSave[i].addEventListener("click", saveGoods);
|
|
|
|
// }
|
|
|
|
//SCRIPT;
|
|
|
|
//$this->registerJs($js);
|
|
|
|
//?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|