123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>我的订单</title>
- <link rel="stylesheet" href="../css/main.css" />
- <script src="../js/flexible.js"></script>
- <script src="../js/api.js"></script>
- <script src="../js/checkLanguage.js"></script>
- </head>
- <body>
- <ul id="evaluation" class="orderList">
- </ul>
- <script type="text/javascript">
- try {
- var text=languages.orderAll;
- }catch (e){
- alert(languages.all.list5)
- }
- </script>
- <script src="../js/doT.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../js/publicData.js"></script>
- <script src="../js/jquery-3.1.0.min.js"></script>
- <script id="evaluationtmpl" type="text/x-dot-template">
-
- {{ for(var prop in it["amount"]) { }}
- <li class="bb bgff mb20" rel='{{= it["amount"][prop]["id"] }}'>
- <div class="ub ub-pj p25 p-te fz22 ptb26 ">
- <p class="fz22 c81 p-te orderGSW">{{=it['languages']['list11']}}:{{= it["amount"][prop]["Carrier"] }}</p>
- <p class="fz22 c81 plr20">{{= it["amount"][prop]["addDate"] }}</p>
- </div>
- <div class="bgfa fz24 info-txt orderContent" id='{{= it["amount"][prop]["id"] }}'>
- <p class="blue fz24 p-te">{{=it['languages']['list3']}}:{{= it["amount"][prop]["startArea"] }}</p>
- <p class="blue fz24 p-te">{{=it['languages']['list4']}}:{{= it["amount"][prop]["endArea"] }}</p>
- <p class="fz24 c98">{{=it['languages']['list1']}}:{{= it["amount"][prop]["nameCn"] }} </p>
- <p class="fz24 c98"> {{ if(it["amount"][prop]["nameOfboard"]!=""){}} {{=it['languages']['list17']}}:{{= it["amount"][prop]["nameOfboard"] }}{{ } }}</p>
- <p class="fz24 c98">{{=it['languages']['list12']}}:{{ if(it["amount"][prop]["timeSpendDay"]!=0){}}{{= it["amount"][prop]["timeSpendDay"] }}{{=it['languages']['list18']}}{{ } }}{{ if(it["amount"][prop]["timeSpendHour"]!=0){}}{{= it["amount"][prop]["timeSpendHour"] }}{{=it['languages']['list19']}}{{ } }} </p>
- <p class="fz24 c98">{{=it['languages']['list13']}}:{{= it["amount"][prop]["dateOfStart"] }} {{=it['languages']['list14']}}:{{= it["amount"][prop]["dateOfEndGate"] }} </p>
- <p class="fz24 c28 clear">
- {{ for(var i in it["amount"][prop]['res']){ }}
- {{ if(it["amount"][prop]['res'][i]["buyCount"]!=0){ }}
- <span class="fl mr20">{{= it["amount"][prop]['res'][i]['code'] }}{{= it["amount"][prop]['res'][i]['perPrice'] }}/{{= it["amount"][prop]['res'][i]['theCode'] }} *{{= it["amount"][prop]['res'][i]["buyCount"] }} </span>
- {{ } }}
- {{ } }}
- </p>
- <p class="fz24 c28 ub">
- {{=it['languages']['list15']}}:{{= it["amount"][prop]["additionalPrice"] }}
- </p>
- <p class="fz24 c28 ub">
- <span class="ub-f1">{{=it['languages']['list7']}}:{{= it["amount"][prop]["code"] }}{{= it["amount"][prop]["allPrice"] }}</span>
- <span class="ub-f1">{{=it['languages']['list9']}}:{{= it["amount"][prop]["payMethod"] }}</span>
- </p>
- <p class="fz24 c65 ub">
- <span class="ub-f1">{{=it['languages']['list6']}}:{{= it["amount"][prop]["sysOrderNo"] }}</span>
- </p>
- </div>
- <div class="ptb20 plr25 ub ub-pe buttonContent">
- <span class="ub-f1 pt10">{{=it['languages']['list2']}}:{{=it['languages']['list10']}}</span>
- <a href="javascript:;" class="red revise-btn fz24 ml10" id="recover">{{=it['languages']['btn1']}}</a>
- <!--{{? it["amount"][prop].stateOfOrcer==1 }}-->
- <!--<span class="ub-f1 pt10">订单状态:未处理</span>-->
- <!--{{?? it["amount"][prop].stateOfOrcer == 4}}-->
- <!--<span class="ub-f1 pt10">订单状态:已完成</span>-->
- <!--{{?? it["amount"][prop].stateOfOrcer == 3}}-->
- <!--<span class="ub-f1 pt10">订单状态:运输中</span>-->
- <!--{{?}}-->
- <!--{{? it["amount"][prop].stateOfOrcer==1 }}-->
- <!--<a href="javascript:;" class="red revise-btn fz24" id="accept">接受</a>-->
- <!--<a href="javascript:;" class="delete-btn fz24 ml10" id="refuse">拒绝</a>-->
- <!--{{?? it["amount"][prop].stateOfOrcer == 4}}-->
- <!--<a href="javascript:;" class="red revise-btn fz24 ml10" id="sureBtn">开发票</a>-->
- <!--{{?? it["amount"][prop].stateOfOrcer == 3}}-->
- <!--<a href="javascript:;" class="red revise-btn fz24" id="lookVoucher">查看运单</a>-->
- <!--<a href="javascript:;" class="red revise-btn fz24 ml10" id="lookMaterial">运输状态</a>-->
- <!--{{?}}-->
- </div>
- </li>
- {{ } }}
- </script>
- <script>
-
- $(this).attr("rel")
- del(".btn")
- function del (obj){
- $(obj).click(function(){
- $('#deom1 img')[index].remove()
- document.getElementById('demo1').children
-
-
- // $(this).parent().html('')
-
- })
- }
- var pageIndex=1,isReload=false;
- apiready = function() {
-
-
- getdata(true);
- api.setRefreshHeaderInfo({
- loadingImg: 'widget://image/refresh.png',
- bgColor: '#efefef',
- textColor: '#818181',
- textDown: languages.all.list34+'...',
- textUp: languages.all.list35+'...'
- }, function(ret, err) {
- //在这里从服务器加载数据,加载完成后调用api.refreshHeaderLoadDone()方法恢复组件到默认状态
- getdata(true,1);
- });
- api.addEventListener({
- name:"loginInit"
- },function (ret,err) {
- api.closeFrame({
- name: 'orderAll'
- });
- })
- api.addEventListener({
- name: 'scrolltobottom',
- extra: {
- threshold: 0 //设置距离底部多少距离时触发,默认值为0,数字类型
- }
- }, function(ret, err) {
- if(isReload) return;
- getdata(false);
- });
- }
- function getdata(bl,thisPage) {
- isReload=true;
- api.ajax({
- url: pageUrl + "order/my_order",
- method: 'get',
- timeout: 30,
- dataType: 'json',
- returnAll: false,
- headers: {
- "Content-Type": "application/json"
- },
- data: {
- body: {
- stateOfOrcer:5,
- page:thisPage||pageIndex
- }
- }
- }, function(ret, err) {
- console.log(JSON.stringify(ret))
- if(thisPage) pageIndex=thisPage;
- if(ret.data.page<pageIndex){
- if(bl){
- api.refreshHeaderLoadDone();
- $("#evaluation").html(" <p style='padding-top: 5.3rem;font-size: .5rem;text-align: center;color: #818181'>"+languages.orderAll.remind1+"</p>");
- }else {
- api.toast({
- msg: languages.all.list19,
- duration: 2000,
- location: 'bottom'
- });
- }
- isReload=false;
- return;
- }
- var dataEval = ret.data;
- dataEval.languages=languages.orderAll;
- var evalText = doT.template($("#evaluationtmpl").text());
- $("#evaluation").html(evalText(dataEval));
- buttonclick();
- orderclick();
- api.refreshHeaderLoadDone();
- pageIndex++;
- isReload=false;
- })
- }
- // 操作按键点击
- function buttonclick() {
- var orderUl = $api.dom(".orderList"),
- buttonList = $api.domAll(orderUl, ".buttonContent a");
- for(var orderNum = 0, len = buttonList.length; orderNum < len; orderNum++) {
- ! function(i) {
- buttonList[i].onclick = function() {
- var id=$(this).parent().parent().attr("rel"); //订单id
- switch($(this).attr("id")) {
- case "accept":
- popups(languages.orderAll.remind3,function (ret,dialogBox) {
- if(ret.eventType == 'right') {
- buttons(3,id);
- dialogBox.close({
- dialogName: 'alert'
- });
- }else if (ret.eventType == 'left') {
- dialogBox.close({
- dialogName: 'alert'
- });
- }
- })
- break;
- case "refuse":
- popups(languages.orderAll.remind4,function (ret,dialogBox) {
- if(ret.eventType == 'right') {
- buttons(5,id);
- dialogBox.close({
- dialogName: 'alert'
- });
- }else if (ret.eventType == 'left') {
- dialogBox.close({
- dialogName: 'alert'
- });
- }
- })
- break;
- case "recover":
- popups(languages.orderAll.remind5,function (ret,dialogBox) {
- if(ret.eventType == 'right') {
- buttons(3,id);
- dialogBox.close({
- dialogName: 'alert'
- });
- }else if (ret.eventType == 'left') {
- dialogBox.close({
- dialogName: 'alert'
- });
- }
- })
- break;
- case "sureBtn":
- api.openWin({
- name: 'invoice',
- url: 'invoice.html',
- pageParam: {name: 'pageparamname',
- id: id}
- });
- break;
- case "lookVoucher":
- api.openWin({
- name: 'Voucher',
- url: 'Voucher.html',
- pageParam: {name: 'pageparamname',
- id: id}
- });
- break;
- case "lookMaterial":
- api.openWin({
- name: 'lookMaterial',
- url: 'lookMaterial.html',
- pageParam: {name: 'pageparamname',
- id:id}
- });
- break;
- default:
- break;
- }
- }
- }(orderNum)
- }
- }
- // 操作按钮具体操作
- function buttons(statu,ids) {
- api.ajax({
- url: pageUrl + "order/accept",
- method: 'get',
- timeout: 30,
- dataType: 'json',
- returnAll: false,
- headers: {
- "Content-Type": "application/json"
- },
- data: {
- values: {
- id: ids,
- status: statu
- }
- }
- }, function(ret, err) {
- if(ret.status=="200"){
- api.execScript({
- frameName: 'orderNav',
- script: 'getTotal();'
- });
- }
- api.toast({
- msg: ret.message,
- duration: 2000,
- location: 'bottom'
- });
- getdata(true,1)
- })
- }
- function orderclick() {
- var orderUl = $api.dom(".orderList"),
- orderList = $api.domAll(orderUl, ".orderContent");
- for(var orderNum = 0, len = orderList.length; orderNum < len; orderNum++) {
- ! function(i) {
- orderList[i].onclick = function() {
- api.openWin({
- name: 'orderDetails',
- url: 'orderDetails.html',
- pageParam: {
- name: 'pageparamname',
- id: $(this).parent().attr("rel")
- }
- });
- }
- }(orderNum)
- }
- }
- function popups(val,fn) {
- var dialogBox = api.require('dialogBox');
- dialogBox.alert({
- texts: {
- title: languages.all.list18,
- content: val,
- leftBtnTitle: languages.all.list2,
- rightBtnTitle: languages.all.list18
- },
- styles: {
- bg: '#fff',
- w: 300,
- title: {
- marginT: 20,
- icon: 'widget://res/gou.png',
- iconSize: 40,
- titleSize: 13,
- titleColor: '#000'
- },
- content: {
- color: '#000',
- size: 16
- },
- left: {
- marginB: 0,
- marginL: 0,
- w: 150,
- h: 60,
- corner: 2,
- bg: '#f9f9f9',
- color: '#818181',
- size: 12
- },
- right: {
- marginB: 0,
- marginL: 0,
- w: 150,
- h:60,
- corner: 2,
- bg: '#51c4d4',
- color: '#fff',
- size: 12
- }
- }
- }, function(ret) {
- fn(ret,dialogBox)
- });
- }
- </script>
- </body>
- </html>
|