shanshipin.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!-- https://cxzx.smcic.net/topic/qinshufa/assets/logp.png -->
  2. <template>
  3. <van-row class="shanshipin">
  4. <van-col span="12" style="padding-left: 15px">
  5. <img
  6. style="
  7. width: 40px;
  8. border-radius: 5px;
  9. vertical-align: middle;
  10. margin-right: 5px;
  11. "
  12. src="https://cxzx.smcic.net/topic/qinshufa/assets/logp.png"
  13. alt=""
  14. srcset=""
  15. />
  16. <span style="vertical-align: middle">闪视频</span>
  17. </van-col>
  18. <van-col span="12" style="text-align: right; padding-right: 15px">
  19. <van-button
  20. style="margin-top: -5px"
  21. type="danger"
  22. size="small"
  23. color="#c11616"
  24. @click="download"
  25. >下载</van-button
  26. >
  27. </van-col>
  28. </van-row>
  29. </template>
  30. <script setup>
  31. import { showToast } from "vant";
  32. // import { reactive } from "vue";
  33. /**
  34. * window.$originData.orginParames.title 页面标题
  35. * window.$originData.orginParames.parameters 固定参数值
  36. * window.$originData.urlParames url参数
  37. */
  38. import { isIpad, isIphone, isIpod, isWechat } from "@/utils/isTerminal.js";
  39. let time = undefined;
  40. function getDownloadUrl() {
  41. let url = "https://ssp.sxtvs.com.cn/app/shp.apk";
  42. if (isIpad || isIpod || isIphone)
  43. url =
  44. "https://apps.apple.com/cn/app/%E9%97%AA%E8%A7%86%E9%A2%91/id1498056575";
  45. return url;
  46. }
  47. function download() {
  48. if (time) clearTimeout(time);
  49. time = window.setTimeout(() => {
  50. window.SL && window.SL.Interactive.AppClick({
  51. page_name: "官网",
  52. event_type: "downloadApp",
  53. });
  54. const url = getDownloadUrl();
  55. if (isIpad || isIpod || isIphone) return location.href = url;
  56. if (isWechat) return showToast("请在浏览器打开下载app");
  57. location.href = url;
  58. }, 200);
  59. }
  60. </script>
  61. <style scoped>
  62. .shanshipin {
  63. position: fixed;
  64. padding-bottom: 10px;
  65. bottom: 0;
  66. left: 0;
  67. right: 0;
  68. height: 70px;
  69. line-height: 70px;
  70. background: #fff;
  71. z-index: 5;
  72. font-size: 16px;
  73. }
  74. </style>