update
parent
9ae2729807
commit
a040a82fd8
|
@ -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']
|
||||
|
|
|
@ -249,7 +249,7 @@ async function handlePictureChange(event: Event) {
|
|||
placeholder="请输入加入费用"
|
||||
>
|
||||
<template #suffix>
|
||||
积分
|
||||
金币
|
||||
</template>
|
||||
</NInputNumber>
|
||||
</NFormItem>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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 () => {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue