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 goods_id: id
}); });
}, },
// 商品搜索
ShopSearch({keyword,page = 1,order = 'goods_salenum'}){
return vm.$u.post('ShopSearch/search',{
keyword,page,order
})
},
// 秒杀推荐 // 秒杀推荐
recommendedSpike() { recommendedSpike() {
return vm.$u.post('Spike/recommendedSpike'); return vm.$u.post('Spike/recommendedSpike');

View File

@ -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>

View File

@ -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,17 +21,42 @@
</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>
@ -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>