index.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { defineComponent } from "vue";
  2. import icon_title from "./icon_title.png";
  3. import icon_btn from "./icon_btn.png";
  4. import icon_close from "./icon_close.png";
  5. import styles from "./index.module.less";
  6. import { Popup } from "vant";
  7. import { api_back } from "/src/helpers/communication";
  8. import { postMessage } from "/src/utils/native-message";
  9. export default defineComponent({
  10. name: "TheVip",
  11. setup() {
  12. const close = () => {
  13. api_back();
  14. };
  15. return () => (
  16. <Popup
  17. teleport="body"
  18. closeOnClickOverlay={false}
  19. class={["popup-custom"]}
  20. show={true}
  21. >
  22. <div class={styles.container}>
  23. <img class={styles.close} src={icon_close} onClick={close} />
  24. <img class={styles.title} src={icon_title} />
  25. <div class={styles.content}>
  26. 您还未领取<span style={{ color: "#FF5A56" }}>“AI学练”</span>
  27. 哦,如需继续使用,请领取~
  28. </div>
  29. <div class={styles.btns}>
  30. <img
  31. class={styles.btn}
  32. src={icon_btn}
  33. onClick={() => {
  34. postMessage({
  35. api: "openWebView",
  36. content: {
  37. url: `${location.origin.includes('192') ? 'https://test.lexiaoya.cn' : location.origin}/classroom-app/#/member-center`,
  38. orientation: 1,
  39. },
  40. });
  41. }}
  42. />
  43. <div onClick={close}>暂不领取</div>
  44. </div>
  45. </div>
  46. </Popup>
  47. );
  48. },
  49. });