前端 + 后端:商品搜索

This commit is contained in:
YunaiV
2019-04-24 21:47:43 +08:00
parent 68dadab873
commit b98e21e157
29 changed files with 770 additions and 125 deletions

View File

@@ -8,17 +8,20 @@
style="background:#fff"
>
<template slot="thumb">
<img :src="product.picUrls[0]"/>
<img :src="product.picUrls && product.picUrls ? product.picUrls[0] : ''"/>
<!-- TODO 芋艿 暂时去掉 -->
<!-- <p v-if="product.imageTag!=null&&product.imageTag!=''" class="image_tag">{{product.imageTag}}</p>-->
</template>
<template slot="tags">
<p class="price" v-if="product.price!=null && product.price !== ''">
<span>{{product.price / 100.00}}</span>
<p class="price" v-if="product.buyPrice || product.price">
<span>{{product.buyPrice ? product.buyPrice / 100.00 : product.price / 100.00}}</span>
<!-- TODO 芋艿 暂时去掉 -->
<!-- <van-tag v-if="product.tags!=null" v-for="tag in product.tags" :key="tag" plain type="danger">-->
<!-- {{tag}}-->
<!-- </van-tag>-->
<van-tag v-if="product.promotionActivityTitle" plain type="danger">
{{ product.promotionActivityTitle }}
</van-tag>
</p>
<!-- TODO 芋艿 暂时去掉 -->

View File

@@ -8,13 +8,13 @@
placeholder="请输入搜索关键词"
background="#fff"
show-action
@search="onSearch"
@search="onSearchClick"
slot="title"
>
<div slot="action" @click="onSearch">搜索</div>
<div slot="action" @click="onSearchClick">搜索</div>
</van-search>
</van-nav-bar>
</div>
</template>
@@ -27,14 +27,19 @@ export default {
components:{
[Search.name]:Search,
},
props: {
// keyword: String,
// onSearch: Function,
},
data(){
return{
value:'',
}
},
methods:{
onSearch() {
console.log(this.value);
onSearchClick() {
// this.props.onSearch(this.keyword);
this.$emit('onSearch', this.value);
},
onBack() {
history.back();