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

137 lines
4.9 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. formData: {
  9. name: "",
  10. phone: "",
  11. occupation: "",
  12. age: "",
  13. promotionTime: ""
  14. },
  15. showPickerPopup: false,
  16. currentPickerType: "",
  17. currentPickerIndex: 0,
  18. indicatorStyle: "height: 88rpx; border: none;",
  19. pickerOptions: {
  20. occupation: ["产品摄影师", "外呼专员", "宝妈", "导购员", "产品经理"],
  21. age: ["28岁", "29岁", "30岁", "31岁", "32岁"],
  22. promotionTime: ["2小时", "3小时", "4小时", "5小时", "6小时"]
  23. }
  24. };
  25. },
  26. computed: {
  27. pickerTitle() {
  28. const titles = {
  29. occupation: "职业",
  30. age: "年龄",
  31. promotionTime: "每日可花推广时间"
  32. };
  33. return titles[this.currentPickerType] || "";
  34. },
  35. currentPickerOptions() {
  36. return this.pickerOptions[this.currentPickerType] || [];
  37. }
  38. },
  39. methods: {
  40. async onRefresh() {
  41. await new Promise((resolve) => setTimeout(resolve, 1e3));
  42. common_vendor.index.stopPullRefresh();
  43. },
  44. navigateBack() {
  45. common_vendor.index.navigateBack();
  46. },
  47. contactService() {
  48. common_vendor.index.showToast({
  49. title: "正在连接客服...",
  50. icon: "none"
  51. });
  52. },
  53. showPicker(type) {
  54. this.currentPickerType = type;
  55. const currentValue = this.formData[this.currentPickerType];
  56. this.currentPickerIndex = this.currentPickerOptions.indexOf(currentValue);
  57. if (this.currentPickerIndex === -1)
  58. this.currentPickerIndex = 0;
  59. this.showPickerPopup = true;
  60. },
  61. hidePicker() {
  62. this.showPickerPopup = false;
  63. },
  64. onPickerChange(e) {
  65. const index = e.detail.value[0];
  66. this.currentPickerIndex = index;
  67. },
  68. confirmPicker() {
  69. const selectedValue = this.currentPickerOptions[this.currentPickerIndex];
  70. this.formData[this.currentPickerType] = selectedValue;
  71. this.hidePicker();
  72. },
  73. upgrade() {
  74. common_vendor.index.navigateTo({
  75. url: "/pages/component/upgrad"
  76. });
  77. },
  78. submitForm() {
  79. common_vendor.index.__f__("log", "at pages/subcomponent/apply.vue:222", "提交表单数据:", this.formData);
  80. common_vendor.index.showToast({
  81. title: "提交成功",
  82. icon: "success"
  83. });
  84. }
  85. }
  86. };
  87. if (!Array) {
  88. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  89. _easycom_uni_icons2();
  90. }
  91. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  92. if (!Math) {
  93. _easycom_uni_icons();
  94. }
  95. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  96. return common_vendor.e({
  97. a: common_vendor.p({
  98. type: "left",
  99. size: "20"
  100. }),
  101. b: common_vendor.o((...args) => $options.navigateBack && $options.navigateBack(...args)),
  102. c: common_vendor.o((...args) => $options.contactService && $options.contactService(...args)),
  103. d: $data.formData.name,
  104. e: common_vendor.o(($event) => $data.formData.name = $event.detail.value),
  105. f: $data.formData.phone,
  106. g: common_vendor.o(($event) => $data.formData.phone = $event.detail.value),
  107. h: common_vendor.t($data.formData.occupation || "请选择"),
  108. i: !$data.formData.occupation ? 1 : "",
  109. j: common_vendor.o(($event) => $options.showPicker("occupation")),
  110. k: common_vendor.t($data.formData.age || "请选择"),
  111. l: !$data.formData.age ? 1 : "",
  112. m: common_vendor.o(($event) => $options.showPicker("age")),
  113. n: common_vendor.t($data.formData.promotionTime || "请选择"),
  114. o: !$data.formData.promotionTime ? 1 : "",
  115. p: common_vendor.o(($event) => $options.showPicker("promotionTime")),
  116. q: common_vendor.o((...args) => $options.upgrade && $options.upgrade(...args)),
  117. r: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args)),
  118. s: $data.showPickerPopup
  119. }, $data.showPickerPopup ? {
  120. t: common_vendor.o((...args) => $options.hidePicker && $options.hidePicker(...args)),
  121. v: common_vendor.t($options.pickerTitle),
  122. w: common_vendor.f($options.currentPickerOptions, (item, index, i0) => {
  123. return {
  124. a: common_vendor.t(item),
  125. b: index,
  126. c: index === $data.currentPickerIndex ? 1 : ""
  127. };
  128. }),
  129. x: [$data.currentPickerIndex],
  130. y: common_vendor.o((...args) => $options.onPickerChange && $options.onPickerChange(...args)),
  131. z: $data.indicatorStyle,
  132. A: common_vendor.o((...args) => $options.confirmPicker && $options.confirmPicker(...args))
  133. } : {});
  134. }
  135. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-894ab7b5"]]);
  136. wx.createPage(MiniProgramPage);
  137. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/subcomponent/apply.js.map