search.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. require("../api/common.js");
  4. require("../common/request.js");
  5. const _sfc_main = {
  6. data() {
  7. return {
  8. searchHistory: [],
  9. searchKey: "",
  10. statusBarHeight: common_vendor.index.getStorageSync("menuInfo").statusBarHeight
  11. };
  12. },
  13. onLoad() {
  14. this.searchHistory = this.$getHisSearch();
  15. },
  16. methods: {
  17. clearHistory() {
  18. this.$clearHisSearch();
  19. this.searchHistory = this.$getHisSearch();
  20. },
  21. back() {
  22. common_vendor.index.navigateBack({
  23. delta: 1
  24. });
  25. },
  26. goSearchList(key) {
  27. common_vendor.index.navigateTo({
  28. url: "/pages_doctor/doctorList?keyword=" + key
  29. });
  30. },
  31. toSearchList() {
  32. if (this.searchKey != "") {
  33. this.$addHisSearch(this.searchKey);
  34. }
  35. common_vendor.index.navigateTo({
  36. url: "/pages_doctor/doctorList?keyword=" + this.searchKey
  37. });
  38. }
  39. }
  40. };
  41. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  42. return {
  43. a: $data.statusBarHeight,
  44. b: common_vendor.o(($event) => $options.back()),
  45. c: common_vendor.o(($event) => $options.toSearchList($data.searchKey)),
  46. d: $data.searchKey,
  47. e: common_vendor.o(($event) => $data.searchKey = $event.detail.value),
  48. f: common_vendor.o((...args) => $options.toSearchList && $options.toSearchList(...args)),
  49. g: common_vendor.o(($event) => $options.clearHistory()),
  50. h: common_vendor.f($data.searchHistory, (item, index, i0) => {
  51. return {
  52. a: common_vendor.t(item),
  53. b: common_vendor.o(($event) => $options.goSearchList(item), index),
  54. c: index
  55. };
  56. })
  57. };
  58. }
  59. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-f6a74fa4"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/search.vue"]]);
  60. wx.createPage(MiniProgramPage);