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

"use strict";
const common_vendor = require("../../common/vendor.js");
const pages_mixins_pullRefreshMixin = require("../mixins/pullRefreshMixin.js");
const _sfc_main = {
mixins: [pages_mixins_pullRefreshMixin.pullRefreshMixin],
data() {
return {
formData: {
name: "",
phone: "",
occupation: "",
age: "",
promotionTime: ""
},
showPickerPopup: false,
currentPickerType: "",
currentPickerIndex: 0,
indicatorStyle: "height: 88rpx; border: none;",
pickerOptions: {
occupation: ["产品摄影师", "外呼专员", "宝妈", "导购员", "产品经理"],
age: ["28岁", "29岁", "30岁", "31岁", "32岁"],
promotionTime: ["2小时", "3小时", "4小时", "5小时", "6小时"]
}
};
},
computed: {
pickerTitle() {
const titles = {
occupation: "职业",
age: "年龄",
promotionTime: "每日可花推广时间"
};
return titles[this.currentPickerType] || "";
},
currentPickerOptions() {
return this.pickerOptions[this.currentPickerType] || [];
}
},
methods: {
async onRefresh() {
await new Promise((resolve) => setTimeout(resolve, 1e3));
common_vendor.index.stopPullRefresh();
},
navigateBack() {
common_vendor.index.navigateBack();
},
contactService() {
common_vendor.index.showToast({
title: "正在连接客服...",
icon: "none"
});
},
showPicker(type) {
this.currentPickerType = type;
const currentValue = this.formData[this.currentPickerType];
this.currentPickerIndex = this.currentPickerOptions.indexOf(currentValue);
if (this.currentPickerIndex === -1)
this.currentPickerIndex = 0;
this.showPickerPopup = true;
},
hidePicker() {
this.showPickerPopup = false;
},
onPickerChange(e) {
const index = e.detail.value[0];
this.currentPickerIndex = index;
},
confirmPicker() {
const selectedValue = this.currentPickerOptions[this.currentPickerIndex];
this.formData[this.currentPickerType] = selectedValue;
this.hidePicker();
},
upgrade() {
common_vendor.index.navigateTo({
url: "/pages/component/upgrad"
});
},
submitForm() {
common_vendor.index.__f__("log", "at pages/subcomponent/apply.vue:222", "提交表单数据:", this.formData);
common_vendor.index.showToast({
title: "提交成功",
icon: "success"
});
}
}
};
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.p({
type: "left",
size: "20"
}),
b: common_vendor.o((...args) => $options.navigateBack && $options.navigateBack(...args)),
c: common_vendor.o((...args) => $options.contactService && $options.contactService(...args)),
d: $data.formData.name,
e: common_vendor.o(($event) => $data.formData.name = $event.detail.value),
f: $data.formData.phone,
g: common_vendor.o(($event) => $data.formData.phone = $event.detail.value),
h: common_vendor.t($data.formData.occupation || "请选择"),
i: !$data.formData.occupation ? 1 : "",
j: common_vendor.o(($event) => $options.showPicker("occupation")),
k: common_vendor.t($data.formData.age || "请选择"),
l: !$data.formData.age ? 1 : "",
m: common_vendor.o(($event) => $options.showPicker("age")),
n: common_vendor.t($data.formData.promotionTime || "请选择"),
o: !$data.formData.promotionTime ? 1 : "",
p: common_vendor.o(($event) => $options.showPicker("promotionTime")),
q: common_vendor.o((...args) => $options.upgrade && $options.upgrade(...args)),
r: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args)),
s: $data.showPickerPopup
}, $data.showPickerPopup ? {
t: common_vendor.o((...args) => $options.hidePicker && $options.hidePicker(...args)),
v: common_vendor.t($options.pickerTitle),
w: common_vendor.f($options.currentPickerOptions, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: index,
c: index === $data.currentPickerIndex ? 1 : ""
};
}),
x: [$data.currentPickerIndex],
y: common_vendor.o((...args) => $options.onPickerChange && $options.onPickerChange(...args)),
z: $data.indicatorStyle,
A: common_vendor.o((...args) => $options.confirmPicker && $options.confirmPicker(...args))
} : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-894ab7b5"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/subcomponent/apply.js.map