|
@@ -1,57 +1,62 @@
|
|
|
"use strict";
|
|
|
const common_vendor = require("../../common/vendor.js");
|
|
|
+if (!Array) {
|
|
|
+ const _easycom_u_search2 = common_vendor.resolveComponent("u-search");
|
|
|
+ const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
|
|
|
+ (_easycom_u_search2 + _easycom_u_icon2)();
|
|
|
+}
|
|
|
+const _easycom_u_search = () => "../../node-modules/uview-plus/components/u-search/u-search.js";
|
|
|
+const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
|
|
|
+if (!Math) {
|
|
|
+ (_easycom_u_search + _easycom_u_icon)();
|
|
|
+}
|
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
__name: "index",
|
|
|
setup(__props) {
|
|
|
- var _a, _b, _c;
|
|
|
- const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
|
|
|
- (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$app;
|
|
|
- (_c = common_vendor.getCurrentInstance()) == null ? void 0 : _c.appContext.config.globalProperties.$config;
|
|
|
- const config = common_vendor.ref({ logo: [] });
|
|
|
- common_vendor.onLoad(async () => {
|
|
|
- await searchConfig();
|
|
|
- await search();
|
|
|
- });
|
|
|
- const searchConfig = async () => {
|
|
|
- let res = await $api(`config`, "GET", {});
|
|
|
- if (res.errcode == 0) {
|
|
|
- config.value = res.data;
|
|
|
- common_vendor.index.setStorage({
|
|
|
- key: "config",
|
|
|
- data: res.data
|
|
|
- });
|
|
|
- }
|
|
|
+ var _a;
|
|
|
+ (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
|
|
|
+ const value = common_vendor.ref("");
|
|
|
+ const list = common_vendor.ref([]);
|
|
|
+ const toChange = async () => {
|
|
|
};
|
|
|
- const search = async () => {
|
|
|
- common_vendor.index.getStorage({
|
|
|
- key: "openid",
|
|
|
- success: function(res) {
|
|
|
- common_vendor.index.reLaunch({
|
|
|
- url: `/pages/home/index`
|
|
|
- });
|
|
|
- },
|
|
|
- fail: function(err) {
|
|
|
- common_vendor.index.login({
|
|
|
- success: async function(res) {
|
|
|
- if (res.code) {
|
|
|
- common_vendor.index.reLaunch({
|
|
|
- url: `/pages/home/index`
|
|
|
- });
|
|
|
- } else {
|
|
|
- common_vendor.index.showToast({
|
|
|
- title: res.errMsg,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ const toCustom = async () => {
|
|
|
+ value.value = "";
|
|
|
+ };
|
|
|
+ const toView = (item) => {
|
|
|
+ console.log(item);
|
|
|
+ common_vendor.index.navigateTo({
|
|
|
+ url: `/pagesHome/search/index?type=${item.type || ""}`
|
|
|
});
|
|
|
};
|
|
|
return (_ctx, _cache) => {
|
|
|
- var _a2, _b2;
|
|
|
return {
|
|
|
- a: ((_b2 = (_a2 = config.value) == null ? void 0 : _a2.logo[0]) == null ? void 0 : _b2.url) || "/static/logo.png"
|
|
|
+ a: common_vendor.o(toChange),
|
|
|
+ b: common_vendor.o(toCustom),
|
|
|
+ c: common_vendor.o(($event) => value.value = $event),
|
|
|
+ d: common_vendor.p({
|
|
|
+ shape: "square",
|
|
|
+ ["show-action"]: true,
|
|
|
+ ["action-text"]: "取消",
|
|
|
+ placeholder: "想买什么车",
|
|
|
+ modelValue: value.value
|
|
|
+ }),
|
|
|
+ e: common_vendor.f(list.value, (item, index, i0) => {
|
|
|
+ return common_vendor.e({
|
|
|
+ a: item.file
|
|
|
+ }, item.file ? {
|
|
|
+ b: item.file && item.file.length > 0 ? item.file[0].url : ""
|
|
|
+ } : {
|
|
|
+ c: "2f32406a-1-" + i0,
|
|
|
+ d: common_vendor.p({
|
|
|
+ size: "14px",
|
|
|
+ name: "search"
|
|
|
+ })
|
|
|
+ }, {
|
|
|
+ e: common_vendor.t(item.name),
|
|
|
+ f: index,
|
|
|
+ g: common_vendor.o(($event) => toView(item), index)
|
|
|
+ });
|
|
|
+ })
|
|
|
};
|
|
|
};
|
|
|
}
|