index.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { Button, Popup } from 'vant';
  2. import { defineComponent } from 'vue';
  3. import styles from './index.module.less';
  4. import { state } from '@/state';
  5. import { gotoMemberCenter } from '@/views/hook/useFee';
  6. import {
  7. postMessage
  8. } from '@/helpers/native-message';
  9. export default defineComponent({
  10. name: 'theVip',
  11. setup() {
  12. return () => (
  13. <Popup v-model:show={state.vipShow} round class={styles.courseDialog} closeOnClickOverlay={false}>
  14. {state.vipFrom !== "exercise" && <i
  15. class={styles.iconClose}
  16. onClick={() => (state.vipShow = false)}></i>}
  17. <div class={styles.title}>温馨提示</div>
  18. <div class={styles.content}>
  19. 该课件暂未解锁,解锁更多课件,享受全新学习体验!
  20. </div>
  21. <div class={styles.popupBtnGroup}>
  22. <Button round onClick={() => {
  23. state.vipShow = false
  24. if(state.vipFrom === "exercise") {
  25. postMessage({ api: 'back' });
  26. }
  27. }}>取消</Button>
  28. <Button round type="primary" onClick={() => {
  29. gotoMemberCenter()
  30. state.vipShow = false
  31. }}>
  32. 去开通
  33. </Button>
  34. </div>
  35. </Popup>
  36. );
  37. }
  38. });