合同小程序前端代码仓库
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.

143 lines
4.5 KiB

  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const common_assets = require("../../common/assets.js");
  4. const _sfc_main = common_vendor.defineComponent({
  5. data() {
  6. return {
  7. ServiceName: "",
  8. title: "北京汽车有限公司",
  9. isshow: false,
  10. isshow_1: false,
  11. newListData: [],
  12. allMsg: [
  13. new UTSJSONObject({ name: "myhua", id: 1 }),
  14. new UTSJSONObject({ name: "mp3", id: 2 }),
  15. new UTSJSONObject({ name: "hello", id: 3 }),
  16. new UTSJSONObject({ name: "world", id: 4 }),
  17. new UTSJSONObject({ name: "warm weather", id: 5 }),
  18. new UTSJSONObject({ name: "m3", id: 6 }),
  19. new UTSJSONObject({ name: "hahaha", id: 7 })
  20. ],
  21. textcontent: []
  22. };
  23. },
  24. mounted() {
  25. this.allMsg = [
  26. { name: "myhua", id: 1 },
  27. { name: "mp3", id: 2 },
  28. { name: "hello", id: 3 },
  29. { name: "world", id: 4 },
  30. { name: "warm weather", id: 5 },
  31. { name: "m3", id: 6 },
  32. { name: "hahaha", id: 7 }
  33. ];
  34. this.textcontent = this.allMsg;
  35. },
  36. methods: {
  37. change_text() {
  38. if (this.isshow) {
  39. this.isshow = false;
  40. } else {
  41. this.isshow = true;
  42. common_vendor.index.__f__("log", "at pages/home/home.uvue:91", "111");
  43. }
  44. },
  45. orderEntry() {
  46. common_vendor.index.__f__("log", "at pages/home/home.uvue:95", "111");
  47. common_vendor.index.navigateTo({ url: "/pages/views/dingDanCreate" });
  48. },
  49. // 搜索城市名字
  50. searchName() {
  51. },
  52. change_city(name = null) {
  53. this.title = name;
  54. this.change_text();
  55. this.isshow_1 = true;
  56. },
  57. close_view() {
  58. this.isshow_1 = false;
  59. },
  60. // 模糊匹配
  61. // 右上角搜索框--模糊查询
  62. handleSearch(event = null) {
  63. common_vendor.index.__f__("log", "at pages/home/home.uvue:115", event);
  64. if (event) {
  65. let queryStringArr = event.split("");
  66. let str = "(.*?)";
  67. this.textcontent = [];
  68. let regStr = str + queryStringArr.join(str) + str;
  69. let reg = RegExp(regStr, "i");
  70. this.allMsg.map((item) => {
  71. if (reg.test(item.name)) {
  72. this.textcontent.push(item);
  73. }
  74. });
  75. } else {
  76. this.textcontent = [];
  77. this.textcontent = this.allMsg;
  78. }
  79. }
  80. }
  81. });
  82. if (!Array) {
  83. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  84. const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
  85. (_easycom_uni_icons2 + _easycom_uni_easyinput2)();
  86. }
  87. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  88. const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
  89. if (!Math) {
  90. (_easycom_uni_icons + _easycom_uni_easyinput)();
  91. }
  92. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  93. return common_vendor.e({
  94. a: common_vendor.t($data.title),
  95. b: $data.title,
  96. c: common_vendor.p({
  97. type: "right",
  98. size: "30",
  99. color: "#c2d4de"
  100. }),
  101. d: common_vendor.o((...args) => $options.change_text && $options.change_text(...args)),
  102. e: common_assets._imports_0$1,
  103. f: common_assets._imports_1,
  104. g: common_vendor.p({
  105. type: "right",
  106. size: 25,
  107. color: "#306e91"
  108. }),
  109. h: common_vendor.o((...args) => $options.orderEntry && $options.orderEntry(...args)),
  110. i: $data.isshow
  111. }, $data.isshow ? {
  112. j: common_vendor.p({
  113. type: "search",
  114. size: 20
  115. }),
  116. k: common_vendor.o($options.handleSearch),
  117. l: common_vendor.o(($event) => $data.ServiceName = $event),
  118. m: common_vendor.p({
  119. inputBorder: false,
  120. placeholder: "请输入服务名称",
  121. modelValue: $data.ServiceName
  122. }),
  123. n: common_vendor.o((...args) => $options.searchName && $options.searchName(...args)),
  124. o: common_vendor.f($data.textcontent, (item, index, i0) => {
  125. return {
  126. a: common_vendor.t(item.name),
  127. b: index,
  128. c: common_vendor.o(($event) => $options.change_city(item.name), index)
  129. };
  130. })
  131. } : {}, {
  132. p: $data.isshow_1
  133. }, $data.isshow_1 ? {
  134. q: common_assets._imports_2,
  135. r: common_vendor.t($data.title),
  136. s: common_vendor.o((...args) => $options.close_view && $options.close_view(...args))
  137. } : {}, {
  138. t: common_vendor.sei(_ctx.virtualHostId, "view")
  139. });
  140. }
  141. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  142. wx.createPage(MiniProgramPage);
  143. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/home/home.js.map