index.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  5. const _easycom_u_form_item2 = common_vendor.resolveComponent("u-form-item");
  6. const _easycom_u__form2 = common_vendor.resolveComponent("u--form");
  7. (_easycom_u_icon2 + _easycom_u_form_item2 + _easycom_u__form2)();
  8. }
  9. const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
  10. const _easycom_u_form_item = () => "../../node-modules/uview-plus/components/u-form-item/u-form-item.js";
  11. const _easycom_u__form = () => "../../node-modules/uview-plus/components/u-form/u-form.js";
  12. if (!Math) {
  13. (_easycom_u_icon + _easycom_u_form_item + _easycom_u__form)();
  14. }
  15. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  16. __name: "index",
  17. setup(__props) {
  18. var _a, _b;
  19. (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  20. (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
  21. const config = common_vendor.ref({});
  22. const agree = common_vendor.ref(false);
  23. common_vendor.ref({});
  24. const form = common_vendor.ref({ phone: "" });
  25. const rules = common_vendor.ref({
  26. phone: [
  27. {
  28. required: true,
  29. message: "请输入手机号",
  30. trigger: ["blur", "change"]
  31. }
  32. ]
  33. });
  34. 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万公里" }]);
  35. common_vendor.onLoad(async () => {
  36. await searchConfig();
  37. });
  38. common_vendor.onShow(() => {
  39. common_vendor.index.$on("toRoute", function(data) {
  40. form.value.brand = data;
  41. });
  42. common_vendor.index.$on("toCity", function(data) {
  43. form.value.city = data;
  44. });
  45. });
  46. const searchConfig = async () => {
  47. config.value = common_vendor.index.getStorageSync("config");
  48. };
  49. const dateChange = (e) => {
  50. form.value.start = e.target.value;
  51. };
  52. const courseChange = (e) => {
  53. const data = courseList.value[e.detail.value];
  54. if (data)
  55. form.value.course = data.label;
  56. };
  57. const toCity = () => {
  58. common_vendor.index.navigateTo({
  59. url: `/pagesHome/city/index`
  60. });
  61. };
  62. const toSelect = () => {
  63. common_vendor.index.navigateTo({
  64. url: `/pagesHome/brand/index`
  65. });
  66. };
  67. const toEvaluate = async () => {
  68. if (agree.value) {
  69. $refs.form.validate().then((res) => {
  70. common_vendor.index.$u.toast("校验通过");
  71. }).catch((errors) => {
  72. common_vendor.index.$u.toast("校验失败");
  73. });
  74. } else {
  75. common_vendor.index.showToast({
  76. title: "请阅读并同意用户协议和隐私政策",
  77. icon: "none"
  78. });
  79. }
  80. };
  81. const toAgree = () => {
  82. common_vendor.index.navigateTo({
  83. url: `/pagesHome/agree/index`
  84. });
  85. };
  86. const changeAgree = () => {
  87. agree.value = !agree.value;
  88. };
  89. return (_ctx, _cache) => {
  90. var _a2, _b2, _c, _d, _e, _f, _g, _h;
  91. return common_vendor.e({
  92. a: !form.value.brand && !((_a2 = form.value.brand) == null ? void 0 : _a2.title)
  93. }, !form.value.brand && !((_b2 = form.value.brand) == null ? void 0 : _b2.title) ? {
  94. b: common_vendor.p({
  95. name: "plus-circle-fill",
  96. size: "20",
  97. color: "#ffbc00"
  98. }),
  99. c: common_vendor.o(toSelect)
  100. } : {
  101. 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",
  102. e: common_vendor.t((_f = form.value.brand) == null ? void 0 : _f.title),
  103. f: common_vendor.p({
  104. name: "arrow-right"
  105. }),
  106. g: common_vendor.o(toSelect)
  107. }, {
  108. h: form.value.bank,
  109. i: common_vendor.o(($event) => form.value.bank = $event.detail.value),
  110. j: common_vendor.p({
  111. name: "arrow-right"
  112. }),
  113. k: common_vendor.p({
  114. label: "车辆车系",
  115. prop: "bank"
  116. }),
  117. l: form.value.type,
  118. m: common_vendor.o(($event) => form.value.type = $event.detail.value),
  119. n: common_vendor.p({
  120. name: "arrow-right"
  121. }),
  122. o: common_vendor.p({
  123. label: "车辆车型",
  124. prop: "type"
  125. }),
  126. p: common_vendor.t(form.value.start || "请选择"),
  127. q: common_vendor.o(dateChange),
  128. r: common_vendor.p({
  129. name: "arrow-right"
  130. }),
  131. s: common_vendor.p({
  132. label: "上牌日期",
  133. prop: "start"
  134. }),
  135. t: common_vendor.t(form.value.course || "请选择"),
  136. v: common_vendor.o(courseChange),
  137. w: _ctx.index,
  138. x: courseList.value,
  139. y: common_vendor.p({
  140. name: "arrow-right"
  141. }),
  142. z: common_vendor.p({
  143. label: "行驶里程",
  144. prop: "course"
  145. }),
  146. A: common_vendor.t(((_g = form.value.city) == null ? void 0 : _g.name) || "请选择"),
  147. B: common_vendor.o(toCity),
  148. C: common_vendor.p({
  149. name: "arrow-right"
  150. }),
  151. D: common_vendor.p({
  152. label: "上牌城市",
  153. prop: "city"
  154. }),
  155. E: common_vendor.t(((_h = form.value.place) == null ? void 0 : _h.name) || "请选择"),
  156. F: common_vendor.o(toCity),
  157. G: common_vendor.p({
  158. name: "arrow-right"
  159. }),
  160. H: common_vendor.p({
  161. label: "估值地区",
  162. prop: "place"
  163. }),
  164. I: form.value.contacts,
  165. J: common_vendor.o(($event) => form.value.contacts = $event.detail.value),
  166. K: common_vendor.p({
  167. label: "联系人",
  168. prop: "contacts"
  169. }),
  170. L: form.value.tel,
  171. M: common_vendor.o(($event) => form.value.tel = $event.detail.value),
  172. N: common_vendor.p({
  173. label: "联系电话",
  174. prop: "tel"
  175. }),
  176. O: common_vendor.sr("uForm", "1d378803-2"),
  177. P: common_vendor.p({
  178. model: form.value,
  179. rules: rules.value,
  180. labelWidth: "65",
  181. ["border-bottom"]: true
  182. }),
  183. Q: common_vendor.o(toEvaluate),
  184. R: agree.value,
  185. S: common_vendor.o(toAgree),
  186. T: common_vendor.o(changeAgree)
  187. });
  188. };
  189. }
  190. });
  191. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1d378803"], ["__file", "D:/project/二手车/car_applet/pagesHome/sell/index.vue"]]);
  192. wx.createPage(MiniProgramPage);