清理代码

This commit is contained in:
aixianling
2024-03-06 14:24:49 +08:00
parent 21ccd9ff81
commit 8a6b586503
2 changed files with 8 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
div<template> <template>
<div class="Detail" v-if="pageShow"> <div class="Detail" v-if="pageShow">
<div class="top"> <div class="top">
<div class="item-top"> <div class="item-top">
@@ -115,7 +115,7 @@ div<template>
<div class="popup"> <div class="popup">
<div class="popup-title"> <div class="popup-title">
<h2>评论</h2> <h2>评论</h2>
<image @click="isShowComment = false, focus = false" src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-guanbi.png" /> <image @click="isShowComment = false,focus = false" src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-guanbi.png" />
</div> </div>
<div class="form"> <div class="form">
<textarea :maxlength="100" :cursor-spacing="10" :placeholder="commentId ? '回复' + replyName : '请输入评论内容'" :focus="focus" v-model="content"></textarea> <textarea :maxlength="100" :cursor-spacing="10" :placeholder="commentId ? '回复' + replyName : '请输入评论内容'" :focus="focus" v-model="content"></textarea>
@@ -133,7 +133,6 @@ div<template>
export default { export default {
name: 'Detail', name: 'Detail',
appName: '详情', appName: '详情',
data () { data () {
return { return {
id: '', id: '',
@@ -153,11 +152,9 @@ div<template>
replyName: '' replyName: ''
} }
}, },
computed: { computed: {
...mapState(['user', 'token']) ...mapState(['user', 'token'])
}, },
onLoad (query) { onLoad (query) {
this.isFrom = query.isFrom this.isFrom = query.isFrom
this.id = query.id this.id = query.id
@@ -175,10 +172,8 @@ div<template>
this.getCommontList(query.id) this.getCommontList(query.id)
} }
}, },
methods: { methods: {
...mapActions(['autoLogin']), ...mapActions(['autoLogin']),
toTask() { toTask() {
if (!this.user.areaId) { if (!this.user.areaId) {
this.$dialog.confirm({ this.$dialog.confirm({
@@ -191,14 +186,12 @@ div<template>
} }
this.$linkTo(`/mods/AppNewFarmerBank/taskDetail?id=${this.info.integralTaskId}`) this.$linkTo(`/mods/AppNewFarmerBank/taskDetail?id=${this.info.integralTaskId}`)
}, },
previewImage (url, files) { previewImage (url, files) {
uni.previewImage({ uni.previewImage({
current: url, current: url,
urls: files.map(v => v.url) urls: files.map(v => v.url)
}) })
}, },
showComment () { showComment () {
if (!this.user.areaId) { if (!this.user.areaId) {
this.$dialog.confirm({ this.$dialog.confirm({
@@ -222,7 +215,6 @@ div<template>
}, 500) }, 500)
}) })
}, },
replay (item) { replay (item) {
if (!this.user.areaId) { if (!this.user.areaId) {
this.$dialog.confirm({ this.$dialog.confirm({
@@ -247,10 +239,9 @@ div<template>
}, 500) }, 500)
}) })
}, },
getInfo (id) { getInfo (id) {
this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`, null, { this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`, null, {
withoutToken: this.token ? false : true, withoutToken: !this.token,
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.info = res.data this.info = res.data
@@ -260,7 +251,6 @@ div<template>
uni.hideLoading() uni.hideLoading()
}) })
}, },
reciate () { reciate () {
this.$loading() this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/appreciate?id=${this.id}`).then(res => { this.$instance.post(`/app/appneighborhoodassistance/appreciate?id=${this.id}`).then(res => {
@@ -272,7 +262,6 @@ div<template>
uni.hideLoading() uni.hideLoading()
}) })
}, },
send () { send () {
if (!this.content) { if (!this.content) {
return this.$toast('内容不能为空') return this.$toast('内容不能为空')
@@ -303,7 +292,6 @@ div<template>
} }
}) })
}, },
toTopic (url) { toTopic (url) {
if (this.isFrom === 'topic') { if (this.isFrom === 'topic') {
uni.navigateBack({ uni.navigateBack({
@@ -313,13 +301,12 @@ div<template>
this.$linkTo(url) this.$linkTo(url)
} }
}, },
getCommontList (id) { getCommontList (id) {
if (this.isMore) return if (this.isMore) return
this.$loading() this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/commontList`, null, { this.$instance.post(`/app/appneighborhoodassistance/commontList`, null, {
withoutToken: this.token ? false : true, withoutToken: !this.token,
params: { params: {
id, id,
current: this.current, current: this.current,
@@ -349,11 +336,9 @@ div<template>
}) })
} }
}, },
onReachBottom () { onReachBottom () {
this.getCommontList() this.getCommontList()
}, },
onShareTimeline () { onShareTimeline () {
return { return {
title: this.info.content, title: this.info.content,
@@ -463,7 +448,6 @@ div<template>
width: 100px; width: 100px;
height: 60px; height: 60px;
line-height: 60px; line-height: 60px;
text-align: right;
text-align: center; text-align: center;
font-size: 26px; font-size: 26px;
color: #fff; color: #fff;

View File

@@ -1,4 +1,4 @@
div<template> <template>
<div class="Detail" v-if="pageShow"> <div class="Detail" v-if="pageShow">
<div class="top"> <div class="top">
<div class="item-top"> <div class="item-top">
@@ -250,7 +250,7 @@ div<template>
getInfo (id) { getInfo (id) {
this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`, null, { this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`, null, {
withoutToken: this.token ? false : true, withoutToken: !this.token,
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.info = res.data this.info = res.data
@@ -319,7 +319,7 @@ div<template>
this.$loading() this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/commontList`, null, { this.$instance.post(`/app/appneighborhoodassistance/commontList`, null, {
withoutToken: this.token ? false : true, withoutToken: !this.token,
params: { params: {
id, id,
current: this.current, current: this.current,
@@ -463,7 +463,6 @@ div<template>
width: 100px; width: 100px;
height: 60px; height: 60px;
line-height: 60px; line-height: 60px;
text-align: right;
text-align: center; text-align: center;
font-size: 26px; font-size: 26px;
color: #fff; color: #fff;
@@ -675,7 +674,7 @@ div<template>
font-size: 28px; font-size: 28px;
} }
} }
.item-imgs { .item-imgs {
display: flex; display: flex;