feedback.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const common_assets = require("../../common/assets.js");
  4. const _sfc_main = {
  5. data() {
  6. return {
  7. content: "",
  8. typeList: ["功能建议", "内容问题", "BUG反馈", "其他"],
  9. typeIdx: 0,
  10. history: []
  11. };
  12. },
  13. methods: {
  14. onTypeChange(e) {
  15. this.typeIdx = e.detail.value;
  16. },
  17. submit() {
  18. if (!this.content) {
  19. common_vendor.index.showToast({ title: "请填写反馈内容", icon: "none" });
  20. return;
  21. }
  22. this.history.unshift({
  23. id: Date.now(),
  24. type: this.typeList[this.typeIdx],
  25. content: this.content
  26. });
  27. this.content = "";
  28. common_vendor.index.showToast({ title: "反馈已提交", icon: "success" });
  29. }
  30. }
  31. };
  32. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  33. return common_vendor.e({
  34. a: common_assets._imports_0$3,
  35. b: $data.content,
  36. c: common_vendor.o(($event) => $data.content = $event.detail.value),
  37. d: common_vendor.t($data.typeList[$data.typeIdx]),
  38. e: $data.typeList,
  39. f: $data.typeIdx,
  40. g: common_vendor.o((...args) => $options.onTypeChange && $options.onTypeChange(...args)),
  41. h: common_vendor.o((...args) => $options.submit && $options.submit(...args)),
  42. i: $data.history.length === 0
  43. }, $data.history.length === 0 ? {} : {
  44. j: common_vendor.f($data.history, (item, k0, i0) => {
  45. return {
  46. a: common_vendor.t(item.type),
  47. b: common_vendor.t(item.content),
  48. c: item.id
  49. };
  50. })
  51. });
  52. }
  53. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  54. wx.createPage(MiniProgramPage);
  55. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine/feedback.js.map