Browse Source

refactor: 订单发货商品js修改为注册方式引入

wechat_public_accounts
travis 5 years ago
parent
commit
f7752a6466
  1. 16
      backend/modules/shop/views/order/delivery_goods.php

16
backend/modules/shop/views/order/delivery_goods.php

@ -38,10 +38,10 @@
<input type="hidden" id="deliveryGoods" name="deliveryGoods"><!-- 用于保存商品json --> <input type="hidden" id="deliveryGoods" name="deliveryGoods"><!-- 用于保存商品json -->
</div> </div>
<script src="/js/jquery.js"></script>
<script>
//初始化订单商品数据
var data = <?= $deliveryGoods ?>;
<?php
$js = <<<SCRIPT
//初始化订单商品数据
var data = $deliveryGoods ;
console.log(data); console.log(data);
var unShipped = {}; var unShipped = {};
function init() { function init() {
@ -82,7 +82,7 @@
'<th>商品名称</th>' + '<th>商品名称</th>' +
'<th>商品sku</th>' + '<th>商品sku</th>' +
'<th>发货数量</th>' + '<th>发货数量</th>' +
'</tr>\n' +
'</tr>' +
'</table>'; '</table>';
// var div = document.createElement('div'); // var div = document.createElement('div');
// div.innerText = '运单号:' + item.logisticInfo.invoice_no + '快递公司:'+ item.logisticInfo.exp_name; // div.innerText = '运单号:' + item.logisticInfo.invoice_no + '快递公司:'+ item.logisticInfo.exp_name;
@ -127,5 +127,9 @@
$(ref).hide(); $(ref).hide();
$(ref).prev().show(); $(ref).prev().show();
} }
</script>
SCRIPT;
$this->registerJs($js);
?>
Loading…
Cancel
Save