// 提醒发货 function noticeDeliver(id){ var box = WST.confirm({content:"您确定要提醒发货吗?",yes:function(){ layer.close(box); var ll = WST.load({msg:'正在提交信息,请稍候...'}); $.post(WST.U('home/orders/noticeDeliver'),{id:id},function(data){ var json = WST.toJson(data); if(json.status>0){ WST.msg(json.msg,{icon:1}); waitReceiveByPage(WSTCurrPage); layer.close(ll); }else{ WST.msg(json.msg,{icon:2}); } }); }}); } function waitPayByPage(p){ $('#loading').show(); var params = {}; params = WST.getParams('.u-query'); params.key = $.trim($('#key').val()); params.page = p; $.post(WST.U('home/orders/waitPayByPage'),params,function(data,textStatus){ $('#loading').hide(); var json = WST.toJson(data); $('.j-order-row').remove(); if(json.status==1){ json = json.data; if(params.page>json.TotalPage && json.TotalPage >0){ waitPayByPage(json.TotalPage); return; } var gettpl = document.getElementById('tblist').innerHTML; laytpl(gettpl).render(json.Rows, function(html){ $(html).insertAfter('#loadingBdy'); $('.gImg').lazyload({ effect: "fadeIn",failurelimit : 10,skip_invisible : false,threshold: 200,placeholder:window.conf.IMGURL+'/'+WST.conf.GOODS_LOGO}); }); laypage({ cont: 'pager', pages:json.TotalPage, curr: json.CurrentPage, skin: '#e23e3d', groups: 3, jump: function(e, first){ if(!first){ waitPayByPage(e.curr); } } }); } }); } function waitReceiveByPage(p){ $('#loading').show(); var params = {}; params = WST.getParams('.u-query'); params.key = $.trim($('#key').val()); params.page = p; $.post(WST.U('home/orders/waitReceiveByPage'),params,function(data,textStatus){ $('#loading').hide(); var json = WST.toJson(data); $('.j-order-row').remove(); if(json.status==1){ json = json.data; if(params.page>json.TotalPage && json.TotalPage >0){ waitReceiveByPage(json.TotalPage); return; } var gettpl = document.getElementById('tblist').innerHTML; laytpl(gettpl).render(json.Rows, function(html){ $(html).insertAfter('#loadingBdy'); $('.gImg').lazyload({ effect: "fadeIn",failurelimit : 10,skip_invisible : false,threshold: 200,placeholder:window.conf.IMGURL+'/'+WST.conf.GOODS_LOGO}); }); laypage({ cont: 'pager', pages:json.TotalPage, curr: json.CurrentPage, skin: '#e23e3d', groups: 3, jump: function(e, first){ if(!first){ waitReceiveByPage(e.curr); } } }); } }); } function toReceive(id){ WST.confirm({content:'您确定已收货吗?',yes:function(){ var ll = WST.load({msg:'正在提交信息,请稍候...'}); $.post(WST.U('home/orders/receive'),{id:id},function(data){ var json = WST.toJson(data); if(json.status>0){ WST.msg(json.msg,{icon:1}); waitReceiveByPage(WSTCurrPage); layer.close(ll); }else{ WST.msg(json.msg,{icon:2}); } }); }}) } function toDelay(id){ WST.confirm({content:'亲,只能延时收货一次哒?',yes:function(){ var ll = WST.load({msg:'正在提交信息,请稍候...'}); $.post(WST.U('home/orders/delay'),{id:id},function(data){ var json = WST.toJson(data); if(json.status>0){ WST.msg(json.msg,{icon:1}); waitReceiveByPage(WSTCurrPage); layer.close(ll); }else{ WST.msg(json.msg,{icon:2}); } }); }}) } function waitAppraiseByPage(p){ $('#loading').show(); var params = {}; params = WST.getParams('.s-query'); params.key = $.trim($('#key').val()); params.page = p; $.post(WST.U('home/orders/waitAppraiseByPage'),params,function(data,textStatus){ $('#loading').hide(); var json = WST.toJson(data); $('.j-order-row').remove(); if(json.status==1){ json = json.data; if(params.page>json.TotalPage && json.TotalPage >0){ waitAppraiseByPage(json.TotalPage); return; } var gettpl = document.getElementById('tblist').innerHTML; laytpl(gettpl).render(json.Rows, function(html){ $(html).insertAfter('#loadingBdy'); $('.gImg').lazyload({ effect: "fadeIn",failurelimit : 10,skip_invisible : false,threshold: 200,placeholder:window.conf.IMGURL+'/'+WST.conf.GOODS_LOGO}); }); laypage({ cont: 'pager', pages:json.TotalPage, curr: json.CurrentPage, skin: '#e23e3d', groups: 3, jump: function(e, first){ if(!first){ waitAppraiseByPage(e.curr); } } }); } }); } function finishByPage(p){ $('#loading').show(); var params = {}; params = WST.getParams('.u-query'); params.key = $.trim($('#key').val()); params.page = p; $.post(WST.U('home/orders/finishByPage'),params,function(data,textStatus){ $('#loading').hide(); var json = WST.toJson(data); $('.j-order-row').remove(); if(json.status==1){ json = json.data; var gettpl = document.getElementById('tblist').innerHTML; laytpl(gettpl).render(json.Rows, function(html){ $(html).insertAfter('#loadingBdy'); $('.gImg').lazyload({ effect: "fadeIn",failurelimit : 10,skip_invisible : false,threshold: 200,placeholder:window.conf.IMGURL+'/'+WST.conf.GOODS_LOGO}); }); laypage({ cont: 'pager', pages:json.TotalPage, curr: json.CurrentPage, skin: '#e23e3d', groups: 3, jump: function(e, first){ if(!first){ finishByPage(e.curr); } } }); } }); } function cancel(id,type){ var ll = WST.load({msg:'正在加载信息,请稍候...'}); $.post(WST.U('home/orders/toCancel'),{id:id},function(data){ layer.close(ll); var w = WST.open({ type: 1, title:"取消订单", shade: [0.6, '#000'], border: [0], content: data, area: ['500px', '260px'], btn: ['提交', '关闭窗口'], yes: function(index, layero){ var reason = $.trim($('#reason').val()); ll = WST.load({msg:'数据处理中,请稍候...'}); $.post(WST.U('home/orders/cancellation'),{id:id,reason:reason},function(data){ layer.close(w); layer.close(ll); var json = WST.toJson(data); if(json.status==1){ WST.msg(json.msg, {icon: 1}); if(type==0){ waitPayByPage(WSTCurrPage); }else{ waitReceiveByPage(WSTCurrPage); } }else{ WST.msg(json.msg, {icon: 2}); } }); } }); }); } function toReject(id){ var ll = WST.load({msg:'正在加载信息,请稍候...'}); $.post(WST.U('home/orders/toReject'),{id:id},function(data){ layer.close(ll); var w = WST.open({ type: 1, title:"拒收订单", shade: [0.6, '#000'], border: [0], content: data, area: ['500px', '300px'], btn: ['提交', '关闭窗口'], yes: function(index, layero){ var params = {}; params.reason = $.trim($('#reason').val()); params.content = $.trim($('#content').val()); params.id = id; if(params.id==10000 && params.conten==''){ WST.msg('请输入拒收原因',{icon:2}); return; } ll = WST.load({msg:'数据处理中,请稍候...'}); $.post(WST.U('home/orders/reject'),params,function(data){ layer.close(w); layer.close(ll); var json = WST.toJson(data); if(json.status==1){ WST.msg(json.msg, {icon: 1}); waitReceiveByPage(WSTCurrPage); }else{ WST.msg(json.msg, {icon: 2}); } }); } }); }); } function changeRejectType(v){ if(v==10000){ $('#rejectTr').show(); }else{ $('#rejectTr').hide(); } } function cancelByPage(p){ $('#loading').show(); var params = {}; params = WST.getParams('.u-query'); params.key = $.trim($('#key').val()); params.page = p; $.post(WST.U('home/orders/cancelByPage'),params,function(data,textStatus){ $('#loading').hide(); var json = WST.toJson(data); $('.j-order-row').remove(); if(json.status==1){ json = json.data; var gettpl = document.getElementById('tblist').innerHTML; laytpl(gettpl).render(json.Rows, function(html){ $(html).insertAfter('#loadingBdy'); $('.gImg').lazyload({ effect: "fadeIn",failurelimit : 10,skip_invisible : false,threshold: 200,placeholder:window.conf.IMGURL+'/'+WST.conf.GOODS_LOGO}); }); laypage({ cont: 'pager', pages:json.TotalPage, curr: json.CurrentPage, skin: '#e23e3d', groups: 3, jump: function(e, first){ if(!first){ cancelByPage(e.curr); } } }); } }); } function abnormalByPage(p){ $('#loading').show(); var params = {}; params = WST.getParams('.u-query'); params.key = $.trim($('#key').val()); params.page = p; $.post(WST.U('home/orders/abnormalByPage'),params,function(data,textStatus){ $('#loading').hide(); var json = WST.toJson(data); $('.j-order-row').remove(); if(json.status==1){ json = json.data; if(params.page>json.TotalPage && json.TotalPage >0){ abnormalByPage(json.TotalPage); return; } var gettpl = document.getElementById('tblist').innerHTML; laytpl(gettpl).render(json.Rows, function(html){ $(html).insertAfter('#loadingBdy'); $('.gImg').lazyload({ effect: "fadeIn",failurelimit : 10,skip_invisible : false,threshold: 200,placeholder:window.conf.IMGURL+'/'+WST.conf.GOODS_LOGO}); }); laypage({ cont: 'pager', pages:json.TotalPage, curr: json.CurrentPage, skin: '#e23e3d', groups: 3, jump: function(e, first){ if(!first){ abnormalByPage(e.curr); } } }); } }); } function refund(id,src){ var ll = WST.load({msg:'正在加载信息,请稍候...'}); $.post(WST.U('home/orders/toRefund'),{id:id},function(data){ layer.close(ll); var w = WST.open({ type: 1, title:"申请退款", shade: [0.6, '#000'], border: [0], content: data, area: ['500px', '320px'], btn: ['提交', '关闭窗口'], yes: function(index, layero){ var params = {}; params.reason = $.trim($('#reason').val()); params.content = $.trim($('#content').val()); params.money = $.trim($('#money').val()); params.id = id; if(params.money<0){ WST.msg('无效的退款金额',{icon:2}); return; } if(params.id==10000 && params.conten==''){ WST.msg('请输入原因',{icon:2}); return; } ll = WST.load({msg:'数据处理中,请稍候...'}); $.post(WST.U('home/orderrefunds/refund'),params,function(data){ layer.close(ll); var json = WST.toJson(data); if(json.status==1){ WST.msg(json.msg, {icon: 1}); layer.close(w); if(src=='abnormal'){ abnormalByPage(WSTCurrPage); }else{ cancelByPage(WSTCurrPage); } }else{ WST.msg(json.msg, {icon: 2}); } }); } }); }); } function view(id){ location.href=WST.U('home/orders/detail','id='+id); } function complain(id){ location.href=WST.U('home/ordercomplains/complain','orderId='+id); } /******************** 评价页面 ***********************/ function appraisesShowImg(id){ layer.photos({ photos: '#'+id }); } function toAppraise(id){ location.href=WST.U("home/orders/orderAppraise",{'oId':id}); } //文件上传 function upload(n){ var uploader =WST.upload({ pick:'#filePicker'+n, formData: {dir:'appraises',isThumb:1}, fileNumLimit:5, accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'}, callback:function(f,file){ var json = WST.toJson(f); if(json.status==1){ // var tdiv = $("
'+params.content+'['+year+month+day+']
'; html +='