This commit is contained in:
Gdpao
2020-08-06 20:42:03 +08:00
parent 201f858833
commit 090b7cc753
22 changed files with 209 additions and 184 deletions

View File

@@ -3,7 +3,13 @@
<view class="user">
<view class="info">
<view class="avatar">
<image :src="item.member_avatar"></image>
<image :src="item.member_avatar" mode="aspectFill"></image>
<view class="posi-type">
<view>
<u-icon name="play-right-fill" color="#fff" size="20rpx"></u-icon>
</view>
<text>正在直播</text>
</view>
</view>
<view class="box">
<view class="name">{{ item.member_nickname }}</view>
@@ -34,11 +40,39 @@
display: flex;
align-items: center;
.avatar {
position: relative;
&>image{
z-index: 99;
width: 140rpx;
height: 140rpx;
border-radius: 50%;
}
.posi-type {
z-index: 100;
position: absolute;
bottom: 0;
left: 0;
display: flex;
align-items: center;
border-radius: 30rpx;
background-color: rgba(0,0,0,0.3);
& > view {
width: 40rpx;
height: 40rpx;
flex-shrink: 0;
text-align: center;
line-height: 30rpx;
border-radius: 50%;
background-color: rgba(0,0,0,0.5);
}
& > text {
padding: 0 12rpx 0 6rpx;
color: #FF3131;
height: 40rpx;
line-height: 40rpx;
font-size: 20rpx;
}
}
}
.box {
display: flex;
@@ -68,7 +102,7 @@
border-radius: 30rpx;
}
.btn-follow {
background-color: #007AFF;
background-color: #999999;
}
.btn-unfollow {
background-color: #FF780F;

View File

@@ -106,9 +106,9 @@ export default {
methods: {
// 关注
following(id) {
this.is_follow = !this.is_follow;
this.$u.api.attentionMember({member_id: id}).then(res => {
if (res.errCode == 0) {
this.is_follow = !this.is_follow;
this.$u.toast(res.message);
}
})
@@ -116,10 +116,10 @@ export default {
// 点赞
likeType(id) {
// console.log(id);
this.is_like = !this.is_like;
this.$u.post("article/articleLike",{article_id: id}).then(res => {
if (res.errCode == 0) {
// console.log(res);
this.is_like = !this.is_like;
this.list.like_num = res.data.num;
} else {
this.$u.toast(res.message);
@@ -128,10 +128,10 @@ export default {
},
// 收藏
collecting(id) {
this.is_collect = !this.is_collect;
this.$u.post("article/articleCollect",{article_id: id}).then(res => {
if (res.errCode == 0) {
// console.log(res);
this.is_collect = !this.is_collect;
this.list.collect_num = res.data.num;
} else {
this.$u.toast(res.message);

View File

@@ -515,10 +515,16 @@ export default {
},
// 发现回复列表
getReplyList(id) {
this.page_[id] = 0;
console.log(this.page_);
this.$u.post("article/articleReplyList", {id: id, page: 0}).then(res => {
this.allList[id] = res.data;
this.page_[id] = 0;
if (!this.page_[id] === 0) {
}
console.log(this.page_[id]);
this.$u.post("article/articleReplyList", {id: id, page: this.page_[id]}).then(res => {
console.log(this.page_);
if (res.errCode == 0) {
this.page_[id]++;
this.allList[id] = res.data;
}
})
},
// 预览图片
@@ -536,7 +542,6 @@ export default {
scrollBottom(e) {
this.page++;
this.getComment();
console.log(e);
},
// 跳转到商品
gotoInfo(id) {

View File

@@ -1,6 +1,6 @@
<template>
<view class="sdetails">
<u-swiper :list="list" height="500" border-radius="0" mode="dot"></u-swiper>
<u-swiper :list="list" height="500" border-radius="0" mode="dot" @click="viewImage"></u-swiper>
<view class="spike-view" v-if="type == 3">
<view class="left">
<view class="price">
@@ -461,7 +461,18 @@ export default {
id: this.goodsInfo.goods_id
}
})
}
},
// 查看轮播图
viewImage(index) {
let arr = [];
this.list.forEach(item => {
arr.push(item.image);
})
uni.previewImage({
urls: arr,
current: arr[index]
})
}
},
}
</script>