index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const common_assets = require("../../common/assets.js");
  4. const _sfc_main = {
  5. data() {
  6. return {
  7. //产品列表
  8. productList: [],
  9. // 请求参数
  10. requestParam: {
  11. name: "",
  12. page: 1
  13. },
  14. // 是否最后一页
  15. isLast: false,
  16. // 是否请求中
  17. isReqing: false
  18. };
  19. },
  20. onShow() {
  21. if (this.isReqing)
  22. return;
  23. this.requestParam.name = "";
  24. this.requestParam.page = 1;
  25. this.isLast = false;
  26. this.isReqing = true;
  27. this.$http.request("api/course/get_list", this.requestParam.page).then((re) => {
  28. this.isReqing = false;
  29. if (re.code == "success") {
  30. if (re.data.last_page <= this.requestParam.page)
  31. this.isLast = true;
  32. this.productList = re.data.data;
  33. }
  34. });
  35. },
  36. methods: {}
  37. };
  38. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  39. return {
  40. a: common_vendor.f(2, (item, index, i0) => {
  41. return {
  42. a: common_vendor.t(item.course_name),
  43. b: common_vendor.t(item.desc),
  44. c: common_vendor.t(item.course_number),
  45. d: common_vendor.t(item.reservation_number),
  46. e: common_vendor.t(item.price_total),
  47. f: index
  48. };
  49. }),
  50. b: common_assets._imports_0$1,
  51. c: common_vendor.t()
  52. };
  53. }
  54. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  55. wx.createPage(MiniProgramPage);