list.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. // pages/order/admin/list/list.js
  2. var app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. statusUserList: [{
  9. id: '',
  10. name: "全部"
  11. }, {
  12. id: 0,
  13. name: "待审核"
  14. },
  15. {
  16. id: 1,
  17. name: "已审核"
  18. },
  19. {
  20. id: 2,
  21. name: "审核终止"
  22. },
  23. {
  24. id: 3,
  25. name: "已发货"
  26. },
  27. {
  28. id: 4,
  29. name: "已签收"
  30. },
  31. {
  32. id: 5,
  33. name: "已取消"
  34. },
  35. ],
  36. statusAdminList: [{
  37. id: '',
  38. name: "全部"
  39. }, {
  40. id: 0,
  41. name: "待审核"
  42. },
  43. {
  44. id: 1,
  45. name: "审核通过"
  46. },
  47. {
  48. id: 2,
  49. name: "已终止"
  50. },
  51. {
  52. id: 3,
  53. name: "超时自动取消"
  54. },
  55. {
  56. id: 4,
  57. name: "人工取消"
  58. }
  59. ],
  60. queryList: [{
  61. column: "checkNumber",
  62. name: "订单编号",
  63. text: "请输入订单编号"
  64. },
  65. {
  66. column: "dvyFlowId",
  67. name: "快递单号",
  68. text: "请输入快递单号"
  69. },
  70. {
  71. column: "picTitle",
  72. name: "商品名称",
  73. text: "请输入商品名称"
  74. },
  75. {
  76. column: "createTime",
  77. name: "下单时间",
  78. text: "开始日期 - 结束日期",
  79. type: 1
  80. },
  81. ],
  82. valueText: "",
  83. queryIndex: 3,
  84. queryShow: false,
  85. skuCode: "", //商品编码SKU
  86. checkStatus: 0, //订单状态
  87. checkNumber: "", //订单编号
  88. dvyFlowId: "", //快递单号
  89. picTitle: "", //商品名称
  90. orderTimeStart: "",
  91. orderTimeEnd: "",
  92. current: 0,
  93. orderList: [],
  94. current: 0,
  95. pages: null,
  96. loading: true
  97. },
  98. /**
  99. * 生命周期函数--监听页面加载
  100. */
  101. onLoad(options) {
  102. this.setData({
  103. checkStatus: options.status || 0
  104. })
  105. },
  106. /**
  107. * 生命周期函数--监听页面初次渲染完成
  108. */
  109. onReady() {
  110. },
  111. /**
  112. * 生命周期函数--监听页面显示
  113. */
  114. async onShow() {
  115. await this.initData();
  116. this.setData({
  117. loading: false
  118. })
  119. },
  120. async initData(d) {
  121. let userInfo = wx.getStorageSync('userInfo');
  122. this.setData({
  123. current: this.data.current + 1,
  124. loadding: true
  125. });
  126. let {
  127. data
  128. } = await app.ajax.get({
  129. url: `/admin/bxdordercheck/queryByMini`,
  130. data: {
  131. orderSaleId: userInfo.userId,
  132. checkStatus: this.data.statusUserList[this.data.checkStatus].id,
  133. checkNumber: this.data.checkNumber,
  134. orderTimeStart: this.data.orderTimeStart ? this.data.orderTimeStart + ' 00:00:00' : '',
  135. orderTimeEnd: this.data.orderTimeEnd ? this.data.orderTimeEnd + ' 23:59:59' : '',
  136. current: d && d.current != undefined ? d.current : this.data.current,
  137. size: 20,
  138. }
  139. });
  140. this.setData({
  141. current: this.data.current,
  142. orderList: this.data.orderList.concat(data.data.records),
  143. pages: data.data.pages || null,
  144. loadding: false
  145. })
  146. // admin/bxdorder/query?activityImgs=&companyId=56&companyName=HZRCS&createTime=&current=1&desc=create_time&mobile=&orderCheckNumber=&orderNumber=&orderSaleName&receiverName=&size=10&status=
  147. },
  148. async queryData(e) {
  149. this.setData({
  150. orderList: [],
  151. checkStatus: 0
  152. })
  153. await this.initData({
  154. current: 0
  155. });
  156. },
  157. chooseQuery(e) {
  158. if (this.data.queryIndex == e.currentTarget.dataset.index) {
  159. return;
  160. }
  161. this.setData({
  162. checkNumber: "", //订单编号
  163. dvyFlowId: "", //快递单号
  164. picTitle: "", //商品名称
  165. orderTimeStart: "",
  166. orderTimeEnd: "",
  167. valueText: "",
  168. })
  169. this.setData({
  170. queryShow: !this.data.queryShow
  171. })
  172. },
  173. chooseQueryItem(e) {
  174. if (this.data.queryIndex == e.currentTarget.dataset.index) {
  175. return;
  176. }
  177. this.setData({
  178. checkNumber: "", //订单编号
  179. dvyFlowId: "", //快递单号
  180. picTitle: "", //商品名称
  181. orderTimeStart: "",
  182. orderTimeEnd: "",
  183. valueText: "",
  184. })
  185. this.setData({
  186. queryShow: !this.data.queryShow,
  187. queryIndex: e.currentTarget.dataset.index
  188. })
  189. },
  190. async changeTabbar(e, a) {
  191. if (this.data.checkStatus == e.detail.index) {
  192. return;
  193. }
  194. this.setData({
  195. orderList: [],
  196. checkStatus: e.detail.index
  197. })
  198. await this.initData(0);
  199. },
  200. bindinputchange(e) {
  201. this.setData({
  202. valueText: e.detail.value,
  203. [e.currentTarget.dataset.name]: e.detail.value
  204. })
  205. },
  206. bindchange1(e) {
  207. this.setData({
  208. orderTimeStart: e.detail.value
  209. })
  210. },
  211. bindchange2(e) {
  212. this.setData({
  213. orderTimeEnd: e.detail.value
  214. })
  215. },
  216. cleanDate(e) {
  217. this.setData({
  218. checkNumber: "", //订单编号
  219. dvyFlowId: "", //快递单号
  220. picTitle: "", //商品名称
  221. orderTimeStart: "",
  222. orderTimeEnd: "",
  223. valueText: "",
  224. })
  225. },
  226. /**
  227. * 生命周期函数--监听页面隐藏
  228. */
  229. onHide() {
  230. },
  231. /**
  232. * 生命周期函数--监听页面卸载
  233. */
  234. onUnload() {
  235. },
  236. /**
  237. * 页面相关事件处理函数--监听用户下拉动作
  238. */
  239. onPullDownRefresh() {
  240. },
  241. /**
  242. * 页面上拉触底事件的处理函数
  243. */
  244. onReachBottom() {
  245. },
  246. /**
  247. * 用户点击右上角分享
  248. */
  249. onShareAppMessage() {
  250. }
  251. })