"use strict"; const common_vendor = require("../../../common/vendor.js"); const sheep_index = require("../../index.js"); require("../../api/index.js"); require("../../api/distri/score.js"); require("../../request/index.js"); require("../../config/index.js"); require("../../store/index.js"); require("../../store/app.js"); require("../../api/promotion/diy.js"); require("../../platform/index.js"); require("../../platform/provider/wechat/index.js"); require("../../platform/provider/wechat/miniProgram.js"); require("../../api/member/auth.js"); require("../../api/member/social.js"); require("../../api/member/user.js"); require("../../platform/provider/apple/index.js"); require("../../platform/share.js"); require("../../router/index.js"); require("../../hooks/useModal.js"); require("../../helper/index.js"); require("../../helper/test.js"); require("../../helper/digit.js"); require("../../api/member/signin.js"); require("../../helper/throttle.js"); require("../../url/index.js"); require("../../platform/pay.js"); require("../../api/pay/order.js"); require("../../store/user.js"); require("../../store/cart.js"); require("../../api/trade/cart.js"); require("../../api/pay/wallet.js"); require("../../api/trade/order.js"); require("../../api/promotion/coupon.js"); require("../../store/sys.js"); require("../../store/modal.js"); require("../../api/distri/share.js"); require("../../api/distri/team.js"); require("../../api/infra/file.js"); require("../../api/member/address.js"); require("../../api/member/point.js"); require("../../api/migration/app.js"); require("../../api/migration/chat.js"); require("../../api/migration/index.js"); require("../../api/migration/third.js"); require("../../api/pay/channel.js"); require("../../api/product/category.js"); require("../../api/product/comment.js"); require("../../api/product/favorite.js"); require("../../api/product/history.js"); require("../../api/product/spu.js"); require("../../api/promotion/activity.js"); require("../../api/promotion/article.js"); require("../../api/promotion/bargain.js"); require("../../api/promotion/combination.js"); require("../../api/promotion/rewardActivity.js"); require("../../api/promotion/seckill.js"); require("../../api/system/area.js"); require("../../api/system/voice.js"); require("../../api/trade/afterSale.js"); require("../../api/trade/brokerage.js"); require("../../api/trade/config.js"); require("../../api/trade/delivery.js"); require("../../config/zIndex.js"); if (!Array) { const _easycom_uni_search_bar2 = common_vendor.resolveComponent("uni-search-bar"); _easycom_uni_search_bar2(); } const _easycom_uni_search_bar = () => "../../../uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js"; if (!Math) { _easycom_uni_search_bar(); } const _sfc_main = { __name: "s-search-block", props: { data: { type: Object, default: () => ({}) }, // 输入框背景色 elBackground: { type: String, default: "" }, height: { type: Number, default: 36 }, // 图标颜色 iconColor: { type: String, default: "#b0b3bf" }, // 字体颜色 fontColor: { type: String, default: "#b0b3bf" }, // placeholder placeholder: { type: String, default: "这是一个搜索框" }, radius: { type: Number, default: 10 }, width: { type: String, default: "100%" }, navbar: { type: Boolean, default: true } }, emits: ["click"], setup(__props, { emit: __emit }) { const state = common_vendor.reactive({ searchVal: "" }); const emits = __emit; const props = __props; const click = () => { emits("click"); }; function onSearch(e) { if (e.value) { sheep_index.sheep.$router.go("/pages/goods/list", { keyword: e.value }); setTimeout(() => { state.searchVal = ""; }, 100); } } return (_ctx, _cache) => { return common_vendor.e({ a: __props.navbar }, __props.navbar ? { b: common_vendor.s({ color: props.iconColor }), c: common_vendor.t(__props.placeholder), d: common_vendor.s({ color: __props.fontColor, width: __props.width }) } : {}, { e: !__props.navbar }, !__props.navbar ? { f: common_vendor.o(onSearch), g: common_vendor.o(($event) => state.searchVal = $event), h: common_vendor.p({ radius: __props.data.borderRadius, placeholder: __props.data.placeholder, cancelButton: "none", clearButton: "none", modelValue: state.searchVal }) } : {}, { i: common_vendor.f(__props.data.hotKeywords, (item, index, i0) => { return { a: common_vendor.t(item), b: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/goods/list", { keyword: item }), index), c: index }; }), j: common_vendor.s({ color: __props.data.textColor }), k: __props.data.hotKeywords && __props.data.hotKeywords.length && __props.navbar }, __props.data.hotKeywords && __props.data.hotKeywords.length && __props.navbar ? { l: common_vendor.f(__props.data.hotKeywords, (item, index, i0) => { return { a: common_vendor.t(item), b: index }; }), m: common_vendor.s({ color: __props.data.textColor, marginRight: "10rpx" }) } : {}, { n: common_vendor.o(click), o: common_vendor.s({ borderRadius: __props.radius + "px", background: __props.elBackground, height: __props.height + "px", width: __props.width }), p: common_vendor.n({ "border-content": __props.navbar }) }); }; } }; const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1f3fe5bf"], ["__file", "D:/zx/mall-front-app/sheep/components/s-search-block/s-search-block.vue"]]); wx.createComponent(Component);