$('#content').after('
'); var pay_name = 0; var token = localStorage.getItem('token'); var order_class = localStorage.getItem('shop_order_class'); var orderNo; var orderId; var getReasonUrl = ''; var priceT = 0; var payCode = ''; var shopId = ''; var wxChannel = null; // 微信支付 var aliChannel = null; // 支付宝支付 var channel = null; //支付通道 mui.init({ pullRefresh: { container: '#pullrefresh', down: { style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 height: '50px', //可选,默认50px.下拉刷新控件的高度, range: '100px', //可选 默认100px,控件可下拉拖拽的范围 offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 // auto: true, //可选,默认false.首次加载自动上拉刷新一次 contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 contentnomore: '没有更多数据了', callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; }, up: { contentrefresh: '正在加载...', callback: pullupRefresh }, beforeback: function() { //获得父页面的webview var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 mui.fire(list, 'reload'); //返回true,继续页面关闭逻辑 return true; } } }); var count = 1; function pullupRefresh() { count += 1; getData(count); mui('#pullrefresh').pullRefresh().endPullupToRefresh(); } // //console.log(order_class); /** * 下拉刷新具体业务实现 */ function pulldownRefresh() { setTimeout(function() { window.location.reload(); //mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed }, 1500); } var isLoad = false; function getData(page) { if (true == isLoad) return; isLoad = true; JZL.ajax(qlgUrl('app/Shoporders/getSellerOrderList'), { type: order_class, shopId: shopId, page: page, pagesize: 10 }, function(data) { //console.log(data); var data = toJson(data); var html = '', html1 = ""; if (1 == data.status) { // console.log(data); if ('' == data.data.Rows) { mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); return; } $.each(data.data.Rows, function() { //this.pay_name = 1; var shopConfirmHtml = ''; // console.log(this.orderStatus); // if ( == 0) { // if (0 == this.shopConfirm) { // shopConfirmHtml = '' + this.goodsName + '
' + this.goodsSpecNames + '
¥' + this.goodsPrice + '
' + this.goodsName + '
' + this.goodsSpecNames + // '
¥' + this.goodsPrice + '
地址:
' + this.userAddress + '
电话:
' + this.userPhone + '
' + this.userName + '
抵扣额' + data.data.product.useProductOk + // '
扣税 ' + data.data.product.useProductTaxFee + // '
手续费 ' + data.data.product.useProductHandlingFee + // '
'; // // $('#productInfo').html('产品券[抵扣额:' + data.data.product.useProductOk + ',扣税:' + data.data.product.useProductTaxFee + // // ',手续费:' + data.data.product.useProductHandlingFee + ']'); // $('.productInfo_').html(html1) // // } // $('#couponsNum').val(data.data.coupons.useCoupons); // if (data.data.coupons.useCoupons > 0) { // var html2 = '抵扣额' + data.data.coupons.useCouponsOk + // '
扣税 ' + data.data.coupons.useCouponsTaxFee + // '
手续费 ' + data.data.coupons.useCouponsHandlingFee + // '
'; // $('.couponsInfo_').html(html2) // // $('#couponsInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee + // // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']'); // } // $('#wangNum').val(data.data.wang.useWang); // $('#moneyNum').val(data.data.money.useMoney); // // } else { // mui.alert(data.msg) // } // }); // } else if (payCode == 'wallets' || payCode == 'ect') { // //跳输入密码的页面 // mui.ajax(hyhUrl('app/' + payCode + '/payment'), { // data: { // orderNo: orderNo, // isBatch: 0 // }, // dataType: 'json', //服务器返回json格式数据 // type: 'post', //HTTP请求类型 // timeout: 10000, //超时时间设置为10秒; // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; // // //console.log(data.data.goodsFavoritesNum) // var data = toJson(data); // if (data.status == 1) { // $('.pay').css('display', 'none'); // $('#pay_pwd').css('display', 'block'); // if (data.data.payPwd == '0') { // mui.alert('还未设置支付密码请先设置支付密码!'); // var url = 'setting_fogetPayPwd'; // mui.openWindow({ // url: url + '.html', // id: url + '.html', // styles: { // top: '0px', //新页面顶部位置 // bottom: '0px', //新页面底部位置 // width: '100%', //新页面宽度,默认为100% // height: '100%' //新页面高度,默认为100% // }, // extras: { // // data_href: data_href // // ..... //自定义扩展参数,可以用来处理页面间传值 // }, // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 // show: { // // autoShow: true, //页面loaded事件发生后自动显示,默认为true // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 // // extras: {} //窗口动画是否使用图片加速 // }, // waiting: { // autoShow: true, //自动显示等待框,默认为true // title: '正在加载...', //等待对话框上显示的提示内容 // options: { // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 // // ...... // } // } // }) // } // } // }, // error: function(xhr, type, errorThrown) { //异常处理; // // mui.alert(type); // } // }); // // } else if (payCode == 'alipays') { // pay('alipay', orderNo); // // plus.nativeUI.showWaiting(); // // mui.post(hyhUrl('app/Alipays/payment'), { // // orderNo: data.data, // // isBatch: 1 // // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1'); // // } // // that.removeAttr('disabled'); // } else { // mui.alert('发生错误请刷新后重试!'); // // location.reload(); // } // }, // error: function(xhr, type, errorThrown) { //异常处理; // mui.alert(type); // } // }) // }) // $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() { // var url = 'setting_fogetPayPwd'; // JZL.openWindow(url + '.html', url + '.html'); // }) // $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() { // // var self = plus.webview.currentWebview(); // // var data_href = self.id; // // //console.log(data_href) // // JZL.closeWindow('waitPay'); // //return; // var payPwd = $('#payPwd').val(); // if (payPwd == '') { // mui.alert('支付密码不能为空!'); // return; // } // var that = $(this); // that.attr('disabled', 'disabled') // var srcc = '' // if (payCode == 'qlgpay') { // srcc = 'payByQlg'; // } else if (payCode == 'ect') { // srcc = 'payByEct'; // } else { // srcc = 'payByWallet'; // } // // mui.ajax(hyhUrl('app/' + payCode + '/' + srcc), { // // data: { // orderNo: orderNo, // isBatch: 0, // payPwd: payPwd // }, // dataType: 'json', //服务器返回json格式数据 // type: 'post', //HTTP请求类型 // timeout: 10000, //超时时间设置为10秒; // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; // // //console.log(data.data.goodsFavoritesNum) // var data = toJson(data); // mui.alert(data.msg) // //console.log(data.status) // if (data.status == 1) { // JZL.openWindow('indent.html', 'waitDeliver', { // data_href: 'waitDeliver' // }); // setTimeout(function() { // JZL.closeWindow(plus.webview.currentWebview().id); // // JZL.closeWindow('indent.html'); // }, 700) // // var targetTab = plus.webview.getWebviewById("templete/my.html"); // // mui.fire(targetTab, 'refresh'); // // location.reload(); // } else { // // } // that.removeAttr('disabled') // // }, // error: function(xhr, type, errorThrown) { //异常处理; // // mui.alert(type); // } // }); // // }) mui('.con').on('tap', '.row_con', function() { var data_order_id = $(this).attr('data-id'); mui.openWindow({ url: 'order_out.html', id: 'order_out.html', styles: { top: '0px', //新页面顶部位置 bottom: '0px', //新页面底部位置 width: '100%', //新页面宽度,默认为100% height: '100%' //新页面高度,默认为100% }, extras: { data_order_id: data_order_id // data_id: data_id // ..... //自定义扩展参数,可以用来处理页面间传值 }, createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 show: { // autoShow: true, //页面loaded事件发生后自动显示,默认为true // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 // extras: {} //窗口动画是否使用图片加速 }, waiting: { autoShow: true, //自动显示等待框,默认为true title: '正在加载...', //等待对话框上显示的提示内容 options: { // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 // ...... } } }) }) mui('.con').on('tap', '.ckwl', function() { var data_order_id = $(this).parent().parent().attr('data-id'); //$(this).attr('data-id'); JZL.openWindow('logistics.html', 'logistics.html', { data_order_id: data_order_id }); }) //上传凭证 mui('.con').on('tap', '.uploadCertificate', function() { var orderId = $(this).parent().parent().attr('data-id'); // mui.alert('跳到上传凭证页' + orderId) JZL.openWindow("uploadVoucher.html", "uploadVoucher.html", { orderId: orderId }) }) $('.con').on('tap', '.qxdd_js', function() { orderNo = $(this).parent().parent().attr('data-orderNo'); orderId = $(this).parent().parent().attr('data-id'); if ($(this).html() == '取消订单') { getReasonUrl = 'getCancelCause'; } else if ($(this).html() == '拒收') { getReasonUrl = 'getRejectCause'; } else if ($(this).html() == '申请退款') { getReasonUrl = 'getRefundCause'; JZL.ajax(hyhUrl('/app/Orders/getRefund'), { id: orderId }, function(data) { //服务器返回响应 // //console.log(JSON.stringify(data)); var data = toJson(data); if (data.status == 1) { data = data.data; var html = ''; if ('qlgpay' == data.payFrom) { html = ' 退款产品券数量:' + ' 退款优惠券数量:' + ' 退款旺旺券数量:' + ' 退款现金数量:' + data.moneyNum + ',现金方面请与商家协商' + // '(金额不能超过
(金额不能超过
(积分数量:' + data.ectNum + ')
'; } $('.tui').html(html) } else { mui.alert(data.msg) } }); } $('.bg_').css('display', 'block'); $('.bg_con').css('display', 'none'); $('.bg_con').slideDown(300, function() {}); mui.ajax(hyhUrl('/app/Orders/' + getReasonUrl), { data: {}, dataType: 'json', //服务器返回json格式数据 type: 'post', //HTTP请求类型 timeout: 10000, //超时时间设置为10秒; success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; // //console.log(data.data.goodsFavoritesNum) // //console.log(data.data.Rows) var data = toJson(data); if (data.status == 1) { var html = ''; $.each(data.data, function() { html += '' }); $('#select').html(html) } else { mui.alert(data.msg) } }, error: function(xhr, type, errorThrown) { //异常处理; // mui.alert(type); } }); }) $('.bg_').on('tap', '.en_false', function() { $('.bg_').css('display', 'none'); }) $('.bg_').on('tap', '.en_true', function() { var setReasonUrl = ''; var content = $('#content').val(); var reason = $('#select').val(); if ($('#select').val() == 0) { mui.alert('请选择原因!'); return; } if ($('#select').val() == 10000 && content == '') { mui.alert('请输入其他原因!'); return; } if (getReasonUrl == 'getCancelCause') { setReasonUrl = 'cancellation'; mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), { data: { reason: reason, id: orderId, content: content }, dataType: 'json', //服务器返回json格式数据 type: 'post', //HTTP请求类型 timeout: 10000, //超时时间设置为10秒; success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; // //console.log(data.data.goodsFavoritesNum) // //console.log(data.data.Rows) var data = toJson(data); mui.alert(data.msg); if (data.status == 1) { // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 // mui.fire(list, 'refresh'); if ('waitPay' == plus.webview.currentWebview().id) { location.reload(); } else { JZL.openWindow('indent.html', 'abnormal', { data_href: 'abnormal' }); setTimeout(function() { //plus.webview.currentWebview().close(); JZL.closeWindow(plus.webview.currentWebview().id); }, 500) } // JZL.openWindow('indent.html', 'abnormal', { // data_href: 'abnormal' // }); // setTimeout(function() { // plus.webview.currentWebview().close(); // // JZL.closeWindow(plus.webview.currentWebview().id); // }, 500) //location.reload(); } }, error: function(xhr, type, errorThrown) { //异常处理; // mui.alert(type); } }); } else if (getReasonUrl == 'getRejectCause') { setReasonUrl = 'reject'; mui.ajax(hyhUrl('app/Orders/' + setReasonUrl), { data: { reason: reason, id: orderId, content: content }, dataType: 'json', //服务器返回json格式数据 type: 'post', //HTTP请求类型 timeout: 10000, //超时时间设置为10秒; success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; // //console.log(data.data.goodsFavoritesNum) // //console.log(data.data.Rows) var data = toJson(data); mui.alert(data.msg); if (data.status == 1) { // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 // mui.fire(list, 'refresh'); location.reload(); } }, error: function(xhr, type, errorThrown) { //异常处理; // mui.alert(type); } }); } else if (getReasonUrl == 'getRefundCause') { var params = {} // params.money = $('#Tmoney').val(); // if (params.money < 0 || params.money == 0) { // mui.alert('退款金额不能为0!'); // return; // } params.productNum = $('#productNum').val(); params.couponsNum = $('#couponsNum').val(); params.wangNum = $('#wangNum').val(); params.reason = reason; params.id = orderId; params.content = content; JZL.ajax(hyhUrl('app/Orderrefunds/refund'), params, function(data) { var data = toJson(data); mui.alert(data.msg); if (data.status == 1) { var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 mui.fire(list, 'refresh'); location.reload(); } }) } }) $('#select').on('change', function() { if ($(this).val() == '10000') { $('#content').css('display', 'block'); } else { $('#content').css('display', 'none'); } }) })