"use strict"; const common_vendor = require("../../common/vendor.js"); if (!Array) { const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon"); const _easycom_u_form_item2 = common_vendor.resolveComponent("u-form-item"); const _easycom_u__form2 = common_vendor.resolveComponent("u--form"); (_easycom_u_icon2 + _easycom_u_form_item2 + _easycom_u__form2)(); } const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js"; const _easycom_u_form_item = () => "../../node-modules/uview-plus/components/u-form-item/u-form-item.js"; const _easycom_u__form = () => "../../node-modules/uview-plus/components/u-form/u-form.js"; if (!Math) { (_easycom_u_icon + _easycom_u_form_item + _easycom_u__form)(); } const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "index", setup(__props) { var _a, _b; (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api; (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config; const config = common_vendor.ref({}); const agree = common_vendor.ref(false); common_vendor.ref({}); const form = common_vendor.ref({ phone: "" }); const rules = common_vendor.ref({ phone: [ { required: true, message: "请输入手机号", trigger: ["blur", "change"] } ] }); const courseList = common_vendor.ref([{ value: "1", label: "1万公里" }, { value: "2", label: "2万公里" }, { value: "3", label: "3万公里" }, { value: "4", label: "4万公里" }, { value: "5", label: "5万公里" }]); common_vendor.onLoad(async () => { await searchConfig(); }); common_vendor.onShow(() => { common_vendor.index.$on("toRoute", function(data) { form.value.brand = data; }); common_vendor.index.$on("toCity", function(data) { form.value.city = data; }); }); const searchConfig = async () => { config.value = common_vendor.index.getStorageSync("config"); }; const dateChange = (e) => { form.value.start = e.target.value; }; const courseChange = (e) => { const data = courseList.value[e.detail.value]; if (data) form.value.course = data.label; }; const toCity = () => { common_vendor.index.navigateTo({ url: `/pagesHome/city/index` }); }; const toSelect = () => { common_vendor.index.navigateTo({ url: `/pagesHome/brand/index` }); }; const toEvaluate = async () => { if (agree.value) { $refs.form.validate().then((res) => { common_vendor.index.$u.toast("校验通过"); }).catch((errors) => { common_vendor.index.$u.toast("校验失败"); }); } else { common_vendor.index.showToast({ title: "请阅读并同意用户协议和隐私政策", icon: "none" }); } }; const toAgree = () => { common_vendor.index.navigateTo({ url: `/pagesHome/agree/index` }); }; const changeAgree = () => { agree.value = !agree.value; }; return (_ctx, _cache) => { var _a2, _b2, _c, _d, _e, _f, _g, _h; return common_vendor.e({ a: !form.value.brand && !((_a2 = form.value.brand) == null ? void 0 : _a2.title) }, !form.value.brand && !((_b2 = form.value.brand) == null ? void 0 : _b2.title) ? { b: common_vendor.p({ name: "plus-circle-fill", size: "20", color: "#ffbc00" }), c: common_vendor.o(toSelect) } : { d: ((_c = form.value.brand) == null ? void 0 : _c.url) && ((_d = form.value.brand) == null ? void 0 : _d.url.length) > 0 ? (_e = form.value.brand) == null ? void 0 : _e.url[0].url : "/static/logo.png", e: common_vendor.t((_f = form.value.brand) == null ? void 0 : _f.title), f: common_vendor.p({ name: "arrow-right" }), g: common_vendor.o(toSelect) }, { h: form.value.bank, i: common_vendor.o(($event) => form.value.bank = $event.detail.value), j: common_vendor.p({ name: "arrow-right" }), k: common_vendor.p({ label: "车辆车系", prop: "bank" }), l: form.value.type, m: common_vendor.o(($event) => form.value.type = $event.detail.value), n: common_vendor.p({ name: "arrow-right" }), o: common_vendor.p({ label: "车辆车型", prop: "type" }), p: common_vendor.t(form.value.start || "请选择"), q: common_vendor.o(dateChange), r: common_vendor.p({ name: "arrow-right" }), s: common_vendor.p({ label: "上牌日期", prop: "start" }), t: common_vendor.t(form.value.course || "请选择"), v: common_vendor.o(courseChange), w: _ctx.index, x: courseList.value, y: common_vendor.p({ name: "arrow-right" }), z: common_vendor.p({ label: "行驶里程", prop: "course" }), A: common_vendor.t(((_g = form.value.city) == null ? void 0 : _g.name) || "请选择"), B: common_vendor.o(toCity), C: common_vendor.p({ name: "arrow-right" }), D: common_vendor.p({ label: "上牌城市", prop: "city" }), E: common_vendor.t(((_h = form.value.place) == null ? void 0 : _h.name) || "请选择"), F: common_vendor.o(toCity), G: common_vendor.p({ name: "arrow-right" }), H: common_vendor.p({ label: "估值地区", prop: "place" }), I: form.value.contacts, J: common_vendor.o(($event) => form.value.contacts = $event.detail.value), K: common_vendor.p({ label: "联系人", prop: "contacts" }), L: form.value.tel, M: common_vendor.o(($event) => form.value.tel = $event.detail.value), N: common_vendor.p({ label: "联系电话", prop: "tel" }), O: common_vendor.sr("uForm", "1d378803-2"), P: common_vendor.p({ model: form.value, rules: rules.value, labelWidth: "65", ["border-bottom"]: true }), Q: common_vendor.o(toEvaluate), R: agree.value, S: common_vendor.o(toAgree), T: common_vendor.o(changeAgree) }); }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1d378803"], ["__file", "D:/project/二手车/car_applet/pagesHome/sell/index.vue"]]); wx.createPage(MiniProgramPage);