index.tsx 1014 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { defineComponent, ref } from "vue";
  2. import { Button, Popup } from "vant";
  3. import state from "/src/state";
  4. import TipsIcon from "./tips.png";
  5. import styles from "./index.module.less";
  6. export const vipShow = ref(false)
  7. export default defineComponent({
  8. name: "vip-popup",
  9. data() {
  10. return {
  11. content: "您尚未开通云练习服务,请联系乐团老师开通",
  12. };
  13. },
  14. methods: {
  15. open() {
  16. vipShow.value = false;
  17. },
  18. getContent() {
  19. if (state.isSchool) {
  20. this.content = "VIP曲目暂不可用";
  21. }
  22. return this.content;
  23. },
  24. },
  25. render() {
  26. return (
  27. <Popup show={vipShow.value} get-container="body" closeable onClickCloseIcon={() => (vipShow.value = false)} round>
  28. <div class={styles.vip}>
  29. <img src={TipsIcon} />
  30. <p>{this.getContent()}</p>
  31. <Button class={styles.btn} onClick={this.open} round color="#01C1B5">
  32. 确定
  33. </Button>
  34. </div>
  35. </Popup>
  36. );
  37. },
  38. });