Skip to content

Commit

Permalink
🐞 fix: 用户分享的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Chadwuo committed Jan 15, 2025
1 parent d612183 commit 3da46e9
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 59 deletions.
77 changes: 43 additions & 34 deletions src/pages/family/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,37 +68,49 @@ async function onSelectedAction(e: any) {
}
onShareAppMessage(() => {
if (userFamilys.value) {
// if (userFamilys.value.length >= 1 && userInfo.value?.isVip) {
// message
// .confirm({
// msg: '开通会员解锁家庭成员数量上限',
// title: '家庭成员超过上限',
// confirmButtonText: '开通会员',
// cancelButtonText: '再想想',
// })
// .then(() => {
// uni.navigateTo({
// url: '/pages/subscription/index',
// })
// })
// .catch(() => {
// return {}
// })
// return {}
// }
const familyId = userFamilys.value[0].familyId
const word = `${userInfo.value?.nickName}邀请你一起记录家庭中的人情往来`
const avatarUrl = userInfo.value?.avatar
return {
title: '和我一起记录家庭中的人情往来',
path: `/pages/family/invite?familyId=${familyId}&word=${word}&avatarUrl=${avatarUrl}`,
imageUrl: '/static/share/2.png',
const promise = new Promise<Page.CustomShareContent>((resolve, reject) => {
if (!userFamilys.value) {
reject()
} else {
if (userFamilys.value.length >= 2 && !userInfo.value?.isVip) {
reject()
message
.confirm({
msg: '开通会员后解锁家庭成员数量无上限权益',
title: '家庭成员超过上限',
confirmButtonText: '开通会员',
cancelButtonText: '再想想',
})
.then(() => {
uni.navigateTo({
url: '/pages/subscription/index',
})
})
.catch(() => {
console.log('点击了取消按钮')
})
} else {
const familyId = userFamilys.value[0].familyId
const word = `${userInfo.value?.nickName}邀请你一起记录家庭中的人情往来`
const avatarUrl = userInfo.value?.avatar
resolve({
title: '和我一起记录家庭中的人情往来',
path: `/pages/family/invite?familyId=${familyId}&word=${word}&avatarUrl=${avatarUrl}`,
imageUrl: '/static/share/2.png',
})
}
}
})
return {
title: '可能是东半球最好用的人情记账工具',
path: `/pages/book/page`,
imageUrl: '/static/share/1.png',
promise
}
return {}
})
</script>

<template>
Expand Down Expand Up @@ -169,18 +181,15 @@ onShareAppMessage(() => {
</div>
</div>
<wd-action-sheet v-model="actionSheetShow" :actions="actionSheetList" cancel-text="取消"
:close-on-click-action="false" @select="onSelectedAction"
/>
:close-on-click-action="false" @select="onSelectedAction" />
</div>
</template>

<style lang="scss" scoped></style>

<route lang="json">
{
<route lang="json">{
"style": {
"navigationBarTitleText": "家人共享",
"enablePullDownRefresh": true
}
}
</route>
}</route>
15 changes: 8 additions & 7 deletions src/pages/mine/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ onShareAppMessage(() => {
<div class="bg-mine bg-contain bg-no-repeat">
<div class="mx-3 pt-24 space-y-5">
<div class="flex items-center" @click="toSettings">
<uv-avatar :src="userInfo?.avatar" shape="square" :size="55" />
<div class="relative">
<uv-avatar :src="userInfo?.avatar" :size="55" />
<img v-if="userInfo?.isVip" class="absolute bottom-0 left-0" width="55" src="/static/avatar/ring.png">
</div>
<div class="ml-3">
<div class="text-lg">
{{ welcome() }},{{ userInfo?.nickName }}
Expand Down Expand Up @@ -91,11 +94,11 @@ onShareAppMessage(() => {
</wd-cell>
</div>
<div class="rounded-2xl bg-white p-2 space-y-3">
<!-- <wd-cell title="支持礼记" is-link to="/pages/subscription/index">
<wd-cell title="支持礼记" is-link to="/pages/subscription/index">
<template #icon>
<div class="i-bx-like mx-2 text-lg text-red" />
</template>
</wd-cell> -->
</wd-cell>
<wd-cell is-link>
<template #icon>
<div class="i-ri-wechat-fill pr-4 text-lg text-green" />
Expand Down Expand Up @@ -123,10 +126,8 @@ onShareAppMessage(() => {

<style lang="scss" scoped></style>

<route lang="json">
{
<route lang="json">{
"style": {
"navigationStyle": "custom"
}
}
</route>
}</route>
22 changes: 4 additions & 18 deletions src/pages/subscription/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import { storeToRefs } from 'pinia'
const loading = ref(false)
const textArray = ref([
'欢迎使用',
])
const { userInfo } = storeToRefs(useAuthStore())
const pay = async () => {
loading.value = true
Expand All @@ -28,20 +25,11 @@ const pay = async () => {
}
}
const back = () => {
uni.navigateBack()
}
</script>

<template>
<div class="mx-3">
<wd-navbar custom-class=" bg-transparent" :bordered="false" safe-area-inset-top leftarrow placeholder fixed
custom-style="background-color: transparent !important;" @click-left="back"
>
<template #title>
<wd-notice-bar type="info" direction="vertical" :text="textArray" :delay="3" custom-class="text-center mt-1" />
</template>
</wd-navbar>

<wd-button block :loading="loading" loading-color="#F87171" @click="pay">
立即购买
</wd-button>
Expand All @@ -54,10 +42,8 @@ const back = () => {

<style lang="scss" scoped></style>

<route lang="json">
{
<route lang="json">{
"style": {
"navigationStyle": "custom"
"navigationBarTitleText": ""
}
}
</route>
}</route>
Binary file added src/static/avatar/ring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3da46e9

Please sign in to comment.