orderAll.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>我的订单</title>
  6. <link rel="stylesheet" href="../css/main.css" />
  7. <script src="../js/flexible.js"></script>
  8. <script src="../js/api.js"></script>
  9. <script src="../js/checkLanguage.js"></script>
  10. </head>
  11. <body>
  12. <ul id="evaluation" class="orderList">
  13. </ul>
  14. <script type="text/javascript">
  15. try {
  16. var text=languages.orderAll;
  17. }catch (e){
  18. alert(languages.all.list5)
  19. }
  20. </script>
  21. <script src="../js/doT.min.js" type="text/javascript" charset="utf-8"></script>
  22. <script src="../js/publicData.js"></script>
  23. <script src="../js/jquery-3.1.0.min.js"></script>
  24. <script id="evaluationtmpl" type="text/x-dot-template">
  25. {{ for(var prop in it["amount"]) { }}
  26. <li class="bb bgff mb20" rel='{{= it["amount"][prop]["id"] }}'>
  27. <div class="ub ub-pj p25 p-te fz22 ptb26 ">
  28. <p class="fz22 c81 p-te orderGSW">{{=it['languages']['list11']}}:{{= it["amount"][prop]["Carrier"] }}</p>
  29. <p class="fz22 c81 plr20">{{= it["amount"][prop]["addDate"] }}</p>
  30. </div>
  31. <div class="bgfa fz24 info-txt orderContent" id='{{= it["amount"][prop]["id"] }}'>
  32. <p class="blue fz24 p-te">{{=it['languages']['list3']}}:{{= it["amount"][prop]["startArea"] }}</p>
  33. <p class="blue fz24 p-te">{{=it['languages']['list4']}}:{{= it["amount"][prop]["endArea"] }}</p>
  34. <p class="fz24 c98">{{=it['languages']['list1']}}:{{= it["amount"][prop]["nameCn"] }} </p>
  35. <p class="fz24 c98"> {{ if(it["amount"][prop]["nameOfboard"]!=""){}} &nbsp;{{=it['languages']['list17']}}:{{= it["amount"][prop]["nameOfboard"] }}{{ } }}</p>
  36. <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>
  37. <p class="fz24 c98">{{=it['languages']['list13']}}:{{= it["amount"][prop]["dateOfStart"] }} &nbsp;{{=it['languages']['list14']}}:{{= it["amount"][prop]["dateOfEndGate"] }} </p>
  38. <p class="fz24 c28 clear">
  39. {{ for(var i in it["amount"][prop]['res']){ }}
  40. {{ if(it["amount"][prop]['res'][i]["buyCount"]!=0){ }}
  41. <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>
  42. {{ } }}
  43. {{ } }}
  44. </p>
  45. <p class="fz24 c28 ub">
  46. {{=it['languages']['list15']}}:{{= it["amount"][prop]["additionalPrice"] }}
  47. </p>
  48. <p class="fz24 c28 ub">
  49. <span class="ub-f1">{{=it['languages']['list7']}}:{{= it["amount"][prop]["code"] }}{{= it["amount"][prop]["allPrice"] }}</span>
  50. <span class="ub-f1">{{=it['languages']['list9']}}:{{= it["amount"][prop]["payMethod"] }}</span>
  51. </p>
  52. <p class="fz24 c65 ub">
  53. <span class="ub-f1">{{=it['languages']['list6']}}:{{= it["amount"][prop]["sysOrderNo"] }}</span>
  54. </p>
  55. </div>
  56. <div class="ptb20 plr25 ub ub-pe buttonContent">
  57. <span class="ub-f1 pt10">{{=it['languages']['list2']}}:{{=it['languages']['list10']}}</span>
  58. <a href="javascript:;" class="red revise-btn fz24 ml10" id="recover">{{=it['languages']['btn1']}}</a>
  59. <!--{{? it["amount"][prop].stateOfOrcer==1 }}-->
  60. <!--<span class="ub-f1 pt10">订单状态:未处理</span>-->
  61. <!--{{?? it["amount"][prop].stateOfOrcer == 4}}-->
  62. <!--<span class="ub-f1 pt10">订单状态:已完成</span>-->
  63. <!--{{?? it["amount"][prop].stateOfOrcer == 3}}-->
  64. <!--<span class="ub-f1 pt10">订单状态:运输中</span>-->
  65. <!--{{?}}-->
  66. <!--{{? it["amount"][prop].stateOfOrcer==1 }}-->
  67. <!--<a href="javascript:;" class="red revise-btn fz24" id="accept">接受</a>-->
  68. <!--<a href="javascript:;" class="delete-btn fz24 ml10" id="refuse">拒绝</a>-->
  69. <!--{{?? it["amount"][prop].stateOfOrcer == 4}}-->
  70. <!--<a href="javascript:;" class="red revise-btn fz24 ml10" id="sureBtn">开发票</a>-->
  71. <!--{{?? it["amount"][prop].stateOfOrcer == 3}}-->
  72. <!--<a href="javascript:;" class="red revise-btn fz24" id="lookVoucher">查看运单</a>-->
  73. <!--<a href="javascript:;" class="red revise-btn fz24 ml10" id="lookMaterial">运输状态</a>-->
  74. <!--{{?}}-->
  75. </div>
  76. </li>
  77. {{ } }}
  78. </script>
  79. <script>
  80. $(this).attr("rel")
  81. del(".btn")
  82. function del (obj){
  83. $(obj).click(function(){
  84. $('#deom1 img')[index].remove()
  85. document.getElementById('demo1').children
  86. // $(this).parent().html('')
  87. })
  88. }
  89. var pageIndex=1,isReload=false;
  90. apiready = function() {
  91. getdata(true);
  92. api.setRefreshHeaderInfo({
  93. loadingImg: 'widget://image/refresh.png',
  94. bgColor: '#efefef',
  95. textColor: '#818181',
  96. textDown: languages.all.list34+'...',
  97. textUp: languages.all.list35+'...'
  98. }, function(ret, err) {
  99. //在这里从服务器加载数据,加载完成后调用api.refreshHeaderLoadDone()方法恢复组件到默认状态
  100. getdata(true,1);
  101. });
  102. api.addEventListener({
  103. name:"loginInit"
  104. },function (ret,err) {
  105. api.closeFrame({
  106. name: 'orderAll'
  107. });
  108. })
  109. api.addEventListener({
  110. name: 'scrolltobottom',
  111. extra: {
  112. threshold: 0 //设置距离底部多少距离时触发,默认值为0,数字类型
  113. }
  114. }, function(ret, err) {
  115. if(isReload) return;
  116. getdata(false);
  117. });
  118. }
  119. function getdata(bl,thisPage) {
  120. isReload=true;
  121. api.ajax({
  122. url: pageUrl + "order/my_order",
  123. method: 'get',
  124. timeout: 30,
  125. dataType: 'json',
  126. returnAll: false,
  127. headers: {
  128. "Content-Type": "application/json"
  129. },
  130. data: {
  131. body: {
  132. stateOfOrcer:5,
  133. page:thisPage||pageIndex
  134. }
  135. }
  136. }, function(ret, err) {
  137. console.log(JSON.stringify(ret))
  138. if(thisPage) pageIndex=thisPage;
  139. if(ret.data.page<pageIndex){
  140. if(bl){
  141. api.refreshHeaderLoadDone();
  142. $("#evaluation").html(" <p style='padding-top: 5.3rem;font-size: .5rem;text-align: center;color: #818181'>"+languages.orderAll.remind1+"</p>");
  143. }else {
  144. api.toast({
  145. msg: languages.all.list19,
  146. duration: 2000,
  147. location: 'bottom'
  148. });
  149. }
  150. isReload=false;
  151. return;
  152. }
  153. var  dataEval  =  ret.data;
  154. dataEval.languages=languages.orderAll;
  155. var  evalText  =  doT.template($("#evaluationtmpl").text());
  156. $("#evaluation").html(evalText(dataEval));
  157. buttonclick();
  158. orderclick();
  159. api.refreshHeaderLoadDone();
  160. pageIndex++;
  161. isReload=false;
  162. })
  163. }
  164. // 操作按键点击
  165. function buttonclick() {
  166. var orderUl = $api.dom(".orderList"),
  167. buttonList = $api.domAll(orderUl, ".buttonContent a");
  168. for(var orderNum = 0, len = buttonList.length; orderNum < len; orderNum++) {
  169. ! function(i) {
  170. buttonList[i].onclick = function() {
  171. var id=$(this).parent().parent().attr("rel"); //订单id
  172. switch($(this).attr("id")) {
  173. case "accept":
  174. popups(languages.orderAll.remind3,function (ret,dialogBox) {
  175. if(ret.eventType == 'right') {
  176. buttons(3,id);
  177. dialogBox.close({
  178. dialogName: 'alert'
  179. });
  180. }else if (ret.eventType == 'left') {
  181. dialogBox.close({
  182. dialogName: 'alert'
  183. });
  184. }
  185. })
  186. break;
  187. case "refuse":
  188. popups(languages.orderAll.remind4,function (ret,dialogBox) {
  189. if(ret.eventType == 'right') {
  190. buttons(5,id);
  191. dialogBox.close({
  192. dialogName: 'alert'
  193. });
  194. }else if (ret.eventType == 'left') {
  195. dialogBox.close({
  196. dialogName: 'alert'
  197. });
  198. }
  199. })
  200. break;
  201. case "recover":
  202. popups(languages.orderAll.remind5,function (ret,dialogBox) {
  203. if(ret.eventType == 'right') {
  204. buttons(3,id);
  205. dialogBox.close({
  206. dialogName: 'alert'
  207. });
  208. }else if (ret.eventType == 'left') {
  209. dialogBox.close({
  210. dialogName: 'alert'
  211. });
  212. }
  213. })
  214. break;
  215. case "sureBtn":
  216. api.openWin({
  217. name: 'invoice',
  218. url: 'invoice.html',
  219. pageParam: {name: 'pageparamname',
  220. id: id}
  221. });
  222. break;
  223. case "lookVoucher":
  224. api.openWin({
  225. name: 'Voucher',
  226. url: 'Voucher.html',
  227. pageParam: {name: 'pageparamname',
  228. id: id}
  229. });
  230. break;
  231. case "lookMaterial":
  232. api.openWin({
  233. name: 'lookMaterial',
  234. url: 'lookMaterial.html',
  235. pageParam: {name: 'pageparamname',
  236. id:id}
  237. });
  238. break;
  239. default:
  240. break;
  241. }
  242. }
  243. }(orderNum)
  244. }
  245. }
  246. // 操作按钮具体操作
  247. function buttons(statu,ids) {
  248. api.ajax({
  249. url: pageUrl + "order/accept",
  250. method: 'get',
  251. timeout: 30,
  252. dataType: 'json',
  253. returnAll: false,
  254. headers: {
  255. "Content-Type": "application/json"
  256. },
  257. data: {
  258. values: {
  259. id: ids,
  260. status: statu
  261. }
  262. }
  263. }, function(ret, err) {
  264. if(ret.status=="200"){
  265. api.execScript({
  266. frameName: 'orderNav',
  267. script: 'getTotal();'
  268. });
  269. }
  270. api.toast({
  271. msg: ret.message,
  272. duration: 2000,
  273. location: 'bottom'
  274. });
  275. getdata(true,1)
  276. })
  277. }
  278. function orderclick() {
  279. var orderUl = $api.dom(".orderList"),
  280. orderList = $api.domAll(orderUl, ".orderContent");
  281. for(var orderNum = 0, len = orderList.length; orderNum < len; orderNum++) {
  282. ! function(i) {
  283. orderList[i].onclick = function() {
  284. api.openWin({
  285. name: 'orderDetails',
  286. url: 'orderDetails.html',
  287. pageParam: {
  288. name: 'pageparamname',
  289. id: $(this).parent().attr("rel")
  290. }
  291. });
  292. }
  293. }(orderNum)
  294. }
  295. }
  296. function popups(val,fn) {
  297. var dialogBox = api.require('dialogBox');
  298. dialogBox.alert({
  299. texts: {
  300. title: languages.all.list18,
  301. content: val,
  302. leftBtnTitle: languages.all.list2,
  303. rightBtnTitle: languages.all.list18
  304. },
  305. styles: {
  306. bg: '#fff',
  307. w: 300,
  308. title: {
  309. marginT: 20,
  310. icon: 'widget://res/gou.png',
  311. iconSize: 40,
  312. titleSize: 13,
  313. titleColor: '#000'
  314. },
  315. content: {
  316. color: '#000',
  317. size: 16
  318. },
  319. left: {
  320. marginB: 0,
  321. marginL: 0,
  322. w: 150,
  323. h: 60,
  324. corner: 2,
  325. bg: '#f9f9f9',
  326. color: '#818181',
  327. size: 12
  328. },
  329. right: {
  330. marginB: 0,
  331. marginL: 0,
  332. w: 150,
  333. h:60,
  334. corner: 2,
  335. bg: '#51c4d4',
  336. color: '#fff',
  337. size: 12
  338. }
  339. }
  340. }, function(ret) {
  341. fn(ret,dialogBox)
  342. });
  343. }
  344. </script>
  345. </body>
  346. </html>