爱简收旧衣按件回收前端代码仓库
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.7 KiB

  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const pages_mixins_pullRefreshMixin = require("../mixins/pullRefreshMixin.js");
  4. const _sfc_main = {
  5. mixins: [pages_mixins_pullRefreshMixin.pullRefreshMixin],
  6. data() {
  7. return {
  8. statusBarHeight: 0,
  9. navBarHeight: 44,
  10. navBarTotalHeight: 44,
  11. featureTags: ["收益高", "品类全", "到账快", "城市多"],
  12. formData: {
  13. name: "",
  14. phone: "",
  15. userTime: ""
  16. },
  17. showPickerPopup: false,
  18. currentPickerIndex: 0,
  19. indicatorStyle: "height: 88rpx; border: none;",
  20. pickerOptions: ["2小时", "3小时", "4小时", "5小时", "6小时"]
  21. };
  22. },
  23. onLoad() {
  24. const sysInfo = common_vendor.index.getSystemInfoSync();
  25. this.statusBarHeight = sysInfo.statusBarHeight;
  26. this.navBarHeight = 44;
  27. this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight;
  28. this.getMyPromotionInfo();
  29. },
  30. methods: {
  31. async onRefresh() {
  32. await new Promise((resolve) => setTimeout(resolve, 1e3));
  33. common_vendor.index.stopPullRefresh();
  34. },
  35. navigateBack() {
  36. common_vendor.index.navigateBack();
  37. },
  38. contactService() {
  39. common_vendor.index.navigateTo({ url: "/pages/subcomponent/admin_faq" });
  40. },
  41. showPicker() {
  42. this.showPickerPopup = true;
  43. },
  44. hidePicker() {
  45. this.showPickerPopup = false;
  46. },
  47. onPickerChange(e) {
  48. const index = e.detail.value[0];
  49. this.currentPickerIndex = index;
  50. },
  51. confirmPicker() {
  52. this.formData.userTime = this.pickerOptions[this.currentPickerIndex];
  53. this.hidePicker();
  54. },
  55. resetPicker() {
  56. this.currentPickerIndex = 0;
  57. },
  58. submitForm() {
  59. this.$api("apply", this.formData, (res) => {
  60. if (res && res.success) {
  61. common_vendor.index.showToast({ title: "提交成功", icon: "success" });
  62. common_vendor.index.navigateBack();
  63. }
  64. });
  65. },
  66. getMyPromotionInfo() {
  67. this.$api("getMyPromotionInfo", {}, (res) => {
  68. if (res && res.success && res.result) {
  69. this.formData = res.result;
  70. }
  71. });
  72. }
  73. }
  74. };
  75. if (!Array) {
  76. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  77. _easycom_uni_icons2();
  78. }
  79. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  80. if (!Math) {
  81. _easycom_uni_icons();
  82. }
  83. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  84. return common_vendor.e({
  85. a: common_vendor.p({
  86. type: "left",
  87. size: "22",
  88. color: "#222"
  89. }),
  90. b: common_vendor.o((...args) => $options.navigateBack && $options.navigateBack(...args)),
  91. c: common_vendor.p({
  92. type: "more-filled",
  93. size: "22",
  94. color: "#222"
  95. }),
  96. d: $data.navBarTotalHeight + "px",
  97. e: $data.statusBarHeight + "px",
  98. f: common_vendor.f($data.featureTags, (t, i, i0) => {
  99. return {
  100. a: common_vendor.t(t),
  101. b: i
  102. };
  103. }),
  104. g: $data.navBarTotalHeight + "px",
  105. h: common_vendor.p({
  106. type: "headphones",
  107. size: "22",
  108. color: "#df8155"
  109. }),
  110. i: common_vendor.o((...args) => $options.contactService && $options.contactService(...args)),
  111. j: $data.formData.name,
  112. k: common_vendor.o(($event) => $data.formData.name = $event.detail.value),
  113. l: $data.formData.phone,
  114. m: common_vendor.o(($event) => $data.formData.phone = $event.detail.value),
  115. n: common_vendor.t($data.formData.userTime || "请选择"),
  116. o: !$data.formData.userTime ? 1 : "",
  117. p: common_vendor.p({
  118. type: "right",
  119. size: "18",
  120. color: "#bbb"
  121. }),
  122. q: common_vendor.o(($event) => $options.showPicker("userTime")),
  123. r: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args)),
  124. s: $data.showPickerPopup
  125. }, $data.showPickerPopup ? {
  126. t: common_vendor.o((...args) => $options.hidePicker && $options.hidePicker(...args)),
  127. v: common_vendor.o((...args) => $options.resetPicker && $options.resetPicker(...args)),
  128. w: common_vendor.f($data.pickerOptions, (item, index, i0) => {
  129. return {
  130. a: common_vendor.t(item),
  131. b: index,
  132. c: index === $data.currentPickerIndex ? 1 : ""
  133. };
  134. }),
  135. x: [$data.currentPickerIndex],
  136. y: common_vendor.o((...args) => $options.onPickerChange && $options.onPickerChange(...args)),
  137. z: $data.indicatorStyle,
  138. A: common_vendor.o((...args) => $options.confirmPicker && $options.confirmPicker(...args))
  139. } : {});
  140. }
  141. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a0c82533"]]);
  142. wx.createPage(MiniProgramPage);
  143. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/subcomponent/upgrad.js.map