| | |
| | | </view> |
| | | <view class="search_box_item_xl" v-if="searchData && searchData.length > 0"> |
| | | <view class="search_box_item_xl_item" v-for="(item, i) in searchData" :key="i"> |
| | | <view :class="index === i ? 'search_box_item_xl_item_name active' : 'search_box_item_xl_item_name'" @click="clickItem(item, i)">{{ item.name }}</view><span v-if="item.price">¥{{ item.price }}</span> |
| | | <view :class="index === i ? 'search_box_item_xl_item_name active' : 'search_box_item_xl_item_name'" @click="clickItem(item, i)" @mouseenter="aaa(i)" @mouseleave="bbb"> |
| | | |
| | | <span :style="{color: fontColorIndex === i ? fontColor : ''}">{{item.name}}</span> |
| | | </view> |
| | | <span v-if="item.price">¥{{ item.price }}</span> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | name2: '', |
| | | |
| | | index: 0, |
| | | focus: true |
| | | focus: true, |
| | | fontColorIndex: '' |
| | | } |
| | | }, |
| | | props: { |
| | |
| | | }, |
| | | categoryid: { |
| | | type: Number | String |
| | | }, |
| | | |
| | | fontColor:{ |
| | | type: Number | String |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | aaa(index) { |
| | | this.fontColorIndex = index |
| | | }, |
| | | bbb() { |
| | | this.fontColorIndex = '' |
| | | }, |
| | | percentage(bgColor, alpha) { |
| | | let res = +(alpha * 2.55).toFixed(0) |
| | | return bgColor + res.toString(16) |
| | |
| | | // color: #FFF200; |
| | | // } |
| | | // } |
| | | .active { |
| | | .active { |
| | | color: #FFF200 !important; |
| | | } |
| | | } |
| | | .search_box_item_xl_item_name { |
| | | flex: 1; |
| | | height: 100%; |