爱简收旧衣按件回收前端代码仓库
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

  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const pages_mixins_pullRefreshMixin = require("../mixins/pullRefreshMixin.js");
  4. const _sfc_main = {
  5. mixins: [pages_mixins_pullRefreshMixin.pullRefreshMixin],
  6. data() {
  7. return {
  8. staff: {
  9. name: "冯启彬",
  10. phone: "18899102278",
  11. role: "质检员"
  12. },
  13. statusBarHeight: 0
  14. };
  15. },
  16. computed: {
  17. navbarStyle() {
  18. return `padding-top: ${this.statusBarHeight}px;`;
  19. }
  20. },
  21. onLoad(options) {
  22. common_vendor.index.getSystemInfo({
  23. success: (res) => {
  24. this.statusBarHeight = res.statusBarHeight || 20;
  25. }
  26. });
  27. const eventChannel = this.getOpenerEventChannel && this.getOpenerEventChannel();
  28. if (eventChannel) {
  29. eventChannel.on("staffDetail", (staff) => {
  30. this.staff = Object.assign({}, this.staff, staff);
  31. });
  32. }
  33. },
  34. methods: {
  35. goBack() {
  36. common_vendor.index.navigateBack();
  37. },
  38. removeStaff() {
  39. if (!this.staff.id) {
  40. common_vendor.index.showToast({ title: "缺少员工ID", icon: "none" });
  41. return;
  42. }
  43. this.$api && this.$api("removeMember", { id: this.staff.id }, (res) => {
  44. if (res && res.code === 200) {
  45. common_vendor.index.showToast({ title: "已解除员工", icon: "none" });
  46. setTimeout(() => {
  47. common_vendor.index.$emit("refreshStaffList");
  48. common_vendor.index.navigateBack();
  49. }, 500);
  50. } else {
  51. common_vendor.index.showToast({ title: "操作失败", icon: "none" });
  52. }
  53. });
  54. },
  55. refreshData() {
  56. },
  57. async onRefresh() {
  58. await this.refreshData && this.refreshData();
  59. }
  60. },
  61. onPullDownRefresh() {
  62. this.refreshData && this.refreshData();
  63. common_vendor.index.stopPullDownRefresh();
  64. }
  65. };
  66. if (!Array) {
  67. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  68. _easycom_uni_icons2();
  69. }
  70. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  71. if (!Math) {
  72. _easycom_uni_icons();
  73. }
  74. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  75. return {
  76. a: common_vendor.p({
  77. type: "back",
  78. size: "24",
  79. color: "#222"
  80. }),
  81. b: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)),
  82. c: common_vendor.s($options.navbarStyle),
  83. d: common_vendor.t($data.staff.name),
  84. e: common_vendor.t($data.staff.phone),
  85. f: common_vendor.t($data.staff.role),
  86. g: common_vendor.o((...args) => $options.removeStaff && $options.removeStaff(...args))
  87. };
  88. }
  89. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ede25f3a"]]);
  90. wx.createPage(MiniProgramPage);
  91. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/manager/staff-detail.js.map