update api

This commit is contained in:
2020-06-29 17:24:57 +08:00
parent 905022e6e4
commit dce6d3a1b8
19 changed files with 280 additions and 87 deletions

View File

@@ -23,14 +23,13 @@
<indexad style="width:690rpx"></indexad>
<view class="list">
<view >
<videoItem v-for="item in 10"></videoItem>
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item"></videoItem>
</view>
<view style="margin-left:20rpx">
<videoItem v-for="item in 10"></videoItem>
<videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item"></videoItem>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item>
@@ -178,7 +177,9 @@ export default {
name: '关注'
}
],
num:0
num:0,
page: 0, // 0即第一页
articleList: [],
}
},
components:{
@@ -187,6 +188,9 @@ export default {
indexad,
darenItem
},
onLoad(){
this.getArticlelist();
},
methods:{
dianji(a){
console.log(a)
@@ -195,15 +199,17 @@ export default {
}else{
this.num = a
}
}
},
getArticlelist () {
this.$u.api.getArticlelist({
page: this.page,
is_video_img: 0, // 查询视频1 图文2 都查0
}).then(res => {
if(res.errCode == 0) {
this.articleList = res.data.list;
}
})
}
},
onLoad(){
// this.$u.api.phoneLogin({
// member_mobile: 1,
// sms_code: 2
// }).then((res)=>{
// console.log(res)
// })
}
}
</script>

View File

@@ -128,7 +128,7 @@ export default {
},
filters: {
phoneFormat(value) {
return value.replace(/^(\d{3})\d*(\d{4})$/, '$1****$2');
return value ? value.replace(/^(\d{3})\d*(\d{4})$/, '$1****$2') : '';
}
},
onLoad() {

View File

@@ -46,6 +46,9 @@
<youhq></youhq>
<view class="hr" style="margin-top:40rpx"></view>
<list :classifyList="classifyList" :goodsList="goodsList"></list>
<view class="cart" @click="toCartPage">
<image src="/static/image/common/3.png"></image>
</view>
<u-picker mode="region" :params="areaParams" v-model="chooseArea" @confirm="setArea"></u-picker>
</view>
</template>
@@ -109,7 +112,6 @@ export default {
this.$u.api.getGoodsRecommend({
page: 1,
}).then((res)=>{
console.log(res);
if (res.errCode == 0) {
this.classifyList = res.data.classifyList;
this.goodsList = res.data.goodsList;
@@ -121,6 +123,11 @@ export default {
setArea(e) {
// console.log(e);
this.area = e.city.label;
},
toCartPage() {
uni.navigateTo({
url: '/pageC/cart/index'
});
}
},
}
@@ -198,5 +205,22 @@ export default {
margin-top: 29rpx;
background-color: #ececec;
}
.cart {
position: fixed;
right: 30rpx;
bottom: 300rpx;
width: 100rpx;
height: 100rpx;
background: rgba(253, 211, 96, 1);
box-shadow: 0rpx 10rpx 6rpx 0rpx rgba(253,211,96,0.34);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
> image {
width: 56rpx;
height: 54rpx;
}
}
}
</style>