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

144 lines
4.7 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months 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. common_vendor.index.switchTab({
  34. url: "/pages/home/home"
  35. });
  36. },
  37. toNext() {
  38. if (this.name == "畅行无忧") {
  39. common_vendor.index.navigateTo({ url: "/pages/index/PayPal" });
  40. } else {
  41. common_vendor.index.navigateTo({ url: "/pages/index/PayPal_pinpai" });
  42. }
  43. },
  44. clear() {
  45. this.ServiceName = "";
  46. },
  47. FirstLevelChange(id = null) {
  48. this.FirstIndex = id;
  49. this.product_2 = this.product[id].products;
  50. this.categoryName = this.product[id].categoryName;
  51. },
  52. selctRadio(name = null, pdf = null) {
  53. getApp().productName = name;
  54. getApp().productUrl = pdf;
  55. this.name = name;
  56. common_vendor.index.__f__("log", "at pages/views/dingDanCreate.uvue:104", this.name);
  57. },
  58. handleSearch(event = null) {
  59. this.FirstIndex = 0;
  60. if (event) {
  61. this.product_2 = [];
  62. for (var index = 0; index < this.product_4.length; index++) {
  63. this.product_4[index].products.map((item = null) => {
  64. if (item.name.indexOf(event) !== -1) {
  65. this.product_2.push(item);
  66. }
  67. });
  68. }
  69. } else {
  70. this.product_2 = [];
  71. this.product_2 = this.product_3;
  72. }
  73. },
  74. searchName() {
  75. this.FirstIndex = 0;
  76. if (this.ServiceName) {
  77. this.product_2 = [];
  78. for (var index = 0; index < this.product_4.length; index++) {
  79. this.product_4[index].products.map((item = null) => {
  80. if (item.name.indexOf(this.ServiceName) !== -1) {
  81. this.product_2.push(item);
  82. }
  83. });
  84. }
  85. } else {
  86. this.product_2 = [];
  87. this.product_2 = this.product_3;
  88. }
  89. }
  90. }
  91. });
  92. if (!Array) {
  93. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  94. const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
  95. (_easycom_uni_icons2 + _easycom_uni_easyinput2)();
  96. }
  97. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  98. const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
  99. if (!Math) {
  100. (_easycom_uni_icons + _easycom_uni_easyinput)();
  101. }
  102. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  103. return {
  104. a: common_vendor.p({
  105. type: "left",
  106. size: "30",
  107. color: "#c2d4de"
  108. }),
  109. b: common_vendor.o((...args) => $options.toBack && $options.toBack(...args)),
  110. c: common_vendor.p({
  111. type: "search",
  112. size: 20
  113. }),
  114. d: common_vendor.o($options.handleSearch),
  115. e: common_vendor.o($options.clear),
  116. f: common_vendor.o(($event) => $data.ServiceName = $event),
  117. g: common_vendor.p({
  118. inputBorder: false,
  119. placeholder: "请输入服务名称",
  120. modelValue: $data.ServiceName
  121. }),
  122. h: common_vendor.o((...args) => $options.searchName && $options.searchName(...args)),
  123. i: common_vendor.f($data.product, (item, index, i0) => {
  124. return {
  125. a: common_vendor.t(item.categoryName),
  126. b: common_vendor.n($data.FirstIndex === item.categoryId ? "click_color" : ""),
  127. c: common_vendor.o(($event) => $options.FirstLevelChange(item.categoryId))
  128. };
  129. }),
  130. j: common_vendor.f($data.product_2, (item, index, i0) => {
  131. return {
  132. a: common_vendor.t(item.name),
  133. b: common_vendor.n(item.name === $data.name ? "select_color" : ""),
  134. c: item.name == $data.name,
  135. d: common_vendor.o(($event) => $options.selctRadio(item.name, item.pdf))
  136. };
  137. }),
  138. k: common_vendor.o((...args) => $options.toNext && $options.toNext(...args)),
  139. l: common_vendor.sei(_ctx.virtualHostId, "view")
  140. };
  141. }
  142. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  143. wx.createPage(MiniProgramPage);
  144. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/views/dingDanCreate.js.map