Merge pull request 'xbx' (#68) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/68
This commit is contained in:
luyuan 2020-07-18 15:58:22 +08:00
commit 157a29457a
3 changed files with 63 additions and 18 deletions

View File

@ -172,6 +172,12 @@ export default {
goods_id: id
});
},
// 商品搜索
ShopSearch({keyword,page = 1,order = 'goods_salenum'}){
return vm.$u.post('ShopSearch/search',{
keyword,page,order
})
},
// 秒杀推荐
recommendedSpike() {
return vm.$u.post('Spike/recommendedSpike');

View File

@ -1,9 +1,9 @@
<template>
<view class="shop">
<image></image>
<view class="shop" @click="tap">
<image :src="image"></image>
<view class="info">
<text class="title">这是标题</text>
<text class="profile u-line-2">这是简介</text>
<text class="title">{{name}}</text>
<text class="profile u-line-2">{{advword}}</text>
</view>
</view>
</template>
@ -14,6 +14,12 @@ export default {
return {
}
},
props:['name','advword','id','image'],
methods:{
tap(){
this.$emit("tap",{id:this.id})
}
}
}
</script>

View File

@ -10,10 +10,6 @@
<scroll-view :scroll-y="true" style="height:100%">
<view style="padding-top:30rpx">
<shop></shop>
<shop></shop>
<shop></shop>
<shop></shop>
<shop></shop>
</view>
</scroll-view>
</swiper-item>
@ -25,17 +21,42 @@
</scroll-view>
</swiper-item>
</swiper>
<view class="select">
<view @click="sx(1)" data-type="xl">销量</view>
<view class="xz" @click="sx(2)">
<text>价格</text>
<view class="jiage">
<view class="top"></view>
<view class="bottom bottomxz"></view>
<view v-else style=" display: flex;flex-direction: column;height: calc(100vh - 88rpx);">
<view class="select">
<view @click="sx(0)" data-type="xl">销量</view>
<view class="xz" @click="sx(1)">
<text>价格</text>
<view class="jiage">
<view class="top"></view>
<view class="bottom bottomxz"></view>
</view>
</view>
<view data-type="hp" @click="sx(2)">好评</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>
</template>
@ -137,9 +158,11 @@ export default {
current: 0,
swiperCurrent: 0,
keyword:"",
type:""
type:"",
shoplist:[]
}
}, methods: {
},
methods: {
tabsChange(index) {
this.swiperCurrent = index;
},
@ -155,11 +178,21 @@ export default {
},
sx(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){
this.type = o.type
this.keyword = o.value
this.search()
}
}
</script>