fix: 问题修复
This commit is contained in:
parent
6951e9d023
commit
bfdde46cc3
@ -22,7 +22,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<button-footer :showConfirm="showStar" cancelText="关闭" @cancel="back()">
|
<view v-if="canSend || showStar" class="relative z-10 px-15 py-12 shadow-up flex items-center">
|
||||||
|
<view v-if="showStar" class="flex-grow text-base text-white text-center py-10 rounded"
|
||||||
|
:class="article.star ? 'bg-deep-gray' : 'bg-success'" @click="starArticle()">
|
||||||
|
{{ article.star ? '取消收藏' : '收藏' }}
|
||||||
|
</view>
|
||||||
|
<view v-if="canSend" class="flex-grow text-base text-white text-center py-10 rounded bg-primary"
|
||||||
|
:class="showStar ? 'ml-10' : ''" @click="send()">发送</view>
|
||||||
|
</view>
|
||||||
|
<!-- <button-footer :showConfirm="showStar" cancelText="关闭" @cancel="back()">
|
||||||
<template #confirm>
|
<template #confirm>
|
||||||
<view class="flex justify-center items-center h-full border-primary rounded bg-primary" @click="star()">
|
<view class="flex justify-center items-center h-full border-primary rounded bg-primary" @click="star()">
|
||||||
<uni-icons class="flex-shrinl-0" :type="article.star ? 'star-filled' : 'star'" color="#FFD700"
|
<uni-icons class="flex-shrinl-0" :type="article.star ? 'star-filled' : 'star'" color="#FFD700"
|
||||||
@ -30,7 +38,7 @@
|
|||||||
<view class="text-base text-white">{{ article.star ? '已收藏' : '收藏' }}</view>
|
<view class="text-base text-white">{{ article.star ? '已收藏' : '收藏' }}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</button-footer>
|
</button-footer> -->
|
||||||
</template>
|
</template>
|
||||||
</full-page>
|
</full-page>
|
||||||
|
|
||||||
@ -63,7 +71,9 @@ const article = ref({});
|
|||||||
const accountStore = useAccountStore();
|
const accountStore = useAccountStore();
|
||||||
const { doctorInfo, account } = storeToRefs(accountStore);
|
const { doctorInfo, account } = storeToRefs(accountStore);
|
||||||
const userId = computed(() => doctorInfo.value?.userid || "");
|
const userId = computed(() => doctorInfo.value?.userid || "");
|
||||||
const { useLoad } = useGuard()
|
const { useLoad } = useGuard();
|
||||||
|
const canSend = ref(false);
|
||||||
|
const eventName = ref("");
|
||||||
|
|
||||||
const showStar = computed(() => {
|
const showStar = computed(() => {
|
||||||
const isMine = article.value && article.value.creatorSignature && article.value.creatorSignature.person && article.value.creatorSignature.person.userId === userId.value;
|
const isMine = article.value && article.value.creatorSignature && article.value.creatorSignature.person && article.value.creatorSignature.person.userId === userId.value;
|
||||||
@ -135,7 +145,8 @@ const loadArticle = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function star() {
|
async function starArticle() {
|
||||||
|
console.log(11111)
|
||||||
showLoading();
|
showLoading();
|
||||||
const res = await api("starArticle", { articleId: articleId, userId: userId.value, star: !article.value.star });
|
const res = await api("starArticle", { articleId: articleId, userId: userId.value, star: !article.value.star });
|
||||||
hideLoading();
|
hideLoading();
|
||||||
@ -147,12 +158,19 @@ async function star() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function send() {
|
||||||
|
uni.$emit(eventName.value);
|
||||||
|
back()
|
||||||
|
}
|
||||||
|
|
||||||
function back() {
|
function back() {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
useLoad((options) => {
|
useLoad((options) => {
|
||||||
if (options.id) {
|
if (options.id) {
|
||||||
|
canSend.value = options.canSend === 'YES';
|
||||||
|
eventName.value = options.eventName;
|
||||||
articleId = options.id;
|
articleId = options.id;
|
||||||
loadArticle();
|
loadArticle();
|
||||||
} else {
|
} else {
|
||||||
@ -244,4 +262,16 @@ useLoad((options) => {
|
|||||||
height: auto !important;
|
height: auto !important;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ml-10 {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-deep-gray {
|
||||||
|
background-color: #bbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.z-10 {
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -281,9 +281,14 @@ const processRichTextContent = (html) => {
|
|||||||
|
|
||||||
// 预览文章
|
// 预览文章
|
||||||
const previewArticle = async (article) => {
|
const previewArticle = async (article) => {
|
||||||
|
const eventName = `previewArticle_${Date.now()}`
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/message/article-detail?id=${article._id}`,
|
url: `/pages/message/article-detail?id=${article._id}&eventName=${eventName}&canSend=${isSelectMode.value ? '' : 'YES'}`,
|
||||||
});
|
});
|
||||||
|
uni.$once(eventName, () => {
|
||||||
|
console.log('预览文章:', article)
|
||||||
|
handlePrimaryAction(article);
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
// 关闭预览
|
// 关闭预览
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user