jiuyiUniapp/jiuyi2/unpackage/dist/dev/mp-weixin/pages/index/myTeam.js

108 lines
2.9 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const api_myteam = require("../../api/myteam.js");
const api_intergral = require("../../api/intergral.js");
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
const _sfc_main = {
__name: "myTeam",
setup(__props) {
const store = common_vendor.useStore();
common_vendor.computed(() => {
let result = store.state.userinfo;
return result;
});
const myQrcodeData = common_vendor.ref("");
const teamData = common_vendor.ref([]);
const lowData = common_vendor.ref([]);
myQrcode();
myTeam();
function myTeam() {
api_myteam.myTeam.myTeam({}).then((rs) => {
teamData.value = rs.data;
console.log(rs);
});
}
function lowTeam(item) {
if (item.showSecond) {
item.showSecond = false;
lowData.value.length = 0;
return;
}
api_myteam.myTeam.lowTeam({
query: {
parentId: item.userId
}
}).then((rs) => {
if (rs.code == 200) {
lowData.value = rs.data;
if (rs.data.length > 0) {
item.showSecond = true;
}
return;
}
util.alert({
content: rs.msg,
showCancel: false
});
});
}
function myQrcode() {
api_intergral.intergral.myQrcode({}).then((rs) => {
if (rs.code == 200 && rs.data) {
myQrcodeData.value = rs.data;
}
});
}
return (_ctx, _cache) => {
return {
a: myQrcodeData.value,
b: common_vendor.p({
type: "right"
}),
c: common_vendor.f(teamData.value, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.nickName),
b: item.showSecond
}, item.showSecond ? {
c: common_vendor.o$1(($event) => lowTeam(item), index),
d: "a7259f58-1-" + i0,
e: common_vendor.p({
type: "up",
color: "#A45EFF",
size: "28rpx"
})
} : {
f: common_vendor.o$1(($event) => lowTeam(item), index),
g: "a7259f58-2-" + i0,
h: common_vendor.p({
type: "plusempty",
color: "#A45EFF",
size: "28rpx"
})
}, {
i: item.showSecond
}, item.showSecond ? {
j: common_vendor.f(lowData.value, (secItem, secIndex, i1) => {
return {
a: common_vendor.t(secItem.nickName),
b: secIndex == 0 ? 1 : "",
c: secIndex
};
})
} : {}, {
k: index
});
})
};
};
}
};
wx.createPage(_sfc_main);