orderList_body.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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. {{item.agentName}}
  114. </div>-->
  115. </div>
  116. <!--<div class="aui-card-list-user-name zmq-flex">
  117. <div class="aui-font-size-14 zmq-text-msg">
  118. {{item.agentName}}
  119. </div>
  120. </div>-->
  121. <div class="aui-card-list-user-name zmq-flex">
  122. <div class="aui-font-size-14 zmq-text-explain">
  123. 下单时间:{{item.createTime}}
  124. </div>
  125. <div class="aui-font-size-14">
  126. 共 <span class="zmq-text-msg">{{item.amount}}</span> 件商品
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </section>
  132. <img v-show="hasData == false" src="../../image/nodata.png" />
  133. <div v-show="upLock == false" class="zmq-text-explain zmq-margin-top-10 zmq-textAlign-center zmq-margin-bottom-10 zmq-block-text">
  134. 已无更多数据
  135. </div>
  136. </div>
  137. </body>
  138. <!--<script type="text/javascript" src="../../script/aui-tab.js" ></script>-->
  139. <script type="text/javascript" src="../../script/api.js"></script>
  140. <script type="text/javascript" src="../../script/aui-scroll.js"></script>
  141. <script type="text/javascript" src="../../script/vue.js"></script>
  142. <script type="text/javascript" src="../../script/httpRequest.js"></script>
  143. <script type="text/javascript" src="../../script/vue_plugins.js"></script>
  144. <script type="text/javascript">
  145. var vm = "";
  146. apiready = function() {
  147. var type = api.pageParam.type;
  148. vm = new Vue({
  149. el : '#app',
  150. data : {
  151. type : type,
  152. // 获取订单列表
  153. getOrderListUrl : 'getOrderListUrl',
  154. // agentId 写死的经销商id
  155. retariler_id : '',
  156. // 订单列表
  157. orderList : [],
  158. allList : [], // 展示的全部的列表
  159. // 分页展示
  160. stateArr : [{
  161. name : "全部订单",
  162. id : '',
  163. }, {
  164. name : "待接单",
  165. id : 0
  166. }, {
  167. name : "已接单",
  168. id : 1
  169. }, {
  170. name : "已驳回",
  171. id : 2
  172. }],
  173. // 是否有数据
  174. hasData : false,
  175. // 顶部导航栏点击且换
  176. chooseIndex : 0,
  177. // 分页展示
  178. upLock : true,
  179. current : 1,
  180. total : 1,
  181. // 订单状态
  182. orderStatus : '',
  183. },
  184. filters : {
  185. statusToStr : function(status) {
  186. var str = "";
  187. switch (status) {
  188. case '0':
  189. str = "待经销商接单";
  190. break;
  191. case '1':
  192. str = "经销商已接单";
  193. break;
  194. default :
  195. break;
  196. }
  197. return str
  198. }
  199. },
  200. methods : {
  201. lookOrderInfo : function(id) {
  202. var param = {
  203. orderid : id
  204. }
  205. this.goWin("orderInfo_win", "./orderInfo_win.html", param);
  206. },
  207. init : function() {
  208. this.retariler_id = $api.getStorage("retailerid");
  209. this.getOrderList();
  210. var _this = this;
  211. // 下拉刷新
  212. this.configHeaderRefush(function() {
  213. _this.downData = 'down';
  214. _this.current = 1;
  215. _this.getOrderList();
  216. });
  217. // 上拉分页展示
  218. this.configBottomRefush(function(status) {
  219. if (_this.hasData == true) {
  220. // 开启上拉加载
  221. if (_this.total > _this.current) {
  222. _this.downData = 'up';
  223. _this.current = _this.current + 1;
  224. _this.getOrderList();
  225. } else {
  226. // 上啦没有数据了
  227. _this.upLock = false;
  228. }
  229. }
  230. })
  231. },
  232. // 获取订单列表
  233. getOrderList : function() {
  234. var data = {
  235. retailerId : this.retariler_id,
  236. current : this.current,
  237. status : this.orderStatus,
  238. }, url = this.getOrderListUrl, _this = this;
  239. this.$post(url, data, function(ret) {
  240. if (ret.code == 0) {
  241. _this.total = ret.page.pages;
  242. if (_this.downData == 'up') {
  243. _this.orderList = _this.orderList.concat(ret.page.records);
  244. _this.allList = _this.allList.concat(ret.page.records);
  245. } else {
  246. _this.orderList = ret.page.records;
  247. _this.allList = ret.page.records;
  248. if (_this.allList.length > 0) {
  249. _this.hasData = true;
  250. } else {
  251. _this.hasData = false;
  252. }
  253. }
  254. }
  255. })
  256. },
  257. // 顶部导航栏切换展示
  258. chooseStatus : function(index) {
  259. this.chooseIndex = index;
  260. var newList = new Array();
  261. this.downData = 'down';
  262. this.upLock = true;
  263. this.orderStatus = this.stateArr[index].id;
  264. // if (index == 0) {
  265. this.getOrderList();
  266. // } else {
  267. // this.allList.map(function(i, d) {
  268. // if (i.status == (index - 1)) {
  269. // newList.push(i);
  270. // }
  271. // })
  272. // this.orderList = newList;
  273. // }
  274. }
  275. },
  276. mounted : function() {
  277. this.init();
  278. }
  279. })
  280. }
  281. function chooseIndex(index) {
  282. vm.chooseStatus(index);
  283. }
  284. // var tab = new auiTab({
  285. // element : document.getElementById("tab"),
  286. // }, function(ret) {
  287. // console.log(ret)
  288. // });
  289. </script>
  290. </html>