123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <template>
- <view class="search-content">
- <view class="search-box">
- <view class="search-input-box">
- <svg t="1733904658291" class="search-icon" viewBox="0 0 1024 1024" version="1.1"
- xmlns="http://www.w3.org/2000/svg" p-id="5981" xmlns:xlink="http://www.w3.org/1999/xlink">
- <path
- d="M174.545 465.455c0-18.619 16.291-34.91 34.91-34.91s34.909 16.291 34.909 34.91c0 121.018 100.072 221.09 221.09 221.09 18.619 0 34.91 16.291 34.91 34.91s-16.291 34.909-34.91 34.909c-160.581 0-290.909-130.328-290.909-290.91z m290.91 360.727c200.145 0 360.727-160.582 360.727-360.727S665.6 104.727 465.455 104.727 104.727 265.31 104.727 465.455 265.31 826.182 465.455 826.182z m323.49-76.8L961.164 921.6c13.963 13.964 13.963 34.91 0 48.873-13.964 13.963-34.91 13.963-48.873 0L737.745 795.927c-74.472 60.51-169.89 97.746-272.29 97.746C228.073 896 34.909 702.836 34.909 465.455S228.073 34.909 465.455 34.909 896 228.073 896 465.455c0 109.381-39.564 209.454-107.055 283.927z"
- p-id="5982">
- </path>
- </svg>
- <input confirm-type="search" ref="searchInputRef" class="search-input" :auto-blur="true" type="text"
- placeholder="请输入关键字" v-model="searchKey" @blur="onSearchBlur()"
- @confirm="onSearchFocus()" />
- </view>
- <view class="search-select">
- <view class="select-item" @click.stop="$refs.cityRef.open()">
- <text class="item-text one-row">{{params.codeLabel || '办理区域'}}</text>
- <u-icon name="arrow-down-fill" color="#101010" size="16"></u-icon>
- </view>
- <view class="select-item" @click.stop="$refs.mapTypeRef.open()">
- <text class="item-text one-row">{{ params.typeName || '位置类型'}}</text>
- <u-icon name="arrow-down-fill" color="#101010" size="16"></u-icon>
- </view>
- </view>
- </view>
- <!-- 选择地址 -->
- <city ref="cityRef" :code.sync="params.code" @cityName="e => params.codeLabel = e" />
- <!-- 选择位置类型 -->
- <mapType ref="mapTypeRef" :mapTypeId.sync="params.mapTypeId" @typeName="e => params.typeName = e" />
- </view>
- </template>
- <script>
- import { getMapList_Api } from "@/api/map.js"
- export default {
- data() {
- return {
- searchKey: undefined,
- params: {
- code: undefined,
- codeLabel: undefined,
- mapTypeId: undefined,
- typeName: undefined,
- }
- }
- },
- methods: {
- init() {
- },
- onSearchBlur(){},
- onSearchFocus() {
- let pms = {};
- if(this.params.code ){
- pms.provinceCode = this.params.code[0] || undefined
- pms.cityCode = this.params.code[1] || undefined
- pms.areaCode = this.params.code[2] || undefined
- }
- pms.mapTypeId = this.params.mapTypeId;
- pms.searchKey = this.searchKey;
- this.$emit("handleSearch" , pms)
- },
- getVal(){
- return {
-
- }
- },
- getMapList() {
- }
- },
- watch: {
- params: {
- handler(newV, oldV) {
- this.onSearchFocus()
- },
- deep: true
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- $radius_ : 20rpx;
- $heig_: 80rpx;
- .search-box {
- // padding: 20rpx 20rpx 0;
- position: fixed;
- left: 20rpx;
- top: 20rpx;
- right: 20rpx;
- z-index: 999;
- background-color: #fff;
- border-radius: $radius_ ;
- overflow: hidden;
- .search-input-box {
- width: 100%;
- height: $heig_;
- display: flex;
- align-items: center;
- padding: 0 10px;
- color: #020202;
- .search-icon {
- width: 45rpx;
- height: 45rpx;
- path {
- fill: #020202;
- }
- }
- .search-input {
- padding-left: 10px;
- }
- }
- .search-select {
- border-top: 1rpx solid #E8E8E8;
- width: 100%;
- height: $heig_;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .select-item {
- width: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 30rpx;
- padding: 0 10rpx;
- .item-text {
- display: inline-block;
- padding-right: 6rpx;
- overflow: hidden;
- }
- }
- }
- }
- </style>
|