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

141 lines
4.6 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const api = require("../../api.js");
  4. const _sfc_main = common_vendor.defineComponent({
  5. data() {
  6. return {
  7. firstFocus: true,
  8. ServiceName: "",
  9. product: [],
  10. product_2: [],
  11. product_3: [],
  12. product_4: [],
  13. FirstIndex: 0,
  14. name: ""
  15. };
  16. },
  17. mounted() {
  18. api.isToken();
  19. api.getProduct().then((res = null) => {
  20. this.product = res.result;
  21. this.product_2 = res.result[0].products;
  22. for (var index = 1; index < this.product.length; index++) {
  23. this.product_4.push(this.product[index]);
  24. }
  25. this.product_3 = res.result[0].products;
  26. getApp().productName = res.result[0].products[0].name;
  27. getApp().productUrl = res.result[0].products[0].pdf;
  28. this.name = res.result[0].products[0].name;
  29. });
  30. },
  31. methods: {
  32. toBack() {
  33. let canNavBack = getCurrentPages();
  34. if (canNavBack && canNavBack.length > 1) {
  35. common_vendor.index.navigateBack();
  36. } else {
  37. history.back();
  38. }
  39. },
  40. toNext() {
  41. common_vendor.index.navigateTo({ url: "/pages/index/PayPal" });
  42. },
  43. clear() {
  44. this.ServiceName = "";
  45. },
  46. FirstLevelChange(id = null) {
  47. this.FirstIndex = id;
  48. this.product_2 = this.product[id].products;
  49. },
  50. selctRadio(name = null, pdf = null) {
  51. getApp().productName = name;
  52. getApp().productUrl = pdf;
  53. this.name = name;
  54. },
  55. handleSearch(event = null) {
  56. this.FirstIndex = 0;
  57. if (event) {
  58. this.product_2 = [];
  59. for (var index = 0; index < this.product_4.length; index++) {
  60. this.product_4[index].products.map((item = null) => {
  61. if (item.name.indexOf(event) !== -1) {
  62. this.product_2.push(item);
  63. }
  64. });
  65. }
  66. } else {
  67. this.product_2 = [];
  68. this.product_2 = this.product_3;
  69. }
  70. },
  71. searchName() {
  72. this.FirstIndex = 0;
  73. if (this.ServiceName) {
  74. this.product_2 = [];
  75. for (var index = 0; index < this.product_4.length; index++) {
  76. this.product_4[index].products.map((item = null) => {
  77. if (item.name.indexOf(this.ServiceName) !== -1) {
  78. this.product_2.push(item);
  79. }
  80. });
  81. }
  82. } else {
  83. this.product_2 = [];
  84. this.product_2 = this.product_3;
  85. }
  86. }
  87. }
  88. });
  89. if (!Array) {
  90. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  91. const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
  92. (_easycom_uni_icons2 + _easycom_uni_easyinput2)();
  93. }
  94. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  95. const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
  96. if (!Math) {
  97. (_easycom_uni_icons + _easycom_uni_easyinput)();
  98. }
  99. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  100. return {
  101. a: common_vendor.p({
  102. type: "left",
  103. size: "30",
  104. color: "#c2d4de"
  105. }),
  106. b: common_vendor.o((...args) => $options.toBack && $options.toBack(...args)),
  107. c: common_vendor.p({
  108. type: "search",
  109. size: 20
  110. }),
  111. d: common_vendor.o($options.handleSearch),
  112. e: common_vendor.o($options.clear),
  113. f: common_vendor.o(($event) => $data.ServiceName = $event),
  114. g: common_vendor.p({
  115. inputBorder: false,
  116. placeholder: "请输入服务名称",
  117. modelValue: $data.ServiceName
  118. }),
  119. h: common_vendor.o((...args) => $options.searchName && $options.searchName(...args)),
  120. i: common_vendor.f($data.product, (item, index, i0) => {
  121. return {
  122. a: common_vendor.t(item.categoryName),
  123. b: common_vendor.n($data.FirstIndex === item.categoryId ? "click_color" : ""),
  124. c: common_vendor.o(($event) => $options.FirstLevelChange(item.categoryId))
  125. };
  126. }),
  127. j: common_vendor.f($data.product_2, (item, index, i0) => {
  128. return {
  129. a: common_vendor.t(item.name),
  130. b: common_vendor.n(item.name === $data.name ? "select_color" : ""),
  131. c: item.name == $data.name,
  132. d: common_vendor.o(($event) => $options.selctRadio(item.name, item.pdf))
  133. };
  134. }),
  135. k: common_vendor.o((...args) => $options.toNext && $options.toNext(...args)),
  136. l: common_vendor.sei(_ctx.virtualHostId, "view")
  137. };
  138. }
  139. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  140. wx.createPage(MiniProgramPage);
  141. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/views/dingDanCreate.js.map