master
shenhan000 2025-04-29 10:27:49 +08:00
parent 9ae2729807
commit a040a82fd8
8 changed files with 78 additions and 27 deletions

1
app/components.d.ts vendored
View File

@ -16,6 +16,7 @@ declare module 'vue' {
NCheckbox: typeof import('naive-ui')['NCheckbox']
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDatePicker: typeof import('naive-ui')['NDatePicker']
NDivider: typeof import('naive-ui')['NDivider']
NDropdown: typeof import('naive-ui')['NDropdown']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NEmpty: typeof import('naive-ui')['NEmpty']

View File

@ -249,7 +249,7 @@ async function handlePictureChange(event: Event) {
placeholder="请输入加入费用"
>
<template #suffix>
积分
金币
</template>
</NInputNumber>
</NFormItem>

View File

@ -78,8 +78,8 @@ async function getCommunityDetail() {
formValue.value = {
imageUrl,
communityName,
communityTag: communityTag.toString(),
type: type.toString(),
communityTag: communityTag?.toString() || '',
type: type?.toString() || '',
price,
id,
validityDay,
@ -274,7 +274,7 @@ async function handlePictureChange(event: Event) {
placeholder="请输入加入费用"
>
<template #suffix>
积分
金币
</template>
</NInputNumber>
</NFormItem>

View File

@ -122,7 +122,7 @@ watchEffect(() => {
<template>
<div class="bg-white rounded-lg w-[290px] p-4 h-fit">
<div class="flex flex-col gap-4">
<div class="flex flex-col">
<!-- 左侧图片 -->
<div class="w-[258px] h-[258px] rounded-lg relative bg-[#f2f3f5] overflow-hidden">
<img
@ -150,7 +150,7 @@ watchEffect(() => {
</div>
</div>
</div>
<n-divider />
<!-- 右侧信息 -->
<div class="flex flex-col justify-between flex-1">
<div class="space-y-2">

View File

@ -36,14 +36,14 @@ const showEditPlanet = ref(false)
const menuItems = computed(() => {
const items = [
{
label: '分享星球',
action: () => {
const url = window.location.href
navigator.clipboard.writeText(url)
message.success('链接已复制到剪贴板')
},
},
// {
// label: '',
// action: () => {
// const url = window.location.href
// navigator.clipboard.writeText(url)
// message.success('')
// },
// },
{
label: '退出星球',
action: async () => {

View File

@ -28,6 +28,7 @@ const typeList = ref([
value: 999,
},
])
const showPublishModal = ref(false)
const publishListParams = ref({
@ -74,6 +75,38 @@ function closePublishModal() {
PublishComponentKey.value++
})
}
onMounted(() => {
const state = history.state
if (state && state.communityId && state.tenantId) {
publishListParams.value = {
communityId: state.communityId,
tenantId: state.tenantId,
publishId: state.id,
type: null,
pageNum: 1,
pageSize: 10,
}
questionParams.value = {
communityId: state.communityId,
tenantId: state.tenantId,
pageNum: 1,
pageSize: 10,
}
}
else {
// state退 URL
publishListParams.value = {
communityId: route.query.communityId as string,
tenantId: route.query.tenantId as string,
publishId: route.query.id as string,
type: null,
pageNum: 1,
pageSize: 10,
}
}
})
</script>
<template>
@ -139,7 +172,7 @@ function closePublishModal() {
</div>
</div>
<div class="w-[300px]">
<PlanetBaseInfo :community-id="route.query.communityId" :tenant-id="route.query.tenantId" />
<PlanetBaseInfo v-if="publishListParams.communityId && publishListParams.tenantId" :community-id="publishListParams.communityId" :tenant-id="publishListParams.tenantId" />
</div>
<n-modal
v-model:show="showPublishModal"
@ -149,8 +182,9 @@ function closePublishModal() {
class="rounded-lg"
>
<PublishContent
:community-id="route.query.communityId"
:tenant-id="route.query.tenantId"
v-if="publishListParams.communityId && publishListParams.tenantId"
:community-id="publishListParams.communityId"
:tenant-id="publishListParams.tenantId"
@success="closePublishModal"
/>
</n-modal>

View File

@ -210,9 +210,9 @@ function copyToClipboard(text: string) {
<div class="min-h-screen bg-[#F7F8FA] px-10 py-6 flex gap-4">
<div class="bg-white rounded-lg flex-1">
<div class="flex justify-between items-center m-3 text-sm">
<div class="bg-[#328afe] text-white px-3 py-1 rounded-sm cursor-pointer">
<!-- <div class="bg-[#328afe] text-white px-3 py-1 rounded-sm cursor-pointer">
分享星球
</div>
</div> -->
<div class="relative flex items-center w-[300px]">
<input
v-model="params.searchContent"

View File

@ -111,7 +111,12 @@ const qrUrl = ref('')
//
const paymentStatus = ref(1)
const isJoinModal = ref(false)
async function handleJoin() {
isJoinModal.value = true
}
async function onPositiveJoinClick() {
try {
const data = {
communityId: params.value.communityId,
@ -119,25 +124,24 @@ async function handleJoin() {
}
const res = await request.post(`/community/join`, data)
if (res.code === 200) {
isJoinModal.value = false
message.success('加入成功')
setTimeout(() => {
router.push(`/planet-detail?communityId=${params.value.communityId}&tenantId=${params.value.tenantId}`)
}, 1000)
}
}
catch (err) {
if (err.code === 12202) {
// isShowGoldPayment.value = true
catch (err: any) {
if (err.code === 12202 && err.msg === '钱包余额不足,请充值') {
showConfirmModal.value = true
}
// isShowGoldPayment.value = true
// if (goldPaymentRef.value) {
// goldPaymentRef.value.isVisible = true
// }
// console.log(err)
}
}
function onNegativeJoinClick() {
isJoinModal.value = false
}
function closePayment() {
paymentModal.value = false
}
@ -393,6 +397,18 @@ async function getQrCode() {
</div>
</div>
</n-modal>
<!-- 是否加入弹框 -->
<n-modal
v-model:show="isJoinModal"
:mask-closable="false"
preset="dialog"
title="确认"
content="是否确认加入星球?"
positive-text="确认"
negative-text="算了"
@positive-click="onPositiveJoinClick"
@negative-click="onNegativeJoinClick"
/>
</div>
</template>