index.tsx 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { defineComponent } from "vue";
  2. import icon_title from "./icon_title.png";
  3. import icon_btn from "./icon_btn.png";
  4. import icon_btn_cancel from "./icon_btn_cancel.png";
  5. import icon_close from "./icon_close.png";
  6. import styles from "./index.module.less";
  7. import { Popup } from "vant";
  8. import { api_back, api_goback } from "/src/helpers/communication";
  9. import { postMessage } from "/src/utils/native-message";
  10. import { getQuery } from "/src/utils/queryString";
  11. export default defineComponent({
  12. name: "TheVip",
  13. setup() {
  14. const apiUrls = {
  15. dev: "https://dev.kt.colexiu.com",
  16. test: "https://test.lexiaoya.cn",
  17. online: "https://kt.colexiu.com",
  18. };
  19. let environment: "dev" | "test" | "online" = location.origin.includes("//dev") ? "dev" : location.origin.includes("//test") ? "test" : location.origin.includes("//online") || location.origin.includes("//kt") || location.origin.includes("//mec") ? "online" : "dev";
  20. const close = () => {
  21. const query = getQuery();
  22. if (query.modelType) {
  23. api_goback();
  24. } else {
  25. api_back();
  26. }
  27. };
  28. return () => (
  29. <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom"]} show={true}>
  30. <div class={styles.container}>
  31. {/* <img class={styles.close} src={icon_close} onClick={close} /> */}
  32. {/* <img class={styles.title} src={icon_title} /> */}
  33. <div class={styles.content}>
  34. 立即开通<span style={{ color: "#FF5A56" }}>"乐器AI学练工具"</span>服务,解锁更多专属权益,享受全新学习体验!
  35. </div>
  36. <div class={styles.btns}>
  37. <img class={[styles.btn, styles.btnCancel]} src={icon_btn_cancel} onClick={close} />
  38. <img
  39. class={styles.btn}
  40. src={icon_btn}
  41. onClick={() => {
  42. postMessage({
  43. api: "openWebView",
  44. content: {
  45. url: `${location.origin.includes("192") ? "https://test.lexiaoya.cn" : apiUrls[environment]}/classroom-app/#/member-center`,
  46. orientation: 1,
  47. },
  48. });
  49. }}
  50. />
  51. {/* <div onClick={close}>暂不领取</div> */}
  52. </div>
  53. </div>
  54. </Popup>
  55. );
  56. },
  57. });