From 8a7c00c2126fdb1d9eed5c446ecde4974ff0d2d9 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Mon, 21 Apr 2025 13:57:36 +0800 Subject: [PATCH] 1 --- pages/components/notice-index.vue | 63 ++++++++++++++++++------------- pages/index.vue | 30 ++++++++++++++- 2 files changed, 65 insertions(+), 28 deletions(-) diff --git a/pages/components/notice-index.vue b/pages/components/notice-index.vue index de03b2c..c7628e8 100644 --- a/pages/components/notice-index.vue +++ b/pages/components/notice-index.vue @@ -170,10 +170,16 @@ import { getNoticeList } from '@/api/business/notice.js' - import {dealMemberRights} from '@/api/business/member.js' - import {getJSONData} from '@/utils/auth.js'; - import {getUserType} from '@/utils/common.js' - import constant from '@/utils/constant'; + import { + dealMemberRights + } from '@/api/business/member.js' + import { + getJSONData + } from '@/utils/auth.js'; + import { + getUserType + } from '@/utils/common.js' + import constant from '@/utils/constant'; export default { components: { @@ -285,9 +291,12 @@ * 选择平台 */ async choosePlat(index) { + this.$emit("openVip") + return if (index == 2) { //鉴权 if (!this.checkIfHasRights(rightsCode.subscribeSelect)) { + this.$emit("openVip") return } this.$refs.showRight2.open() @@ -444,32 +453,32 @@ * @param {Object} item */ goDetail(item) { - let userInfo = getJSONData(constant.userInfo) - let userType = getUserType() - let param = { - userId: userInfo.userId, - userType: userType, - noticeId: item.id, - rightsCode: 'unlock_notice', - deplete:1 - } - dealMemberRights(param).then(res=>{ - if (res.code == 200) { - this.$tab.navigateTo(`/pages/notice/detail?id=${item.id}`) - } - }).catch((e) => { - uni.showToast({ - icon: 'error', - duration: 2000, - title: e - }); - }) + let userInfo = getJSONData(constant.userInfo) + let userType = getUserType() + let param = { + userId: userInfo.userId, + userType: userType, + noticeId: item.id, + rightsCode: 'unlock_notice', + deplete: 1 + } + dealMemberRights(param).then(res => { + if (res.code == 200) { + this.$tab.navigateTo(`/pages/notice/detail?id=${item.id}`) + } + }).catch((e) => { + uni.showToast({ + icon: 'error', + duration: 2000, + title: e + }); + }) }, /**扣除解锁通告权益*/ - dealMemberRights(){ - dealMemberRights() - } + dealMemberRights() { + dealMemberRights() + } } } diff --git a/pages/index.vue b/pages/index.vue index cd4f7bd..81df07c 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -3,7 +3,7 @@ - + @@ -11,6 +11,12 @@ + + + + + + @@ -85,6 +91,18 @@ this.selectSiteConfig("platform_tel") }, methods: { + /** + * 打开VIP弹窗 + */ + openVip() { + this.$refs.popup.open('center') + }, + /** + * 去VIP开通页 + */ + goVip() { + this.$tab.navigateTo('/pages/mine/member/member-card?userType=' + this.nowUserType) + }, /** * 重新获取当前角色 */ @@ -189,5 +207,15 @@ height: 100%; background-color: white; // padding-bottom: calc(var(--window-bottom) + 127rpx); + + } + + .popup-content { + padding: 0 !important; + background-color: transparent; + + image { + width: 70vw; + } } \ No newline at end of file