|
|
@@ -30,6 +30,17 @@ |
|
|
|
<text>{{item.name}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="seckill-section"> |
|
|
|
<view class="floor-list-whitelist"> |
|
|
|
<view v-for="(item, index) in cateList" :key="index" class="floor-item" @click="navToDetailPages(item)"> |
|
|
|
<view style="width:100%;text-align: center;"> |
|
|
|
<image :src="item.image" mode="aspectFill"></image> |
|
|
|
</view> |
|
|
|
<text class="title clamp">{{item.title }}</text> |
|
|
|
<text class="price">¥{{item.sales_price }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 秒杀楼层 --> |
|
|
|
<view class="seckill-section" v-if="flashSale && flashSale.product.length > 0"> |
|
|
|
<!-- <view class="s-header" @click="navTo('/pages/flash/list')"> --> |
|
|
@@ -42,6 +53,18 @@ |
|
|
|
<!-- <text class="yticon icon-you"></text> --> |
|
|
|
<!-- </view> --> |
|
|
|
<view class="floor-list-whitelist"> |
|
|
|
<view v-for="item in cateList" :key="item.id"> |
|
|
|
<view class="cate-item b-b two" :class="{active: item.id==fId}" @click="changeFirst(item.id)">{{item.name}}</view> |
|
|
|
<view |
|
|
|
v-for="tItem in item.child" :key="tItem.id" |
|
|
|
class="cate-item b-b" |
|
|
|
:class="{active: tItem.id==sId}" |
|
|
|
@click="changeSecond(tItem)"> |
|
|
|
{{tItem.name}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <view class="floor-list-whitelist"> |
|
|
|
<view v-for="(item, index) in flashSale.product" :key="index" class="floor-item" @click="navToDetailPage({ product_id: item.flash_product_id }, flashSale.flash_id)"> |
|
|
|
<view style="width:100%;text-align: center;"> |
|
|
|
<image :src="item.image" mode="aspectFill"></image> |
|
|
@@ -49,7 +72,7 @@ |
|
|
|
<text class="title clamp">{{item.title }}</text> |
|
|
|
<text class="price">¥{{item.sales_price }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<!-- <scroll-view class="floor-list" scroll-x> |
|
|
|
<view class="scoll-wrapper"> |
|
|
|
<view v-for="(item, index) in flashSale.product" :key="index" class="floor-item" @click="navToDetailPage({ product_id: item.flash_product_id }, flashSale.flash_id)"> |
|
|
@@ -218,6 +241,7 @@ |
|
|
|
goodsList: [], |
|
|
|
menu: [], |
|
|
|
flashSale: '', |
|
|
|
cateList: [], |
|
|
|
page: 1, |
|
|
|
pageSize: 16, |
|
|
|
day: 0, |
|
|
@@ -230,6 +254,7 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.loadCateList(); |
|
|
|
this.loadData(); |
|
|
|
}, |
|
|
|
onShow() { |
|
|
@@ -244,6 +269,7 @@ |
|
|
|
} |
|
|
|
this.goodsList = []; |
|
|
|
this.page = 1; |
|
|
|
this.loadCateList(); |
|
|
|
this.loadData(); |
|
|
|
}, |
|
|
|
onShareAppMessage(e) { |
|
|
@@ -303,6 +329,11 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
async loadCateList(fid, sid){ |
|
|
|
const that = this; |
|
|
|
//let list = await this.$api.json('cateList'); |
|
|
|
this.cateList = await this.$api.request('/product/lists', 'GET', {fid:"",sid:0,page:this.page,by:'weigh',desc:'desc'}); |
|
|
|
}, |
|
|
|
// 获取限时秒杀数据 |
|
|
|
async getFlash() { |
|
|
|
let data = await this.$api.request('/flash/index'); |
|
|
@@ -322,6 +353,12 @@ |
|
|
|
this.swiperCurrent = index; |
|
|
|
this.titleNViewBackground = this.carouselList[index].background; |
|
|
|
}, |
|
|
|
//详情 |
|
|
|
navToDetailPages(item){ |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/pages/product/product?id=${item.product_id}` |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 商品详情页 |
|
|
|
navToDetailPage(item, flash_id = 0) { |
|
|
|
let id = item.product_id; |
|
|
|