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

137 lines
4.5 KiB

  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const pages_mixins_pullRefreshMixin = require("../mixins/pullRefreshMixin.js");
  4. const emailPopup = () => "../../wxcomponents/email-popup/email-popup.js";
  5. const _sfc_main = {
  6. mixins: [pages_mixins_pullRefreshMixin.pullRefreshMixin],
  7. components: { emailPopup },
  8. data() {
  9. return {
  10. statusBarHeight: 0,
  11. navBarHeight: 0,
  12. // px
  13. navBarHeightRpx: 0,
  14. // rpx
  15. showEmailPopup: false,
  16. showPhonePopup: false,
  17. faqList: []
  18. };
  19. },
  20. onLoad() {
  21. const sysInfo = common_vendor.index.getSystemInfoSync();
  22. this.statusBarHeight = sysInfo.statusBarHeight;
  23. let navBarHeight = 24;
  24. try {
  25. const menuButtonInfo = common_vendor.index.getMenuButtonBoundingClientRect();
  26. navBarHeight = menuButtonInfo.bottom + menuButtonInfo.top - sysInfo.statusBarHeight;
  27. } catch (e) {
  28. }
  29. this.navBarHeight = navBarHeight;
  30. this.navBarHeightRpx = Math.round(navBarHeight * 750 / sysInfo.windowWidth);
  31. this.getQuestionList();
  32. },
  33. computed: {
  34. phone() {
  35. common_vendor.index.__f__("log", "at pages/subcomponent/admin_faq.vue:88", getApp().globalData.configData, "getApp().globalData.configData");
  36. const item = getApp().globalData.configData.find((i) => i.keyName === "phone");
  37. return item ? item.keyContent : "";
  38. }
  39. },
  40. methods: {
  41. async onRefresh() {
  42. await new Promise((resolve) => setTimeout(resolve, 1e3));
  43. common_vendor.index.stopPullRefresh();
  44. },
  45. openEmailPopup() {
  46. this.showEmailPopup = true;
  47. },
  48. handleCloseEmailPopup() {
  49. this.showEmailPopup = false;
  50. },
  51. navigateBack() {
  52. common_vendor.index.navigateBack();
  53. },
  54. callService() {
  55. this.showPhonePopup = true;
  56. },
  57. closePhonePopup() {
  58. this.showPhonePopup = false;
  59. },
  60. makePhoneCall() {
  61. if (this.phone) {
  62. common_vendor.index.makePhoneCall({
  63. phoneNumber: this.phone
  64. //仅为示例
  65. });
  66. } else {
  67. common_vendor.index.showToast({ title: "暂无客服电话", icon: "none" });
  68. }
  69. },
  70. copyEmail() {
  71. if (this.phone) {
  72. common_vendor.index.makePhoneCall({
  73. phoneNumber: this.phone
  74. //仅为示例
  75. });
  76. } else {
  77. common_vendor.index.showToast({ title: "暂无微信客服", icon: "none" });
  78. }
  79. },
  80. getQuestionList() {
  81. this.$api("getQuestionList", {}, (res) => {
  82. if (res && res.success && res.result && res.result.records) {
  83. this.faqList = res.result.records.map((item) => ({
  84. q: item.title,
  85. a: item.titleText
  86. }));
  87. }
  88. });
  89. }
  90. }
  91. };
  92. if (!Array) {
  93. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  94. const _component_email_popup = common_vendor.resolveComponent("email-popup");
  95. (_easycom_uni_icons2 + _component_email_popup)();
  96. }
  97. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  98. if (!Math) {
  99. _easycom_uni_icons();
  100. }
  101. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  102. return common_vendor.e({
  103. a: common_vendor.p({
  104. type: "left",
  105. size: "20"
  106. }),
  107. b: common_vendor.o((...args) => $options.navigateBack && $options.navigateBack(...args)),
  108. c: common_vendor.f($data.faqList, (item, idx, i0) => {
  109. return {
  110. a: common_vendor.t(item.q),
  111. b: common_vendor.t(item.a),
  112. c: idx
  113. };
  114. }),
  115. d: common_vendor.o((...args) => $options.callService && $options.callService(...args)),
  116. e: common_vendor.o((...args) => $options.openEmailPopup && $options.openEmailPopup(...args)),
  117. f: common_vendor.o($options.handleCloseEmailPopup),
  118. g: common_vendor.o($options.copyEmail),
  119. h: common_vendor.p({
  120. show: $data.showEmailPopup
  121. }),
  122. i: $data.showPhonePopup
  123. }, $data.showPhonePopup ? {
  124. j: common_vendor.o((...args) => $options.closePhonePopup && $options.closePhonePopup(...args)),
  125. k: common_vendor.o((...args) => $options.closePhonePopup && $options.closePhonePopup(...args)),
  126. l: common_vendor.t($options.phone),
  127. m: common_vendor.o($options.makePhoneCall),
  128. n: common_vendor.p({
  129. type: "phone-filled",
  130. size: "28",
  131. color: "#222"
  132. })
  133. } : {});
  134. }
  135. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2d4a740c"]]);
  136. wx.createPage(MiniProgramPage);
  137. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/subcomponent/admin_faq.js.map