1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const api_list = require("../../api/list.js");
- const _sfc_main = {
- data() {
- return {
- list: null,
- liveId: null
- };
- },
- onLoad(option) {
- this.getList();
- },
- methods: {
- goLive(item) {
- this.liveId = item.liveId;
- console.log("要传的liveId", this.liveId);
- common_vendor.index.navigateTo({
- url: "/pages/home/living?liveId=" + this.liveId
- // url: `/pages/home/living?liveId=${encodeURIComponent(JSON.stringify(liveId))}`
- });
- },
- getList() {
- const data = {
- page: 1,
- page_size: 10
- };
- common_vendor.index.showLoading({
- title: "处理中..."
- });
- api_list.liveList(data).then((res) => {
- if (res.code == 200) {
- this.list = res.rows;
- console.log("list>>", this.list);
- } else {
- common_vendor.index.showToast({
- title: res.msg,
- icon: "none"
- });
- }
- }).catch((rej) => {
- console.log("请求失败:", JSON.stringify(rej));
- }).finally(() => {
- common_vendor.index.hideLoading();
- });
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return {
- a: common_vendor.f($data.list, (item, index, i0) => {
- return {
- a: item.liveImgUrl,
- b: common_vendor.t(item.liveName),
- c: common_vendor.o(($event) => $options.goLive(item), index),
- d: index
- };
- })
- };
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7bd28468"]]);
- wx.createPage(MiniProgramPage);
|