@DeleteMapping("/del/{id}")
void del(@PathVariable int id){
orderRepository.delete(id);
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
前台
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function showOrder(userid){
$(".order-info").html("<img class='loadgif' src='images/loading.gif'/>");
$.ajax({
url:"http://127.0.0.1:8081/order/list/" + userid,
type:"get",
success:function(data){
console.info("订单信息",data);
var orderHtml = "";
$.each(data, function(index,order) {
var productHtml = "";
$.each(order.plist, function(i,product) {
productHtml += "<tr><td><a href='##'><img src="
+ product.img + " alt='product'></a></td><td style='max-width: 200px;'><span>" + product.name
+ " </span></td><td>¥ " + product.sell
+ " </td><td><span>数量: " + order.nlist[i]
+ " </span></td></tr> "
});
orderHtml += "<div class='order-detail' data-no='" + order.orderNo + "' data-username='" + order.user.username + "' data-day='" + order.createDate + "'><div class='order-top'><strong>订单号:</strong><span>" + order.orderNo
+ "</span><strong>购买者:</strong><span>" + order.user.username
+ "</span><strong>时间:</strong><span>" + order.createDate
+ "</span><input type='button' class='cancel-order btn btn-xs' value='取消订单' /><i class='openBtn'><span class='glyphicon glyphicon-chevron-up' aria-hidden='true'></span></i></div><table class='table productTable'>"
+ productHtml
+ "</table><div class='order-buttom text-right'><strong>总价:</strong><span>¥ " + order.total
+ "</span><strong>佣金:</strong><span>¥ " + order.profitsStr
+ "</span></div></div>"
});
$(".order-info").html(orderHtml);
},
error:function(){
$(".order-info").html("加载失败!!!").css({"font-size":"20px","color":"red"}).addClass("text-center");
}
});
};
leiqjl
褪去浮尘
相关分类