迁移图片

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">
<span v-if="tabIndex0 != 3">
<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 v-if="tabIndex0 == 3">

View File

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