update 动态模块页面

This commit is contained in:
zengBin 2024-09-10 15:16:50 +08:00
parent ea8ce09324
commit b2215b29df
13 changed files with 2548 additions and 358 deletions

View File

@ -142,6 +142,17 @@ pages: [
},
subPackages: [
{
'root': 'pages/dynamic',
'pages': [
'dynamicDetail',
'hotTopic',
'issue',
'searchPopular',
'searchTopic',
'voteDetail',
]
},
{
'root': 'pages/home',
'pages': [
'information',

View File

@ -0,0 +1,356 @@
<style lang="less">
.ui-discuss-box{
padding-bottom: 240rpx;
}
.operation_mask{
width: 100vw;
height: 100vh;
background: rgba(255, 255, 255, 0);
position: fixed;
top: 0;
left: 0;
z-index: 2222;
}
.ui-no-data{
text-align: center;
padding-top: 200rpx;
}
.activeItem{
background: #f5f5f5;
}
.operation_box {
padding: 6rpx 20rpx 9rpx 20rpx;
border-radius: 8rpx;
background: #454545;
position: absolute;
top: -68rpx;
left: 50%;
transform: translateX(-50%);
z-index: 9999;
}
.operation_box:before {
content: "";
width: 0;
height: 0;
position: absolute;
top: 54rpx;
left: 50%;
transform: translateX(-50%);
border-top: solid 12rpx #454545;
border-left: solid 12rpx transparent;
border-right: solid 12rpx transparent;
border-bottom: solid 12rpx transparent;
}
.ui-user-pic {
width: 60rpx;
min-width: 60rpx;
height: 60rpx;
border-radius: 50%;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
.ui-name {
width: auto;
max-width: 300rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
height: 40rpx;
font-size: 30rpx;
font-weight: 600;
color: #333333;
line-height: 40rpx;
}
.ui-sex-icon{
width: 28rpx;
height: 28rpx;
display: block;
}
.referencesIcon {
width: 124rpx;
height: 36rpx;
display: block;
margin-left: 16rpx;
margin-top: 2rpx;
}
.ui-content{
word-break: break-all;
}
.ui-like-icon-box{
position: absolute;
right: 0;
top: 0;
.ui-like-icon{
width: 30rpx;
height: 30rpx;
margin-right: 8rpx;
display: block;
}
.ui-like-icon-v2{
width: 32rpx;
height: 32rpx;
margin-right: 6rpx;
margin-top: -2rpx;
display: block;
}
.ui-img2_gif {
position: relative;
left: 6rpx;
top: -18rpx;
width: 64rpx;
height: 64rpx;
margin-left: -20rpx;
}
}
.ui-bottom-input-box {
width: 100vw;
padding: 24rpx 30rpx 52rpx 30rpx;
box-sizing: border-box;
background: #ffffff;
border-radius: 42rpx 42rpx 0 0;
box-shadow: 0 -1rpx 6rpx rgba(0, 0, 0, 0.1);
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
z-index: 999;
.replyView{
width: 100vw;
position: fixed;
bottom: 180rpx;
left: 0;
padding: 32rpx;
z-index: 9999999;
.replyContent{
border-radius: 32rpx;
max-height: 78vh;
overflow: auto;
padding: 16rpx 26rpx;
background: #f8f8f8;
line-height: 42rpx;
letter-spacing: 4rpx;
word-break: break-all;
}
.main-content-box {
display: inline-block;
white-space: pre-line;
vertical-align: center;
align-items: center;
margin-top: 4rpx;
word-break: break-all; // 纯数字、单词换行
.m_rich {
margin-right: -4rpx;
}
.emoji_text {
align-items: center;
padding: 4rpx;
line-height: 40rpx;
.emoji_small {
width: 42rpx;
height: 42rpx;
vertical-align: middle;
}
}
}
}
}
.ui-input-box {
width: 78vw;
height: 72rpx;
line-height: 72rpx;
padding: 20rpx 76rpx 20rpx 26rpx;
margin-right: 20rpx;
background: #f5f5f7;
border-radius: 100rpx;
position: relative;
.ui-input {
width: 100%;
position: relative;
z-index: 3;
background: initial;
word-break: break-all;
}
}
.ui-send-box {
.ui-send-icon{
width: 80rpx;
height: 80rpx;
color: white;
border-radius: 12rpx;
}
}
</style>
<template>
<view class="~ui-pl-30 ~ui-pr-30 ~ui-pt-20">
<view class="~font_32 ~color333">评论 · {{ detail.comment_count }}</view>
<view class="operation_mask" v-if="showOperation" @tap="hiddenOperation"></view>
<view v-if="detail.comment_count == 0" class="ui-no-data">
<view class="color333">还没有人<span @tap="handlsInput" class="~color-theme">评论</span>,快来抢沙发吧</view>
</view>
<view v-else class="ui-discuss-box">
<block v-for="(item,index) in list" :key="index">
<view @longpress="commentsOperation(item.id)" class="~ui-relative ~ui-mt-36 {{operationId == item.id ? 'activeItem' : ''}}">
<view class="operation_box ~font_26 ~color-999" v-if="operationId == item.id">
<view class="~f-fcc">
<view class="~font_28 ~white" @tap="copy(item.comment)">复制</view>
<block v-if="item.publish == 1">
<view class="~white" style="margin: -2rpx 20rpx 0 20rpx">|</view>
<view class="~font_28 ~white" @tap="deteleComment(item,index)">删除</view>
</block>
<block v-else-if="is_owner">
<view class="~white" style="margin: -2rpx 20rpx 0 20rpx">|</view>
<view class="~font_28 ~white" @tap="deteleComment(item,index)">删除</view>
</block>
</view>
</view>
<view class="~f-fl">
<view class="ui-user-pic" v-if="item.user.avatar" style="{{'background-image:url(' + item.user.avatar + ');'}}"></view>
<view class="ui-user-pic" v-else style="background-image:url(https://image.fulllinkai.com/202203/09/cc1c73eb1a4941fef25a15cd1ff2f9df.png);"></view>
<view class="~ui-pl-16">
<view class="~f-fcl">
<view class="ui-name">{{ item.user.nickname || '未设置名称' }}</view>
<image v-if="item.user.sex == 1" class="ui-sex-icon ~ui-ml-10" src="https://images.ufutx.com/202103/23/3e7ac93e7bff26a9b62fe3232c776a96.png" lazy-load="false"></image>
<image v-else class="ui-sex-icon ~ui-ml-10" src="https://images.ufutx.com/202103/23/4fd7a85e7073152fde91190b8957910e.png" lazy-load="false"></image>
<image class="referencesIcon" src="https://image.fulllinkai.com/202207/19/7e78a1dd367f1250d4cba4e85bfd60f1.png" mode="widthFix" v-if="item.user.type != 'single'"></image>
</view>
<view class="~color999 ~font_24 ~f-fb ~ui-pt-4">{{ item.created_at }}</view>
<view class="~color333 ~font_30 ui-content">{{ item.comment }}</view>
</view>
<view class="ui-like-icon-box">
<view class="~f-fcr" v-if="item.isLker == false">
<image lazy-load="true" class="ui-like-icon-v2" src="https://images.ufutx.com/202106/10/a97c7c76f3aaf7065e7f7a5fe2abc081.png"></image>
{{ item.likerCount }}
</view>
<view class="~f-fr" v-else>
<image class="ui-img2_gif" src="{{item.isLker ? gifurl : 'https://images.ufutx.com/202106/07/b227f3ecf9cbd080fb814450b667b5ce.gif'}}"></image>
{{ item.likerCount }}
</view>
</view>
</view>
</view>
</block>
</view>
</view>
<view class="ui-bottom-input-box">
<!--输入文本加表情预览信息-->
<view class="replyView ~f-fcc ~animation-slide-bottom" v-if="inputVal.length > 17 && showReplyView" style="bottom: {{inputBoxH}}px;">
<view class="replyContent main-content-box" @longpress="copy(inputVal)">{{name ? '回复@' + name + '' : ''}}{{inputVal}}</view>
</view>
<view class="~f-fbc">
<view class="ui-input-box ~f-fcl">
<input class="ui-input ~font_28 ~color3 ~text-left" confirm-hold="{{true}}" v-model="inputVal" type="text" maxlength="-1" :placeholder="name ? '回复@' + name : '想说...'" confirm-type="send" cursorSpacing="26" bindinput="changeMsg" bindenter="changeMsg" bindfocus="InputFocus" @confirm="send">
</view>
<view class="ui-send-box ~f-fcr">
<image class="~font_32 ui-send-icon ~f-fcc" @tap="send" src="https://image.fulllinkai.com/202305/05/4a47a0db6e60853dedfcfdf08a5ca249.png" mode="aspectFit" lazy-load="false"></image>
</view>
</view>
</view>
</template>
<script>
import wepy from '@wepy/core'
import base from '../mixins/base'
import https from '../mixins/https'
wepy.component({
props: {
list: {
type: Array,
default: []
},
detail: {
type: Object,
default: {}
}
},
data: {
operationId: '',
showOperation: false,
defaultAvatar: 'https://images.ufutx.com/202007/01/e0de60525143427d4dd19515a5b387ba.png',
gifurl: 'https://images.ufutx.com/202106/11/d40b92e053a693f30eb197bf6374af95.gif',
name: '',
inputVal: '',
showReplyView: true,
inputBoxH: 86
},
mixins: [https, base],
methods: {
commentsOperation(id) {
let vm = this
vm.showOperation = true
vm.operationId = id
},
hiddenOperation() {
let vm = this
vm.showOperation = false
vm.operationId = ''
},
// 输入框聚焦事件
InputFocus() {
let vm = this
vm.showReplyView = false
setTimeout(() => {
vm.changeInputHeight()
vm.showReplyView = true
}, 500)
},
// 监听输入框内容
changeMsg(e) {
console.log(e, '8888')
let vm = this
if (/\[[^\]]+\]/.test(e.$wx.detail.value)) {
vm.replyContent = vm.transitionMsg(e.$wx.detail.value)
} else {
vm.replyContent = e.$wx.detail.value
}
vm.changeInputHeight()
},
// 监听底部输入框的高度
changeInputHeight() {
let vm = this
let query = wx.createSelectorQuery()
query.select('.ui-bottom-input-box').boundingClientRect((res) => {
if (res) {
vm.inputBoxH = res.height
}
}).exec()
},
copy(e) {
let vm = this
let textRepkace = e.replace(/<[^<>]+>/g, '').replace(/&nbsp;/gi, '')
wx.setClipboardData({
data: textRepkace,
success: function (res) {
wx.hideLoading()
vm.$showToast('复制成功')
}
})
}
},
created() {}
})
</script>

View File

@ -0,0 +1,411 @@
<style lang="less">
scroll-view {
height: 100%;
box-sizing: border-box;
}
.ui-user-pic {
width: 80rpx;
min-width: 80rpx;
height: 80rpx;
border-radius: 50%;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
.ui-time {
position: absolute;
right: 30rpx;
top: 30rpx;
}
.ui-name {
width: auto;
max-width: 300rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
height: 40rpx;
font-size: 30rpx;
font-weight: 600;
color: #333333;
line-height: 40rpx;
}
.ui-identification{
color: #f3903b;
padding: 4rpx 12rpx;
line-height: 32rpx;
border-radius: 20rpx;
background: #fff9f4;
margin-left: 14rpx;
.ui-identification-icon{
width: 24rpx;
height: 24rpx;
display: block;
}
}
.referencesIcon {
width: 124rpx;
height: 36rpx;
display: block;
margin-left: 16rpx;
margin-top: 2rpx;
}
.ui-dynamic-content{
white-space: pre-line;
word-break: break-all;
display: -webkit-box;
}
.ui-active-content{
overflow: hidden;
margin-bottom: 15rpx;
white-space: pre-line;
word-wrap: break-word;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.ui-voteItem{
width: calc(100vw - 156rpx);
background: #f8f8f8;
padding: 16rpx 18rpx;
border-radius: 8rpx;
.ui-vote-icon{
width: 32rpx;
min-width: 32rpx;
margin: 8rpx 8rpx 0 0;
display: block;
}
}
.ui-dynamic-pic-box{
.ui-only-img, .ui-grid-square{
width: 400rpx;
height: 400rpx;
border-radius: 16rpx;
margin-bottom: 10rpx;
display: block;
}
.ui-grid-square{
width: 192rpx;
height: 192rpx;
}
}
.ui-dynamic-pic-box:after{
content: '';
width: 192rpx;
}
.liveImg{
position: relative;
border-radius: 16rpx;
.ui-video-box, .ui-video-r-box{
position: relative;
width: auto;
border-radius: 16rpx;
.ui-vide-poster{
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
text-align: center;
}
.ui-video_play_icon{
width: 52rpx;
height:52rpx;
}
}
}
.ui-tags{
width: auto;
height: 50rpx;
background: #fff1f5;
border-radius: 26rpx;
.ui-img {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
margin-left: 8rpx;
}
}
.ui-address-icon{
width: 20rpx;
min-width: 20rpx;
height: 24rpx;
margin-right: 4rpx;
}
.ui-like-box{
width: calc(100vw - 156rpx);
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 20rpx;
padding-bottom: 20rpx;
.ui-like-icon-box{
display: inline-flex;
align-items: center;
height: 30rpx;
font-size: 24rpx;
color: #666666;
position: relative;
margin-right: 50rpx;
.ui-like-icon{
width: 30rpx;
height: 30rpx;
margin-right: 8rpx;
display: block;
}
.ui-like-icon-v2{
width: 32rpx;
height: 32rpx;
margin-right: 6rpx;
margin-top: -8rpx;
display: block;
}
.ui-img2_gif {
position: relative;
left: 6rpx;
top: -10rpx;
width: 64rpx;
height: 64rpx;
margin-left: -20rpx;
}
}
.ui-cuIcon-moreandroid{
width: 6rpx;
height: 26rpx;
}
}
.ui-line{
margin: 0 30rpx;
height: 2rpx;
background: #f5f5f5;
}
</style>
<template>
<block v-if="item.type != 'vote'">
<block v-for="(item,index) in list" :key="index">
<view class="~f-fl ~ui-pl-30 ~ui-pr-30 ~ui-pt-30 ~ui-relative" @tap="jumpPath(`/pages/dynamic/dynamicDetail?id=${item.id}`)">
<view class="ui-user-pic" v-if="item.u_photo" style="{{'background-image:url(' + item.u_photo + ');'}}"></view>
<view class="ui-user-pic" v-else style="background-image:url(https://image.fulllinkai.com/202203/09/cc1c73eb1a4941fef25a15cd1ff2f9df.png);"></view>
<view class="~color999 ~font_24 ui-time">{{ item.created_at }}</view>
<view class="~ui-pl-16">
<view class="~f-fc">
<view class="~f-fcl">
<view class="ui-name">{{ item.u_nickname || '未设置名称' }}</view>
<view v-if="item.work_user_tag" class="ui-identification ~font_22 ~f-fcc">
<image class="ui-identification-icon" src="https://image.fulllinkai.com/202307/21/eb5c30d676eac58af4235bad8e6d8c43.png" mode="widthFix"></image>
{{item.work_user_tag}}
</view>
</view>
<image class="referencesIcon" src="https://image.fulllinkai.com/202207/19/7e78a1dd367f1250d4cba4e85bfd60f1.png" mode="widthFix" v-if="item.u_type != 'single'"></image>
<view class="~font_24 ~ui-ml-24 ~color-theme" v-if="item.vote_id > 0">
参与了投票:
</view>
</view>
<view class="~font_24 ~f-fbc">
<view class="~f-fcl">
<view class="~font_24 ~color-999">{{ item.u_year }}</view>
<view class="~font_24 ~color-999" v-if="item.u_stature"><text decode>&nbsp;</text>· {{ item.u_stature }}cm
</view>
<view class="~font_24 ~color-999" v-if="item.u_degree"><text decode>&nbsp;</text>· {{ item.u_degree }}</view>
</view>
<view class="~color-theme" v-if="item.is_audited == 0">审核中</view>
<view class="~color-theme" v-if="item.is_audited == -1">审核失败</view>
</view>
<view class="~ui-pt-14">
<view class="ui-dynamic-content substance ~color333 ~ui-mb-10 ~font_30 {{item.readmore.status == false ? 'ui-active-content' : ''}}">{{item.content}}</view>
<block v-if="item.vote_id > 0">
<view class="ui-voteItem ~f-fl" @tap="jumpPath(`/pages/dynamic/voteDetail?id=${item.vote_id}`)">
<image class="ui-vote-icon" src="https://image.fulllinkai.com/202206/29/7fd07d9687390a58d25ac92b55d9a9dd.png" mode="widthFix"></image>
<view class="~font_28">{{item.v_title}}</view>
</view>
</block>
<block v-else>
<view class="~color-theme ~font_30 ~ui-mb-10" v-if="item.readmore.auto" @tap.stop="toggle" data-index="{{index}}">{{ item.readmore.tip }}</view>
<view v-if="item.photos.length > 0" class="~ui-wrap ui-dynamic-pic-box {{item.photos.length == 2 ? '~f-fl' : '~f-fb'}}">
<image v-for="(itemV2,indexV2) in item.photos" :key="indexV2" @tap.stop="$previewImages(itemV2, item.photos)" class="{{item.photos.length == 1 ? 'ui-only-img':''}} {{item.photos.length > 1 ? 'ui-grid-square' : ''}} {{item.photos.length == 2 ? '~ui-mr-10' : ''}}" :src="itemV2" mode="aspectFill"></image>
</view>
<view v-if="item.play_url" :style="{width: item.video_width > item.video_height ? '480rpx' : '320rpx', height: item.video_width > item.video_height ? '270rpx' : '480rpx', display: videoIndex == index ? 'none' : 'block'}" class="liveImg" mode="widthFix" @tap.stop="playVideo(index, item.id)">
<image v-if="videoIndex != index" class="ui-video-box" :src="item.cover_url" :style="{width: item.video_width > item.video_height ? '480rpx' : '320rpx', height: item.video_width > item.video_height ? '270rpx' : '480rpx'}">
<view class="ui-vide-poster">
<image class="ui-video_play_icon" src="https://image.fulllinkai.com/202308/17/42c88bf039bb56f85cfcb9af0392ffb6.png"></image>
</view>
</image>
<video id="video" :src="item.play_url" v-if="videoIndex == index" play-btn-position="center" show-fullscreen-btn="{{false}}" controls direction="0" object-fit="{{videoIndex == index ? 'contain' : 'cover'}}" referrer-policy="origin" bindfullscreenchange="leaveVideo" class="videoCenter ui-video-r-box" :style="{width: item.video_width > item.video_height ? '480rpx' : '320rpx', height: item.video_width > item.video_height ? '270rpx' : '480rpx'}" :key="item.id">
</video>
</view>
<view class="~font_24 ~f-fb ~ui-mt-10" v-if="item.mt_name != null || item.mt_name == ''">
<view class="ui-tags ~f-fcc ~color-theme ~font_24 ~ui-pr-16">
<image lazy-load="true" class="ui-img" src="https://images.ufutx.com/202102/04/dc3043df7d265ae0b2401e589405a239.png" alt=""/>
{{ item.mt_name }}
</view>
</view>
<view v-if="item.address != null || item.address == ''" class="~color666 ~font_24 ~f-fcl ~ui-mt-16">
<image lazy-load="true" class="ui-address-icon" src="https://images.ufutx.com/202102/04/817a393539ee854226eef79defef2fc4.png" alt=""/>
<view>{{ item.address }}</view>
</view>
</block>
</view>
<view class="~color666 ~font_28 ui-like-box">
<view class="ui-like-icon-box">
<image lazy-load="true" class="ui-like-icon" src="https://images.ufutx.com/202102/04/ab432de170b4e8ca1a1a59e34af9aa25.png"></image>
{{ item.comment_count }}
</view>
<view class="ui-like-icon-box ~ui-mr-40" @tap.stop="upvote(item ,index)">
<image v-if="item.is_like == false" lazy-load="true" class="ui-like-icon-v2" src="https://images.ufutx.com/202106/10/a97c7c76f3aaf7065e7f7a5fe2abc081.png"></image>
<image v-else class="ui-img2_gif" src="{{item.is_like ? gifurl : 'https://images.ufutx.com/202106/07/b227f3ecf9cbd080fb814450b667b5ce.gif'}}"></image>
{{ item.like_count }}
</view>
<view class="~ui-pl-6 ~ui-pr-6" style="margin-right: -6rpx">
<image class="ui-cuIcon-moreandroid" src="https://image.fulllinkai.com/202409/05/fdb58839d1909d75f636941d6aea6cb5.png" mode="widthFix" @tap.stop="changeOperation(item, index)"></image>
</view>
</view>
</view>
</view>
<view class="ui-line"></view>
</block>
</block>
</template>
<script>
import wepy from '@wepy/core'
import base from '../mixins/base'
import https from '../mixins/https'
import {service} from '../config'
wepy.component({
mixins: [https, base],
props: {
dynamicList: {
type: Array,
default: []
},
from: {
type: String,
default: ''
}
},
watch: {
dynamicList(newV, oldV) {
let vm = this
if (vm.dynamicList && vm.dynamicList.length > 0) {
vm.list = vm.dynamicList
vm.textAll(vm.dynamicList)
}
}
},
data: {
list: [],
videoIndex: -1,
videoContext: null,
gifurl: 'https://images.ufutx.com/202106/11/d40b92e053a693f30eb197bf6374af95.gif'
},
methods: {
// 文字超出展示全文
textAll(e) {
let vm = this
setTimeout(() => {
const query = wx.createSelectorQuery().in(vm.$wx)
query.selectAll('.substance').boundingClientRect()
query.exec(function (res) {
let num = res[0]
for (let i = 0; i < num.length; i++) {
if (num[i].height > 75) {
e[i].readmore = {
status: false,
auto: true,
tip: '全文'
}
}
}
vm.list = JSON.parse(JSON.stringify(e))
})
}, 300)
},
// 点赞
upvote(e, index) {
let vm = this
let nowTime = new Date()
vm.$post({url: `${service.host}/like/moments/${e.id}`}).then(({code}) => {
wx.hideLoading()
if (code == 0) {
vm.list[index].is_like = !vm.list[index].is_like
vm.list[index].like_count = vm.list[index].like_count + (vm.list[index].is_like ? -1 : 1)
if (vm.list[index].is_like) {
vm.gifurl = `${vm.gifurl}?${nowTime}`
}
}
}).catch(() => {
wx.hideLoading()
})
},
// 选择动态操作
changeOperation(e, index) {
let vm = this
vm.$emit('changeSelect', e, index)
},
// 展开全文或收起
toggle(e) {
let vm = this
let index = e.$wx.currentTarget.dataset.index
let status = vm.list[index].readmore.status
vm.list[index].readmore.status = !status
vm.list[index].readmore.tip = status ? '全文' : '收起'
},
// 播放视频
playVideo(index, id) {
let vm = this
// 首页列表视频禁止播放
if (vm.from != 'dynamicDetail') {
wx.navigateTo({url: `/pages/dynamic/dynamicDetail?id=${id}`})
return
}
vm.videoIndex = index
vm.videoContext = wx.createVideoContext('video', vm.$wx)
vm.videoContext.requestFullScreen()
setTimeout(function() {
// 将点击视频进行播放
vm.videoContext = wx.createVideoContext('video', vm.$wx)
vm.videoContext.play()
}, 1200)
},
// 关闭视频
leaveVideo(e) {
let vm = this
let fullScreen = e.$wx.detail.fullScreen
if (!fullScreen) {
vm.videoContext.stop()
vm.videoContext = null
vm.videoIndex = -1
}
},
jumpPath(url) {
let vm = this
console.log(url, vm.from, '777')
if (vm.from != 'dynamic') {
return
}
wx.navigateTo({url: url})
}
},
created() {}
})
</script>

View File

@ -0,0 +1,226 @@
<style lang="less">
.dialog {
width: 100%;
background: white;
height: auto;
z-index: 1111;
border-radius: 30rpx 30rpx 0rpx 0rpx !important;
view {
height: 90rpx;
text-align: center;
line-height: 100rpx;
margin: 0 30rpx;
color: #333333;
}
view:last-of-type {
border-top: 1rpx solid #f5f5f5;
color: #999999;
}
}
</style>
<template>
<view class="~cu-modal ~bottom-modal" :class="{'~show': chooseShow}" @tap="hideModal">
<view class="~cu-dialog dialog">
<!--管理员才有的操作功能 && 父组件来自首页动态列表时才有-->
<block v-if="admin == 1 && from == 'dynamic'">
<view @tap="deleteDynamic">删除</view>
<view @tap="conceal">隐藏动态</view>
<view v-if="dynamicTabsIndex == 1" @tap="hotDynamic(1)">设置为推荐动态</view>
<view v-else @tap="hotDynamic(0)">取消推荐</view>
<view v-if="selectData.is_top == 0" @tap="topDynamic(1)">设置为置顶</view>
<view v-else @tap="topDynamic(0)">取消置顶</view>
</block>
<!--来自个人中心我的发布-->
<view v-if="from == 'myDynamic'" @tap="deleteDynamic">删除</view>
<block v-else>
<view @tap="lose">不感兴趣</view>
<view @tap="jumpPath(`/pages/user/report?id=${selectData.id}&type=dynamic`)">举报</view>
</block>
<view @tap="hideModal">取消</view>
</view>
</view>
</template>
<script>
import wepy from '@wepy/core'
import base from '../mixins/base'
import https from '../mixins/https'
import {service} from '../config'
wepy.component({
props: {
selectData: {
type: Object,
default: {}
},
selectIndex: {
type: Number,
default: null
},
chooseShow: {
type: Boolean,
default: false
},
admin: {
type: String,
default: ''
},
from: {
type: String,
default: ''
}
},
data: {
},
mixins: [https, base],
methods: {
// 删除动态
deleteDynamic() {
let vm = this
wx.showModal({
title: '温馨提示',
content: '是否确认删除该动态?',
success: function (res) {
if (res.confirm) {
vm.$showLoading('')
vm.$post({url: `${service.host}/moments/${vm.selectData.id}`}).then(({code, data}) => {
if (code == 0) {
vm.$showToast('动态已删除')
vm.$emit('changeOperation', 'delete')
vm.hideModal()
}
wx.hideLoading()
}).catch(() => {
wx.hideLoading()
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
// 隐藏动态
conceal() {
let vm = this
wx.showModal({
title: '温馨提示',
content: '是否确认隐藏该动态?',
success: function (res) {
if (res.confirm) {
vm.$showLoading('')
vm.$post({url: `${service.host}/rbac/hide/moment/${vm.selectData.id}`}).then(({code, data}) => {
if (code == 0) {
vm.$showToast('动态已隐藏')
vm.$emit('changeOperation', 'conceal')
vm.hideModal()
}
wx.hideLoading()
}).catch(() => {
wx.hideLoading()
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
// 设置为热门或取消热门动态
hotDynamic(e) {
let vm = this
wx.showModal({
title: '温馨提示',
content: `是否${e == 1 ? '设置该动态为推荐动态' : '取消该推荐动态'}`,
success: function (res) {
if (res.confirm) {
vm.$showLoading('')
vm.$post({url: `${service.host}/rbac/set/hot/moments?moment_id=${vm.selectData.id}&is_hot=${e}`}).then(({code, data}) => {
if (code == 0) {
vm.$showToast(`${e == 1 ? '设置成功' : '取消成功'}`)
if (e == 0) {
vm.$emit('changeOperation', 'hot')
}
vm.hideModal()
}
wx.hideLoading()
}).catch(() => {
wx.hideLoading()
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
// 设置为置顶或取消置顶动态
topDynamic(e) {
let vm = this
let url = ``
if (e == 0) {
url = `${service.host}/rbac/remove/top/${vm.selectData.id}/moment`
} else {
url = `${service.host}/rbac/top/${vm.selectData.id}/moment`
}
wx.showModal({
title: '温馨提示',
content: `是否${e == 1 ? '设置该动态为置顶动态' : '取消该置顶动态'}`,
success: function (res) {
if (res.confirm) {
vm.$showLoading('')
vm.$post({url: url}).then(({code, data}) => {
if (code == 0) {
vm.$showToast(`${e == 1 ? '设置成功' : '取消成功'}`)
if (e == 0) {
vm.$emit('changeOperation', 'cancelTop')
} else {
vm.$emit('changeOperation', 'isTop')
}
vm.hideModal()
}
wx.hideLoading()
}).catch(() => {
wx.hideLoading()
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
// 不感兴趣
lose() {
let vm = this
wx.showModal({
title: '温馨提示',
content: '是否标记该动态为不感兴趣?',
success: function (res) {
if (res.confirm) {
vm.$showLoading('')
vm.$post({url: `${service.host}/unlike/moments/${vm.selectData.id}`}).then(({code, data}) => {
if (code == 0) {
vm.$emit('changeOperation', 'lose')
vm.$showToast('标记成功')
vm.hideModal()
}
wx.hideLoading()
}).catch(() => {
wx.hideLoading()
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
jumpPath(url) {
wx.navigateTo({url: url})
},
hideModal() {
let vm = this
vm.$emit('hideModal')
}
},
created() {
}
})
</script>

View File

@ -55,6 +55,7 @@
scrollTop: 0,
duration: 400
})
vm.$emit('BackTop')
}
},
created() {

View File

@ -0,0 +1,138 @@
<style lang="less" scoped>
@import url(../../styles/theme.less);
page {
background-color: #ffffff;
}
</style>
<template>
<view class="ui-dynamicDetail"></view>
<!--动态信息-->
<dynamicList :dynamicList="dynamicList" @changeSelect="changeSelect" :from="'dynamicDetail'"></dynamicList>
<!--动态操作功能selectData选择的动态数据、selectIndex选中的动态下标、admin是否管理员、from来自哪个父组件-->
<dynamicOperation :selectData="selectData" :chooseShow.sync="chooseShow" :selectIndex="selectIndex" :admin="admin" :from="'home'" @hideModal="hideModal" @operation="changeOperation"></dynamicOperation>
<!--评论数据-->
<dynamicDiscuss :list="list" :detail="detail"></dynamicDiscuss>
</template>
<script>
import wepy from '@wepy/core'
import https from '../../mixins/https'
import base from '../../mixins/base'
import {service} from '../../config'
import {commentTimeHandle} from '../../mixins/plugins'
wepy.page({
config: {},
mixins: [https, base],
data: {
id: '',
chooseShow: false,
selectData: {},
selectIndex: null,
detail: {},
dynamicList: [],
list: [] // 评论列表数据
},
methods: {
getDetail() {
let vm = this
vm.$get({url: `${service.host}/moments/${vm.id}`}).then(({code, data}) => {
if (code === 0) {
let result = data.moment
if (result.user) {
result.u_photo = result.user.avatar
result.u_nickname = result.user.nickname
result.u_year = result.user.year
result.u_stature = result.user.stature
result.u_degree = result.user.degree
result.u_type = result.user.type
}
if (result.vote) {
result.v_title = result.vote.title
}
if (result.topic) {
result.mt_name = result.topic.name
}
result.comment_count = result.momentCommentCount
result.like_count = result.momentLikerCount
result.is_like = result.isLkerMoment
result.created_at = commentTimeHandle(result.created_at)
vm.detail = result
vm.dynamicList = [result]
}
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
console.log(err)
})
},
// 获取评论列表
getList() {
let vm = this
vm.$showLoading('加载中...')
vm.$get({url: `${service.host}/moment/comments?id=${vm.id}&type=moment&nopage=1`}).then(({code, data}) => {
if (code === 0) {
data.forEach((item) => {
item.created_at = commentTimeHandle(item.created_at)
item.comment = item.comment.split('?')[0]
})
vm.list = data
console.log(vm.list, '////')
}
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
console.log(err)
})
},
// 选择某条动态操作弹框
changeSelect(e, index) {
let vm = this
vm.selectData = e
vm.selectIndex = index
vm.chooseShow = true
},
// 取消动态操作弹框
hideModal() {
let vm = this
vm.chooseShow = false
vm.selectData = {}
vm.selectIndex = null
},
// 操作后对原动态列表数据改动
changeOperation(state) {
let vm = this
if (state == 'isTop') {
// 设置动态为置顶
vm.dynamicList[vm.selectIndex].is_top = 1
vm.dynamicList.unshift(vm.dynamicList[vm.selectIndex])
vm.dynamicList.splice(vm.selectIndex + 1, 1)
} else {
// 删除动态 || 隐藏动态 || 设置动态为推荐动态 || 不感兴趣 || 取消置顶
vm.dynamicList.splice(vm.selectIndex, 1)
}
}
},
onShow() {
},
onLoad(e) {
let vm = this
vm.id = e.id
vm.getDetail()
vm.getList()
}
})
</script>
<config>
{
navigationBarTitleText: '动态详情',
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
usingComponents: {
dynamicList: '~@/components/dynamicList',
dynamicOperation: '~@/components/dynamicOperation',
dynamicDiscuss: '~@/components/dynamicDiscuss',
}
}
</config>

View File

@ -0,0 +1,333 @@
<style lang="less" scoped>
@import url(../../styles/theme.less);
page {
background-color: #ffffff;
}
.returnIcon{
width: 60rpx;
height: 60rpx;
margin-left: 30rpx;
margin-right: 22rpx;
vertical-align: middle;
margin-top: -6rpx;
}
.ui-hotTopic{
height: 100vh;
background: #ffffff;
.title {
position: fixed;
z-index:99;
width: 100%;
font-size: 36rpx;
font-weight: 500;
color: #FFFFFF;
margin-bottom: 30rpx;
.navbar-title {
width: 100%;
box-sizing: border-box;
height: 64rpx;
line-height: 64rpx;
position: relative;
left: 0;
z-index: 10;
overflow: hidden;
white-space: nowrap;
.img {
position: absolute;
top: 0;
bottom: 0;
left: 50rpx;
margin: auto;
padding: 10rpx;
width: 36rpx;
height: 50rpx;
}
}
.handleText{
font-size: 32rpx;
color: #333333;
}
}
}
.topic {
width: 100%;
display: flex;
align-items: center;
flex-direction: column;
position: relative;
.opcitys {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0.3;
background: #000000
}
.titleMain {
margin: 0 50rpx;
height: auto;
font-size: 28rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 40rpx;
z-index: 1;
white-space: normal;
}
}
.ui-hot-dynamic-box{
background: #ffffff;
border-radius: 40rpx 40rpx 0 0;
margin-top: -46rpx;
position: relative;
z-index: 22;
}
</style>
<template>
<view class="cu-custom">
<view class="cu-bar fixed {{bgImage!=''?'none-bg text-white bg-img':''}} {{bgColor}}" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;">
<image v-if="routerNum > 1" class="returnIcon" src="https://images.ufutx.com/202105/18/b3c18587d136dd6fdaa00c0d5909511b.png" mode="widthFix" @tap="handleBack"></image>
<image v-else class="returnIcon" src="https://images.ufutx.com/202105/18/dabd128e4d73be3061855233904e743c.png" mode="widthFix" @tap="gotoRedirect('/pages/tabBar/welcome')"></image>
</view>
</view>
<view class="ui-hotTopic">
<view class="title" style="height:{{navHeight}}px;background:rgba(255, 255, 255, {{opacity}});">
<view class="navbar-title font_36 white text-center {{opacity < 0.8 ? '': 'handleText'}}" style="margin-top:{{navTop}}px;transition: opacity 1s">
#{{detail.name}}
</view>
</view>
<scroll-view scroll-top="{{scrollTopHandle}}" scroll-with-animation="true" scroll-anchoring="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherpulling="onPulling" bindrefresherrefresh="onRefresh" style="height:100%;-webkit-overflow-scrolling: touch" lower-threshold="300" bindscrolltolower="handleScroll" bindscroll="scrollToUpper" scroll-y>
<view class="cu-avatars" style="{{'background-image:url(' + detail.back_image + ');'}}">
<view class="topic" style="height: calc(350rpx + {{titleHeight}}rpx)">
<view class="opcitys"></view>
<view class="title" style="height:{{navHeight}}px;position: sticky;"></view>
<view class="titleMain ellipsis_3 text-center">{{detail.info}}</view>
</view>
</view>
<view class="ui-hot-dynamic-box">
<dynamicList :dynamicList="dynamicList" @changeSelect="changeSelect" :from="'hotTopic'"></dynamicList>
</view>
</scroll-view>
</view>
<!--动态操作功能selectData选择的动态数据、selectIndex选中的动态下标、admin是否管理员、from来自哪个父组件-->
<dynamicOperation :selectData="selectData" :chooseShow.sync="chooseShow" :selectIndex="selectIndex" :admin="admin" :from="'hotTopic'" @hideModal="hideModal" @operation="changeOperation"></dynamicOperation>
<pageScroll ref="pageScroll" @BackTop="BackTop"></pageScroll>
</template>
<script>
import wepy from '@wepy/core'
import https from '../../mixins/https'
import base from '../../mixins/base'
import {service} from '../../config'
import {commentTimeHandle} from '../../mixins/plugins'
wepy.page({
config: {},
mixins: [https, base],
data: {
chooseShow: false,
id: '',
admin: '1',
routerNum: 0, // 是否存在上一个页面路由
detail: {}, // 话题详情数据
dynamicList: [], // 动态列表数据
selectData: {},
selectIndex: null,
scrollTopHandle: -1,
showBackTopBtn: false,
triggered: false,
no_more: false,
loading: false,
page: 1,
titleHeight: 0, // 话题标题高度
opacity: 0, // 页面标题滑动至指定距离后的透明度
navTop: 0,
StatusBar: 0,
CustomBar: 0,
navHeight: 0
},
methods: {
getDetail() {
let vm = this
vm.$get({url: `${service.host}/moment/topics/${vm.id}`}).then(({code, data}) => {
if (code === 0) {
vm.detail = data
vm.$nextTick(() => {
if (vm.detail.info) {
const query = wx.createSelectorQuery()
query.select('.titleMain').boundingClientRect()
query.exec((data) => {
if (data[0].height >= 45 && data[0].height < 55) {
vm.titleHeight = data[0].height / 2.5
} else if (data[0].height >= 55) {
vm.titleHeight = 40
}
})
}
})
}
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
console.log(err)
})
},
getList() {
let vm = this
let data = {
topic_id: vm.id,
page: vm.page
}
vm.$showLoading('加载中...')
vm.$get({url: `${service.host}/moments/v2`, data}).then(({code, data}) => {
if (code === 0) {
if (data.data && data.data.length > 0) {
data.data.forEach((item, index) => {
item.created_at = commentTimeHandle(item.created_at)
let sty = typeof (item.photos)
if (sty == 'string') {
item.photos = JSON.parse(item.photos)
}
if ((item.is_audited == 0 || item.is_audited == -1) && item.is_self == 0) {
data.data.splice(index--, 1)
}
})
}
if (vm.dynamicList.length === 0 || vm.page === 1) {
vm.dynamicList = data.data
} else {
data.data.map(function (item) {
vm.dynamicList.push(item)
})
}
if (vm.dynamicList.length < 15 || data.data.length < 15) {
vm.no_more = true
}
setTimeout(() => {
vm.loading = true
}, 500)
vm.triggered = false
}
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
console.log(err)
})
},
// 选择某条动态操作弹框
changeSelect(e, index) {
let vm = this
vm.selectData = e
vm.selectIndex = index
vm.chooseShow = true
},
// 取消动态操作弹框
hideModal() {
let vm = this
vm.chooseShow = false
vm.selectData = {}
vm.selectIndex = null
},
// 操作后对原动态列表数据改动
changeOperation(state) {
let vm = this
if (state == 'isTop') {
// 设置动态为置顶
vm.dynamicList[vm.selectIndex].is_top = 1
vm.dynamicList.unshift(vm.dynamicList[vm.selectIndex])
vm.dynamicList.splice(vm.selectIndex + 1, 1)
} else {
// 删除动态 || 隐藏动态 || 设置动态为推荐动态 || 不感兴趣 || 取消置顶
vm.dynamicList.splice(vm.selectIndex, 1)
}
},
// 下拉加载中
onPulling() {
let vm = this
vm.triggered = true
},
// 初始化数据
onRefresh() {
let vm = this
vm.page = 1
vm.getList()
},
// 动态列表上拉加载更多数据
handleScroll() {
let vm = this
vm.page += 1
vm.getList()
},
// 动态滚动距离超出380展示回到顶部按钮
scrollToUpper(e) {
let vm = this
let top = e.$wx.detail.scrollTop
vm.opacity = top / 120 > 0.9 ? 1 : top / 120 < 0.1 ? 0 : top / 120
vm.$refs.pageScroll.showBackTopBtn = top > 380
},
// 动态回到顶部
BackTop() {
let vm = this
vm.scrollTopHandle = Math.random()
},
handleBack() {
wx.navigateBack({delta: 1})
}
},
// 上拉获取更多数据
onReachBottom() {
let vm = this
if (!vm.no_more) {
vm.getList()
}
},
// 下拉刷新
onPullDownRefresh() {
let vm = this
vm.page = 1
vm.no_more = false
vm.getList()
},
onShow() {
let vm = this
let app = vm.$app.$options
let pages = getCurrentPages()
vm.routerNum = pages.length
vm.navHeight = app.globalData.navBarHeight
vm.navTop = app.globalData.navTop
vm.StatusBar = app.globalData.StatusBar
vm.CustomBar = app.globalData.CustomBar
},
onLoad(e) {
let vm = this
if (e.scene) {
vm.id = decodeURIComponent(e.scene).split('=')[1]
} else {
vm.id = e.id
}
vm.getDetail()
vm.getList()
}
})
</script>
<config>
{
navigationBarTitleText: '优质单身',
navigationStyle: 'custom',
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
usingComponents: {
dynamicOperation: '~@/components/dynamicOperation',
pageScroll: '~@/components/pageScroll',
dynamicList: '~@/components/dynamicList'
}
}
</config>

394
src/pages/dynamic/issue.wpy Normal file
View File

@ -0,0 +1,394 @@
<style lang="less" scoped>
@import url(../../styles/theme.less);
page {
background-color: #ffffff;
}
.cu-form-group{
textarea {
height: 320rpx!important;
position: relative;
font-size: 30rpx;
color: #333333;
overflow: inherit;
}
.num {
position: absolute;
bottom: -36rpx;
right: 0;
height: 34rpx;
font-size: 24rpx;
font-weight: 400;
color: #c2c2c2;
line-height: 34rpx;
}
}
.hottopic {
height: auto;
background: #FFFFFF;
padding: 0 30rpx;
padding-bottom: 42rpx;
.text-sm {
height: 64rpx;
align-items: center;
}
.tags-v2{
background: #fff1f5;
color: #f33b6c;
}
.tags, .tags-v2 {
width: auto;
height: 50rpx;
line-height: 50rpx;
background: #ececec;
color: #333333;
border-radius: 26rpx;
font-size: 24rpx;
padding-right: 16rpx;
.img {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
margin-left: 8rpx;
}
.delete {
width: 35rpx;
height: 35rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 10rpx;
}
}
.hint {
width: 340rpx;
height: 64rpx;
text-align: center;
line-height: 64rpx;
background: #333333;
position: relative;
margin-left: 20rpx;
font-size: 24rpx;
font-weight: 400;
color: #FFFFFF;
border-radius: 17rpx;
}
.hint::before {
content: "";
top: 0;
bottom: 0;
transform: rotate(45deg);
position: absolute;
display: inline-block;
overflow: hidden;
width: 24rpx;
height: 24rpx;
left: -4rpx;
margin: auto;
background-color: inherit;
}
}
.img-title {
font-size: 24rpx;
color: #AAAAAA;
padding: 0 30rpx 16rpx 30rpx;
background: #FFFFFF;
}
.relative_bot{
.videoCenter{
border-radius: 24rpx;
width: 224rpx;
height: 224rpx;
}
.close_icon{
width: 36rpx;
height: 36rpx;
background-image: url("https://image.fulllinkai.com/202207/05/3d77897be5d841402743fa3c901085a3.png");
background-size: cover;
background-repeat: no-repeat;
position: absolute;
right: 10rpx;
top: 10rpx;
}
}
.d_solids{
width: 224rpx;
height: 224rpx;
background-position: center;
background-size: contain;
}
.location {
background: #FFFFFF;
padding: 10rpx 30rpx 0 30rpx;
position: relative;
font-size: 28rpx;
color: #666666;
display: flex;
align-items: center;
.img {
width: 24rpx;
height: 28rpx;
margin-right: 8rpx;
}
}
.issue-main {
height: auto;
position: relative;
display: flex;
justify-content: center;
align-items: center;
padding: 30rpx;
background: #FFFFFF;
margin-top: 100rpx;
.issue {
width: 360rpx;
height: 80rpx;
text-align: center;
line-height: 80rpx;
background: linear-gradient(270deg, #FF85A5 0%, #FF5380 100%);
border-radius: 44rpx;
font-size: 32rpx;
font-weight: 400;
color: #FFFFFF;
}
}
// 弹框
.modal-mask {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
overflow: hidden;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
.modal-dialog {
width: 540rpx;
overflow: hidden;
z-index: 9999;
background: #f9f9f9;
border-radius: 5rpx;
}
.modal-title {
padding-top: 30rpx;
font-size: 32rpx;
color: #030303;
text-align: center;
}
.modal-content {
padding: 20rpx 32rpx;
font-size: 28rpx;
}
.modal-footer {
display: flex;
flex-direction: row;
height: 86rpx;
border-top: 1px solid #dedede;
font-size: 34rpx;
line-height: 86rpx;
}
.btn-cancel {
width: 50%;
color: #abb4bd;
text-align: center;
border-right: 2rpx solid #dedede;
}
.btn-confirm {
width: 50%;
color: #6fb64b;
text-align: center;
padding: 0;
}
}
</style>
<template>
<view class="ui-issue">
<view class="cu-form-group ui-relative">
<textarea v-model="value" fixed="{{true}}" adjust-position="true" show-confirm-bar="{{false}}" maxlength="500" focus="{{true}}" style="caret-color: #f33b6c;word-break:break-word;" :placeholder="placeholder"></textarea>
<view class="num ui-pr-30">{{value.length}}/500</view>
</view>
<view class="hottopic">
<view class="text-sm flex">
<view class="f-fcc" v-if="title == ''">
<view class="tags f-fcc" catchtap="gotoHotTopic">
<image class="img" src="https://images.ufutx.com/202103/03/23b49569624fb2516fa7267cb255b447.png" alt=""/>
选择话题
</view>
<view class="hint">添加话题更容易获得回复哦</view>
</view>
<view v-else>
<view class="tags-v2 f-fcc" catchtap="gotoHotTopic">
<image class="img" src="https://images.ufutx.com/202102/04/dc3043df7d265ae0b2401e589405a239.png" alt=""/>
{{ title }}
</view>
</view>
</view>
</view>
<view class="img-title" v-if="uploadType == 'video'">添加视频 (最多30秒)</view>
<view class="img-title" v-else>添加照片 (最多9张)</view>
<view class="cu-form-group">
<view class="grid col-04 grid-square flex-sub">
<block v-if="uploadType == 'image'">
<view class="bg-img" style="width:216rpx;height:216rpx" v-for="(item,index) in imgList" :key="index" @tap="$previewImages(item, imgList)">
<image :src="item" mode="aspectFill"></image>
<view class="cu-tag bg-red" style="width:36rpx;height:36rpx;border-radius:60rpx;margin:6rpx 6rpx 0 0" @tap="delImg" data-index="{{index}}">
<text class="cuIcon-close"></text>
</view>
</view>
</block>
<block v-if="uploadType == 'video'">
<view class="relative_bot">
<video id="video" referrer-policy="origin" src="{{play_url}}" direction="0" controls="{{true}}" class="videoCenter"></video>
<view class="close_icon" @tap="closeFn"></view>
</view>
</block>
<block v-if="!play_url">
<view class="d_solids" style="background-image: url('https://image.fulllinkai.com/202207/05/691522eab940b6165d2f3784984c18bd.png')" @tap="chooseVideo" v-if="!uploadType || mgList.length < 1"></view>
<view class="d_solids" style="background-image: url('https://image.fulllinkai.com/202207/05/deb3f6b011f33e54e3fdecf2a9da65f4.png')" @tap="ChooseImage" v-if="imgList.length<9"></view>
</block>
</view>
</view>
<view class="location {{address == '我在哪里'? '' : 'color-theme'}}" bindtap="location">
<image v-if="address == '我在哪里'" class="img" src="https://images.ufutx.com/202102/04/817a393539ee854226eef79defef2fc4.png"/>
<image v-else class="img" src="https://images.ufutx.com/202101/28/be1cca1ed09cf469d5baefdf95a12bd9.png"/>
{{ address }}
</view>
<view class="issue-main">
<view class="issue" bindtap="issue" data-id="{{id}}">发布</view>
</view>
</view>
<view v-if="showCon" class="modal-mask" @tap="showCon = false">
<view class="modal-dialog">
<view class="modal-title">温馨提示</view>
<view class="modal-content">获取定位失败,请前往设置打开定位权限</view>
<view class="modal-footer">
<view class="btn-cancel">取消</view>
<button open-type="openSetting" class="btn-confirm button-on-view" @tap.stop="showCon = false">设置</button>
</view>
</view>
</view>
</template>
<script>
import wepy from '@wepy/core'
import https from '../../mixins/https'
import base from '../../mixins/base'
import {service} from '../../config'
wepy.page({
config: {},
mixins: [https, base],
data: {
id: '',
value: '',
placeholder: '用视频/图片分享记录,能获得更多好友点赞',
title: '',
showCon: false,
imgList: [],
uploadType: '',
address: '我在哪里'
},
methods: {
delImg(index) {
let vm = this
vm.imgList.splice(index, 1)
},
location() {
let vm = this
// 判断开启位置允许
if (wx.getFuzzyLocation) {
wx.getSetting({
success: (res) => {
if (!res.authSetting['scope.userFuzzyLocation'] && !res.authSetting['scope.userLocation']) {
// 打开提示框,提示前往设置页面
vm.showCon = true
}
}
})
// 判断GPS是否开启
wx.getSystemInfo({
success: (res) => {
console.log(res + 'GPS定位')
var isopendingwei = res.locationEnabled
console.log(res.locationEnabled)
if (isopendingwei == false) {
console.log('请先开启手机GPS定位,然后重新刷新')
wx.showToast({
title: '请打开GPS定位获取地理位置',
icon: 'none',
duration: 2000
})
} else {
wx.getFuzzyLocation({
type: 'gcj02',
success(res) {
vm.latitude = res.latitude
vm.longitude = res.longitude
wx.chooseLocation({
latitude: res.latitude,
longitude: res.longitude,
scale: 28, // 缩放比例
success(res) {
if (res.address == '') {
vm.address = '我在哪里'
} else {
vm.address = res.address
}
}
})
}
})
}
}
})
} else {
console.log('1312312----')
vm.hide = false
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
}
},
onShow() {
},
onLoad() {
let vm = this
}
})
</script>
<config>
{
navigationBarTitleText: '编辑动态',
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
}
</config>

View File

@ -0,0 +1,203 @@
<style lang="less" scoped>
@import url(../../styles/theme.less);
page {
background-color: #ffffff;
}
.ui-search{
width: 100vw;
background: #ffffff;
position: fixed;
top: 0;
left: 0;
z-index: 22;
}
.searchIcon{
width: 27rpx;
height: 27rpx;
margin: 0 20rpx;
}
.main {
padding: 100rpx 30rpx 60rpx 30rpx;
background: #ffffff;
.cu-list {
.cu-item {
position: relative;
display: block;
height: 200rpx;
.cu-avatar.lgs {
width: 160rpx;
height: 160rpx;
border-radius: 8px;
left: 0;
font-size: 2em;
}
.content {
position: absolute;
left: 176rpx;
top: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
border-bottom: 1rpx solid #f5f5f5;
.title {
height: 44rpx;
font-size: 32rpx;
font-weight: 400;
color: #333333;
line-height: 44rpx;
margin-top: 10rpx;
}
.mains {
height: auto;
font-size: 24rpx;
color: #999999;
line-height: 34rpx;
margin-top: 12rpx;
}
.num {
height: 36rpx;
font-size: 26rpx;
color: #666666;
line-height: 36rpx;
margin-top: 10rpx;
}
}
}
}
.cu-list {
margin: 30rpx 0;
}
}
</style>
<template>
<view class="ui-searchPopular">
<view class="cu-bar ui-search bg-white">
<view class="search-form round">
<image class="searchIcon" src="https://images.ufutx.com/202102/26/4081d59162d4a38736c323ed7fffd3db.png" alt=""></image>
<input type="text" placeholder="搜索话题" confirm-type="search" bindinput="inputTyping" />
</view>
</view>
<view class="main">
<block v-for="(item,index) in list" :key="index">
<view class="cu-list menu-avatar">
<view class="cu-item" @tap="gotoHotTopic(item.id)">
<view class="cu-avatar round lgs" style="{{'background-image:url(' + item.back_image + ');'}}"></view>
<view class="content flex-sub">
<view class="title"># {{item.name}}</view>
<view class="mains ellipsis_1">{{item.info}}</view>
<view class="num"><span style="color:#333333;">{{item.quote_num}}</span> 条动态</view>
</view>
</view>
</view>
</block>
</view>
</view>
<pageScroll ref="pageScroll"></pageScroll>
</template>
<script>
import wepy from '@wepy/core'
import https from '../../mixins/https'
import base from '../../mixins/base'
import {service} from '../../config'
wepy.page({
config: {},
mixins: [https, base],
data: {
arr: [],
no_more: false,
loading: false,
page: 1,
list: [] // 列表数据
},
methods: {
getList() {
let vm = this
let data = {
page: vm.page
}
vm.$showLoading('加载中...')
vm.$get({url: `${service.host}/moment/topics`, data}).then(({code, data}) => {
if (code === 0) {
if (vm.list.length === 0 || vm.page === 1) {
vm.list = data.data
vm.arr = data.data
} else {
data.data.map(function (item) {
vm.list.push(item)
vm.arr.push(item)
})
}
if (vm.list.length < 15 || data.data.length < 15) {
vm.no_more = true
}
setTimeout(() => {
vm.loading = true
}, 500)
vm.page++
}
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
console.log(err)
})
},
inputTyping(e) {
let vm = this
let key = e.$wx.detail.value
if (key == '') {
vm.list = vm.arr
} else {
vm.list = []
vm.arr.forEach(ele => {
if (ele.name.indexOf(key) >= 0) {
vm.list = vm.list.concat([ele])
}
})
}
}
},
// 上拉获取更多数据
onReachBottom() {
let vm = this
if (!vm.no_more) {
vm.getList()
}
},
// 下拉刷新
onPullDownRefresh() {
let vm = this
vm.page = 1
vm.no_more = false
vm.getList()
},
onPageScroll(res) {
let vm = this
let top = res.scrollTop
vm.$refs.pageScroll.showBackTopBtn = top > 380
},
onShow() {
},
onLoad() {
let vm = this
vm.getList()
}
})
</script>
<config>
{
navigationBarTitleText: '热门话题',
enablePullDownRefresh: true,
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
usingComponents: {
pageScroll: '~@/components/pageScroll'
}
}
</config>

View File

@ -0,0 +1,155 @@
<style lang="less" scoped>
@import url(../../styles/theme.less);
page {
background-color: #ffffff;
}
.ui-search{
width: 100vw;
background: #ffffff;
position: fixed;
top: 0;
left: 0;
z-index: 22;
}
.searchIcon{
width: 27rpx;
height: 27rpx;
margin: 0 20rpx;
}
.main {
padding: 130rpx 30rpx 60rpx 30rpx;
background: #ffffff;
.hot {
.topic {
height: 22px;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 22px;
}
.mains {
height: auto;
display: flex;
flex-wrap: wrap;
.zanwu {
height: 240rpx;
width: 250rpx;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
.list {
height: 60rpx;
line-height: 60rpx;
background: #F5F5F5;
border-radius: 8rpx;
font-size: 28rpx;
color: #333333;
margin-right: 24rpx;
margin-top: 24rpx;
padding: 0 20rpx;
.img {
width: 28rpx;
height: 28rpx;
margin-left: 6rpx;
}
}
}
}
}
</style>
<template>
<view class="ui-searchTopic">
<view class="cu-bar ui-search bg-white">
<view class="search-form round">
<image class="searchIcon" src="https://images.ufutx.com/202102/26/4081d59162d4a38736c323ed7fffd3db.png" alt=""></image>
<input type="text" placeholder="搜索话题" confirm-type="search" bindinput="inputTyping" />
</view>
</view>
<view class="main" v-if="loading">
<view class="hot">
<view class="topic" v-if="!show">热门话题</view>
<view class="mains">
<view class="list f-fcc" v-for="(item,index) in list" :key="index">
# {{item.name}}
<image v-if="item.is_hot == 1" class="img" src="https://images.ufutx.com/202103/02/0dffc4de154e82b1a75ae4c0a2a62ecf.png" />
</view>
<image class="zanwu" v-if="list && list.length == 0" src="https://images.ufutx.com/202101/28/91c53fec5c317fc68138cb4dd42e9d8f.png"></image>
</view>
</view>
</view>
</view>
</template>
<script>
import wepy from '@wepy/core'
import https from '../../mixins/https'
import base from '../../mixins/base'
import {service} from '../../config'
wepy.page({
config: {},
mixins: [https, base],
data: {
list: [], // 列表数据
arr: [],
loading: false,
show: false
},
methods: {
getList() {
let vm = this
vm.$showLoading('加载中...')
vm.$get({url: `${service.host}/moment/topics`}).then(({code, data}) => {
if (code === 0) {
vm.list = data.data
vm.arr = data.data
vm.loading = true
}
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
console.log(err)
})
},
inputTyping(e) {
let vm = this
let key = e.$wx.detail.value
if (key == '') {
vm.list = vm.arr
vm.show = false
} else {
vm.list = []
vm.arr.forEach(ele => {
if (ele.name.indexOf(key) >= 0) {
vm.list = vm.list.concat([ele])
}
})
if (vm.list && vm.list.length == 0) {
vm.show = true
}
}
}
},
onShow() {
},
onLoad() {
let vm = this
vm.getList()
}
})
</script>
<config>
{
navigationBarTitleText: '更多话题',
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
}
</config>

View File

@ -0,0 +1,265 @@
<style lang="less" scoped>
@import url(../../styles/theme.less);
page {
background-color: #ffffff;
}
.wrapper {
margin: 0 30rpx;
padding-top: 30rpx;
._icon {
width: 36rpx;
height: auto;
margin-right: 16rpx;
}
.sb_title {
margin-left: 52rpx;
}
.vote_item, .vote_item_a {
width: 640rpx;
padding: 0 20rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 16rpx;
border: 2rpx solid #FF95B1;
margin: 20rpx auto;
color: #FF678F;
position: relative;
z-index: 2;
}
.bg_plan, .bg_plan_a {
position: absolute;
left: 0;
top: 0;
border-radius: 12rpx;
height: 76rpx;
background: #FFF1F5;
z-index: -1;
}
.bg_plan_a {
background: #EEF5FF;
}
@keyframes move {
from {
width: 0rpx;
}
to {
width: 420rpx;
}
}
._active {
background: #FAFBFE;
color: #63A5FF;
border: none;
}
}
.ui-like-box{
width: 100vw;
padding-right: 30rpx;
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 50rpx;
padding-bottom: 24rpx;
.ui-like-icon-box{
display: inline-flex;
align-items: center;
height: 30rpx;
font-size: 24rpx;
color: #666666;
position: relative;
margin-right: 50rpx;
.ui-like-icon{
width: 30rpx;
height: 30rpx;
margin-right: 8rpx;
display: block;
}
.ui-like-icon-v2{
width: 32rpx;
height: 32rpx;
margin-right: 6rpx;
margin-top: -8rpx;
display: block;
}
.ui-img2_gif {
position: relative;
left: 6rpx;
top: -10rpx;
width: 64rpx;
height: 64rpx;
margin-left: -20rpx;
}
}
}
.ui-line{
height: 2rpx;
background: #f5f5f5;
}
</style>
<template>
<view class="ui-voteDetail"></view>
<!--投票信息-->
<view class="wrapper">
<view class="f-fc">
<image src="https://image.fulllinkai.com/202206/28/7fd07d9687390a58d25ac92b55d9a9dd.png" mode="widthFix" class="_icon"></image>
<view class="font_32 color333 bold">{{ detail.title }}</view>
</view>
<view class="sb_title color999">{{ detail.content || '如题'}}</view>
<block v-for="(item,index) in detail.option" :key="index">
<view class="text-right ui-ml-40">
<view v-if="!detail.is_vote" class="vote_item text-center" @tap="selectFn(item)">{{ item.title }}</view>
<view v-else class="vote_item_a f-fbc ellipsis_1 {{item.checked == 1 ? '' : '_active'}}">
<view class="ellipsis_1">{{ item.title }}</view>
<view>{{ item.count }} {{ item.rate }} %</view>
<view class="{{item.checked ==1 ? 'bg_plan' : 'bg_plan_a'}}" style="width: {{detail.is_vote ? item.rate : item.rate}}%;"></view>
</view>
</view>
</block>
<view class="~color666 ~font_28 ui-like-box">
<view class="ui-like-icon-box">
<image lazy-load="true" class="ui-like-icon" src="https://images.ufutx.com/202102/04/ab432de170b4e8ca1a1a59e34af9aa25.png"></image>
{{ detail.comment_count }}
</view>
<view class="ui-like-icon-box ~ui-mr-40" @tap.stop="upvote">
<image v-if="detail.is_like == false" lazy-load="true" class="ui-like-icon-v2" src="https://images.ufutx.com/202106/10/a97c7c76f3aaf7065e7f7a5fe2abc081.png"></image>
<image v-else class="ui-img2_gif" src="{{detail.is_like ? gifurl : 'https://images.ufutx.com/202106/07/b227f3ecf9cbd080fb814450b667b5ce.gif'}}"></image>
{{ detail.like_count }}
</view>
</view>
<view class="ui-line"></view>
</view>
<!--评论数据-->
<dynamicDiscuss :list="list" :detail="detail"></dynamicDiscuss>
</template>
<script>
import wepy from '@wepy/core'
import https from '../../mixins/https'
import base from '../../mixins/base'
import {service} from '../../config'
import {commentTimeHandle} from '../../mixins/plugins'
wepy.page({
config: {},
mixins: [https, base],
data: {
id: '',
detail: {},
gifurl: 'https://images.ufutx.com/202106/11/d40b92e053a693f30eb197bf6374af95.gif',
list: [] // 评论列表数据
},
methods: {
getDetail() {
let vm = this
vm.$get({url: `${service.host}/vote/${vm.id}`}).then(({code, data}) => {
if (code === 0) {
let result = data
result.comment_count = result.momentCommentCount
result.like_count = result.momentLikerCount
result.is_like = result.isLkerMoment
result.created_at = commentTimeHandle(result.created_at)
for (let index in data.option) {
data.option[index].rate = vm.getPercentage(data.option[index].rate)
}
vm.detail = result
}
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
console.log(err)
})
},
// 获取评论列表
getList() {
let vm = this
vm.$showLoading('加载中...')
vm.$get({url: `${service.host}/moment/comments?id=${vm.id}&type=vote&nopage=1`}).then(({code, data}) => {
if (code === 0) {
data.forEach((item) => {
item.created_at = commentTimeHandle(item.created_at)
item.comment = item.comment.split('?')[0]
})
vm.list = data
console.log(vm.list, '////')
}
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
console.log(err)
})
},
selectFn(e) {
let vm = this
vm.$showLoading('投票中...')
vm.$post({url: `${service.host}/moment/vote/${e.id}`}).then(({code, data}) => {
if (code == 0) {
vm.$showToast('动态已删除')
for (let index in data.option) {
vm.detail.option[index].rate = vm.getPercentage(data.option[index].rate)
vm.detail.option[index].checked = data.option[index].checked
vm.detail.option[index].count = data.option[index].count
}
vm.hideModal()
}
wx.hideLoading()
}).catch(() => {
wx.hideLoading()
})
},
// 点赞
upvote() {
let vm = this
let nowTime = new Date()
vm.$post({url: `${service.host}/like/vote/${vm.id}`}).then(({code}) => {
wx.hideLoading()
if (code == 0) {
vm.detail.is_like = !vm.detail.is_like
vm.detail.like_count = vm.detail.like_count + (vm.detail.is_like ? 1 : -1)
if (vm.detail.is_like) {
vm.gifurl = `${vm.gifurl}?${nowTime}`
}
}
}).catch(() => {
wx.hideLoading()
})
},
// 计算投票百分比
getPercentage(val) {
return Math.round((val) * 10000) / 100
}
},
onShow() {
},
onLoad(e) {
let vm = this
vm.id = e.id
vm.getDetail()
vm.getList()
}
})
</script>
<config>
{
navigationBarTitleText: '投票详情',
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
usingComponents: {
dynamicDiscuss: '~@/components/dynamicDiscuss',
}
}
</config>

View File

@ -4,11 +4,6 @@ page {
background-color: #ffffff;
}
scroll-view {
height: 100%;
box-sizing: border-box;
}
.ui-tabBar-item{
padding-right: 64rpx;
}
@ -126,195 +121,14 @@ scroll-view {
background: #F8F8F8;
}
.ui-user-pic {
width: 80rpx;
min-width: 80rpx;
height: 80rpx;
border-radius: 50%;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
.ui-time {
position: absolute;
right: 30rpx;
top: 30rpx;
}
.ui-name {
width: auto;
max-width: 300rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
height: 40rpx;
font-size: 30rpx;
font-weight: 600;
color: #333333;
line-height: 40rpx;
}
.ui-identification{
color: #f3903b;
padding: 4rpx 12rpx;
line-height: 32rpx;
border-radius: 20rpx;
background: #fff9f4;
margin-left: 14rpx;
.ui-identification-icon{
width: 24rpx;
height: 24rpx;
display: block;
}
}
.referencesIcon {
.ui-suspend{
position: fixed;
height: 124rpx;
width: 124rpx;
height: 36rpx;
display: block;
margin-left: 16rpx;
margin-top: 2rpx;
}
.ui-dynamic-content{
white-space: pre-line;
word-break: break-all;
display: -webkit-box;
}
.ui-active-content{
overflow: hidden;
margin-bottom: 15rpx;
white-space: pre-line;
word-wrap: break-word;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.ui-voteItem{
width: calc(100vw - 156rpx);
background: #f8f8f8;
padding: 16rpx 18rpx;
border-radius: 8rpx;
.ui-vote-icon{
width: 32rpx;
min-width: 32rpx;
margin: 8rpx 8rpx 0 0;
display: block;
}
}
.ui-dynamic-pic-box{
.ui-only-img, .ui-grid-square{
width: 400rpx;
height: 400rpx;
border-radius: 16rpx;
margin-bottom: 10rpx;
display: block;
}
.ui-grid-square{
width: 192rpx;
height: 192rpx;
}
}
.ui-dynamic-pic-box:after{
content: '';
width: 192rpx;
}
.liveImg {
position: relative;
border-radius: 10rpx;
.playImg {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
width: 72rpx;
height: 72rpx;
}
}
.ui-tags{
width: auto;
height: 50rpx;
background: #fff1f5;
border-radius: 26rpx;
.ui-img {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
margin-left: 8rpx;
}
}
.ui-address-icon{
width: 20rpx;
min-width: 20rpx;
height: 24rpx;
margin-right: 4rpx;
}
.ui-like-box{
width: calc(100vw - 156rpx);
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 20rpx;
padding-bottom: 20rpx;
.ui-like-icon-box{
display: inline-flex;
align-items: center;
height: 30rpx;
font-size: 24rpx;
color: #666666;
position: relative;
margin-right: 50rpx;
.ui-like-icon{
width: 30rpx;
height: 30rpx;
margin-right: 8rpx;
display: block;
}
.ui-like-icon-v2{
width: 32rpx;
height: 32rpx;
margin-right: 6rpx;
margin-top: -8rpx;
display: block;
}
.ui-img2_gif {
position: absolute;
left: -14rpx;
top: -26rpx;
width: 64rpx;
height: 62rpx;
margin-right: 6rpx;
}
}
.ui-cuIcon-moreandroid{
width: 6rpx;
height: 26rpx;
}
}
.ui-line{
margin: 0 30rpx;
height: 2rpx;
background: #f5f5f5;
right: 30rpx;
bottom: 180rpx;
text-align: center;
z-index: 1000;
}
.m_returnTop {
@ -343,30 +157,9 @@ scroll-view {
.show{
opacity:1;
}
.dialog {
width: 100%;
background: white;
height: auto;
z-index: 1111;
border-radius: 30rpx 30rpx 0rpx 0rpx;
view {
height: 90rpx;
text-align: center;
line-height: 100rpx;
margin: 0 30rpx;
color: #333333;
}
view:last-of-type {
border-top: 1rpx solid #f5f5f5;
color: #999999;
}
}
</style>
<template>
<view class="ui-dynamic">
<view class="ui-dynamic ui-relative">
<view class="cu-custom">
<view class="cu-bar fixed" :style="{height: CustomBar + 'px', paddingTop: StatusBar + 'px',zIndex: 999}">
<view class="f-fcl ui-ml-30">
@ -381,14 +174,14 @@ scroll-view {
<scroll-view scroll-top="{{scrollTopHandle}}" scroll-with-animation="true" scroll-anchoring="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherpulling="onPulling" bindrefresherrefresh="onRefresh" style="height:100%;-webkit-overflow-scrolling: touch" lower-threshold="300" bindscrolltolower="handleScroll" bindscroll="scrollToUpper" scroll-y>
<view class="ui-topicTitle">
<view class="ui-hot">热门话题</view>
<view class="ui-more">更多话题
<view class="ui-more" @tap.stop="jumpPath('/pages/dynamic/searchPopular')">更多话题
<image class="ui-rig" src="https://images.ufutx.com/202101/27/aac7d6a4cdd90938d7bcfb378705058c.png" mode="widthFix"></image>
</view>
</view>
<view class="ui-hotTopic-box">
<scroll-view scroll-x="true" class="ui-scroll">
<block v-for="(item,index) in hotTopics" :key="index">
<view v-if="item.is_hot == 1" class="cu-avatar ui-main" @tap.stop="hotTopic(item.id)" style="background-image:url({{ item.back_image }});">
<view v-if="item.is_hot == 1" class="cu-avatar ui-main" style="background-image:url({{ item.back_image }});" @tap.stop="jumpPath(`/pages/dynamic/hotTopic?id=${item.id}`)">
<view>#{{ item.name }}</view>
<view>{{ item.moment_count }} 动态</view>
<view class="ui-mask"></view>
@ -396,89 +189,12 @@ scroll-view {
</block>
</scroll-view>
</view>
<block v-if="item.type != 'vote'">
<view class="f-fcl ui-ml-30">
<view class="font_28 ui-dynamicTabs f-fcc {{dynamicTabsIndex == index ? 'ui-activeDynamic' : 'ui-inactiveDynamic'}}" v-for="(item,index) in dynamicTabs" :key="index" @tap.stop="dynamicTabChange(index)">
{{ item }}
</view>
<view class="f-fcl ui-ml-30">
<view class="font_28 ui-dynamicTabs f-fcc {{dynamicTabsIndex == index ? 'ui-activeDynamic' : 'ui-inactiveDynamic'}}" v-for="(item,index) in dynamicTabs" :key="index" @tap.stop="dynamicTabChange(index)">
{{ item }}
</view>
<block v-for="(item,index) in dynamicList" :key="index">
<view class="f-fl ui-pl-30 ui-pr-30 ui-pt-30 ui-relative">
<view class="ui-user-pic" v-if="item.u_photo" style="{{'background-image:url(' + item.u_photo + ');'}}"></view>
<view class="ui-user-pic" v-else style="background-image:url(https://image.fulllinkai.com/202203/09/cc1c73eb1a4941fef25a15cd1ff2f9df.png);"></view>
<view class="color999 font_24 ui-time">{{ item.created_at }}</view>
<view class="ui-pl-16">
<view class="f-fc">
<view class="f-fcl">
<view class="ui-name">{{ item.u_nickname || '未设置名称' }}</view>
<view v-if="item.work_user_tag" class="ui-identification font_22 f-fcc">
<image class="ui-identification-icon" src="https://image.fulllinkai.com/202307/21/eb5c30d676eac58af4235bad8e6d8c43.png" mode="widthFix"></image>
{{item.work_user_tag}}
</view>
</view>
<image class="referencesIcon" src="https://image.fulllinkai.com/202207/19/7e78a1dd367f1250d4cba4e85bfd60f1.png" mode="widthFix" v-if="item.u_type != 'single'"></image>
<view class="font_24 ui-ml-24 color-theme" v-if="item.vote_id > 0">
参与了投票:
</view>
</view>
<view class="font_24 f-fbc">
<view class="f-fcl">
<view class="font_24 color-999">{{ item.u_year }}</view>
<view class="font_24 color-999" v-if="item.u_stature"> · {{ item.u_stature }}cm
</view>
<view class="font_24 color-999" v-if="item.u_degree"> · {{ item.u_degree }}</view>
</view>
<view class="color-theme" v-if="item.is_audited == 0">审核中</view>
<view class="color-theme" v-if="item.is_audited == -1">审核失败</view>
</view>
<view class="ui-pt-14">
<view class="ui-dynamic-content substance color333 ui-mb-10 font_30 {{item.readmore.status == false ? 'ui-active-content' : ''}}">{{item.content}}</view>
<block v-if="item.vote_id > 0">
<view class="ui-voteItem f-fl">
<image class="ui-vote-icon" src="https://image.fulllinkai.com/202206/29/7fd07d9687390a58d25ac92b55d9a9dd.png" mode="widthFix"></image>
<view class="font_28">{{item.v_title}}</view>
</view>
</block>
<block v-else>
<view class="color-theme font_30 ui-mb-10" v-if="item.readmore.auto" @tap.stop="toggle" data-index="{{index}}">{{ item.readmore.tip }}</view>
<view v-if="item.photos.length > 0" class="ui-wrap ui-dynamic-pic-box {{item.photos.length == 2 ? 'f-fl' : 'f-fb'}}">
<image v-for="(itemV2,indexV2) in item.photos" :key="indexV2" @tap.stop="$previewImages(itemV2, item.photos)" class="{{item.photos.length == 1 ? 'ui-only-img':''}} {{item.photos.length > 1 ? 'ui-grid-square' : ''}} {{item.photos.length == 2 ? 'ui-mr-10' : ''}}" :src="itemV2" mode="aspectFill"></image>
</view>
<view v-if="item.play_url">
<view class="liveImg bg-img only-img" data-img_url="{{item.play_url}}" style="display:{{ videoIndex == index ? 'none' : 'block' }};{{'background-image:url(' + item.cover_url + ');'}};{{item.video_width>item.video_height?'width:480rpx;height:270rpx;':'width:320rpx;height:480rpx;'}}">
<image lazy-load="true" class="playImg" src="https://images.ufutx.com/202103/06/8c94ccedcd19252ebf788f422fbdd22d.png" mode="widthFix"></image>
<video id="video{{index}}" referrer-policy="origin" v-if="videoIndex == index" autoplay="{{videoIndex == index ? true : false}}" src="{{item.play_url}}" direction="0" controls="{{true}}" bindfullscreenchange="leaveVideo" class="videoCenter" style="{{item.video_width>item.video_height?'width:480rpx;height:270rpx;':'width:300rpx;height:480rpx;'}}"></video>
</view>
</view>
<view class="font_24 f-fb ui-mt-10" v-if="item.mt_name != null || item.mt_name == ''">
<view class="ui-tags f-fcc color-theme font_24 ui-pr-16">
<image lazy-load="true" class="ui-img" src="https://images.ufutx.com/202102/04/dc3043df7d265ae0b2401e589405a239.png" alt=""/>
{{ item.mt_name }}
</view>
</view>
<view v-if="item.address != null || item.address == ''" class="color666 font_24 f-fcl ui-mt-16">
<image lazy-load="true" class="ui-address-icon" src="https://images.ufutx.com/202102/04/817a393539ee854226eef79defef2fc4.png" alt=""/>
<view>{{ item.address }}</view>
</view>
</block>
</view>
<view class="color666 font_28 ui-like-box">
<view class="ui-like-icon-box" data-id="{{item.id}}">
<image lazy-load="true" class="ui-like-icon" src="https://images.ufutx.com/202102/04/ab432de170b4e8ca1a1a59e34af9aa25.png"></image>
{{ item.comment_count }}
</view>
<view class="ui-like-icon-box" style="{{item.is_like ? 'ui-pr-38':''}}" bindtap="likeFeed" data-typ="1" data-type="{{item.type}}" data-id="{{item.id}}">
<image v-if="item.is_like == false" lazy-load="true" class="ui-like-icon-v2" src="https://images.ufutx.com/202106/10/a97c7c76f3aaf7065e7f7a5fe2abc081.png"></image>
<image v-else class="ui-img2_gif" src="{{item.id == likeId ? gifurl:'https://images.ufutx.com/202106/07/b227f3ecf9cbd080fb814450b667b5ce.gif'}}"></image>
{{ item.like_count }}
</view>
<image class="ui-cuIcon-moreandroid" src="https://image.fulllinkai.com/202409/05/fdb58839d1909d75f636941d6aea6cb5.png" mode="widthFix"></image>
</view>
</view>
</view>
<view class="ui-line"></view>
</block>
</block>
</view>
<dynamicList :dynamicList="dynamicList" @changeSelect="changeSelect" :from="'dynamic'"></dynamicList>
</scroll-view>
</swiper-item>
<swiper-item wx:key="id" style="-webkit-overflow-scrolling:touch"></swiper-item>
@ -486,28 +202,12 @@ scroll-view {
</swiper>
</view>
</view>
<view class="cu-modal bottom-modal {{modalName=='delete'?'show':''}}" bindtap="hideModal">
<view class="cu-dialog dialog">
<view>删除</view>
<view @tap="conceal" v-if="admin == 1">隐藏动态</view>
<block v-if="dynamicTabsIndex == 1">
<view @tap="hotdt(1)" v-if="admin == 1">设置为推荐动态</view>
</block>
<block v-else>
<view @tap="hotdt(0)" v-if="admin == 1">取消推荐</view>
</block>
<block v-if="ycTop == 0">
<view @tap="topDynamic(1)" v-if="admin == 1">设置为置顶</view>
</block>
<block v-else>
<view @tap="topDynamic(0)" v-if="admin == 1">取消置顶</view>
</block>
<view bindtap="hideModal">取消</view>
</view>
</view>
<image lazy-load="true" class="ui-suspend" src="https://image.fulllinkai.com/202207/01/df8e2ac2ab24eeec52e9914bbab7cdb7.png" mode="widthFix" @tap="jumpPath('/pages/dynamic/issue')"></image>
<view class="m_returnTop {{ showBackTopBtn ? 'show' : 'hide'}}">
<image class="u_returnTop_img" @tap.stop="BackTop" src="https://images.ufutx.com/202106/23/f0d10551dc5d3399cc7f15805cf04f4f.png" mode="scaleToFill" lazy-load="false"></image>
</view>
<!--动态操作功能selectData选择的动态数据、selectIndex选中的动态下标、admin是否管理员、from来自哪个父组件-->
<dynamicOperation :selectData="selectData" :chooseShow.sync="chooseShow" :selectIndex="selectIndex" :admin="admin" :from="'dynamic'" @hideModal="hideModal" @operation="changeOperation"></dynamicOperation>
</template>
<script>
@ -522,7 +222,7 @@ wepy.page({
mixins: [https, base],
data: {
modalName: '',
chooseShow: false,
no_more: false,
loading: false,
page: 1,
@ -532,9 +232,12 @@ wepy.page({
tabBarList: ['动态', '活动', '服务'],
tabBarIndex: 0,
admin: '1',
dynamicTabs: ['推荐', '最新'],
dynamicTabsIndex: 0,
dynamicList: [],
selectData: {},
selectIndex: null,
scrollTopHandle: -1,
videoIndex: -1,
showBackTopBtn: false,
@ -580,11 +283,8 @@ wepy.page({
}
setTimeout(() => {
vm.loading = true
vm.triggered = false
}, 500)
vm.triggered = false
if (vm.dynamicList.length > 0) {
vm.textAll(vm.dynamicList)
}
}
wx.hideLoading()
}).catch(err => {
@ -592,27 +292,6 @@ wepy.page({
console.log(err)
})
},
// 文字超出展示全文
textAll(e) {
let vm = this
setTimeout(() => {
const query = wx.createSelectorQuery()
query.selectAll('.substance').boundingClientRect()
query.exec(function (res) {
let num = res[0].slice(-15)
for (let i = 0; i < num.length; i++) {
if (num[i].height > 75) {
e.slice(-15)[i].readmore = {
status: false,
auto: true,
tip: '全文'
}
}
}
vm.dynamicList = JSON.parse(JSON.stringify(e))
})
}, 100)
},
// 获取热门话题
getHotTopics() {
let vm = this
@ -626,13 +305,32 @@ wepy.page({
console.log(err)
})
},
// 展开全文或收起
toggle(e) {
// 选择某条动态操作弹框
changeSelect(e, index) {
let vm = this
let index = e.$wx.currentTarget.dataset.index
let status = vm.dynamicList[index].readmore.status
vm.dynamicList[index].readmore.status = !status
vm.dynamicList[index].readmore.tip = status ? '全文' : '收起'
vm.selectData = e
vm.selectIndex = index
vm.chooseShow = true
},
// 取消动态操作弹框
hideModal() {
let vm = this
vm.chooseShow = false
vm.selectData = {}
vm.selectIndex = null
},
// 操作后对原动态列表数据改动
changeOperation(state) {
let vm = this
if (state == 'isTop') {
// 设置动态为置顶
vm.dynamicList[vm.selectIndex].is_top = 1
vm.dynamicList.unshift(vm.dynamicList[vm.selectIndex])
vm.dynamicList.splice(vm.selectIndex + 1, 1)
} else {
// 删除动态 || 隐藏动态 || 设置动态为推荐动态 || 不感兴趣 || 取消置顶
vm.dynamicList.splice(vm.selectIndex, 1)
}
},
// 顶部动态、活动、服务切换tab
tabChange(index) {
@ -682,6 +380,9 @@ wepy.page({
let vm = this
vm.scrollTopHandle = 0
vm.showBackTopBtn = false
},
jumpPath(url) {
wx.navigateTo({url: url})
}
},
// 上拉获取更多数据
@ -698,11 +399,6 @@ wepy.page({
vm.no_more = false
vm.getList()
},
onPageScroll(res) {
let vm = this
let top = res.scrollTop
vm.$refs.pageScroll.showBackTopBtn = top > 380
},
onShow() {
let vm = this
let app = vm.$app.$options
@ -727,7 +423,8 @@ enablePullDownRefresh: false,
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
usingComponents: {
pageScroll: '~@/components/pageScroll'
dynamicOperation: '~@/components/dynamicOperation',
dynamicList: '~@/components/dynamicList'
}
}
</config>

View File

@ -578,11 +578,11 @@
}
.ui-mr-36 {
margin-right: 36rpx;
margin-right: 36rpx!important;
}
.ui-mr-40 {
margin-right: 40rpx;
margin-right: 40rpx!important;
}
.ui-mb-4 {