store article 8.13
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<u-checkbox-group class="cart-main" @change="storeChange">
|
||||
<view v-for="(store, s_index) in list" :key="s_index" class="cart-item">
|
||||
<view class="store">
|
||||
<u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="s_index" @change="storeaAloneChange"></u-checkbox>
|
||||
<u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="26" :name="s_index" @change="storeaAloneChange"></u-checkbox>
|
||||
<view class="name" @click="viewStoreDetails(store.store_id)">
|
||||
<image :src="store.store_avatar"></image>
|
||||
<view>{{ store.store_name }}</view>
|
||||
@@ -12,7 +12,7 @@
|
||||
<view class="goods">
|
||||
<u-checkbox-group @change="goodsChange($event, s_index)">
|
||||
<view v-for="(goods, g_index) in store.goods" :key="g_index" class="goods-item">
|
||||
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index"></u-checkbox>
|
||||
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="26" :name="g_index"></u-checkbox>
|
||||
<image :src="goods.goods_image" @click="viewGoodsDetails(goods.goods_id)"></image>
|
||||
<view class="info">
|
||||
<view class="name u-line-2" @click="viewGoodsDetails(goods.goods_id)">{{ goods.goods_name }}</view>
|
||||
@@ -31,7 +31,7 @@
|
||||
</view>
|
||||
<view class="balance">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="checkedAll" shape="circle" active-color="#FF780F" icon-size="35" label-size="30" @change="totalChange">
|
||||
<u-checkbox v-model="checkedAll" shape="circle" active-color="#FF780F" icon-size="26" label-size="30" @change="totalChange">
|
||||
全选
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<view class="listItem">
|
||||
<video v-if="type == '2'" :src="url" :show-fullscreen-btn="true"></video>
|
||||
<!-- <video :src="url" :show-fullscreen-btn="true"></video> -->
|
||||
<view v-if="type == '2'" class="video-container">
|
||||
<image :src="url" mode="aspectFill" class="video"></image>
|
||||
<image src="/static/videoPlay.png" mode="aspectFill" class="play-video"></image>
|
||||
</view>
|
||||
<image v-else :src="url" mode="aspectFill"></image>
|
||||
</view>
|
||||
</template>
|
||||
@@ -9,11 +13,30 @@
|
||||
width: 365rpx;
|
||||
height: 500rpx;
|
||||
overflow: hidden;
|
||||
>image,video{
|
||||
> image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.video-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
position: relative;
|
||||
.video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.play-video {
|
||||
position: absolute;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
z-index: 19;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<view class="videoTop">
|
||||
<video :src="url" :show-fullscreen-btn="true"></video>
|
||||
<view class="videoTop" @click="toDetailsPage">
|
||||
<image :src="url" mode="aspectFill" class="video"></image>
|
||||
<image src="/static/videoPlay.png" mode="aspectFill" class="play-video"></image>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
@@ -8,10 +9,22 @@
|
||||
width: 100%;
|
||||
height: 284rpx;
|
||||
margin-bottom: 20rpx;
|
||||
>video{
|
||||
position: relative;
|
||||
.video{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 9;
|
||||
}
|
||||
.play-video {
|
||||
position: absolute;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
z-index: 19;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
@@ -21,6 +34,13 @@ export default {
|
||||
return {
|
||||
}
|
||||
},
|
||||
props:['url']
|
||||
props:['url'],
|
||||
methods: {
|
||||
toDetailsPage(id) {
|
||||
this.$u.route('pageB/video/video', {
|
||||
id: id
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -42,11 +42,11 @@
|
||||
<view class="main">
|
||||
<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" class="container-top">
|
||||
<videoTop :url="item.article_pic" v-if="item.type == 2" @click.native="toDetailsPage(item.article_id)"></videoTop>
|
||||
<imageTop v-else :url="item.article_pic" @click.native="toDetailsPage(item.article_id)"></imageTop>
|
||||
<videoTop :url="item.article_pic" v-if="item.type == 2" @click.native="toDetailsPage({ id: item.article_id, type: item.type })"></videoTop>
|
||||
<imageTop v-else :url="item.article_pic" @click.native="toDetailsPage({ id: item.article_id, type: item.type })"></imageTop>
|
||||
</view>
|
||||
<view v-if="indexlist.length" class="container-bottom">
|
||||
<listitem v-for="item in indexlist" :key="item.id" :type="item.type" :url="item.article_pic" class="bottom-item" @click.native="toDetailsPage(item.article_id)"></listitem>
|
||||
<listitem v-for="item in indexlist" :key="item.id" :type="item.type" :url="item.article_pic" class="bottom-item" @click.native="toDetailsPage({ id: item.article_id, type: item.type })"></listitem>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="item" v-if="cur==1">
|
||||
@@ -149,11 +149,10 @@ export default {
|
||||
}
|
||||
|
||||
},
|
||||
toDetailsPage(id) {
|
||||
toDetailsPage({ id, type }) {
|
||||
// console.log(11);
|
||||
this.$u.route('pageB/photo/index', {
|
||||
id: id
|
||||
});
|
||||
let src = type == 1 ? 'pageB/photo/index' : 'pageB/video/video';
|
||||
this.$u.route(src, { id: id });
|
||||
},
|
||||
switchCurrent(current) {
|
||||
this.cur = current;
|
||||
@@ -194,15 +193,17 @@ export default {
|
||||
}).then(res => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.errCode == 0) {
|
||||
// this.articleList = res.data.list;
|
||||
let articleList = res.data.list;
|
||||
// articleList.unshift({}, {}, {}, {});
|
||||
// articleList.push({}, {});
|
||||
if(JSON.stringify(res.data) != '[]') {
|
||||
if(res.data.list.length > 0) {
|
||||
this.indextop = [res.data.list[0]]
|
||||
if(articleList.length > 0) {
|
||||
this.indextop = [articleList[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,));
|
||||
if(articleList.length > 1) {
|
||||
this.indextop.push(articleList[1]);
|
||||
this.indexlist.push(...articleList.slice(2,));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user