shanshipin.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!-- https://cxzx.smcic.net/topic/qinshufa/assets/logp.png -->
  2. <template>
  3. <van-row class="shanshipin" :style="color ? 'background:'+ color : ''">
  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 { defineProps } from 'vue';
  33. /**
  34. * window.$originData.orginParames.title 页面标题
  35. * window.$originData.orginParames.parameters 固定参数值
  36. * window.$originData.urlParames url参数
  37. */
  38. defineProps({
  39. color: String,
  40. });
  41. import { isIpad, isIphone, isIpod, isWechat } from '@/utils/isTerminal.js';
  42. let time = undefined;
  43. function getDownloadUrl() {
  44. let url = 'https://ssp.sxtvs.com.cn/app/shp.apk';
  45. if (isIpad || isIpod || isIphone)
  46. url =
  47. 'https://apps.apple.com/cn/app/%E9%97%AA%E8%A7%86%E9%A2%91/id1498056575';
  48. return url;
  49. }
  50. function download() {
  51. if (time) clearTimeout(time);
  52. time = window.setTimeout(() => {
  53. window.SL &&
  54. window.SL.Interactive.AppClick({
  55. page_name: '官网',
  56. event_type: 'downloadApp',
  57. });
  58. const url = getDownloadUrl();
  59. if (isIpad || isIpod || isIphone) return (location.href = url);
  60. if (isWechat) return showToast('请在浏览器打开下载app');
  61. location.href = url;
  62. }, 200);
  63. }
  64. </script>
  65. <style scoped>
  66. .shanshipin {
  67. position: fixed;
  68. padding-bottom: 10px;
  69. bottom: 0;
  70. left: 0;
  71. right: 0;
  72. height: 70px;
  73. line-height: 70px;
  74. background: #fff;
  75. z-index: 5;
  76. font-size: 16px;
  77. }
  78. </style>