This commit is contained in:
Gdpao
2020-08-01 11:16:53 +08:00
parent f30c4f4922
commit 5b31193750
11 changed files with 279 additions and 125 deletions

View File

@@ -3,27 +3,26 @@
<view class="back">
<u-icon name="close" color="#999999" :size="30" @click="goBack"></u-icon>
</view>
<swiper class="swiper">
<swiper-item>
<image :src="list.article_pic"></image>
<swiper class="swiper" circular autoplay @change="changeSwiper">
<swiper-item v-for="(simg,sindex) in list.photo" :key="sindex">
<image :src="simg.url" mode="aspectFill" @tap="viewImage" :data-index="sindex"></image>
</swiper-item>
<!-- <swiper-item>
<image></image>
</swiper-item> -->
</swiper>
<view class="bottom">
<scroll-view scroll-y="true" class="bottom">
<view class="item">
<text>图片</text>
<view v-for="(item,index) in 4" :key="index" :style="{'background-color':index == 2 ? '#fff' : '#ede8e8'}"></view>
<view v-for="(item,index) in list.photo" :key="index" :style="{'background-color':index == swiper_id ? '#fff' : '#ede8e8'}"></view>
</view>
<view class="username">自己黑的哈万岁哦划u将</view>
<view class="title">hasjdhajskhj</view>
<view class="info u-line-2">asdjhasjdkasljdklasjkl</view>
</view>
<userinfo class="userinfo" :list="list"></userinfo>
<shpoone class="shpoone"></shpoone>
<shoplist></shoplist>
<view class="username">{{ list.member_nickname }}</view>
<view class="title">{{ list.article_title }}</view>
<view class="info">{{ list.article_content }}</view>
<view class="box">
<view class="label" v-for="(label,id) in list.label" :key="id">{{ label.name }}</view>
</view>
</scroll-view>
<userinfo class="userinfo" :list="list" :cart="cart_type" @openCart="openCart"></userinfo>
<shpoone class="shpoone" v-show="list.goods.length == 1 && cart_type"></shpoone>
<shoplist :list="list.goods" v-show="list.goods.length > 1 && cart_type" @hideCart="hideCart"></shoplist>
</view>
</template>
<style lang="scss" scoped>
@@ -46,23 +45,23 @@
}
}
.bottom{
width: 100%;
height: 270rpx;
background-color: #fff;
position: fixed;
bottom: 0;
display: flex;
flex-direction: column;
align-items: flex-start;
width: 700rpx;
height: 300rpx;
padding: 20rpx 30rpx;
background-color: #fff;
.item{
display: flex;
align-items: center;
padding: 8rpx 16rpx;
font-size: 24rpx;
color: #fff;
background-color: #999;
display: flex;
align-items: center;
border-radius: 10rpx;
background-color: #999;
>view{
width: 12rpx;
height: 12rpx;
@@ -71,46 +70,61 @@
}
}
.username{
margin: 20rpx 0;
font-size: 36rpx;
color: #333;
margin-top: 20rpx;
}
.title{
font-size: 26rpx;
color: #333;
margin-top: 23rpx;
}
.info{
margin: 20rpx 0;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-size: 28rpx;
line-height: 42rpx;
margin-top: 20rpx;
}
.box {
display: flex;
flex-wrap: wrap;
.label {
padding: 6rpx 10rpx;
margin: 0 10rpx 10rpx 0;
font-size: 24rpx;
color: #fff;
border-radius: 6rpx;
background-color: #000000;
opacity: 0.5;
}
}
}
.userinfo{
position: absolute;
right: 30rpx;
top: 50%;
transform: translateY(-285rpx);
right: 30rpx;
}
.shpoone{
position: absolute;
top: 50%;
z-index: 999;
position: absolute;
right: 139rpx;
top: 54%;
transform: translateY(100rpx);
}
}
</style>
<script>
import userinfo from "../components/userinfo/index"
import shpoone from "../components/shpoone/index"
import shoplist from "../components/shoplist/index"
import userinfo from "../components/userinfo/index" // 点赞组件
import shpoone from "../components/shpoone/index" //
import shoplist from "../components/shoplist/index" // 商品列表
export default {
name:"photo",
onLoad(e) {
console.log('dhdhdhdhd',e)
onLoad(option) {
console.log(option);
},
components:{
userinfo,
@@ -119,16 +133,36 @@ export default {
},
data(){
return {
list:{}
list:{},
swiper_id: "",
cart_type: false,
}
},
methods:{
// 发现详情
articleInfo(article_id){
this.$u.api.articleInfo({article_id}).then((res)=>{
console.log(res)
this.list = res.data.info
this.list = res.data.info;
})
},
// 改变swiper
changeSwiper(e) {
// console.log(e.detail.current);
this.swiper_id = e.detail.current; // 储存swiper id
},
// 更改购物车状态
openCart(data) {
console.log(data);
this.cart_type = data;
},
hideCart(data) {
// console.log(data);
this.cart_type = data;
},
// 预览图片
viewImage(e) {
console.log(e);
},
goBack() {
uni.navigateBack({
delta: 1