|
@@ -48,6 +48,9 @@
|
|
|
</footer>
|
|
|
|
|
|
<div class="mui-content">
|
|
|
+ <input type="hidden" id="salesPostFirm" name="salesPostFirm" value=""/>
|
|
|
+ <input type="hidden" id="salesPostNum" name="salesPostNum" value=""/>
|
|
|
+
|
|
|
<div style="margin:14px 14px 0 14px;background-color: #f3f3f3;text-align: center;">
|
|
|
<ul class="mui-table-view mui-table-view-striped my-grid-view-no mui-table-view-condensed">
|
|
|
<li class="mui-table-view-cell" style="background-color: #f3f3f3;border-radius: 5px;padding: 11px 8px;">
|
|
@@ -101,6 +104,7 @@
|
|
|
<script src="js/main.js"></script>
|
|
|
<script>
|
|
|
var orderId = getParam("orderId");
|
|
|
+ var status;
|
|
|
var isPay = true; // 是否在请求支付,false表示正在请求,true可以请求
|
|
|
var isEfficacious = true; //商品是否有效,有效则可以支付,无效则不能支付
|
|
|
mui.ready(function() {
|
|
@@ -128,9 +132,11 @@
|
|
|
location.href = dt.redirectURL;
|
|
|
} else {
|
|
|
if(dt.status) {
|
|
|
- console.log(dt)
|
|
|
+ //console.log(dt)
|
|
|
var order = dt.data;
|
|
|
|
|
|
+ status = order.salesStatus;
|
|
|
+
|
|
|
$("#addressInfo").html(order.salesAddressInfo);
|
|
|
$("#addressName").html(order.salesAddressName);
|
|
|
$("#salesAddressTel").html(order.salesAddressTel);
|
|
@@ -144,10 +150,22 @@
|
|
|
document.querySelector('.shopping-cart-list').innerHTML = str;
|
|
|
document.querySelector('.loading-bg').style.display = 'none';
|
|
|
|
|
|
- var payHtml = '<button type="button" class="mui-btn my-btn-request go_pay" >立即支付</button>';
|
|
|
- var aftermarketHtml = '<button type="button" class="mui-btn my-btn-request go_aftermarket" >我要售后</button>';
|
|
|
- var logisticsHtml = '<button type="button" class="mui-btn my-btn-request" >查看物流</button>';
|
|
|
- var cancelHtml = '<button type="button" class="mui-btn my-btn-request" >取消申请</button>';
|
|
|
+ if(order.salesPostFirm != null && order.salesPostFirm != "" && typeof(order.salesPostFirm) != "undefined"){
|
|
|
+ $("#salesPostFirm").val(order.salesPostFirm);
|
|
|
+ }
|
|
|
+ if(order.salesPostNum != null && order.salesPostNum != "" && typeof(order.salesPostNum) != "undefined"){
|
|
|
+ $("#salesPostNum").val(order.salesPostNum);
|
|
|
+ }
|
|
|
+
|
|
|
+ var logisticsHtml = '';
|
|
|
+ if(status == 5 || status == 12 || status == 6 || status == 11) { //状态为取消,待支付,代发货,退货,换货都没有物流信息
|
|
|
+ if(order.salesPostFirm != null && order.salesPostFirm != "" && typeof(order.salesPostFirm) != "undefined" && order.salesPostNum != null && order.salesPostNum != "" && typeof(order.salesPostNum) != "undefined"){
|
|
|
+ logisticsHtml = '<button type="button" class="mui-btn my-btn-request logistics" style="margin-right: 20px;">查看物流</button>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var payHtml = '<button type="button" class="mui-btn my-btn-request go_pay" style="margin-right: 20px;">立即支付</button>';
|
|
|
+ var aftermarketHtml = '<button type="button" class="mui-btn my-btn-request go_aftermarket" style="margin-right: 20px;">我要售后</button>';
|
|
|
+ var cancelHtml = '<button type="button" class="mui-btn my-btn-request go_cancel" style="margin-right: 20px;">取消申请</button>';
|
|
|
/*订单状态*/
|
|
|
var statusName = "";
|
|
|
var operationHtml = "";
|
|
@@ -251,13 +269,84 @@
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
- * 立即支付
|
|
|
+ * 查询物流
|
|
|
*/
|
|
|
- mui('body').on('tap', '.go_pay', function() {
|
|
|
- goOrderPay(orderId);
|
|
|
+ mui('body').on('tap', '.logistics', function() {
|
|
|
+ var salesPostFirm = $("#salesPostFirm").val();
|
|
|
+ var salesPostNum = $("#salesPostNum").val();
|
|
|
+ location.href = "logistics-massage.html?salesPostFirm="+salesPostFirm + "&salesPostNum="+salesPostNum;
|
|
|
+ });
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 取消订单
|
|
|
+ */
|
|
|
+ mui('body').on('tap', '.go_cancel', function() {
|
|
|
+ var newStatus;
|
|
|
+ if(status == 3){ //申请退款的
|
|
|
+ newStatus = 3
|
|
|
+ }else if(status == 6){ //申请退货的
|
|
|
+ newStatus = 5
|
|
|
+ }else if(status == 7){ //退货中 的
|
|
|
+ newStatus = 6
|
|
|
+ }else if(status == 11){
|
|
|
+ newStatus = 8
|
|
|
+ }
|
|
|
+ if(status != null){
|
|
|
+ updateOrderStatus(orderId,newStatus,"");
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ /*修改订单状态*/
|
|
|
+ function updateOrderStatus(orderId, status, remark) {
|
|
|
+ var msg = "";
|
|
|
+ if(status == 1){
|
|
|
+ msg = "是否取消该订单";
|
|
|
+ }else if(status == 3){
|
|
|
+ msg = "是否取消申请退款";
|
|
|
+ }else if(status == 5){
|
|
|
+ msg = "是否取消申请退货";
|
|
|
+ }else if(status == 6){
|
|
|
+ msg = "是否取消申请退货";
|
|
|
+ }else if(status == 8){
|
|
|
+ msg = "是否取消申请换货";
|
|
|
+ }
|
|
|
+
|
|
|
+ var btnArray = ['否', '是'];
|
|
|
+ mui.confirm(msg, "", btnArray, function(e){
|
|
|
+ if (e.index == 1) {
|
|
|
+ $.ajax(base_path + '/wechat/cart/updateOrderStatus?dates=' + new Date().getTime(), {
|
|
|
+ data: {
|
|
|
+ "status": status, //更改后的状态
|
|
|
+ "orderId": orderId, //订单id
|
|
|
+ "remark": remark
|
|
|
+ },
|
|
|
+ dataType: 'json',
|
|
|
+ xhrFields: {
|
|
|
+ withCredentials: true
|
|
|
+ },
|
|
|
+ crossDomain: true,
|
|
|
+ type: 'get',
|
|
|
+ timeout: 15000,
|
|
|
+ success: function(dt) {
|
|
|
+ if(dt.resultCode == 200) {
|
|
|
+ //mui.alert("获取订单列表失败!网络错误");
|
|
|
+ //location.reload();//刷新
|
|
|
+ }
|
|
|
+ location.reload();//刷新
|
|
|
+ },
|
|
|
+ error: function(xhr, type, errorThrown) {
|
|
|
+ console.log(xhr);
|
|
|
+ mui.alert("获取订单列表失败!网络错误");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
function goOrderPay(salesOrderid) {
|
|
|
var dataArgs = {
|
|
|
"orderId": salesOrderid
|