This commit is contained in:
liuye
2024-03-11 12:03:12 +08:00
6 changed files with 1196 additions and 1263 deletions

View File

@@ -2,8 +2,9 @@
export default {
onLaunch() {
if (!wx.getUpdateManager) return
const updateManager = wx.getUpdateManager()
if (uni.getUpdateManager) {
const updateManager = uni.getUpdateManager()
if (updateManager) {
updateManager.onUpdateReady(() => {
this.$dialog.alert({
title: '更新提示',
@@ -13,6 +14,8 @@ export default {
}).catch(() => {
})
})
}
}
},
}
</script>

View File

@@ -40,7 +40,10 @@ export const user = {
reject(res);
}
},
fail: () => resolve(dispatch("getCode", ++count))
fail: err => {
console.error(err)
resolve(dispatch("getCode", ++count))
}
})
})
},

View File

@@ -1,4 +1,4 @@
div<template>
<template>
<div class="Detail" v-if="pageShow">
<div class="top">
<div class="item-top">
@@ -130,10 +130,10 @@ div<template>
<script>
import {mapActions, mapState} from 'vuex'
export default {
name: 'Detail',
appName: '详情',
data() {
return {
id: '',
@@ -153,32 +153,23 @@ div<template>
replyName: ''
}
},
computed: {
...mapState(['user', 'token'])
},
onLoad(query) {
this.isFrom = query.isFrom
this.id = query.id
this.themeId = query.themeId
this.name = query.name || ''
this.$loading()
if (!this.token) {
this.autoLogin().then(() => {
this.getInfo(query.id)
this.$loading();
(this.token ? Promise.resolve() : this.autoLogin()).finally(() => Promise.all([
this.getInfo(query.id),
this.getCommontList(query.id)
})
} else {
this.getInfo(query.id)
this.getCommontList(query.id)
}
])).finally(() => this.$hideLoading())
},
methods: {
...mapActions(['autoLogin']),
toTask() {
if (!this.user.areaId) {
this.$dialog.confirm({
@@ -191,14 +182,12 @@ div<template>
}
this.$linkTo(`/mods/AppNewFarmerBank/taskDetail?id=${this.info.integralTaskId}`)
},
previewImage(url, files) {
uni.previewImage({
current: url,
urls: files.map(v => v.url)
})
},
showComment() {
if (!this.user.areaId) {
this.$dialog.confirm({
@@ -222,7 +211,6 @@ div<template>
}, 500)
})
},
replay(item) {
if (!this.user.areaId) {
this.$dialog.confirm({
@@ -247,20 +235,16 @@ div<template>
}, 500)
})
},
getInfo(id) {
this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`, null, {
withoutToken: this.token ? false : true,
return this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`, null, {
withoutToken: !this.token,
}).then(res => {
if (res.code === 0) {
if (res?.data) {
this.info = res.data
this.pageShow = true
return this.pageShow = true
}
uni.hideLoading()
})
},
reciate() {
this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/appreciate?id=${this.id}`).then(res => {
@@ -272,12 +256,10 @@ div<template>
uni.hideLoading()
})
},
send() {
if (!this.content) {
return this.$toast('内容不能为空')
}
this.$loading()
this.$instance.post(!this.commentId ? `/app/appneighborhoodassistance/addComment` : `/app/appneighborhoodassistance/addReply`, {
content: this.content,
@@ -285,7 +267,6 @@ div<template>
type: this.commentId ? 1 : 0,
commentId: this.commentId || ''
}).then(res => {
uni.hideLoading()
if (res.code === 0) {
this.isShowComment = false
this.$toast('提交成功')
@@ -296,14 +277,12 @@ div<template>
this.isMore = false
this.current = 1
this.$nextTick(() => {
this.getCommontList(this.id)
})
}
})
},
toTopic(url) {
if (this.isFrom === 'topic') {
uni.navigateBack({
@@ -313,54 +292,44 @@ div<template>
this.$linkTo(url)
}
},
getCommontList(id) {
if (this.isMore) return
this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/commontList`, null, {
withoutToken: this.token ? false : true,
return this.$instance.post(`/app/appneighborhoodassistance/commontList`, null, {
withoutToken: !this.token,
params: {
id,
current: this.current,
size: 10
}
}).then(res => {
if (res.code === 0) {
this.$hideLoading()
if (res?.data) {
if (this.current > 1) {
this.list = [...this.list, ...res.data.records]
} else {
this.list = res.data.records
}
if (res.data.records.length < 10) {
this.isMore = true
return false
}
this.current = this.current + 1
} else {
this.isMore = true
}
}).catch(() => {
this.$hideLoading()
})
}).finally(() => this.$hideLoading())
}
},
onReachBottom() {
this.getCommontList()
},
onShareTimeline() {
return {
title: this.info.content,
path: `/pages/AppCircle/Detail?id=${this.id}&themeId=${this.themeId}&name=${this.name}`
}
},
onShareAppMessage() {
this.$instance.post(`/app/appneighborhoodassistance/share?id=${this.id}`).then(res => {
if (res.code === 0) {
@@ -463,7 +432,6 @@ div<template>
width: 100px;
height: 60px;
line-height: 60px;
text-align: right;
text-align: center;
font-size: 26px;
color: #fff;
@@ -472,6 +440,7 @@ div<template>
}
}
}
.footer {
display: flex;
align-items: center;
@@ -749,8 +718,10 @@ div<template>
font-family: "PingFang SC";
line-height: 30px;
margin-bottom: 16px;
.label {
width: 160px;
img {
width: 30px;
height: 30px;
@@ -758,6 +729,7 @@ div<template>
vertical-align: bottom;
}
}
.value {
width: calc(100% - 160px);
color: #333;

View File

@@ -1,15 +1,12 @@
div<template>
<template>
<div class="Detail" v-if="pageShow">
<div class="top">
<div :class="name == '婚礼' ? 'top-pad marry-css' : 'top-pad'">
<div class="item-top">
<image :src="info.createUserAvatar || 'https://cdn.cunwuyun.cn/fengdu/avatar.png'" />
<image :src="info.createUserAvatar || 'https://cdn.cunwuyun.cn/wxmp/fengdu/avatar.png'"/>
<div class="right">
<h3>{{ info.createUserName }}</h3>
<span v-if="info.publishDepartName">{{ info.publishDepartName }}</span>
</div>
<div class="top-btn" v-if="info.integralTaskId && info.integralTaskInfo.status != 2 && info.showSignBtn" @click="toTask">去参与</div>
</div>
<image src="https://cdn.cunwuyun.cn/fengdu/marry-top.png" class="marry-top" v-if="name == '婚礼'" />
<div class="item-content">
<span v-if="name" @click="toTopic('./TopicDetail?themeId=' + themeId + '&name=' + name)">#{{ name }}</span>
@@ -33,16 +30,22 @@ div<template>
<div class="label"><img src="https://cdn.cunwuyun.cn/fengdu/leave-icon.png" alt="">离场时间</div>
<div class="value">{{ info.integralTaskInfo.exitBegintime }}{{ info.integralTaskInfo.exitEndtime }}</div>
</div>
</div>
<div class="item-imgs" v-if="info.files && info.files.length">
<!-- <div class="item-imgs" v-if="info.files && info.files.length">
<image mode="aspectFill" @click="previewImage(item.url, info.files)" v-for="(item, index) in info.files" :key="index" :src="item.url" />
</div> -->
<div class="info-flex">
<div class="label"><img src="https://cdn.cunwuyun.cn/fengdu/time-icon.png" alt="">{{ info.integralTaskInfo.type == 1 ? '报名时间:' : '进场时间:' }}</div>
<div class="value">{{ info.integralTaskInfo.intoBegintime }}{{ info.integralTaskInfo.intoEndtime }}</div>
</div>
<div class="time-flex">
<p>{{ info.createTime }}</p>
<image src="https://cdn.cunwuyun.cn/fengdu/marry-bottom.png" class="marry-bottom" v-if="name == '婚礼'" />
</div>
</div>
<div class="item-imgs" v-if="info.files && info.files.length">
<image mode="aspectFill" @click="previewImage(item.url, info.files)" v-for="(item, index) in info.files" :key="index" :src="item.url"/>
</div>
<div class="item-bottom">
<button open-type="share">
@@ -137,10 +140,10 @@ div<template>
<script>
import {mapActions, mapState} from 'vuex'
export default {
name: 'Detail',
appName: '详情',
data() {
return {
id: '',
@@ -160,32 +163,23 @@ div<template>
replyName: ''
}
},
computed: {
...mapState(['user', 'token'])
},
onLoad(query) {
this.isFrom = query.isFrom
this.id = query.id
this.themeId = query.themeId
this.name = query.name || ''
this.$loading()
if (!this.token) {
this.autoLogin().then(() => {
this.getInfo(query.id)
this.$loading();
(this.token ? Promise.resolve() : this.autoLogin()).finally(() => Promise.all([
this.getInfo(query.id),
this.getCommontList(query.id)
})
} else {
this.getInfo(query.id)
this.getCommontList(query.id)
}
])).finally(() => this.$hideLoading())
},
methods: {
...mapActions(['autoLogin']),
toTask() {
if (!this.user.areaId) {
this.$dialog.confirm({
@@ -198,14 +192,12 @@ div<template>
}
this.$linkTo(`/mods/AppNewFarmerBank/taskDetail?id=${this.info.integralTaskId}`)
},
previewImage(url, files) {
uni.previewImage({
current: url,
urls: files.map(v => v.url)
})
},
showComment() {
if (!this.user.areaId) {
this.$dialog.confirm({
@@ -229,7 +221,6 @@ div<template>
}, 500)
})
},
replay(item) {
if (!this.user.areaId) {
this.$dialog.confirm({
@@ -254,20 +245,16 @@ div<template>
}, 500)
})
},
getInfo(id) {
this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`, null, {
withoutToken: this.token ? false : true,
return this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`, null, {
withoutToken: !this.token,
}).then(res => {
if (res.code === 0) {
if (res?.data) {
this.info = res.data
this.pageShow = true
return this.pageShow = true
}
uni.hideLoading()
})
},
reciate() {
this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/appreciate?id=${this.id}`).then(res => {
@@ -279,12 +266,10 @@ div<template>
uni.hideLoading()
})
},
send() {
if (!this.content) {
return this.$toast('内容不能为空')
}
this.$loading()
this.$instance.post(!this.commentId ? `/app/appneighborhoodassistance/addComment` : `/app/appneighborhoodassistance/addReply`, {
content: this.content,
@@ -292,7 +277,6 @@ div<template>
type: this.commentId ? 1 : 0,
commentId: this.commentId || ''
}).then(res => {
uni.hideLoading()
if (res.code === 0) {
this.isShowComment = false
this.$toast('提交成功')
@@ -303,14 +287,12 @@ div<template>
this.isMore = false
this.current = 1
this.$nextTick(() => {
this.getCommontList(this.id)
})
}
})
},
toTopic(url) {
if (this.isFrom === 'topic') {
uni.navigateBack({
@@ -320,21 +302,18 @@ div<template>
this.$linkTo(url)
}
},
getCommontList(id) {
if (this.isMore) return
this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/commontList`, null, {
withoutToken: this.token ? false : true,
return this.$instance.post(`/app/appneighborhoodassistance/commontList`, null, {
withoutToken: !this.token,
params: {
id,
current: this.current,
size: 10
}
}).then(res => {
if (res.code === 0) {
this.$hideLoading()
if (res?.data) {
if (this.current > 1) {
this.list = [...this.list, ...res.data.records]
} else {
@@ -351,23 +330,18 @@ div<template>
} else {
this.isMore = true
}
}).catch(() => {
this.$hideLoading()
})
}).finally(() => this.$hideLoading())
}
},
onReachBottom() {
this.getCommontList()
},
onShareTimeline() {
return {
title: this.info.content,
path: `/pages/AppCircle/Detail?id=${this.id}&themeId=${this.themeId}&name=${this.name}`
}
},
onShareAppMessage() {
this.$instance.post(`/app/appneighborhoodassistance/share?id=${this.id}`).then(res => {
if (res.code === 0) {
@@ -470,7 +444,6 @@ div<template>
width: 100px;
height: 60px;
line-height: 60px;
text-align: right;
text-align: center;
font-size: 26px;
color: #fff;
@@ -479,6 +452,7 @@ div<template>
}
}
}
.footer {
display: flex;
align-items: center;
@@ -644,13 +618,6 @@ div<template>
}
}
}
& > h2 {
margin-bottom: 32px;
color: #3d3d3d;
font-size: 38px;
font-weight: 600;
}
}
& > .top {
@@ -756,8 +723,10 @@ div<template>
font-family: "PingFang SC";
line-height: 30px;
margin-bottom: 16px;
.label {
width: 160px;
img {
width: 30px;
height: 30px;
@@ -765,6 +734,7 @@ div<template>
vertical-align: bottom;
}
}
.value {
width: calc(100% - 160px);
color: #333;
@@ -787,29 +757,5 @@ div<template>
right: 32px;
}
}
.top-pad {
padding: 32px;
}
.marry-css {
background-image: linear-gradient(191deg, #FFE0E4 0%, #FFFFFF 89%);
position: relative;
.marry-top {
width: 216px;
height: 100px;
position: absolute;
top: 18px;
right: 12px;
}
.time-flex {
display: flex;
justify-content: space-between;
.marry-bottom {
width: 300px;
height: 40px;
margin-top: -4px;
}
}
}
}
</style>

View File

@@ -13,7 +13,7 @@
<div class="flex wrap">
<image class="fill imageItem" v-for="(item, index) in info.files" @click="preview(item.url)" :key="index" :src="item.url"/>
</div>
<span v-if="!info.files.length">暂无照片</span>
<span v-if="!hasFiles(info.files)">暂无照片</span>
</AiItem>
</AiGroup>
<u-gap height="24" v-if="result.doExplain"/>
@@ -23,7 +23,7 @@
<div class="flex wrap">
<image class="fill imageItem" v-for="(item, index) in result.files" @click="preview(item.url)" :key="index" :src="item.url"/>
</div>
<span v-if="!result.files.length">暂无照片</span>
<span v-if="!hasFiles(result.files)">暂无照片</span>
</AiItem>
</AiGroup>
<!-- <u-gap height="24" v-if="info.judgeName"/>
@@ -51,7 +51,7 @@
<AiItem label="调处结果" class="not-line" value="调解成功" />
</AiGroup> -->
<u-gap height="24"/>
<u-tabs :list="evaluation && evaluation.id ? [{name:'办理进度'},{name:'我的评价'}] : [{name:'办理进度'}] " :current="currentTab" @change="v=>currentTab=v"/>
<u-tabs :list="tabs" :current="currentTab" @change="v=>currentTab=v"/>
<u-gap height="24" bg-color="#fff"/>
<AiGroup noBorder v-if="currentTab=='0'">
<AiStep v-for="(item,i) in process" :key="item.id" :index="i">
@@ -98,8 +98,15 @@ export default {
systemExplain: `${createUserName}完成评价 (${score}星评价)`
})
}
return list
return list;
},
tabs: v => {
const tabs = [{name: "办理进度"}];
if (!!v.evaluation?.id) {
tabs.push({name: "我的评价"});
}
return tabs;
},
},
onShow() {
this.getInfo()
@@ -134,11 +141,14 @@ export default {
preview(url) {
uni.previewImage({
urls: this.info.files.map(v => v.url),
current: url
})
}
}
}
current: url,
});
},
hasFiles(files) {
return files?.length > 0;
},
},
};
</script>
<style lang="scss">
@@ -220,6 +230,7 @@ export default {
margin-right: 0;
}
}
.not-line {
.AiItem {
.normal {
@@ -228,20 +239,25 @@ export default {
}
}
}
::v-deep .AiGroup {
.groupHeader {
padding-top: 16px !important;
}
}
.level1 {
color: #3D88F5;
}
.level2 {
color: #52C75B;
}
.level3 {
color: #FF883C;
}
.level4 {
color: #FF3C3C;
}

View File

@@ -179,13 +179,11 @@ export default {
this.id = query.id
this.themeId = query.themeId
this.name = query.name || ''
this.$loading()
Promise.resolve(this.token || this.autoLogin()).then(() =>
Promise.all([
this.$loading();
(this.token ? Promise.resolve() : this.autoLogin()).finally(() => Promise.all([
this.getInfo(query.id),
this.getCommontList(query.id)
])
).finally(() => this.$hideLoading())
])).finally(() => this.$hideLoading())
},
methods: {
...mapActions(['autoLogin']),
@@ -260,18 +258,15 @@ export default {
},
getInfo(id) {
this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`, null, {
return this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`, null, {
withoutToken: !this.token,
}).then(res => {
if (res.code === 0) {
if (res?.data) {
this.info = res.data
this.pageShow = true
return this.pageShow = true
}
uni.hideLoading()
})
},
reciate() {
this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/appreciate?id=${this.id}`).then(res => {
@@ -329,7 +324,7 @@ export default {
if (this.isMore) return
this.$loading()
this.$instance.post(`/app/appneighborhoodassistance/commontList`, null, {
return this.$instance.post(`/app/appneighborhoodassistance/commontList`, null, {
withoutToken: !this.token,
params: {
id,
@@ -337,7 +332,7 @@ export default {
size: 10
}
}).then(res => {
if (res.code === 0) {
if (res?.data) {
this.$hideLoading()
if (this.current > 1) {
this.list = [...this.list, ...res.data.records]
@@ -353,7 +348,7 @@ export default {
} else {
this.isMore = true
}
}).catch(() => {
}).finally(() => {
this.$hideLoading()
})
}
@@ -362,13 +357,12 @@ export default {
onReachBottom() {
this.getCommontList()
},
// onShareTimeline() {
// return {
// title: this.info.content,
// // path: `/mods/AppCircle/Detail?id=${this.id}&themeId=${this.themeId}&name=${this.name}`
// }
// },
onShareTimeline() {
return {
title: this.info.content,
path: `/mods/AppCircle/Detail?id=${this.id}&themeId=${this.themeId}&name=${this.name}`
}
},
onShareAppMessage() {
this.$instance.post(`/app/appneighborhoodassistance/share?id=${this.id}`).then(res => {
if (res.code === 0) {
@@ -472,7 +466,6 @@ export default {
width: 100px;
height: 60px;
line-height: 60px;
text-align: right;
text-align: center;
font-size: 26px;
color: #fff;