Commit 5c07fe67 authored by lijiongliang's avatar lijiongliang

精选商城修改

parent 8699eade
......@@ -2,7 +2,7 @@
<view class="main_content">
<index v-if="tab=='index'"></index>
<moveCar v-if="tab=='moveCar'"></moveCar>
<shop v-if="tab=='shop'"></shop>
<shop v-if="tab=='shop'" ref="shop" :page="page"></shop>
<personal v-if="tab=='personal'" ref="personal"></personal>
<u-gap bgColor="transparent" height="055"></u-gap>
<view class="tabbar">
......@@ -32,6 +32,7 @@ export default {
data() {
return {
tab: "index",
page:1
}
},
computed: {
......@@ -47,6 +48,14 @@ export default {
this.$refs.personal.getUserInfo();
}
},
onReachBottom(){
let refresh = uni.getStorageSync("refresh")
if(refresh == 0){
if(this.tab == 'shop'){
this.page++;
}
}
},
methods: {
tabChange(index) {
let that = this
......
......@@ -25,21 +25,21 @@
</div>
<div class="shop__list__one">
<div class="view__title">车主精选 养车必备</div>
<scroll-list ref="list" :option="option" @load="load" @refresh="refresh">
<div class="list__one__items" v-if="boutiqueMallList.length>0">
<div class="one__item" v-for="(vo,inx) in boutiqueMallList" :key="inx" @click="goDetail(vo.id)">
<div class="one__item__img">
<view class="owner-select" v-if="boutiqueMallList.length > 0">
<view class="one_item" v-for="(vo,inx) in boutiqueMallList" :key="inx" @click="goDetail(vo.id)">
<view class="one_item_img">
<image :src="getImage(vo.mainImgUrl)" />
</div>
<div class="one__item__title">
</view>
<view class="one_item_title">
{{vo.title}}
</div>
<div class="one__item__price">
{{vo.currentPrice/100}}<span class="num__two">{{vo.originalPrice/100}}</span>
</div>
</div>
</div>
</scroll-list>
</view>
<view class="one_item_price">
{{vo.currentPrice/100}}
<span class="num__two">{{vo.originalPrice/100}}</span>
</view>
</view>
</view>
<u-loadmore :status="loading" v-if="boutiqueMallList.length > 0"/>
</div>
</view>
<u-gap bgColor="transparent" height="60"></u-gap>
......@@ -50,6 +50,7 @@
<script>
export default {
props:["page"],
data() {
return {
isShow:false,
......@@ -71,6 +72,17 @@ export default {
mallList: [],
//精品商品
boutiqueMallList: [],
loading:"loadmore"
}
},
watch:{
page(newVal,oldVal){
if(newVal > oldVal){
this.loading = "loading"
setTimeout(()=>{
this.getBoutiqueMallList()
},1000)
}
}
},
methods: {
......@@ -166,10 +178,22 @@ export default {
method: 'get'
};
this.http.httpTokenRequest(opts, {
classification: "2"
classification: "2",
pageSize:10,
pageNum:this.page
}).then(res => {
if (res.data.code == 200) {
this.boutiqueMallList = res.data.data.rows
let data = res.data.data.rows;
data.forEach(elem=>{
this.boutiqueMallList.push(elem)
})
if(data.length < 10){
uni.setStorageSync('refresh',1)
this.loading = "nomore"
}else{
uni.setStorageSync('refresh',0)
this.loading = "loadmore"
}
}
})
},
......@@ -209,7 +233,7 @@ export default {
}, 200);
this.getMallList()
this.getRotationList()
//this.getBoutiqueMallList()
this.getBoutiqueMallList()
}
};
</script>
......@@ -219,23 +243,23 @@ export default {
height: 100%;
.shop__list__one {
padding: 0 30rpx;
padding: 0 30rpx 40rpx;
background: #f9f9f9;
.list__one__items {
.owner-select{
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
.one__item {
.one_item {
width: 48%;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.2);
border-radius: 20rpx;
margin-bottom: 30rpx;
.one__item__img {
.one_item_img {
width: 100%;
height: 320rpx;
background: #FFD4D4;
......@@ -248,7 +272,7 @@ export default {
}
}
.one__item__title {
.one_item_title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
......@@ -261,7 +285,7 @@ export default {
overflow: hidden;
}
.one__item__price {
.one_item_price {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
......@@ -280,12 +304,13 @@ export default {
}
}
.my__search {
padding: 30rpx;
}
.view__title {
font-size: 38rpx;
font-family: PingFang SC;
font-weight: bold;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment