index.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. "use strict";
  2. var common_vendor = require("../../common/vendor.js");
  3. var api_list = require("../../api/list.js");
  4. require("../../common/request.js");
  5. const _sfc_main = {
  6. data() {
  7. return {
  8. list: null
  9. };
  10. },
  11. onLoad(option) {
  12. this.getList();
  13. },
  14. methods: {
  15. goLive(item) {
  16. var liveId = item.liveId;
  17. common_vendor.index.setStorageSync("liveId", liveId);
  18. console.log("\u8981\u4F20\u7684liveId", liveId);
  19. common_vendor.index.navigateTo({
  20. url: "/pages/home/living"
  21. });
  22. },
  23. getList() {
  24. const data = {
  25. page: 1,
  26. page_size: 10
  27. };
  28. common_vendor.index.showLoading({ title: "\u5904\u7406\u4E2D..." });
  29. api_list.liveList(data).then((res) => {
  30. if (res.code == 200) {
  31. this.list = res.rows;
  32. console.log("list>>", this.list);
  33. } else {
  34. common_vendor.index.showToast({ title: res.msg, icon: "none" });
  35. }
  36. }).catch((rej) => {
  37. console.log("\u8BF7\u6C42\u5931\u8D25:", JSON.stringify(rej));
  38. }).finally(() => {
  39. common_vendor.index.hideLoading();
  40. });
  41. }
  42. }
  43. };
  44. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  45. return {
  46. a: common_vendor.f($data.list, (item, index, i0) => {
  47. return {
  48. a: common_vendor.t(index),
  49. b: common_vendor.o(($event) => $options.goLive(item), index),
  50. c: index
  51. };
  52. })
  53. };
  54. }
  55. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-49d770da"], ["__file", "C:/Users/Administrator/Desktop/\u9879\u76EE/\u76F4\u64AD/liveH5-v3/pages/list/index.vue"]]);
  56. wx.createPage(MiniProgramPage);