upgrade 8.6

This commit is contained in:
2020-08-06 17:52:25 +08:00
parent 8bf42a75dd
commit 1a1a0de460
17 changed files with 183 additions and 76 deletions

View File

@@ -14,7 +14,7 @@
</view>
<scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
<view class="goods-container">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-view" @click="toDetailsPage(goods.goods_id)">
<view v-for="(goods, index) in goodsList" :key="index" class="goods-view" @click="toDetailsPage(goods.goods_id)">
<goodsItem :info="goods"></goodsItem>
</view>
</view>

View File

@@ -37,19 +37,16 @@
</scroll-view>
</view>
<view class="main">
<view class="video-image" v-if="cur==0 && indextop.length">
<scroll-view class="video-image" scroll-y v-if="cur==0 && indextop.length" :style="{ height: scrollHeiht }">
<view v-for="item in indextop" :key="item.id">
<videoTop :url="item.url" v-if="item.type == 2"></videoTop>
<imageTop v-else :url="item.url"></imageTop>
<videoTop :url="item.article_pic" v-if="item.type == 2"></videoTop>
<imageTop v-else :url="item.article_pic"></imageTop>
</view>
<view style="display: flex;flex-wrap: wrap;" v-if="indexlist.length">
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.url"></listitem>
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.article_pic"></listitem>
</view>
</view>
<!-- 商品筛选排序未完成 -->
</scroll-view>
<view class="item" v-if="cur==1">
<!-- <item v-for="item in list" :key="item.gc_id" :info="item" class="item"></item> -->
<goods :sid="sid"></goods>
</view>
</view>
@@ -87,10 +84,12 @@ export default {
sid: '',
show: false,
cur: 0,
list:[],
indexlist:[],
indextop:[],
info:{}
list: [],
indexlist: [],
indextop: [],
info: {},
page: 0,
scrollHeiht: '',
}
},
components:{
@@ -101,7 +100,8 @@ export default {
},
onPullDownRefresh() {
this.getStoreInfo();
this.getStoreImgVideoList();
this.getArticlelist();
// this.getStoreImgVideoList();
},
onNavigationBarButtonTap(e) {
// console.log(e.index);
@@ -114,7 +114,7 @@ export default {
if(current == 0) {
this.$u.route('/pageC/merchant/storeClassify', { id: this.sid });
} else if(current == 2) {
this.$u.route('./details', { id: this.sid });
this.$u.route('/pageC/merchant/details', { id: this.sid });
}
},
getStoreInfo() {
@@ -140,12 +140,38 @@ export default {
this.$u.toast(res.message);
})
},
getArticlelist() {
this.$u.api.getArticlelist({
page: this.page,
is_video_img: 0,
store_id: this.sid,
}).then(res => {
uni.stopPullDownRefresh();
if (res.errCode == 0) {
// this.articleList = res.data.list;
if(res.data.list.length > 0) {
this.indextop = [res.data.list[0]]
this.indextop = [res.data.list[0], res.data.list[1]];
}
if(res.data.list.length > 1) {
this.indextop.push(res.data.list[1]);
this.indexlist.push(...res.data.list.slice(2,));
}
}
})
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeiht = res.windowHeight - (73 + 20 + 170) + 'px';
}
},
onLoad(option){
this.sid = option.id;
console.log(this.sid);
// console.log(this.sid);
this.getStoreInfo();
this.getStoreImgVideoList();
this.getArticlelist();
this.setViewHeight();
// this.getStoreImgVideoList();
}
};
</script>