爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

91 lines
2.8 KiB

"use strict";
const common_vendor = require("../../common/vendor.js");
const pages_mixins_pullRefreshMixin = require("../mixins/pullRefreshMixin.js");
const _sfc_main = {
mixins: [pages_mixins_pullRefreshMixin.pullRefreshMixin],
data() {
return {
staff: {
name: "冯启彬",
phone: "18899102278",
role: "质检员"
},
statusBarHeight: 0
};
},
computed: {
navbarStyle() {
return `padding-top: ${this.statusBarHeight}px;`;
}
},
onLoad(options) {
common_vendor.index.getSystemInfo({
success: (res) => {
this.statusBarHeight = res.statusBarHeight || 20;
}
});
const eventChannel = this.getOpenerEventChannel && this.getOpenerEventChannel();
if (eventChannel) {
eventChannel.on("staffDetail", (staff) => {
this.staff = Object.assign({}, this.staff, staff);
});
}
},
methods: {
goBack() {
common_vendor.index.navigateBack();
},
removeStaff() {
if (!this.staff.id) {
common_vendor.index.showToast({ title: "缺少员工ID", icon: "none" });
return;
}
this.$api && this.$api("removeMember", { id: this.staff.id }, (res) => {
if (res && res.code === 200) {
common_vendor.index.showToast({ title: "已解除员工", icon: "none" });
setTimeout(() => {
common_vendor.index.$emit("refreshStaffList");
common_vendor.index.navigateBack();
}, 500);
} else {
common_vendor.index.showToast({ title: "操作失败", icon: "none" });
}
});
},
refreshData() {
},
async onRefresh() {
await this.refreshData && this.refreshData();
}
},
onPullDownRefresh() {
this.refreshData && this.refreshData();
common_vendor.index.stopPullDownRefresh();
}
};
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();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.p({
type: "back",
size: "24",
color: "#222"
}),
b: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)),
c: common_vendor.s($options.navbarStyle),
d: common_vendor.t($data.staff.name),
e: common_vendor.t($data.staff.phone),
f: common_vendor.t($data.staff.role),
g: common_vendor.o((...args) => $options.removeStaff && $options.removeStaff(...args))
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ede25f3a"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/manager/staff-detail.js.map