123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602 |
- <!DOCTYPE html>
- <html lang="zh-cn">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
- <meta name="format-detection" content="email=no" />
- <meta name="format-detection" content="telephone=no" />
- <title>订单详情</title>
- <link rel="stylesheet" href="../../css/reset.css">
- <style>
- html{font-size:10px}
- html,body{
- height: 100%;
- }
- .flex-wrap{
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- }
- .flex-con{
- -webkit-box-flex: 1;
- -webkit-flex: 1;
- flex: 1;
- }
- body{
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-orient: vertical;
- -webkit-flex-flow: column;
- flex-flow: column;
- }
- header{
- width: 100%;
- height: 4rem;
- line-height: 4rem;
- background-color: #252736;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- }
- header h2{
- width: 100%;
- height: 100%;
- font-size: 1.8rem;
- color: #fff;
- font-weight: lighter;
- text-align: center;
- position: relative;
- }
- header i{
- display: inline-block;
- width: 4.3rem;
- height: 4.3rem;
- background: url("../../img/index/backBtn.png") no-repeat 30%/60%;
- position: absolute;
- left: 0;
- bottom: 0;
- }
- header a{
- display: inline-block;
- font-size: 1.2rem;
- color: #fff;
- position: absolute;
- right: 1.2rem;
- top: 0;
- }
- header span{
- display: inline-block;
- font-size: 1.2rem;
- color: #fff;
- position: absolute;
- right: 1.2rem;
- top: 0;
- }
- main{
- background-color: #f7f7f7;
- padding-top: 4rem;
- position: relative;
- }
- .banner{
- width: 100%;
- height: 7rem;
- line-height: 7rem;
- background: url("../../img/order/banner.png") round;
- }
- .banner div:nth-of-type(1){
- font-size: 1.5rem;
- color: #fff;
- margin-left: 3.4rem;
- }
- .banner div:nth-of-type(2){
- width: 7rem;
- height: 5rem;
- margin: 1rem 3.4rem 0 0;
- }
- .banner div:nth-of-type(2).OPay{
- background: url("../../img/order/pay.png") round;
- }
- .banner div:nth-of-type(2).ONo-pay{
- background: url("../../img/order/no-pay.png") round;
- }
- .banner div:nth-of-type(2).OSend{
- background: url("../../img/order/send.png") round;
- }
- .banner div:nth-of-type(2).OEnd{
- background: url("../../img/order/end.png") round;
- }
- .banner div:nth-of-type(2).OCancel{
- width: 5rem;
- height: 5rem;
- background: url("../../img/order/cancel.png") round;
- }
- div.hid{
- display: none;
- }
- .gzOrder{
- background-color: #fff;
- margin-bottom: .1rem;
- }
- .gzOrder>p{
- font-size: 1.1rem;
- line-height: 2.5rem;
- border-bottom: 1px solid #efefef;
- padding-left: .6rem;
- }
- .gzOrder>div{
- height: 5rem;
- padding:.6rem;
- }
- .orderI{
- width: 3.3rem;
- height: 100%;
- background: url("../../img/order/loca.png") no-repeat 50%/50%;
- }
- .userDiv{
- font-size: 1rem;
- color: #212121;
- margin-left: .2rem;
- }
- .Name{
- margin-bottom: .4rem;
- }
- .orderShop li{
- color: #212121;
- background-color: #fff;
- }
- .statusBox{
- background-color: #fff;
- padding: .6rem;
- }
- .orderList{
- background-color: #fff;
- }
- .orderDiv{
- font-size: 1rem;
- color: #8e8e8e;
- }
- .orderNum{
- font-size: 1.1rem;
- color: #b0b0b0;
- }
- .status{
- color: #ff5001;
- font-size: 1.2rem;
- }
- .commDiv{
- padding: .6rem;
- }
- .commImg{
- width: 7rem;
- height: 6rem;
- }
- .commImg>img{
- display: block;
- width: 100%;
- height: 100%;
- }
- .commFig{
- font-size: 1.1rem;
- padding-left: .6rem;
- }
- .commNum{
- font-size: .9rem;
- color: #8e8e8e;
- text-align: right;
- margin-top: .3rem;
- }
- .totalP{
- background-color: #fff;
- }
- .describe{
- text-align: right;
- font-size: .8rem;
- padding: .3rem .6rem;
- }
- .describe span{
- font-size: 1rem;
- }
- .btnBox{
- font-size: 1rem;
- background-color: #fff;
- border-top: 1px solid #efefef;
- padding:.6rem .6rem 2rem 0;
- }
- .btnBox div{
- width: 6rem;
- height: 2.2rem;
- line-height: 2.2rem;
- text-align: center;
- border: 1px solid #a0a0a0;
- border-radius: 1.1rem;
- margin-left: .4rem;
- float: right;
- }
- .btnBox div.active{
- color: #ff5001;
- border: 1px solid #ff5001;
- }
- .payType{
- padding: 0 .6rem;
- margin-top: 1px;
- background-color: #fff;
- }
- .payType>p:nth-of-type(1){
- font-size: 1.1rem;
- line-height: 2.5rem;
- border-bottom: 1px solid #efefef;
- padding-left: .6rem;
- }
- .payType>p:nth-of-type(2){
- font-size: 1.1rem;
- line-height: 2.5rem;
- color: #8e8e8e;
- border-bottom: 1px solid #efefef;
- padding-left: .6rem;
- }
- .payUl li{
- height: 6rem;
- padding: .6rem;
- }
- .payUl li.active .zfI{
- background: url("../../img/order/zfActive.png") no-repeat 50%/50%;
- }
- .zfI{
- width: 3.2rem;
- height: 100%;
- background: url("../../img/shopPage/select.png") no-repeat 50%/50%;
- }
- .zfTypeI{
- width: 4rem;
- height: 4rem;
- background: url("../../img/order/ZFB.png") round;
- margin: .4rem 1rem .4rem 0;
- }
- .zfName{
- line-height: 4.8rem;
- font-size: 1.1rem;
- color: #8e8e8e;
- }
- .cancelDiv{
- position: fixed;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- background-color: rgba(0,0,0,0.5);
- z-index: 99;
- display: none;
- }
- .cancelBox{
- width: 70%;
- height: 14rem;
- background-color: #fff;
- border-radius: .6rem;
- position: absolute;
- top: calc(50% - 7rem);
- left: 15%;
- }
- .cancelBox>p{
- line-height: 9.4rem;
- color: #8e8e8e;
- text-align: center;
- font-size: 1.5rem;
- border-bottom: 1px solid #efefef;
- }
- .cancelBox>div>div{
- width: 50%;
- height: 4.6rem;
- line-height: 4.6rem;
- text-align: center;
- font-size: 1.4rem;
- }
- .suBtn{
- color: #00a651;
- border-left: 1px solid #efefef;
- }
- .waitDiv{
- width: 1rem;
- height: 1rem;
- background: url("../../img/order/waiting.gif") round;
- position: absolute;
- left: calc(50% - .5rem);
- top: calc(50% - .5rem);
- }
- .mainPB{
- width: 100%;
- height: 5rem;
- }
- .cancelDiv{
- position: fixed;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- background-color: rgba(0,0,0,0.5);
- z-index: 99;
- display: none;
- }
- .cancelBox{
- width: 70%;
- height: 14rem;
- background-color: #fff;
- border-radius: .6rem;
- position: absolute;
- top: calc(50% - 7rem);
- left: 15%;
- }
- .cancelBox>p{
- line-height: 9.4rem;
- color: #8e8e8e;
- text-align: center;
- font-size: 1.5rem;
- border-bottom: 1px solid #efefef;
- }
- .cancelBox>div>div{
- width: 50%;
- height: 4.6rem;
- line-height: 4.6rem;
- text-align: center;
- font-size: 1.4rem;
- }
- .suBtn{
- color: #00a651;
- border-left: 1px solid #efefef;
- }
- .remindDiv{
- height: 3rem;
- line-height: 3rem;
- text-align: center;
- font-size: 1.2rem;
- color: #fff;
- padding: 0 1rem;
- border-radius: 2rem;
- background-color: rgba(0,0,0,0.7);
- position: fixed;
- bottom: 20%;
- left: 50%;
- -webkit-transform: translateX(-50%);
- transform: translateX(-50%);
- opacity: 0;
- -webkit-transition: .5s;
- transition: .5s;
- z-index: -99;
- }
- @media screen and (min-width:321px) and (max-width:375px){html{font-size:11px}}
- @media screen and (min-width:376px) and (max-width:414px){html{font-size:12px}}
- @media screen and (min-width:415px) and (max-width:639px){html{font-size:13px}}
- @media screen and (min-width:640px) and (max-width:719px){html{font-size:18px}}
- @media screen and (min-width:720px) and (max-width:749px){html{font-size:19px}}
- @media screen and (min-width:750px) and (max-width:799px){html{font-size:20px}}
- @media screen and (min-width:800px){html{font-size:25px}}
- </style>
- </head>
- <body>
- <header>
- <h2><i id="backBtn" onclick="toBack()"></i>订单详情</h2>
- </header>
- <main class="flex-con">
- <div class="orderConDiv hid">
- <div class="banner clearFix">
- <div class="left">{{type}}</div>
- <div class="right {{cls}}"></div>
- </div>
- <div class="gzOrder">
- <p>跟踪订单</p>
- <div class="clearFix flex-wrap">
- <div class="left orderI"></div>
- <div class="left userDiv flex-con">
- <p class="Name clearFix">收货人:{{name}}<span class="phone right">{{phone}}</span></p>
- <p class="locaDiv">收货地址:{{location}}</p>
- </div>
- </div>
- </div>
- <div class="statusBox clearFix">
- <div class="orderDiv left">订单编号:<span class="orderNum">{{orderNum}}</span></div>
- <div class="status right">{{orderStatus}}</div>
- </div>
- <div class="orderList">
- <ul class="orderShop hid">
- <li>
- <div class="commDiv flex-wrap">
- <div class="commImg">{{img}}</div>
- <div class="commFig flex-con clearFix">
- <div class="left commName">{{commName}}</div>
- <div class="right commPN">
- <p class="commPrice">{{commPrice}}</p>
- <p class="commNum">x{{commNum}}</p>
- </div>
- </div>
- </div>
- </li>
- </ul>
- </div>
- <div class="totalP">
- <p class="describe">共{{totalNum}}件商品 合计:¥<span>{{commPrice}}</span>(含运费{{freight}})</p>
- </div>
- <div class="payType">
- <p class="clearFix">支付方式<span class="right">支付宝支付</span></p>
- <p>变更支付方式</p>
- <ul class="payUl">
- <li class="flex-wrap active">
- <div class="zfI"></div>
- <div class="zfCon flex-con clearFix">
- <div class="zfTypeI left"></div>
- <div class="zfName left">手机支付宝支付</div>
- </div>
- </li>
- </ul>
- </div>
- <div class="btnBox clearFix"></div>
- </div>
- <div class="mainPB"></div>
- <div class="waitDiv"></div>
- <div class="cancelDiv">
- <div class="cancelBox">
- <p></p>
- <div class="clearFix">
- <div class="left clBtn">忽略</div>
- <div class="right suBtn">确定</div>
- </div>
- </div>
- </div>
- <div class="remindDiv"></div>
- </main>
- <script src="../../js/publicData.js"></script>
- <script src="../../dep/jquery-3.1.0.min.js"></script>
- <script>
- $(function () {
- var orderNum=location.search.slice(1),
- divModelHead=$(".banner").html(),
- divModelUser=$(".gzOrder").html(),
- divModelOrder=$(".statusBox").html(),
- divModelTotal=$(".totalP").html(),
- divModelList=$(".orderList ul").html(),
- divModelPay='<div class="payType">'+$(".payType").html()+'</div>',
- imgModel='<img src="{{img}}" alt="">',
- oRemindTime,
- str="",
- username=sessionStorage.getItem("setname");
- var cancelBox=document.getElementsByClassName("cancelBox")[0];
- if(is_weixn()){
- $(".mainPB").css("display","none")
- }
- $.post(pageUrl+"/Api/Index/orderDetail",{orderid:orderNum.split("=")[1],vipid:username},function (data) {
- if(data.status=="999"){
- window.location.href="../login.html";
- }
- var data=data.data.cache,orderStatus="",totalnum=0;
- var strDiv="<div class='btnBox clearFix'>",
- newHead="<div class='banner clearFix'>",
- newUser="<div class='gzOrder'>",
- newList="<div class='orderList'><ul class='orderShop'>",
- newTotal="<div class='totalP'>",
- newOrder="<div class='statusBox clearFix'>";
- switch ((data.status-0)){
- case 1:
- newHead+=divModelHead.replace("{{type}}","等待买家付款").replace("{{cls}}","ONo-pay");
- strDiv+='<div class="cancelOrder">取消订单</div><div class="active payOrder">付款</div>';
- orderStatus="未付款";
- break;
- case 2:
- newHead+=divModelHead.replace("{{type}}","等待卖家发货").replace("{{cls}}","OPay");
- strDiv+='<div onclick="toBack()">好的</div>';
- orderStatus="已付款";
- break;
- case 3:
- newHead+=divModelHead.replace("{{type}}","卖家已发货").replace("{{cls}}","OSend");
- strDiv+='<div class="sureEnd active">确认收货</div><div class="lookExpress">查看物流</div>';
- orderStatus="待收货";
- break;
- case 5:
- newHead+=divModelHead.replace("{{type}}","交易成功").replace("{{cls}}","OEnd");
- strDiv+='<div onclick="toBack()">好的</div>';
- orderStatus="已收货";
- break;
- case 0:
- newHead+=divModelHead.replace("{{type}}","订单已取消").replace("{{cls}}","OCancel");
- strDiv+='<div onclick="toBack()"">好的</div>';
- orderStatus="已取消";
- break;
- }
- newOrder+=divModelOrder.replace("{{orderNum}}",data['oid']).replace("{{orderStatus}}",orderStatus);
- newUser+=divModelUser.replace("{{name}}",data['vipname']).replace("{{phone}}",data['vipmobile'])
- .replace("{{location}}",data['vipaddress']);
- for(var n in data.items){
- newList+=divModelList.replace("{{img}}",imgModel.replace("{{img}}",pageImg+"/.."+data.items[n]["imgurl"])).replace("{{commName}}",data.items[n]["name"])
- .replace("{{commPrice}}","¥"+(data.items[n]["price"]-0).toFixed(2)).replace("{{commNum}}",data.items[n]["item_num"]);
- totalnum+=data.items[n]["item_num"]-0;
- }
- newTotal+=divModelTotal.replace("{{totalNum}}",totalnum).replace("{{commPrice}}",(data['totalprice']-0).toFixed(2))
- .replace("{{freight}}",(data['yf']-0).toFixed(2));
- newList+="</ul></div>";
- newHead+="</div>";
- newUser+="</div>";
- newOrder+="</div>";
- newTotal+="</div>";
- strDiv+="</div>";
- if((data.status-0)==1){
- str=newHead+newUser+newOrder+newList+newTotal+divModelPay+strDiv;
- }else {
- str=newHead+newUser+newOrder+newList+newTotal+strDiv;
- }
- totalnum=0;
- $(".waitDiv").css("display","none");
- $(".orderConDiv").html(str).removeClass("hid");
- /*查看物流*/
- $(".lookExpress").click(function () {
- location.href="./orderExpress.html?order="+data['oid'];
- })
- /*取消订单按钮*/
- $(".cancelOrder").click(function () {
- $(".cancelDiv").css("display","block").find("p").text("你确定取消订单吗?");
- var _that=$(this);
- $(".clBtn").click(function () {
- $(".cancelDiv").css("display","none");
- })
- $(".suBtn").click(function (e) {
- e.stopPropagation();
- var orderNum=_that.parent().parent().find(".orderNum").text();
- /*取消当前订单*/
- $.post(pageUrl+"/Api/Index/orderTuihuoSave",{orderid:orderNum},function (data) {
- $(".cancelDiv").css("display","none");
- if(data.status==200){
- location.reload();
- }
- })
- })
- })
- /*收货按钮*/
- $(".sureEnd").click(function () {
- $(".cancelDiv").css("display","block").find("p").text("你确认收货吗?");
- var _that=$(this);
- $(".clBtn").click(function () {
- $(".cancelDiv").css("display","none");
- })
- $(".suBtn").click(function (e) {
- e.stopPropagation();
- var orderNum=_that.parent().parent().find(".orderNum").text();
- /*发送当前订单*/
- $(".cancelDiv").css("display","none");
- $.post(pageUrl+"/Api/Index/orderOK",{orderid:data['oid']},function (data) {
- remindMes(data.message)
- if(data.status==200){
- setTimeout(function () {
- location.reload();
- },200)
- }
- })
- })
- })
- /*付款按钮*/
- $(".payOrder").click(function () {
- $.get(pageUrl+"/Api/Index/pay1",{orderid:data.oid},function (data) {
- window.location.href=pageImg+data.url;
- })
- })
- })
- function remindMes(val) {
- if(oRemindTime) clearTimeout(oRemindTime);
- $(".remindDiv").text(val).css({"opacity":"1","z-index":99});
- oRemindTime=setTimeout(function () {
- $(".remindDiv").css({"opacity":"0","z-index":-99})
- oRemindTime=undefined;
- },2000)
- }
- })
- function is_weixn(){
- var ua = navigator.userAgent;
- if(/(MicroMessenger)/i.test(ua)) {
- return true;
- } else {
- return false;
- }
- }
- function toBack() {
- window.history.back();
- }
- </script>
- </body>
- </html>
|