orderList_body.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title>AUI快速完成布局</title>
  8. <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  9. <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
  10. <link rel="stylesheet" type="text/css" href="../../css/html.css" />
  11. <style type="text/css">
  12. .text-white {
  13. color: #ffffff !important;
  14. }
  15. .aui-grid [class*=aui-col-] {
  16. padding: 0.75rem 0;
  17. }
  18. .aui-order-number {
  19. padding: 0.75rem;
  20. }
  21. .aui-card-list-user-avatar {
  22. width: 4rem;
  23. height: 3rem;
  24. }
  25. .aui-card-list-user-name {
  26. overflow: hidden;
  27. text-overflow: ellipsis;
  28. -webkit-box-orient: vertical;
  29. -webkit-line-clamp: 3;
  30. }
  31. .aui-card-list-user-info {
  32. text-align: right;
  33. color: #f00;
  34. margin-top: 10px;
  35. }
  36. .aui-top {
  37. padding: 7px 2px;
  38. border-bottom: 1px solid #ddd;
  39. width: 96%;
  40. margin-left: 2%;
  41. }
  42. .aui-state {
  43. float: right;
  44. }
  45. .aui-top .aui-state {
  46. color: #f00;
  47. }
  48. .aui-top .aui-state, .aui-top .aui-time {
  49. font-size: 0.6rem;
  50. }
  51. #user-info {
  52. position: fixed;
  53. top: 0;
  54. left: 0;
  55. width: 100%;
  56. height: 100%;
  57. z-index: 2;
  58. }
  59. .top {
  60. padding-bottom: 1rem;
  61. }
  62. .aui-bottom {
  63. border-top: 1px solid #ddd;
  64. border-bottom: 0px solid #fff;
  65. text-align: right;
  66. }
  67. .aui-float-right {
  68. float: right;
  69. margin-top: 10px;
  70. }
  71. .aui-card-list-user-name {
  72. width: 96%;
  73. }
  74. #tab {
  75. position: fixed;
  76. top: 0;
  77. left: 0;
  78. width: 100%;
  79. z-index: 2;
  80. }
  81. .aui-state-success {
  82. color: #8ec31f !important;
  83. }
  84. .aui-card-list {
  85. margin-bottom: 0px;
  86. }
  87. [v-cloak] {
  88. display: none
  89. }
  90. .zmq-text-status-hd {
  91. color: #F01414 !important;
  92. padding: 1px 3px;
  93. }
  94. </style>
  95. </head>
  96. <body>
  97. <div id="app">
  98. <section class="aui-content top" v-cloak>
  99. <div class="aui-card-list aui-border-t aui-border-b zmq-width-90 zmq-margin-top-10 zmq-radius-10" v-for="(item,index) in orderList" v-on:click="lookOrderInfo(item.id)">
  100. <div class="aui-top">
  101. <span class="aui-time zmq-text-msg" style="padding-left : 1rem;"><img class="zmq-orderCode-img" style="position: absolute;margin-left: -1rem" src="../../image/drawable-xhdpi/orderCode.png" />订单号:{{item.orderNum}}</span>
  102. <span class="aui-state zmq-btn-border zmq-text-msg zmq-padding-status" class="">{{stateArr[(item.status+1)].name}}</span>
  103. <!--<span class="aui-state zmq-btn-border-success zmq-text-success zmq-padding-status" v-show="item.title == '2'">{{stateArr[item.title]}}</span>
  104. <span class="aui-state zmq-btn-border-danger zmq-text-danger zmq-padding-status" v-show="item.title == '3'" class="" style="color: #999">{{stateArr[item.title]}}</span>-->
  105. </div>
  106. <div class="aui-card-list-header aui-card-list-user">
  107. <i class="aui-iconfont aui-icon-right aui-font-size-12 aui-float-right zmq-position-absolute"></i>
  108. <div class="aui-card-list-user-name zmq-flex">
  109. <div class="aui-font-size-14">
  110. 轮胎总数 {{item.amount}} 条<em v-show="item.activityId != null" class="zmq-text-status-hd">(活动)</em>
  111. </div>
  112. <!--<div class="aui-font-size-14 zmq-text-msg">
  113. 已接 10 条 退回 2 条
  114. </div>-->
  115. </div>
  116. <div class="aui-card-list-user-name zmq-flex">
  117. <div class="aui-font-size-14 zmq-text-explain">
  118. 下单时间:{{item.createTime}}
  119. </div>
  120. <div class="aui-font-size-14">
  121. 共 <span class="zmq-text-msg">{{item.amount}}</span> 件商品
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </section>
  127. <img v-show="hasData == false" src="../../image/nodata.png" />
  128. <div v-show="upLock == false" class="zmq-text-explain zmq-margin-top-10 zmq-textAlign-center zmq-margin-bottom-10 zmq-block-text">
  129. 已无更多数据
  130. </div>
  131. </div>
  132. </body>
  133. <!--<script type="text/javascript" src="../../script/aui-tab.js" ></script>-->
  134. <script type="text/javascript" src="../../script/api.js"></script>
  135. <script type="text/javascript" src="../../script/aui-scroll.js"></script>
  136. <script type="text/javascript" src="../../script/vue.js"></script>
  137. <script type="text/javascript" src="../../script/httpRequest.js"></script>
  138. <script type="text/javascript" src="../../script/vue_plugins.js"></script>
  139. <script type="text/javascript">
  140. var vm = "";
  141. apiready = function() {
  142. var type = api.pageParam.type;
  143. vm = new Vue({
  144. el : '#app',
  145. data : {
  146. type : type,
  147. // 获取订单列表
  148. getOrderListUrl : 'getOrderListUrl',
  149. // agentId 写死的经销商id
  150. retariler_id : '',
  151. // 订单列表
  152. orderList : [],
  153. allList : [], // 展示的全部的列表
  154. // 分页展示
  155. stateArr : [{
  156. name : "全部订单",
  157. id : '',
  158. }, {
  159. name : "待接单",
  160. id : 0
  161. }, {
  162. name : "已接单",
  163. id : 1
  164. }, {
  165. name : "已驳回",
  166. id : 2
  167. }],
  168. // 是否有数据
  169. hasData : false,
  170. // 顶部导航栏点击且换
  171. chooseIndex : 0,
  172. // 分页展示
  173. upLock : true,
  174. current : 1,
  175. total : 1,
  176. // 订单状态
  177. orderStatus : '',
  178. },
  179. filters : {
  180. statusToStr : function(status) {
  181. var str = "";
  182. switch (status) {
  183. case '0':
  184. str = "待经销商接单";
  185. break;
  186. case '1':
  187. str = "经销商已接单";
  188. break;
  189. default :
  190. break;
  191. }
  192. return str
  193. }
  194. },
  195. methods : {
  196. lookOrderInfo : function(id) {
  197. var param = {
  198. orderid : id
  199. }
  200. this.goWin("orderInfo_win", "./orderInfo_win.html", param);
  201. },
  202. init : function() {
  203. this.retariler_id = $api.getStorage("retailerid");
  204. this.getOrderList();
  205. var _this = this;
  206. // 下拉刷新
  207. this.configHeaderRefush(function() {
  208. _this.downData = 'down';
  209. _this.current = 1;
  210. _this.getOrderList();
  211. });
  212. // 上拉分页展示
  213. this.configBottomRefush(function(status) {
  214. if (_this.hasData == true) {
  215. // 开启上拉加载
  216. if (_this.total > _this.current) {
  217. _this.downData = 'up';
  218. _this.current = _this.current + 1;
  219. _this.getOrderList();
  220. } else {
  221. // 上啦没有数据了
  222. _this.upLock = false;
  223. }
  224. }
  225. })
  226. },
  227. // 获取订单列表
  228. getOrderList : function() {
  229. var data = {
  230. retailerId : this.retariler_id,
  231. current : this.current,
  232. status : this.orderStatus,
  233. }, url = this.getOrderListUrl, _this = this;
  234. this.$post(url, data, function(ret) {
  235. if (ret.code == 0) {
  236. _this.total = ret.page.pages;
  237. if (_this.downData == 'up') {
  238. _this.orderList = _this.orderList.concat(ret.page.records);
  239. _this.allList = _this.allList.concat(ret.page.records);
  240. } else {
  241. _this.orderList = ret.page.records;
  242. _this.allList = ret.page.records;
  243. if (_this.allList.length > 0) {
  244. _this.hasData = true;
  245. }else{
  246. _this.hasData = false;
  247. }
  248. }
  249. }
  250. })
  251. },
  252. // 顶部导航栏切换展示
  253. chooseStatus : function(index) {
  254. this.chooseIndex = index;
  255. var newList = new Array();
  256. this.downData = 'down';
  257. this.upLock = true;
  258. this.orderStatus = this.stateArr[index].id;
  259. // if (index == 0) {
  260. this.getOrderList();
  261. // } else {
  262. // this.allList.map(function(i, d) {
  263. // if (i.status == (index - 1)) {
  264. // newList.push(i);
  265. // }
  266. // })
  267. // this.orderList = newList;
  268. // }
  269. }
  270. },
  271. mounted : function() {
  272. this.init();
  273. }
  274. })
  275. }
  276. function chooseIndex(index){
  277. vm.chooseStatus(index);
  278. }
  279. // var tab = new auiTab({
  280. // element : document.getElementById("tab"),
  281. // }, function(ret) {
  282. // console.log(ret)
  283. // });
  284. </script>
  285. </html>