orderManage.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/app/orderManage" ], {
  2. 357: function(e, n, t) {
  3. (function(e) {
  4. function n(e) {
  5. return e && e.__esModule ? e : {
  6. default: e
  7. };
  8. }
  9. t(4), n(t(2)), e(n(t(358)).default);
  10. }).call(this, t(1).createPage);
  11. },
  12. 358: function(e, n, t) {
  13. t.r(n);
  14. var o = t(359), r = t(361);
  15. for (var a in r) "default" !== a && function(e) {
  16. t.d(n, e, function() {
  17. return r[e];
  18. });
  19. }(a);
  20. t(363);
  21. var i = t(13), c = Object(i.default)(r.default, o.render, o.staticRenderFns, !1, null, null, null, !1, o.components, void 0);
  22. c.options.__file = "pages/app/orderManage.vue", n.default = c.exports;
  23. },
  24. 359: function(e, n, t) {
  25. t.r(n);
  26. var o = t(360);
  27. t.d(n, "render", function() {
  28. return o.render;
  29. }), t.d(n, "staticRenderFns", function() {
  30. return o.staticRenderFns;
  31. }), t.d(n, "recyclableRender", function() {
  32. return o.recyclableRender;
  33. }), t.d(n, "components", function() {
  34. return o.components;
  35. });
  36. },
  37. 360: function(e, n, t) {
  38. var o;
  39. t.r(n), t.d(n, "render", function() {
  40. return r;
  41. }), t.d(n, "staticRenderFns", function() {
  42. return i;
  43. }), t.d(n, "recyclableRender", function() {
  44. return a;
  45. }), t.d(n, "components", function() {
  46. return o;
  47. });
  48. try {
  49. o = {
  50. uniLoadMore: function() {
  51. return t.e("components/uni-load-more/uni-load-more").then(t.bind(null, 413));
  52. }
  53. };
  54. } catch (e) {
  55. if (-1 === e.message.indexOf("Cannot find module") || -1 === e.message.indexOf(".vue")) throw e;
  56. console.error(e.message), console.error("1. 排查组件名称拼写是否正确"), console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),
  57. console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件");
  58. }
  59. var r = function() {
  60. var e = this, n = (e.$createElement, e._self._c, e.__map(e.navList, function(n, t) {
  61. return {
  62. $orig: e.__get_orig(n),
  63. l1: e.__map(n.orderList, function(n, t) {
  64. return {
  65. $orig: e.__get_orig(n),
  66. l0: e.__map(n.cartInfo, function(t, o) {
  67. return {
  68. $orig: e.__get_orig(t),
  69. m0: 1 === n.cartInfo.length ? e.moneyNum(t.productInfo.price) : null
  70. };
  71. }),
  72. m1: e.moneyNum(n.pay_postage),
  73. m2: e.moneyNum(n.pay_price)
  74. };
  75. })
  76. };
  77. }));
  78. e.$mp.data = Object.assign({}, {
  79. $root: {
  80. l2: n
  81. }
  82. });
  83. }, a = !1, i = [];
  84. r._withStripped = !0;
  85. },
  86. 361: function(e, n, t) {
  87. t.r(n);
  88. var o = t(362), r = t.n(o);
  89. for (var a in o) "default" !== a && function(e) {
  90. t.d(n, e, function() {
  91. return o[e];
  92. });
  93. }(a);
  94. n.default = r.a;
  95. },
  96. 362: function(e, n, t) {
  97. (function(e) {
  98. Object.defineProperty(n, "__esModule", {
  99. value: !0
  100. }), n.default = void 0;
  101. var o = t(354), r = {
  102. components: {
  103. uniLoadMore: function() {
  104. t.e("components/uni-load-more/uni-load-more").then(function() {
  105. return resolve(t(413));
  106. }.bind(null, t)).catch(t.oe);
  107. },
  108. empty: function() {
  109. t.e("components/empty").then(function() {
  110. return resolve(t(420));
  111. }.bind(null, t)).catch(t.oe);
  112. }
  113. },
  114. data: function() {
  115. return {
  116. tabCurrentIndex: 0,
  117. navList: [ {
  118. state: 1,
  119. text: "待发货",
  120. loadingType: "more",
  121. orderList: [],
  122. page: 1,
  123. limit: 10
  124. }, {
  125. state: 2,
  126. text: "待收货",
  127. loadingType: "more",
  128. orderList: [],
  129. page: 1,
  130. limit: 10
  131. }, {
  132. state: 3,
  133. text: "待评价",
  134. loadingType: "more",
  135. orderList: [],
  136. page: 1,
  137. limit: 10
  138. }, {
  139. state: 4,
  140. text: "已完成",
  141. loadingType: "more",
  142. orderList: [],
  143. page: 1,
  144. limit: 10
  145. } ]
  146. };
  147. },
  148. onLoad: function(e) {
  149. this.tabCurrentIndex = +e.state || 0, 0 == e.state && this.loadData();
  150. },
  151. methods: {
  152. moneyNum: function(e) {
  153. return +e;
  154. },
  155. loadData: function(n) {
  156. var t = this, r = this.tabCurrentIndex, a = this.navList[r], i = a.state;
  157. "tabChange" === n && !0 === a.loaded || "loading" !== a.loadingType && "noMore" !== a.loadingType && (a.loadingType = "loading",
  158. (0, o.orderList)({
  159. type: i,
  160. page: a.page,
  161. limit: a.limit
  162. }).then(function(n) {
  163. var o = n.data;
  164. console.log(o);
  165. var r = o.data.map(function(e) {
  166. var n = t.orderStateExp(e.status);
  167. return e.stateTip = n.stateTip, e.stateTipColor = n.stateTipColor, e;
  168. });
  169. a.orderList = a.orderList.concat(r), a.page++, a.limit != o.length ? (a.loadingType = "noMore",
  170. e.hideLoading(), t.$set(a, "loaded", !0)) : a.loadingType = "more";
  171. }).catch(function(e) {
  172. console.log(e);
  173. }));
  174. },
  175. changeTab: function(e) {
  176. this.tabCurrentIndex = e.target.current, this.loadData("tabChange");
  177. },
  178. tabClick: function(e) {
  179. this.tabCurrentIndex = e;
  180. },
  181. deleteOrder: function(n) {
  182. var t = this;
  183. e.showLoading({
  184. title: "请稍后"
  185. }), setTimeout(function() {
  186. t.navList[t.tabCurrentIndex].orderList.splice(n, 1), e.hideLoading();
  187. }, 600);
  188. },
  189. orderStateExp: function(e) {
  190. var n = "", t = "#fa436a";
  191. switch (+e) {
  192. case 0:
  193. n = "待付款";
  194. break;
  195. case 1:
  196. n = "待发货";
  197. break;
  198. case 2:
  199. n = "待收货";
  200. break;
  201. case 3:
  202. n = "待评价";
  203. break;
  204. case 4:
  205. n = "已完成", t = "#5dbc7c";
  206. break;
  207. case 9:
  208. n = "订单已关闭", t = "#909399";
  209. }
  210. return {
  211. stateTip: n,
  212. stateTipColor: t
  213. };
  214. }
  215. }
  216. };
  217. n.default = r;
  218. }).call(this, t(1).default);
  219. },
  220. 363: function(e, n, t) {
  221. t.r(n);
  222. var o = t(364), r = t.n(o);
  223. for (var a in o) "default" !== a && function(e) {
  224. t.d(n, e, function() {
  225. return o[e];
  226. });
  227. }(a);
  228. n.default = r.a;
  229. },
  230. 364: function(e, n, t) {}
  231. }, [ [ 357, "common/runtime", "common/vendor" ] ] ]);