This commit is contained in:
2020-06-30 18:06:50 +08:00
parent c7136c2c11
commit dc69746320
21 changed files with 471 additions and 1315 deletions

View File

@@ -23,10 +23,10 @@
<indexad style="width:690rpx"></indexad>
<view class="list">
<view >
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item"></videoItem>
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
<view style="margin-left:20rpx">
<videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item"></videoItem>
<videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
</view>
</view>
@@ -60,18 +60,19 @@
<image class="right"></image>
</view>
<view class="tuijianlist">
<darenItem style="margin-right:23rpx"></darenItem>
<darenItem style="margin-right:23rpx"></darenItem>
<darenItem></darenItem>
<!-- <darenItem style="margin-right:23rpx"></darenItem>
<darenItem style="margin-right:23rpx"></darenItem> -->
<darenItem v-for="item in recommendList" :key="item.id" :info="item"></darenItem>
</view>
</view>
<view class="list">
<view >
<videoItem isguanzhu="true" v-for="item in 10"></videoItem>
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
<view style="margin-left:20rpx">
<videoItem isguanzhu="true" v-for="item in 10"></videoItem>
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
</view>
</view>
@@ -154,6 +155,9 @@
height: 282rpx;
margin-top: 30rpx;
display: flex;
> view:not(:last-child) {
margin-right: 23rpx;
}
}
}
}
@@ -180,6 +184,7 @@ export default {
num:0,
page: 0, // 0即第一页
articleList: [],
recommendList: [], // 推荐达人
}
},
components:{
@@ -188,12 +193,13 @@ export default {
indexad,
darenItem
},
onLoad(){
this.getArticlelist();
onShow(){
this.getArticlelist();
this.getRecommendList();
},
methods:{
dianji(a){
console.log(a)
// console.log(a)
if(typeof a == "object"){
this.num = a.detail.current
}else{
@@ -209,7 +215,14 @@ export default {
this.articleList = res.data.list;
}
})
}
},
getRecommendList() {
this.$u.api.getRecommendList().then(res => {
if(res.errCode == 0) {
this.recommendList = res.data.list;
}
})
},
},
}
</script>

View File

@@ -113,6 +113,10 @@
<img src="/static/image/mine/15.png" />
<view>投诉意见</view>
</view>
<view @click="clickaa()">
<img src="/static/image/mine/15.png" />
<view>投诉意见11</view>
</view>
</view>
</view>
</view>
@@ -120,6 +124,7 @@
</template>
<script>
var testModule = uni.requireNativePlugin("TestModule")
export default {
data() {
return {
@@ -138,6 +143,9 @@ export default {
this.toOtherPage("/setting/Index");
},
methods: {
clickaa() {
testModule.gotoNativePage();
},
getUserInfo() {
this.$u.api.getMemberInfo().then(res => {
if (res.errCode == 0) {

View File

@@ -7,9 +7,9 @@
<image src="/static/image/shop/2.png"></image>
</view>
<u-search placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999"></u-search>
<image src="/static/image/shop/3.png" class="mnue"></image>
<image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image>
</view>
<u-swiper :list="list"></u-swiper>
<u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper>
<view class="chengnuo">
<view>
<image src="/static/image/shop/4.png"></image>
@@ -28,11 +28,11 @@
<text>上门取件</text>
</view>
</view>
<view class="fenlei">
<!-- <view class="fenlei">
<shopitem v-for="item in 5" class="item"></shopitem>
</view>
</view> -->
<view class="fenlei">
<shopitem v-for="item in 5" class="item"></shopitem>
<shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem>
</view>
<view class="hr" style="margin-top:80rpx"></view>
<recommend></recommend>
@@ -72,7 +72,7 @@ export default {
},
data(){
return {
area: "北京市",
area: "请选择",
chooseArea: false,
areaParams: {
province: true,
@@ -80,34 +80,33 @@ export default {
area: false
},
keyword:"",
list:[{
image: '/static/uView/swiper/swiper1.jpg',
title: '蒹葭苍苍,白露为霜。所谓伊人,在水一方'
},
{
image: '/static/uView/swiper/swiper2.jpg',
title: '溯洄从之,道阻且长。溯游从之,宛在水中央'
},
{
image: '/static/uView/swiper/swiper3.jpg',
title: '蒹葭萋萋,白露未晞。所谓伊人,在水之湄'
}
],
list:[],
goodsClassify: [], // 商品分类
classifyList: [],
goodsList: []
}
},
onLoad() {
// this.getShopTopList();
this.getShopTopList();
this.getGoodsRecommend();
},
methods: {
// getShopTopList() {
// this.$u.api.getShopTopList().then((res)=>{
// if (res.errCode == 0) {
// }
// })
// },
getShopTopList() {
this.$u.api.getShopTopList().then((res)=>{
if (res.errCode == 0) {
let temp = [];
res.data.banner.forEach(item => {
temp.push({
image: item.adv_code,
adv_link: item.adv_link,
adv_id: item.adv_id,
})
})
this.list = temp;
this.goodsClassify = res.data.goodsclass;
}
})
},
getGoodsRecommend() {
this.$u.api.getGoodsRecommend({
page: 1,
@@ -120,6 +119,11 @@ export default {
}
})
},
clickImage(index) {
console.log(index);
console.log(this.list[index]);
},
setArea(e) {
// console.log(e);
this.area = e.city.label;
@@ -128,7 +132,12 @@ export default {
uni.navigateTo({
url: '/pageC/cart/index'
});
}
},
toClassifyPage() {
uni.navigateTo({
url: '/pageC/classify/index'
});
},
},
}
</script>
@@ -189,8 +198,15 @@ export default {
}
.fenlei{
display: flex;
justify-content: space-between;
// justify-content: space-between;
margin-top: 30rpx;
flex-wrap: wrap;
> view {
margin-bottom: 30rpx;
&:not(:nth-child(5n)) {
margin-right: 70rpx;
}
}
}
.hr{
width: 750rpx;