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

158 lines
5.0 KiB

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