商品搜索
This commit is contained in:
		
							parent
							
								
									d1e1934239
								
							
						
					
					
						commit
						82d387a000
					
				@ -149,6 +149,12 @@ export default {
 | 
				
			|||||||
				return vm.$u.post('goods/goodsInfo', {
 | 
									return vm.$u.post('goods/goodsInfo', {
 | 
				
			||||||
					goods_id: id
 | 
										goods_id: id
 | 
				
			||||||
				});
 | 
									});
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								// 商品搜索
 | 
				
			||||||
 | 
								ShopSearch({keyword,page = 1,order = 'goods_salenum'}){
 | 
				
			||||||
 | 
									return vm.$u.post('ShopSearch/search',{
 | 
				
			||||||
 | 
										keyword,page,order
 | 
				
			||||||
 | 
									})
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,9 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
    <view class="shop">
 | 
					    <view class="shop" @click="tap">
 | 
				
			||||||
        <image></image>
 | 
					        <image :src="image"></image>
 | 
				
			||||||
        <view class="info">
 | 
					        <view class="info">
 | 
				
			||||||
            <text class="title">这是标题</text>
 | 
					            <text class="title">{{name}}</text>
 | 
				
			||||||
            <text class="profile u-line-2">这是简介</text>
 | 
					            <text class="profile u-line-2">{{advword}}</text>
 | 
				
			||||||
        </view>
 | 
					        </view>
 | 
				
			||||||
    </view>
 | 
					    </view>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
@ -14,6 +14,12 @@ export default {
 | 
				
			|||||||
        return {
 | 
					        return {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    props:['name','advword','id','image'],
 | 
				
			||||||
 | 
					    methods:{
 | 
				
			||||||
 | 
					        tap(){
 | 
				
			||||||
 | 
					            this.$emit("tap",{id:this.id})
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
				
			|||||||
@ -10,10 +10,6 @@
 | 
				
			|||||||
                <scroll-view :scroll-y="true" style="height:100%">
 | 
					                <scroll-view :scroll-y="true" style="height:100%">
 | 
				
			||||||
                    <view style="padding-top:30rpx">
 | 
					                    <view style="padding-top:30rpx">
 | 
				
			||||||
                        <shop></shop>
 | 
					                        <shop></shop>
 | 
				
			||||||
                        <shop></shop>
 | 
					 | 
				
			||||||
                        <shop></shop>
 | 
					 | 
				
			||||||
                        <shop></shop>
 | 
					 | 
				
			||||||
                        <shop></shop>
 | 
					 | 
				
			||||||
                    </view>
 | 
					                    </view>
 | 
				
			||||||
                </scroll-view>
 | 
					                </scroll-view>
 | 
				
			||||||
            </swiper-item> 
 | 
					            </swiper-item> 
 | 
				
			||||||
@ -25,18 +21,43 @@
 | 
				
			|||||||
                </scroll-view>
 | 
					                </scroll-view>
 | 
				
			||||||
            </swiper-item>
 | 
					            </swiper-item>
 | 
				
			||||||
        </swiper>
 | 
					        </swiper>
 | 
				
			||||||
        <view class="select">
 | 
					        <view v-else style=" display: flex;flex-direction: column;height: calc(100vh - 88rpx);">
 | 
				
			||||||
            <view  @click="sx(1)" data-type="xl">销量</view>
 | 
					            <view class="select">
 | 
				
			||||||
            <view class="xz" @click="sx(2)">
 | 
					                <view  @click="sx(0)" data-type="xl">销量</view>
 | 
				
			||||||
                <text>价格</text>
 | 
					                <view class="xz" @click="sx(1)">
 | 
				
			||||||
                <view class="jiage">
 | 
					                    <text>价格</text>
 | 
				
			||||||
                    <view class="top"></view>
 | 
					                    <view class="jiage">
 | 
				
			||||||
                    <view class="bottom bottomxz"></view>
 | 
					                        <view class="top"></view>
 | 
				
			||||||
 | 
					                        <view class="bottom bottomxz"></view>
 | 
				
			||||||
 | 
					                    </view>
 | 
				
			||||||
                </view>
 | 
					                </view>
 | 
				
			||||||
 | 
					                <view  data-type="hp"  @click="sx(2)">好评</view>
 | 
				
			||||||
            </view>
 | 
					            </view>
 | 
				
			||||||
            <view  data-type="hp"  @click="sx(3)">好评</view>
 | 
					              <swiper class="swiper"  :current="swiperCurrent" @change="huadong">
 | 
				
			||||||
 | 
					                <swiper-item>
 | 
				
			||||||
 | 
					                    <scroll-view :scroll-y="true" style="height:100%">
 | 
				
			||||||
 | 
					                        <view style="padding-top:30rpx">
 | 
				
			||||||
 | 
					                            <shop v-for="(i,j) in shoplist[0]" :key="j" :name="i.goods_name" :id="i.goods_id" :commonid="i.goods_commonid" :image="i.goods_image"></shop>
 | 
				
			||||||
 | 
					                         
 | 
				
			||||||
 | 
					                        </view>
 | 
				
			||||||
 | 
					                    </scroll-view>
 | 
				
			||||||
 | 
					                </swiper-item> 
 | 
				
			||||||
 | 
					                <swiper-item> 
 | 
				
			||||||
 | 
					                    <scroll-view :scroll-y="true" style="height:100%">
 | 
				
			||||||
 | 
					                        <view class="list">
 | 
				
			||||||
 | 
					                            <!-- <darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0rpx 3rpx 7rpx 0rpx rgba(153, 153, 153, 0.35);" v-for="item in 50"></darenItem> -->
 | 
				
			||||||
 | 
					                        </view>
 | 
				
			||||||
 | 
					                    </scroll-view>
 | 
				
			||||||
 | 
					                </swiper-item>
 | 
				
			||||||
 | 
					                <swiper-item> 
 | 
				
			||||||
 | 
					                    <scroll-view :scroll-y="true" style="height:100%">
 | 
				
			||||||
 | 
					                       D
 | 
				
			||||||
 | 
					                    </scroll-view>
 | 
				
			||||||
 | 
					                </swiper-item>
 | 
				
			||||||
 | 
					            </swiper>
 | 
				
			||||||
        </view>
 | 
					        </view>
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    </view>
 | 
					    </view>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
<style lang="scss" scoped>
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
@ -137,9 +158,11 @@ export default {
 | 
				
			|||||||
            current: 0, 
 | 
					            current: 0, 
 | 
				
			||||||
            swiperCurrent: 0,
 | 
					            swiperCurrent: 0,
 | 
				
			||||||
            keyword:"",
 | 
					            keyword:"",
 | 
				
			||||||
            type:""
 | 
					            type:"",
 | 
				
			||||||
 | 
					            shoplist:[]
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }, methods: { 
 | 
					    }, 
 | 
				
			||||||
 | 
					    methods: { 
 | 
				
			||||||
        tabsChange(index) {
 | 
					        tabsChange(index) {
 | 
				
			||||||
            this.swiperCurrent = index; 
 | 
					            this.swiperCurrent = index; 
 | 
				
			||||||
        }, 
 | 
					        }, 
 | 
				
			||||||
@ -155,11 +178,21 @@ export default {
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        sx(type){
 | 
					        sx(type){
 | 
				
			||||||
            console.log(type)
 | 
					            console.log(type)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        huadong(e){
 | 
				
			||||||
 | 
					            console.log(e.detail.current)
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        search(){
 | 
				
			||||||
 | 
					            this.$u.api.ShopSearch({keyword:this.keyword}).then((res)=>{
 | 
				
			||||||
 | 
					                this.shoplist[0] = res.data.data
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    onLoad(o){
 | 
					    onLoad(o){
 | 
				
			||||||
        this.type = o.type
 | 
					        this.type = o.type
 | 
				
			||||||
        this.keyword = o.value
 | 
					        this.keyword = o.value
 | 
				
			||||||
 | 
					        this.search()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user