商家首页
This commit is contained in:
@@ -38,7 +38,14 @@
|
||||
</view>
|
||||
<view class="main">
|
||||
<view class="classify" v-if="cur==0">
|
||||
111
|
||||
<view v-for="item in indextop" :key="item.id">
|
||||
<videoTop :url="item.url" v-if="item.type == 2"></videoTop>
|
||||
<imageTop v-else :url="item.url"></imageTop>
|
||||
</view>
|
||||
<view style="display: flex;flex-wrap: wrap;">
|
||||
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.url"></listitem>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 商品筛选排序未完成 -->
|
||||
<view class="item" v-if="cur==1">
|
||||
@@ -67,16 +74,25 @@
|
||||
</template>
|
||||
<script>
|
||||
import item from "@/components/shop/list/item"
|
||||
import videoTop from "../components/merchant/video-top"
|
||||
import imageTop from "../components/merchant/image-top"
|
||||
import listitem from "../components/merchant/list-item"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
cur: 0,
|
||||
list:[]
|
||||
list:[],
|
||||
indexlist:[],
|
||||
indextop:[]
|
||||
}
|
||||
},
|
||||
components:{
|
||||
item
|
||||
item,
|
||||
videoTop,
|
||||
imageTop,
|
||||
listitem
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
@@ -87,9 +103,14 @@ export default {
|
||||
},
|
||||
onLoad(){
|
||||
this.$u.api.getStoreGoodsList({id:1}).then((res)=>{
|
||||
console.log(res.data)
|
||||
// console.log(res.data)
|
||||
this.list= res.data.list
|
||||
})
|
||||
this.$u.api.getStoreImgVideoList({id:1}).then((res)=>{
|
||||
console.log(res.data)
|
||||
this.indextop = [res.data[0],res.data[1]]
|
||||
this.indexlist = res.data.slice(2,)
|
||||
})
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -155,7 +176,7 @@ export default {
|
||||
background-color: #ffffff;
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
height: 140rpx;
|
||||
// height: 140rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 30rpx;
|
||||
|
||||
Reference in New Issue
Block a user