Files
tk-mini-program/unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/anchorLibrary.js
pengxiaolong 8ec7365e7c 优化页面
2025-06-16 22:09:12 +08:00

137 lines
4.2 KiB
JavaScript

"use strict";
const common_vendor = require("../../../common/vendor.js");
const components_request = require("../../../components/request.js");
const anchorLibrary = () => "./addStreamer/addStreamer.js";
const modifyStreamer = () => "./modifyStreamer/modifyStreamer.js";
const _sfc_main = {
data() {
return {
userinfo: {},
AnchorList: [],
triggered: false,
modifyStreamerMessage: {}
};
},
onLoad() {
common_vendor.index.getStorage({
key: "userinfo",
success: (res) => {
this.userinfo = res.data;
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/anchorLibrary.vue:110", this.userinfo);
this.getAnchorList();
}
});
},
methods: {
// 重新编辑主播信息
onRecompose(item) {
this.modifyStreamerMessage = item;
this.$refs.modifyStreamer.open();
},
// 删除主播信息
onExpurgate(item) {
components_request.request({
url: "anchor/deleteMyAnchor",
method: "POST",
data: {
id: item.id
},
userInfo: true
}).then((res) => {
this.triggered = false;
if (res.code == 200) {
common_vendor.index.showToast({
title: "删除成功",
icon: "success",
duration: 2e3
});
this.getAnchorList();
} else {
common_vendor.index.showToast({
title: res.msg,
icon: "success",
duration: 2e3
});
}
});
},
//获取主播列表
getAnchorList() {
components_request.request({
url: "anchor/list",
method: "POST",
data: {
id: this.userinfo.id
},
userInfo: true
}).then((res) => {
this.triggered = false;
if (res.code == 200) {
this.AnchorList = res.data;
} else {
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/anchorLibrary.vue:162", res.msg);
}
});
},
//打开弹窗,添加主播
openPopupQuantity() {
this.$refs.createModule.open();
},
// 下拉刷新
onRefresherRefresh() {
this.triggered = true;
this.getAnchorList();
},
// 返回上一页
onBack() {
common_vendor.wx$1.navigateBack({
delta: 1
});
}
},
components: {
anchorLibrary,
modifyStreamer
}
};
if (!Array) {
const _component_uni_card = common_vendor.resolveComponent("uni-card");
const _component_anchorLibrary = common_vendor.resolveComponent("anchorLibrary");
const _component_modifyStreamer = common_vendor.resolveComponent("modifyStreamer");
(_component_uni_card + _component_anchorLibrary + _component_modifyStreamer)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.o$1((...args) => $options.onBack && $options.onBack(...args)),
b: common_vendor.f($data.AnchorList, (item, index, i0) => {
return common_vendor.e({
a: item.headerIcon,
b: common_vendor.t(item.anchorId),
c: item.gender === 2
}, item.gender === 2 ? {} : {}, {
d: common_vendor.t(item.gender === 1 ? "男" : "女"),
e: item.gender === 1 ? 1 : "",
f: item.gender === 2 ? 1 : "",
g: common_vendor.t(item.country),
h: common_vendor.o$1(($event) => $options.onRecompose(item), index),
i: common_vendor.o$1(($event) => $options.onExpurgate(item), index),
j: index,
k: "daea6b33-0-" + i0
});
}),
c: common_vendor.o$1((...args) => $options.onRefresherRefresh && $options.onRefresherRefresh(...args)),
d: $data.triggered,
e: common_vendor.o$1(($event) => $options.openPopupQuantity()),
f: common_vendor.sr("createModule", "daea6b33-1"),
g: common_vendor.o$1($options.getAnchorList),
h: common_vendor.sr("modifyStreamer", "daea6b33-2"),
i: common_vendor.o$1($options.getAnchorList),
j: common_vendor.p({
message: $data.modifyStreamerMessage
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-daea6b33"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/Mine/minecomponents/anchorLibrary.js.map