|
|
@ -2,7 +2,8 @@ |
|
|
|
<view class="goods"> |
|
|
|
<view class="goods"> |
|
|
|
<u-navbar> |
|
|
|
<u-navbar> |
|
|
|
<view class="slot-wrap"> |
|
|
|
<view class="slot-wrap"> |
|
|
|
<u-search @click="openPage()" placeholder="iPhone 15" disabled :show-action="false" v-model="keyword"></u-search> |
|
|
|
<u-search @click="openPage()" placeholder="iPhone 15" disabled :show-action="false" v-model="keyword"> |
|
|
|
|
|
|
|
</u-search> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-navbar> |
|
|
|
</u-navbar> |
|
|
|
<view class="goods-hd"> |
|
|
|
<view class="goods-hd"> |
|
|
@ -28,8 +29,8 @@ |
|
|
|
<view class="item" @click="tabFilter(3,7)" :class="filterIndex==3?'item-on':''">综合</view> |
|
|
|
<view class="item" @click="tabFilter(3,7)" :class="filterIndex==3?'item-on':''">综合</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<scroll-view scroll-y class="l"> |
|
|
|
<scroll-view scroll-y class="l"> |
|
|
|
<view class="item" v-for="(item,index) in list" v-if="list.length>0" :key="index" @click="goodsDetail(item.goods_id)" |
|
|
|
<view class="item" v-for="(item,index) in list" v-if="list.length>0" :key="index" |
|
|
|
:isLoading="isLoading"> |
|
|
|
@click="goodsDetail(item.goods_id)" :isLoading="isLoading"> |
|
|
|
<image :src="item.goods_image"></image> |
|
|
|
<image :src="item.goods_image"></image> |
|
|
|
<view class="title"> |
|
|
|
<view class="title"> |
|
|
|
<text>自营</text>{{item.goods_name}} |
|
|
|
<text>自营</text>{{item.goods_name}} |
|
|
@ -69,9 +70,13 @@ |
|
|
|
categoryChildren: [], |
|
|
|
categoryChildren: [], |
|
|
|
list: [], |
|
|
|
list: [], |
|
|
|
swiperList: [], |
|
|
|
swiperList: [], |
|
|
|
orderSort: 1 |
|
|
|
orderSort: 1, |
|
|
|
|
|
|
|
type: 0 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
onLoad(op) { |
|
|
|
|
|
|
|
this.type = op.type |
|
|
|
|
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -94,7 +99,7 @@ |
|
|
|
// 获取分类 |
|
|
|
// 获取分类 |
|
|
|
getCategoryList() { |
|
|
|
getCategoryList() { |
|
|
|
const app = this; |
|
|
|
const app = this; |
|
|
|
Api.category() |
|
|
|
Api.category({is_in_store:this.type==1?1:0}) |
|
|
|
.then(result => { |
|
|
|
.then(result => { |
|
|
|
app.categoryList = result.data.list; |
|
|
|
app.categoryList = result.data.list; |
|
|
|
app.categoryChildren = result.data.list[0].children; |
|
|
|
app.categoryChildren = result.data.list[0].children; |
|
|
@ -111,13 +116,14 @@ |
|
|
|
is_brand: 1, |
|
|
|
is_brand: 1, |
|
|
|
is_new: 0, |
|
|
|
is_new: 0, |
|
|
|
categoryId: categoryId, |
|
|
|
categoryId: categoryId, |
|
|
|
order: app.orderSort |
|
|
|
order: app.orderSort, |
|
|
|
|
|
|
|
is_in_store:this.type==1?1:0 |
|
|
|
} |
|
|
|
} |
|
|
|
Api.brandList(pamars) |
|
|
|
Api.brandList(pamars) |
|
|
|
.then(result => { |
|
|
|
.then(result => { |
|
|
|
let arr = result.data.data; |
|
|
|
let arr = result.data.data; |
|
|
|
if(arr && arr.length > 0){ |
|
|
|
if (arr && arr.length > 0) { |
|
|
|
arr.map(a=>{ |
|
|
|
arr.map(a => { |
|
|
|
a.goods_price_min = Number(a.goods_price_min) |
|
|
|
a.goods_price_min = Number(a.goods_price_min) |
|
|
|
a.goods_price_max = Number(a.goods_price_max) |
|
|
|
a.goods_price_max = Number(a.goods_price_max) |
|
|
|
a.line_price_min = Number(a.line_price_min) |
|
|
|
a.line_price_min = Number(a.line_price_min) |
|
|
@ -129,12 +135,12 @@ |
|
|
|
.finally(() => app.isLoading = false) |
|
|
|
.finally(() => app.isLoading = false) |
|
|
|
}, |
|
|
|
}, |
|
|
|
tabItem(index, item) { |
|
|
|
tabItem(index, item) { |
|
|
|
console.log(item,'1') |
|
|
|
console.log(item, '1') |
|
|
|
this.tabIndex = index; |
|
|
|
this.tabIndex = index; |
|
|
|
this.getBrandList(item.category_id) |
|
|
|
this.getBrandList(item.category_id) |
|
|
|
}, |
|
|
|
}, |
|
|
|
tabItem1(item, index) { |
|
|
|
tabItem1(item, index) { |
|
|
|
console.log(item,'2') |
|
|
|
console.log(item, '2') |
|
|
|
this.tabIndex1 = index; |
|
|
|
this.tabIndex1 = index; |
|
|
|
let app = this; |
|
|
|
let app = this; |
|
|
|
app.categoryChildren = []; |
|
|
|
app.categoryChildren = []; |
|
|
@ -183,6 +189,7 @@ |
|
|
|
&-hd { |
|
|
|
&-hd { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 400rpx; |
|
|
|
height: 400rpx; |
|
|
|
|
|
|
|
|
|
|
|
image { |
|
|
|
image { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
height: 100%; |
|
|
|