调整发布 和分享样式

This commit is contained in:
浅念
2025-12-04 18:34:38 +08:00
parent 087514270a
commit 988a4f47c2
3 changed files with 24 additions and 8 deletions
+4 -4
View File
@@ -6,18 +6,18 @@
<image class="grid-avatar" :src="item.user && item.user.avatar_pull ? item.user.avatar_pull : fallbackAvatar" <image class="grid-avatar" :src="item.user && item.user.avatar_pull ? item.user.avatar_pull : fallbackAvatar"
mode="aspectFill"></image> mode="aspectFill"></image>
<view class="grid-info"> <view class="grid-info">
<text class="grid-tag">{{item.content}}</text> <text class="grid-tag">{{item.content ?item.content:'-'}}</text>
<text class="grid-name">{{item.user && item.user.nickname ? item.user.nickname : '匿名用户'}}</text> <text class="grid-name">{{item.user && item.user.nickname ? item.user.nickname : '匿名用户'}}</text>
</view> </view>
</view> </view>
<view class="card-actions" v-if="isshow"> <view class="card-actions" v-if="isshow">
<view class="iconview" @click.stop="emitComment"> <view class="iconview" @click.stop="emitComment">
<image :src="item.is_comment == 0 ? '/static/image/msg.png' : '/static/image/msga.png'" mode="" class="icons1"></image> <image :src="item.is_comment == 0 ? '/static/image/msg.png' : '/static/image/msga.png'" mode="" class="icons1"></image>
{{item.comment}} {{item.comment?item.comment:0}}
</view> </view>
<view class="iconview" @click.stop="emitLike"> <view class="iconview" @click.stop="emitLike">
<image :src="item.is_like == 0 ? '/static/image/zan.png' : '/static/image/zana.png'" mode="" class="icons"></image> <image :src="item.is_like == 0 ? '/static/image/zan.png' : '/static/image/zana.png'" mode="" class="icons"></image>
{{item.like}} {{item.like?item.like:0}}
</view> </view>
</view> </view>
</view> </view>
@@ -37,7 +37,7 @@
}, },
fallbackImage: { fallbackImage: {
type: String, type: String,
default: '/static/image/img.png' default: ''
}, },
fallbackAvatar: { fallbackAvatar: {
type: String, type: String,
+7
View File
@@ -287,6 +287,13 @@ export default {
}); });
return return
} }
if(this.form.content==''||this.form.media.length==0){
uni.showToast({
title: '发布内容或图片不能为空!',
icon: 'none'
});
return
}
if(uni.getStorageSync('is_login')){ if(uni.getStorageSync('is_login')){
request({ request({
url:'common/post/store', url:'common/post/store',
+13 -4
View File
@@ -29,6 +29,9 @@
</view> </view>
<text class="time">{{detail.publishTime}}</text> <text class="time">{{detail.publishTime}}</text>
</view> </view>
<button open-type="share" class="share">
<image src="/static/image/share.png" mode=""></image>
</button>
</view> </view>
<view class="post-content"> <view class="post-content">
<text>{{detail.content}}</text> <text>{{detail.content}}</text>
@@ -46,10 +49,6 @@
<image :src="detail.is_comment == 0 ? '/static/image/msg.png' : '/static/image/msga.png'" mode="" class="icons18"></image> <image :src="detail.is_comment == 0 ? '/static/image/msg.png' : '/static/image/msga.png'" mode="" class="icons18"></image>
<text>{{detail.comment}}</text> <text>{{detail.comment}}</text>
</view> </view>
<view class="action-item">
<button open-type="share" class="share"><uni-icons type="redo" color="#206ff4" size="20"></uni-icons></button>
</view>
</view> </view>
</view> </view>
@@ -644,6 +643,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 20rpx; margin-bottom: 20rpx;
position: relative;
} }
.avatar { .avatar {
@@ -932,10 +932,19 @@
border: 1px solid #fff; border: 1px solid #fff;
height: 34px; height: 34px;
line-height: 34px; line-height: 34px;
width: 30px;
position: absolute;
right: 0px;
padding: 0px;
top: 8px;
} }
.share:after{ .share:after{
border: 1px solid #fff; border: 1px solid #fff;
} }
.share image{
width: 24px;
height: 24px;
}
.cent{ .cent{
display: flex; display: flex;
align-items: center; align-items: center;