index.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. liveId: null
  10. };
  11. },
  12. onLoad(option) {
  13. this.getList();
  14. },
  15. methods: {
  16. goLive(item) {
  17. this.liveId = item.liveId;
  18. console.log("\u8981\u4F20\u7684liveId", this.liveId);
  19. common_vendor.index.navigateTo({
  20. url: "/pages/home/living?liveId=" + this.liveId
  21. });
  22. },
  23. getList() {
  24. const data = {
  25. page: 1,
  26. page_size: 10
  27. };
  28. common_vendor.index.showLoading({
  29. title: "\u5904\u7406\u4E2D..."
  30. });
  31. api_list.liveList(data).then((res) => {
  32. if (res.code == 200) {
  33. this.list = res.rows;
  34. console.log("list>>", this.list);
  35. } else {
  36. common_vendor.index.showToast({
  37. title: res.msg,
  38. icon: "none"
  39. });
  40. }
  41. }).catch((rej) => {
  42. console.log("\u8BF7\u6C42\u5931\u8D25:", JSON.stringify(rej));
  43. }).finally(() => {
  44. common_vendor.index.hideLoading();
  45. });
  46. }
  47. }
  48. };
  49. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  50. return {
  51. a: common_vendor.f($data.list, (item, index, i0) => {
  52. return {
  53. a: item.liveImgUrl,
  54. b: common_vendor.t(item.liveName),
  55. c: common_vendor.o(($event) => $options.goLive(item), index),
  56. d: index
  57. };
  58. })
  59. };
  60. }
  61. 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"]]);
  62. wx.createPage(MiniProgramPage);