index.js 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. await search();
  38. });
  39. common_vendor.onShow(() => {
  40. common_vendor.index.$on("toRoute", function(data) {
  41. form.value.brand = data;
  42. });
  43. common_vendor.index.$on("toCity", function(data) {
  44. form.value.city = data;
  45. });
  46. });
  47. const searchConfig = async () => {
  48. config.value = common_vendor.index.getStorageSync("config");
  49. };
  50. const search = async () => {
  51. };
  52. const dateChange = (e) => {
  53. console.log(e);
  54. };
  55. const courseChange = (e) => {
  56. console.log(e);
  57. };
  58. const toCity = () => {
  59. common_vendor.index.navigateTo({
  60. url: `/pagesHome/city/index`
  61. });
  62. };
  63. const toSelect = () => {
  64. common_vendor.index.navigateTo({
  65. url: `/pagesHome/brand/index`
  66. });
  67. };
  68. const toEvaluate = async () => {
  69. if (agree.value) {
  70. $refs.form.validate().then((res) => {
  71. common_vendor.index.$u.toast("校验通过");
  72. }).catch((errors) => {
  73. common_vendor.index.$u.toast("校验失败");
  74. });
  75. } else {
  76. common_vendor.index.showToast({
  77. title: "请阅读并同意用户协议和隐私政策",
  78. icon: "none"
  79. });
  80. }
  81. };
  82. const toAgree = () => {
  83. common_vendor.index.navigateTo({
  84. url: `/pagesHome/agree/index`
  85. });
  86. };
  87. const changeAgree = () => {
  88. agree.value = !agree.value;
  89. };
  90. return (_ctx, _cache) => {
  91. var _a2, _b2, _c, _d, _e, _f, _g, _h;
  92. return common_vendor.e({
  93. a: !form.value.brand && !((_a2 = form.value.brand) == null ? void 0 : _a2.title)
  94. }, !form.value.brand && !((_b2 = form.value.brand) == null ? void 0 : _b2.title) ? {
  95. b: common_vendor.p({
  96. name: "plus-circle-fill",
  97. size: "20",
  98. color: "#ffbc00"
  99. }),
  100. c: common_vendor.o(toSelect)
  101. } : {
  102. 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",
  103. e: common_vendor.t((_f = form.value.brand) == null ? void 0 : _f.title),
  104. f: common_vendor.p({
  105. name: "arrow-right"
  106. }),
  107. g: common_vendor.o(toSelect)
  108. }, {
  109. h: form.value.bank,
  110. i: common_vendor.o(($event) => form.value.bank = $event.detail.value),
  111. j: common_vendor.p({
  112. name: "arrow-right"
  113. }),
  114. k: common_vendor.p({
  115. label: "车辆车系",
  116. prop: "bank"
  117. }),
  118. l: form.value.type,
  119. m: common_vendor.o(($event) => form.value.type = $event.detail.value),
  120. n: common_vendor.p({
  121. name: "arrow-right"
  122. }),
  123. o: common_vendor.p({
  124. label: "车辆车型",
  125. prop: "type"
  126. }),
  127. p: common_vendor.t(form.value.date || "请选择"),
  128. q: common_vendor.o(dateChange),
  129. r: common_vendor.p({
  130. name: "arrow-right"
  131. }),
  132. s: common_vendor.p({
  133. label: "上牌日期",
  134. prop: "date"
  135. }),
  136. t: common_vendor.t(form.value.course || "请选择"),
  137. v: common_vendor.o(courseChange),
  138. w: _ctx.index,
  139. x: courseList.value,
  140. y: common_vendor.p({
  141. name: "arrow-right"
  142. }),
  143. z: common_vendor.p({
  144. label: "行驶里程",
  145. prop: "course"
  146. }),
  147. A: common_vendor.t(((_g = form.value.city) == null ? void 0 : _g.name) || "请选择"),
  148. B: common_vendor.o(toCity),
  149. C: common_vendor.p({
  150. name: "arrow-right"
  151. }),
  152. D: common_vendor.p({
  153. label: "上牌城市",
  154. prop: "city"
  155. }),
  156. E: common_vendor.t(((_h = form.value.city) == null ? void 0 : _h.name) || "请选择"),
  157. F: common_vendor.o(toCity),
  158. G: common_vendor.p({
  159. name: "arrow-right"
  160. }),
  161. H: common_vendor.p({
  162. label: "估值地区",
  163. prop: "phone"
  164. }),
  165. I: form.value.phone,
  166. J: common_vendor.o(($event) => form.value.phone = $event.detail.value),
  167. K: common_vendor.p({
  168. label: "手机号",
  169. prop: "phone"
  170. }),
  171. L: common_vendor.sr("uForm", "1d378803-2"),
  172. M: common_vendor.p({
  173. model: form.value,
  174. rules: rules.value,
  175. labelWidth: "65",
  176. ["border-bottom"]: true
  177. }),
  178. N: common_vendor.o(toEvaluate),
  179. O: agree.value,
  180. P: common_vendor.o(toAgree),
  181. Q: common_vendor.o(changeAgree)
  182. });
  183. };
  184. }
  185. });
  186. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1d378803"], ["__file", "D:/project/二手车/car_applet/pagesHome/sell/index.vue"]]);
  187. wx.createPage(MiniProgramPage);