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

122 lines
4.1 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. apply: {
  9. name: "周小艺",
  10. phone: "18899102278",
  11. time: "6小时",
  12. applyTime: "2025-03-20 11:00",
  13. status: "待审批"
  14. },
  15. statusBarHeight: 0,
  16. navBarRealHeight: 0
  17. };
  18. },
  19. computed: {
  20. navbarStyle() {
  21. return `padding-top: ${this.statusBarHeight}px;`;
  22. }
  23. },
  24. onLoad(options) {
  25. common_vendor.index.getSystemInfo({
  26. success: (res) => {
  27. this.statusBarHeight = res.statusBarHeight || 20;
  28. }
  29. });
  30. this.$nextTick(() => {
  31. common_vendor.index.createSelectorQuery().select(".navbar").boundingClientRect((rect) => {
  32. if (rect) {
  33. this.navBarRealHeight = rect.height;
  34. }
  35. }).exec();
  36. });
  37. const eventChannel = this.getOpenerEventChannel && this.getOpenerEventChannel();
  38. if (eventChannel) {
  39. eventChannel.on("applyDetail", (apply) => {
  40. this.apply = Object.assign({}, this.apply, apply);
  41. });
  42. }
  43. },
  44. methods: {
  45. goBack() {
  46. common_vendor.index.navigateBack();
  47. },
  48. reject() {
  49. if (!this.apply.id) {
  50. common_vendor.index.showToast({ title: "缺少申请ID", icon: "none" });
  51. return;
  52. }
  53. this.$api && this.$api("rejectPromotionApply", { id: this.apply.id }, (res) => {
  54. if (res && res.code === 200) {
  55. common_vendor.index.showToast({ title: "已驳回", icon: "none" });
  56. this.apply.status = "已驳回";
  57. } else {
  58. common_vendor.index.showToast({ title: "操作失败", icon: "none" });
  59. }
  60. });
  61. },
  62. approve() {
  63. if (!this.apply.id) {
  64. common_vendor.index.showToast({ title: "缺少申请ID", icon: "none" });
  65. return;
  66. }
  67. common_vendor.index.__f__("log", "at pages/manager/tui-apply-detail.vue:116", this.apply);
  68. this.$api && this.$api("passPromotionApply", { id: this.apply.id }, (res) => {
  69. if (res && res.code === 200) {
  70. common_vendor.index.showToast({ title: "已通过", icon: "none" });
  71. this.apply.status = "已确认";
  72. } else {
  73. common_vendor.index.showToast({ title: "操作失败", icon: "none" });
  74. }
  75. });
  76. },
  77. refreshData() {
  78. },
  79. async onRefresh() {
  80. await this.refreshData && this.refreshData();
  81. }
  82. },
  83. onPullDownRefresh() {
  84. this.refreshData && this.refreshData();
  85. common_vendor.index.stopPullDownRefresh();
  86. }
  87. };
  88. if (!Array) {
  89. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  90. _easycom_uni_icons2();
  91. }
  92. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  93. if (!Math) {
  94. _easycom_uni_icons();
  95. }
  96. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  97. return common_vendor.e({
  98. a: common_vendor.p({
  99. type: "back",
  100. size: "24",
  101. color: "#222"
  102. }),
  103. b: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)),
  104. c: common_vendor.s($options.navbarStyle),
  105. d: $data.apply.status === "待审批"
  106. }, $data.apply.status === "待审批" ? {} : $data.apply.status === "已驳回" ? {} : $data.apply.status === "已确认" ? {} : {}, {
  107. e: $data.apply.status === "已驳回",
  108. f: $data.apply.status === "已确认",
  109. g: common_vendor.t($data.apply.name),
  110. h: common_vendor.t($data.apply.phone),
  111. i: common_vendor.t($data.apply.time),
  112. j: common_vendor.t($data.apply.applyTime),
  113. k: $data.navBarRealHeight + "px",
  114. l: $data.apply.status === "待审批"
  115. }, $data.apply.status === "待审批" ? {
  116. m: common_vendor.o((...args) => $options.reject && $options.reject(...args)),
  117. n: common_vendor.o((...args) => $options.approve && $options.approve(...args))
  118. } : {});
  119. }
  120. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-138bea45"]]);
  121. wx.createPage(MiniProgramPage);
  122. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/manager/tui-apply-detail.js.map