迁移图片

This commit is contained in:
aixianling
2022-07-14 17:24:00 +08:00
parent 2ef6de0eb5
commit dfb0dbc66d
2 changed files with 108 additions and 107 deletions

View File

@@ -34,7 +34,7 @@
<div class="cardTop"> <div class="cardTop">
<span v-if="tabIndex0 != 3"> <span v-if="tabIndex0 != 3">
<img :src="item.avatarUrl" alt="" v-if="item.avatarUrl" class="img"/> <img :src="item.avatarUrl" alt="" v-if="item.avatarUrl" class="img"/>
<img src="../../static/img/avatar.png" alt="" class="img" v-else/> <img src="https://cdn.cunwuyun.cn/shandong10086/avatar.png" alt="" class="img" v-else/>
</span> </span>
<span v-if="tabIndex0 == 3"> <span v-if="tabIndex0 == 3">

View File

@@ -7,12 +7,12 @@
<div class="middle" v-if="showPage"> <div class="middle" v-if="showPage">
<div class="cardTop"> <div class="cardTop">
<span v-if="tabIndex0 != 3"> <span v-if="tabIndex0 != 3">
<img :src="avatarUrl" alt="" v-if="avatarUrl" class="img" /> <img :src="avatarUrl" alt="" v-if="avatarUrl" class="img"/>
<img src="../../static/img/avatar.png" alt="" class="img" v-else /> <img src="https://cdn.cunwuyun.cn/shandong10086/avatar.png" alt="" class="img" v-else/>
</span> </span>
<span v-if="tabIndex0 == 3"> <span v-if="tabIndex0 == 3">
<img :src="user.avatarUrl" alt="" v-if="user.avatarUrl" class="img" /> <img :src="user.avatarUrl" alt="" v-if="user.avatarUrl" class="img"/>
</span> </span>
<div class="rightTop"> <div class="rightTop">
@@ -38,11 +38,12 @@
<!-- 图片 --> <!-- 图片 -->
<div class="cardImg" v-if="tabCurrent1 == 0"> <div class="cardImg" v-if="tabCurrent1 == 0">
<img :src="items.url" alt="" v-for="(items, i) in detail.pictures" :key="i" @click.stop="previewImage(detail.pictures, items.url)" /> <img :src="items.url" alt="" v-for="(items, i) in detail.pictures" :key="i" @click.stop="previewImage(detail.pictures, items.url)"/>
</div> </div>
<div class="cardImg" v-if="tabCurrent1 == 1"> <div class="cardImg" v-if="tabCurrent1 == 1">
<img :src="items.url" alt="" v-for="(items, i) in detail.villagerCircleInfo.pictures" :key="i" @click.stop="previewImage(detail.villagerCircleInfo.pictures, items.url)" /> <img :src="items.url" alt="" v-for="(items, i) in detail.villagerCircleInfo.pictures" :key="i"
@click.stop="previewImage(detail.villagerCircleInfo.pictures, items.url)"/>
</div> </div>
<!-- 分享 留言 点赞 --> <!-- 分享 留言 点赞 -->
@@ -55,14 +56,14 @@
<div class="icones" v-if="tabIndex0 != 3"> <div class="icones" v-if="tabIndex0 != 3">
<div class="img1"> <div class="img1">
<button class="buttons" open-type="share" :data-id="item.id"> <button class="buttons" open-type="share" :data-id="item.id">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/1.png" alt="" class="img11" /> <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/1.png" alt="" class="img11"/>
</button> </button>
</div> </div>
<div class="rightFlex"> <div class="rightFlex">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/2.png" alt="" class="img2" @click="poupShow = true" /> <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/2.png" alt="" class="img2" @click="poupShow = true"/>
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" class="img3" @click="like" v-if="detail.upFlag == 0" /> <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" class="img3" @click="like" v-if="detail.upFlag == 0"/>
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/33.png" alt="" class="img3" @click="like" v-if="detail.upFlag == 1" /> <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/33.png" alt="" class="img3" @click="like" v-if="detail.upFlag == 1"/>
</div> </div>
</div> </div>
</div> </div>
@@ -70,7 +71,7 @@
<!-- 评论 --> <!-- 评论 -->
<div class="reply" v-if="tabCurrent1 == 0 && (detail.upCount != 0 || commentsList.length)"> <div class="reply" v-if="tabCurrent1 == 0 && (detail.upCount != 0 || commentsList.length)">
<div class="replyTop" v-if="detail.upCount != 0"> <div class="replyTop" v-if="detail.upCount != 0">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" /> <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt=""/>
<span class="people" v-if="detail.upCount != 0 && detail.upUserNames"> <span class="people" v-if="detail.upCount != 0 && detail.upUserNames">
<span v-if="detail.upUserNames"> {{ detail.upUserNames }}</span> <span v-if="detail.upUserNames"> {{ detail.upUserNames }}</span>
<span v-if="detail.upUserNames && detail.upCount * 1 > 3"></span> <span v-if="detail.upUserNames && detail.upCount * 1 > 3"></span>
@@ -87,7 +88,7 @@
<div class="reply" v-if="tabCurrent1 == 1 && (detail.villagerCircleInfo.upCount != 0 || commentsInfoList.length)"> <div class="reply" v-if="tabCurrent1 == 1 && (detail.villagerCircleInfo.upCount != 0 || commentsInfoList.length)">
<div class="replyTop"> <div class="replyTop">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" /> <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt=""/>
<span class="people" v-if="detail.villagerCircleInfo.upCount != 0 && upUserNamesList"> <span class="people" v-if="detail.villagerCircleInfo.upCount != 0 && upUserNamesList">
<span v-if="upUserNamesList"> {{ upUserNamesList }}</span> <span v-if="upUserNamesList"> {{ upUserNamesList }}</span>
<span v-if="upUserNamesList && detail.villagerCircleInfo.upCount * 1 > 3"></span> <span v-if="upUserNamesList && detail.villagerCircleInfo.upCount * 1 > 3"></span>
@@ -124,11 +125,11 @@
</u-popup> </u-popup>
</div> </div>
<AiEmpty :description="`请往'我的-个人身份认证'<br/>进行身份认证`" v-else /> <AiEmpty :description="`请往'我的-个人身份认证'<br/>进行身份认证`" v-else/>
</template> </template>
<script> <script>
import { mapState } from 'vuex' import {mapState} from 'vuex'
export default { export default {
name: 'detail', name: 'detail',
@@ -182,67 +183,67 @@ export default {
methods: { methods: {
getDetail() { getDetail() {
this.$instance this.$instance
.post(`/app/${this.tabCurrent1 != 0 ? 'appvillagercirclecomment' : 'appvillagercircleinfo'}/queryDetailById`, null, { .post(`/app/${this.tabCurrent1 != 0 ? 'appvillagercirclecomment' : 'appvillagercircleinfo'}/queryDetailById`, null, {
params: { params: {
id: this.id, id: this.id,
}, },
}) })
.then((res) => { .then((res) => {
if (res?.data) { if (res?.data) {
this.detail = res.data this.detail = res.data
// 我的话题通过的 不重复的评论 // 我的话题通过的 不重复的评论
if (this.detail.comments && this.detail.comments) { if (this.detail.comments && this.detail.comments) {
let lists = [] let lists = []
this.detail.comments.map((e) => { this.detail.comments.map((e) => {
if (e.status == 1) { if (e.status == 1) {
lists.push(e) lists.push(e)
}
})
this.commentsList = lists
if (this.commentsList.length) {
var arr = this.commentsList
var obj = {}
this.nameList = arr.reduce(function (item, next) {
obj[next.replyUserName] ? '' : (obj[next.replyUserName] = true && item.push(next))
return item
}, [])
} }
} })
// 我的话题点赞人数 this.commentsList = lists
if (this.detail.upUserNames) {
this.detail.upUserNames = this.detail && this.detail.upUserNames.match(/[^\u3001]+(?:\u3001[^\u3001]+){2,2}/) == null ? this.detail.upUserNames : this.detail && this.detail.upUserNames.match(/[^\u3001]+(?:\u3001[^\u3001]+){2,2}/)[0]
}
// 我的评论 通过不重复的的评论
if (this.detail.villagerCircleInfo && this.detail.villagerCircleInfo.comments) {
let listss = []
this.detail.villagerCircleInfo &&
this.detail.villagerCircleInfo.comments.map((item) => {
if (item.status == 1) {
listss.push(item)
}
})
this.commentsInfoList = listss
if (this.commentsInfoList.length) { if (this.commentsList.length) {
arr = this.commentsInfoList var arr = this.commentsList
obj = {} var obj = {}
this.nameLists = arr.reduce(function (item, next) { this.nameList = arr.reduce(function (item, next) {
obj[next.replyUserName] ? '' : (obj[next.replyUserName] = true && item.push(next)) obj[next.replyUserName] ? '' : (obj[next.replyUserName] = true && item.push(next))
return item return item
}, []) }, [])
}
}
// 我的评论 点赞人数
if (this.detail.villagerCircleInfo) {
const upUserName = this.detail.villagerCircleInfo.upUserNames
this.upUserNamesList = upUserName.match(/[^\u3001]+(?:\u3001[^\u3001]+){2,2}/) == null ? upUserName : upUserName.match(/[^\u3001]+(?:\u3001[^\u3001]+){2,2}/)[0]
} }
} }
}) // 我的话题点赞人数
.finally(() => { if (this.detail.upUserNames) {
this.showPage = true this.detail.upUserNames = this.detail && this.detail.upUserNames.match(/[^\u3001]+(?:\u3001[^\u3001]+){2,2}/) == null ? this.detail.upUserNames : this.detail && this.detail.upUserNames.match(/[^\u3001]+(?:\u3001[^\u3001]+){2,2}/)[0]
}) }
// 我的评论 通过不重复的的评论
if (this.detail.villagerCircleInfo && this.detail.villagerCircleInfo.comments) {
let listss = []
this.detail.villagerCircleInfo &&
this.detail.villagerCircleInfo.comments.map((item) => {
if (item.status == 1) {
listss.push(item)
}
})
this.commentsInfoList = listss
if (this.commentsInfoList.length) {
arr = this.commentsInfoList
obj = {}
this.nameLists = arr.reduce(function (item, next) {
obj[next.replyUserName] ? '' : (obj[next.replyUserName] = true && item.push(next))
return item
}, [])
}
}
// 我的评论 点赞人数
if (this.detail.villagerCircleInfo) {
const upUserName = this.detail.villagerCircleInfo.upUserNames
this.upUserNamesList = upUserName.match(/[^\u3001]+(?:\u3001[^\u3001]+){2,2}/) == null ? upUserName : upUserName.match(/[^\u3001]+(?:\u3001[^\u3001]+){2,2}/)[0]
}
}
})
.finally(() => {
this.showPage = true
})
}, },
send() { send() {
@@ -252,26 +253,26 @@ export default {
} }
this.flag = true this.flag = true
this.$instance this.$instance
.post(`/app/appvillagercirclecomment/addOrUpdate`, { .post(`/app/appvillagercirclecomment/addOrUpdate`, {
content: this.content, content: this.content,
replyUserResidentId: this.user.id, replyUserResidentId: this.user.id,
replyUserName: this.user.realName, replyUserName: this.user.realName,
areaId: this.user.areaId, areaId: this.user.areaId,
vcId: this.detail.id, vcId: this.detail.id,
}) })
.then((res) => { .then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.$u.toast('发送成功') this.$u.toast('发送成功')
this.content = '' this.content = ''
this.poupShow = false this.poupShow = false
this.getDetail() this.getDetail()
this.flag = false
}
})
.catch(() => {
this.flag = false this.flag = false
this.$u.toast('发送失败') }
}) })
.catch(() => {
this.flag = false
this.$u.toast('发送失败')
})
}, },
like() { like() {
@@ -279,21 +280,21 @@ export default {
this.flagLike = true this.flagLike = true
this.$instance this.$instance
.post(`/app/appvillagercircleinfo/up?id=${this.detail.id}&userId=${this.user.id}`) .post(`/app/appvillagercircleinfo/up?id=${this.detail.id}&userId=${this.user.id}`)
.then((res) => { .then((res) => {
this.$hideLoading() this.$hideLoading()
if (res.code === 0) { if (res.code === 0) {
this.$u.toast(this.detail.upFlag == 0 ? '点赞成功' : '取消点赞成功') this.$u.toast(this.detail.upFlag == 0 ? '点赞成功' : '取消点赞成功')
this.getDetail() this.getDetail()
setTimeout(() => { setTimeout(() => {
this.flagLike = false this.flagLike = false
}, 600) }, 600)
} }
}) })
.catch((err) => { .catch((err) => {
this.$u.toast(err) this.$u.toast(err)
this.flagLike = false this.flagLike = false
}) })
}, },
previewImage(images, img) { previewImage(images, img) {
@@ -314,14 +315,14 @@ export default {
}, },
onShareAppMessage() { onShareAppMessage() {
let { let {
detail: { id }, detail: {id},
tabCurrent1, tabCurrent1,
} = this } = this
return { return {
title: this.detail.content, title: this.detail.content,
path: this.$qs.stringifyUrl({ path: this.$qs.stringifyUrl({
url: '/pages/AppVillager/detail', url: '/pages/AppVillager/detail',
query: { id, tabCurrent1 }, query: {id, tabCurrent1},
}), }),
} }
}, },