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

140 lines
4.4 KiB

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