import ColHeader from '@/components/col-header' import { Button, Cell, Dialog, Icon, Image, Popup, Toast } from 'vant' import { defineComponent } from 'vue' import styles from './index.module.less' import request from '@/helpers/request' import { state } from '@/state' import shareBanner from '../images/share-banner.png' import wxImage from '../images/wx_bg.png' import { shareCall, initJumpNativePage } from '../share' import { browser } from '@/helpers/utils' import { postMessage } from '@/helpers/native-message' import qs from 'query-string' export const getAssetsHomeFile = (fileName: string) => { const path = `../../../views/member-center/images/${fileName}` const modules = import.meta.globEager('../../../views/member-center/images/*') return modules[path].default } export default defineComponent({ name: 'MemberCenter', data() { const query = this.$route.query query.recomUserId = query.userType && query.userType == 'STUDENT' ? '' : query.recomUserId const tmpUrl = `${location.origin}/student/#/memberCenter?${qs.stringify( query )}` return { activityId: query.activityId, recomUserId: query.recomUserId, discount: 0, functionList: [], wxStatus: false, jumpUrl: tmpUrl } }, computed: { userInfo() { const users = state.user.data return { username: users?.username, phone: users?.phone, avatar: users?.heardUrl, id: users?.userId, memberRankSettingId: users?.memberRankSettingId, membershipDays: users?.membershipDays, membershipEndTime: users?.membershipEndTime } } }, created() { initJumpNativePage(this.jumpUrl) }, async mounted() { try { const res = await request.post( `/api-teacher/open/memberPriceSettings/vipPermissions` ) const result = res.data || [] this.functionList = result.map((item: any) => { return { title: item.paramName, icon: getAssetsHomeFile(`${item.paramValue}.png`) } }) const active = await request.post( `/api-teacher/open/activity/state/${this.activityId}` ) this.discount = active.data.check || 0 } catch { // } }, methods: { onShare() { if (browser().weixin) { this.wxStatus = true return } // 尝试拉起app shareCall(this.jumpUrl) // 不管有没有拉起app则都跳转到下载app setTimeout(() => { window.location.href = location.origin + '/student/#/download' }, 3000) } }, render() { return (

酷乐秀会员可使用包括平台提供的所有训练乐谱,并专享“ 小酷Ai ”八大核心功能,孩子在家就能轻松完成乐器自主规范练习。

{this.functionList.length > 0 && (
会员功能
{this.functionList.map((item: any) => (
))}
)}
{this.discount === 1 && (
专属优惠
)}
{this.wxStatus && (
{ this.wxStatus = false }} >
)}
) } })