2020-06-03 09:17:05 +00:00
|
|
|
<template>
|
|
|
|
<view class="out">
|
2020-08-04 11:39:31 +00:00
|
|
|
<u-tabs-swiper v-if="type == 'dianpu'" @change="tabsChange" :show-bar="false" :bold="false" :font-size="32"
|
|
|
|
active-color="#FF780F" ref="uTabs" :list="list" :is-scroll="false" style="border-bottom: 1px solid #ececec;flex-shrink:0"
|
|
|
|
height="88"></u-tabs-swiper>
|
|
|
|
<swiper v-if="type == 'dianpu'" class="swiper" :current="swiperCurrent" @transition="transition"
|
|
|
|
@animationfinish="animationfinish">
|
2020-06-03 09:17:05 +00:00
|
|
|
<swiper-item>
|
|
|
|
<scroll-view :scroll-y="true" style="height:100%">
|
|
|
|
<view style="padding-top:30rpx">
|
|
|
|
<shop></shop>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
2020-08-04 11:39:31 +00:00
|
|
|
</swiper-item>
|
|
|
|
<swiper-item>
|
2020-06-03 09:17:05 +00:00
|
|
|
<scroll-view :scroll-y="true" style="height:100%">
|
|
|
|
<view class="list">
|
2020-07-25 07:17:52 +00:00
|
|
|
<!-- <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> -->
|
2020-06-03 09:17:05 +00:00
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</swiper-item>
|
|
|
|
</swiper>
|
2020-07-18 03:44:05 +00:00
|
|
|
<view v-else style=" display: flex;flex-direction: column;height: calc(100vh - 88rpx);">
|
|
|
|
<view class="select">
|
2020-08-04 11:39:31 +00:00
|
|
|
<view @click="sx(0)" class="xz" data-type="xl">销量</view>
|
2020-07-18 03:44:05 +00:00
|
|
|
<view class="xz" @click="sx(1)">
|
|
|
|
<text>价格</text>
|
|
|
|
<view class="jiage">
|
2020-07-27 06:35:32 +00:00
|
|
|
<view class="top topxz"></view>
|
2020-07-18 03:44:05 +00:00
|
|
|
<view class="bottom bottomxz"></view>
|
|
|
|
</view>
|
2020-07-10 07:58:03 +00:00
|
|
|
</view>
|
2020-07-25 07:17:52 +00:00
|
|
|
<view data-type="hp" @click="sx(2)">好评</view>
|
2020-07-10 07:58:03 +00:00
|
|
|
</view>
|
2020-08-04 11:39:31 +00:00
|
|
|
<view class="swiper" :current="swiperCurrent" @change="huadong">
|
|
|
|
<scroll-view :scroll-y="true" style="height:100%">
|
|
|
|
<view style="padding-top:30rpx">
|
|
|
|
<shop v-for="(i,j) in shoplist" :key="j" :name="i.goods_name" :id="i.goods_id" :commonid="i.goods_commonid"
|
|
|
|
:image="i.goods_image"></shop>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</view>
|
2020-07-10 07:58:03 +00:00
|
|
|
</view>
|
2020-06-03 09:17:05 +00:00
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
2020-08-04 11:39:31 +00:00
|
|
|
.out {
|
2020-06-03 09:17:05 +00:00
|
|
|
display: flex;
|
2020-08-04 11:39:31 +00:00
|
|
|
flex-direction: column;
|
|
|
|
height: 100vh;
|
2020-06-03 09:17:05 +00:00
|
|
|
|
2020-08-04 11:39:31 +00:00
|
|
|
.sosuo {
|
|
|
|
width: 100%;
|
|
|
|
height: 88rpx;
|
|
|
|
border-bottom: 1rpx solid #ececec;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 0 30rpx;
|
2020-06-03 09:17:05 +00:00
|
|
|
flex-shrink: 0;
|
2020-08-04 11:39:31 +00:00
|
|
|
|
|
|
|
>image {
|
|
|
|
width: 18rpx;
|
|
|
|
height: 32rpx;
|
|
|
|
margin-right: 24rpx;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
align-items: center;
|
2020-06-03 09:17:05 +00:00
|
|
|
}
|
2020-08-04 11:39:31 +00:00
|
|
|
|
|
|
|
.swiper {
|
2020-06-03 09:17:05 +00:00
|
|
|
width: 100%;
|
2020-08-04 11:39:31 +00:00
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
.list {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
width: 100%;
|
|
|
|
padding-left: 30rpx;
|
|
|
|
}
|
2020-06-03 09:17:05 +00:00
|
|
|
}
|
2020-08-04 11:39:31 +00:00
|
|
|
|
|
|
|
.select {
|
|
|
|
width: 100%;
|
|
|
|
height: 89rpx;
|
|
|
|
border-bottom: 1rpx solid #ececec;
|
2020-07-10 07:58:03 +00:00
|
|
|
display: flex;
|
2020-08-04 11:39:31 +00:00
|
|
|
align-items: center;
|
|
|
|
padding: 0 40rpx;
|
|
|
|
flex-shrink: 0;
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
>view {
|
|
|
|
font-size: 32rpx;
|
|
|
|
color: #333;
|
2020-07-10 07:58:03 +00:00
|
|
|
display: flex;
|
2020-08-04 11:39:31 +00:00
|
|
|
font-weight: 400;
|
|
|
|
|
|
|
|
.jiage {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
.top {
|
|
|
|
width: 12rpx;
|
|
|
|
border-bottom: 12rpx solid #707070;
|
|
|
|
border-left: 11rpx solid #fff;
|
|
|
|
border-right: 11rpx solid #fff;
|
|
|
|
margin-bottom: 2rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.bottom {
|
|
|
|
width: 12rpx;
|
|
|
|
border-top: 12rpx solid #707070;
|
|
|
|
border-left: 11rpx solid #fff;
|
|
|
|
border-right: 11rpx solid #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
.topxz {
|
|
|
|
border-bottom: 12rpx solid #FF780F;
|
|
|
|
}
|
|
|
|
|
|
|
|
.bottomxz {
|
|
|
|
border-top: 12rpx solid #FF780F;
|
|
|
|
}
|
2020-07-10 07:58:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-04 11:39:31 +00:00
|
|
|
|
|
|
|
.xz {
|
|
|
|
color: #FF780F;
|
|
|
|
}
|
|
|
|
|
2020-07-10 07:58:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-03 09:17:05 +00:00
|
|
|
</style>
|
|
|
|
<script>
|
2020-08-04 11:39:31 +00:00
|
|
|
import shop from "../components/search/shop"
|
|
|
|
import darenItem from "@/components/index/daren-item/index"
|
|
|
|
export default {
|
|
|
|
name: "out",
|
|
|
|
components: {
|
|
|
|
shop,
|
|
|
|
darenItem
|
2020-06-03 09:17:05 +00:00
|
|
|
},
|
2020-08-04 11:39:31 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
list: [{
|
|
|
|
name: "店铺"
|
|
|
|
}, {
|
|
|
|
name: "达人"
|
|
|
|
}],
|
|
|
|
current: 0,
|
|
|
|
swiperCurrent: 0,
|
|
|
|
keyword: "",
|
|
|
|
type: "",
|
|
|
|
shoplist: []
|
|
|
|
}
|
2020-07-10 07:58:03 +00:00
|
|
|
},
|
2020-08-04 11:39:31 +00:00
|
|
|
onLoad(o) {
|
|
|
|
this.type = o.type
|
|
|
|
this.keyword = o.value
|
|
|
|
this.search()
|
2020-07-18 03:44:05 +00:00
|
|
|
},
|
2020-08-04 11:39:31 +00:00
|
|
|
methods: {
|
|
|
|
tabsChange(index) {
|
|
|
|
this.swiperCurrent = index;
|
|
|
|
},
|
|
|
|
transition(e) {
|
|
|
|
let dx = e.detail.dx;
|
|
|
|
this.$refs.uTabs.setDx(dx);
|
|
|
|
},
|
|
|
|
animationfinish(e) {
|
|
|
|
let current = e.detail.current;
|
|
|
|
this.$refs.uTabs.setFinishCurrent(current);
|
|
|
|
this.swiperCurrent = current;
|
|
|
|
this.current = current;
|
|
|
|
},
|
|
|
|
sx(type) {
|
|
|
|
console.log(type)
|
|
|
|
|
|
|
|
},
|
|
|
|
huadong(e) {
|
|
|
|
console.log(e.detail.current)
|
|
|
|
},
|
|
|
|
search() {
|
|
|
|
this.$u.api.ShopSearch({
|
|
|
|
keyword: this.keyword
|
|
|
|
}).then((res) => {
|
|
|
|
this.shoplist = res.data.data
|
|
|
|
})
|
|
|
|
}
|
2020-07-18 03:44:05 +00:00
|
|
|
},
|
2020-08-04 11:39:31 +00:00
|
|
|
}
|
|
|
|
</script>
|