|
@@ -3,8 +3,10 @@ import { Button, Cell, Icon, Image } from 'vant'
|
|
|
import { defineComponent } from 'vue'
|
|
|
import styles from './index.module.less'
|
|
|
import ColProtocol from '@/components/col-protocol'
|
|
|
+import request from '@/helpers/request'
|
|
|
+import { state } from '@/state'
|
|
|
|
|
|
-import iconTeacher from '@common/images/icon_teacher.png'
|
|
|
+import iconStudent from '@common/images/icon_student.png'
|
|
|
|
|
|
export const getAssetsHomeFile = (fileName: string) => {
|
|
|
const path = `./images/${fileName}`
|
|
@@ -17,18 +19,48 @@ export default defineComponent({
|
|
|
data() {
|
|
|
return {
|
|
|
agreeStatus: false,
|
|
|
- functionList: [
|
|
|
- { title: '五线谱<br />跟播', icon: getAssetsHomeFile('1.png') },
|
|
|
- { title: '演奏指法<br />跟播', icon: getAssetsHomeFile('2.png') },
|
|
|
- { title: '原声/伴奏<br />切换', icon: getAssetsHomeFile('3.png') },
|
|
|
- { title: '播放速度<br />调整', icon: getAssetsHomeFile('4.png') },
|
|
|
- { title: '五线谱选段<br />播放', icon: getAssetsHomeFile('5.png') },
|
|
|
- { title: '智能评测', icon: getAssetsHomeFile('6.png') },
|
|
|
- { title: '评测报告', icon: getAssetsHomeFile('7.png') },
|
|
|
- { title: '评测音视频<br />云储存', icon: getAssetsHomeFile('8.png') }
|
|
|
- ]
|
|
|
+ functionList: [],
|
|
|
+ params: {
|
|
|
+ page: 1,
|
|
|
+ rows: 20
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ userInfo() {
|
|
|
+ const users = state.user.data
|
|
|
+ return {
|
|
|
+ username: users?.username,
|
|
|
+ phone: users?.phone,
|
|
|
+ avatar: users?.heardUrl,
|
|
|
+ memberRankSettingId: users?.memberRankSettingId,
|
|
|
+ membershipDays: users?.membershipDays
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async mounted() {
|
|
|
+ try {
|
|
|
+ const res = await request.post(
|
|
|
+ '/api-student/memberPriceSettings/vipPermissions'
|
|
|
+ )
|
|
|
+ const result = res.data || []
|
|
|
+ this.functionList = result.map((item: any) => {
|
|
|
+ return {
|
|
|
+ title: item.paramName,
|
|
|
+ icon: getAssetsHomeFile(`${item.paramValue}.png`)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ const setting = await request.post(
|
|
|
+ '/api-student/memberPriceSettings/list',
|
|
|
+ {
|
|
|
+ page: 1,
|
|
|
+ rows: 20
|
|
|
+ }
|
|
|
+ )
|
|
|
+ console.log(setting)
|
|
|
+ } catch {}
|
|
|
+ },
|
|
|
methods: {
|
|
|
onSubmit() {
|
|
|
this.$router.push({
|
|
@@ -42,7 +74,7 @@ export default defineComponent({
|
|
|
render() {
|
|
|
return (
|
|
|
<div class={styles['member-center']}>
|
|
|
- <ColHeader isFixed={false} background="transparent" />
|
|
|
+ <ColHeader background="#ffe5cc" />
|
|
|
<div class={styles.member_container}>
|
|
|
<Cell
|
|
|
class={styles.userMember}
|
|
@@ -50,26 +82,38 @@ export default defineComponent({
|
|
|
v-slots={{
|
|
|
icon: () => (
|
|
|
<div class={styles.userImgSection}>
|
|
|
- <Image class={styles.userImg} src={iconTeacher} fit="cover" />
|
|
|
+ <Image
|
|
|
+ class={styles.userImg}
|
|
|
+ src={this.userInfo.avatar || iconStudent}
|
|
|
+ fit="cover"
|
|
|
+ />
|
|
|
</div>
|
|
|
),
|
|
|
title: () => (
|
|
|
<div class={styles.userInfo}>
|
|
|
- <span class={styles.name}>李小明</span>
|
|
|
- <Image
|
|
|
- class={styles.level}
|
|
|
- src="https://daya.ks3-cn-beijing.ksyun.com/202107/ScSTL1D.png"
|
|
|
- />
|
|
|
- <span class={styles.phone} v-html="(15907121013)"></span>
|
|
|
+ <span class={styles.name}>{this.userInfo.username}</span>
|
|
|
+ {!!this.userInfo.memberRankSettingId && (
|
|
|
+ <Image
|
|
|
+ class={styles.level}
|
|
|
+ src="https://daya.ks3-cn-beijing.ksyun.com/202107/ScSTL1D.png"
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ <span
|
|
|
+ class={styles.phone}
|
|
|
+ v-html={`(${this.userInfo.phone})`}
|
|
|
+ ></span>
|
|
|
</div>
|
|
|
),
|
|
|
label: () => (
|
|
|
<div class={styles.member_time}>
|
|
|
- {true ? (
|
|
|
+ {this.userInfo.memberRankSettingId ? (
|
|
|
<div>
|
|
|
{' '}
|
|
|
会员权益有效期剩余
|
|
|
- <span class={styles.remaining}>200</span>天
|
|
|
+ <span class={styles.remaining}>
|
|
|
+ {this.userInfo.membershipDays}
|
|
|
+ </span>
|
|
|
+ 天
|
|
|
</div>
|
|
|
) : (
|
|
|
<div>亲,您还不是会员哟</div>
|
|
@@ -129,21 +173,24 @@ export default defineComponent({
|
|
|
</p>
|
|
|
</div>
|
|
|
|
|
|
- <div class={styles.memberItem}>
|
|
|
- <div class={styles.title}>会员功能</div>
|
|
|
+ {this.functionList.length > 0 && (
|
|
|
+ <div class={styles.memberItem}>
|
|
|
+ <div class={styles.title}>会员功能</div>
|
|
|
|
|
|
- <div class={styles.member_function}>
|
|
|
- {this.functionList.map((item: any) => (
|
|
|
- <div class={styles.function_item}>
|
|
|
- <Icon name={item.icon} size={34} />
|
|
|
- <div class={styles.function_text} v-html={item.title}></div>
|
|
|
- </div>
|
|
|
- ))}
|
|
|
+ <div class={styles.member_function}>
|
|
|
+ {this.functionList.map((item: any) => (
|
|
|
+ <div class={styles.function_item}>
|
|
|
+ <Icon name={item.icon} size={34} />
|
|
|
+ <div class={styles.function_text} v-html={item.title}></div>
|
|
|
+ </div>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ )}
|
|
|
|
|
|
<ColProtocol
|
|
|
v-model={this.agreeStatus}
|
|
|
+ showHeader
|
|
|
style={{ paddingLeft: 0, paddingRight: 0, marginBottom: '64px' }}
|
|
|
/>
|
|
|
</div>
|