|
|
@ -523,9 +523,9 @@ |
|
|
|
:src="$picUrl+'/static/user/right.png'"></image> |
|
|
|
:src="$picUrl+'/static/user/right.png'"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="goodsRecommend" v-if="isLogin == false || userInfo.user_type != 40"> |
|
|
|
<view class="goodsRecommend" v-if="isLogin == false || userInfo.user_type != 40"> |
|
|
|
<!-- <u-waterfall v-model="suggestGoodsList" ref="uWaterfall1"> --> |
|
|
|
<!-- <u-waterfall v-model="goodsRecommend" ref="uWaterfall1"> --> |
|
|
|
<!-- <template v-slot:left="{leftList}"> --> |
|
|
|
<!-- <template v-slot:left="{leftList}"> --> |
|
|
|
<view class="goodsItem" v-for="(item,index) in suggestGoodsList" @click="goodsDetail(item)" |
|
|
|
<view class="goodsItem" v-for="(item,index) in goodsRecommend" @click="goodsDetail(item)" |
|
|
|
:key="index"> |
|
|
|
:key="index"> |
|
|
|
<view class="pic"> |
|
|
|
<view class="pic"> |
|
|
|
<image :src="item.goods_image" mode="aspectFill"></image> |
|
|
|
<image :src="item.goods_image" mode="aspectFill"></image> |
|
|
@ -616,6 +616,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> --> |
|
|
|
</template> --> |
|
|
|
<!-- </u-waterfall> --> |
|
|
|
<!-- </u-waterfall> --> |
|
|
|
|
|
|
|
<view v-if="goodsRecommend.length" class="finished">{{ recommendLoadTitle }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
@ -688,7 +689,10 @@ |
|
|
|
memberCode: false, |
|
|
|
memberCode: false, |
|
|
|
isLogin: false, |
|
|
|
isLogin: false, |
|
|
|
userInfo: {}, |
|
|
|
userInfo: {}, |
|
|
|
suggestGoodsList: [], |
|
|
|
goodsRecommend: [], |
|
|
|
|
|
|
|
recommendPage: 1, |
|
|
|
|
|
|
|
recommendFinish: false, |
|
|
|
|
|
|
|
recommendLoadTitle: '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onShow(options) { |
|
|
|
onShow(options) { |
|
|
@ -706,7 +710,16 @@ |
|
|
|
recovery_order: {} |
|
|
|
recovery_order: {} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.getSuggest(); |
|
|
|
this.recommendPage = 1; |
|
|
|
|
|
|
|
this.recommendFinish = false; |
|
|
|
|
|
|
|
this.recommendLoadTitle = ''; |
|
|
|
|
|
|
|
this.goodsRecommend = []; |
|
|
|
|
|
|
|
this.getSuggest() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onReachBottom() { |
|
|
|
|
|
|
|
if (!this.recommendFinish) { |
|
|
|
|
|
|
|
this.getSuggest() |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onPageScroll(e) { |
|
|
|
onPageScroll(e) { |
|
|
|
if (e.scrollTop <= 200) { // 当滚动到顶部且向下滑动时为true |
|
|
|
if (e.scrollTop <= 200) { // 当滚动到顶部且向下滑动时为true |
|
|
@ -854,20 +867,24 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
getSuggest() { |
|
|
|
getSuggest() { |
|
|
|
// 获取推荐商品 |
|
|
|
// 获取推荐商品 |
|
|
|
const that = this |
|
|
|
Api.recommendedNew({ page: this.recommendPage++ }).then(res => { |
|
|
|
Api.recommended() |
|
|
|
console.log(res); |
|
|
|
.then(res => { |
|
|
|
let arr = res.data.goodsList.data |
|
|
|
let arr = res.data.goodsList |
|
|
|
if (arr && arr.length > 0) { |
|
|
|
if (arr && arr.length > 0) { |
|
|
|
for (let i = 0; i < arr.length; i++) { |
|
|
|
arr.map(a => { |
|
|
|
arr[i].goods_price_min = Number(arr[i].goods_price_min); |
|
|
|
a.goods_price_min = Number(a.goods_price_min) |
|
|
|
arr[i].goods_price_max = Number(arr[i].goods_price_max) |
|
|
|
a.goods_price_max = Number(a.goods_price_max) |
|
|
|
arr[i].line_price_min = Number(arr[i].line_price_min); |
|
|
|
a.line_price_min = Number(a.line_price_min) |
|
|
|
arr[i].line_price_max = Number(arr[i].line_price_max) |
|
|
|
a.line_price_max = Number(a.line_price_max) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
that.suggestGoodsList = arr |
|
|
|
} |
|
|
|
}) |
|
|
|
if (arr.length < res.data.goodsList.per_page) { |
|
|
|
|
|
|
|
this.recommendFinish = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.recommendLoadTitle = this.recommendFinish ? "已全部加载完" : "上拉加载更多"; |
|
|
|
|
|
|
|
this.goodsRecommend = [...this.goodsRecommend, ...arr] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 刷新页面 |
|
|
|
// 刷新页面 |
|
|
|
onRefreshPage() { |
|
|
|
onRefreshPage() { |
|
|
@ -1388,6 +1405,15 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.finished { |
|
|
|
|
|
|
|
font-size: 28rpx; |
|
|
|
|
|
|
|
line-height: 100rpx; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
color: #bbb; |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.section_1 { |
|
|
|
.section_1 { |
|
|
|