index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <div class="main">
  3. <!-- pc -->
  4. <div v-if="device == 'chrome' || device == 'no-chrome'" class="content">
  5. <v-logo></v-logo>
  6. <div class="tool-cover">
  7. <img :src="detail.cover" alt="">
  8. </div>
  9. <!-- 非chrome -->
  10. <div v-if="device == 'no-chrome'">
  11. <div class="txt">Use chrome browser to access Subway Surfers</div>
  12. <install-chrome></install-chrome>
  13. </div>
  14. <!-- chrome -->
  15. <div v-if="device == 'chrome'">
  16. <div class="txt">Use chrome browser to access Subway Surfers</div>
  17. <install-extension></install-extension>
  18. </div>
  19. </div>
  20. <!-- 移动端 -->
  21. <div v-if="device == 'ios' || device == '安卓'" class="mobile">
  22. <div class="mobile-content">
  23. <img :src="detail.cover" alt="">
  24. <div class="title">Open link on PC to use Subway Surfers</div>
  25. </div>
  26. <div class="area-button">
  27. <div class="btn1" @click="clickExtension">
  28. Install Chrome Extension
  29. </div>
  30. <div class="btn2" @click="clickCopy">
  31. Copy Link
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import VLogo from '@/components/logo.vue'
  39. import InstallChrome from '@/components/InstallChrome.vue'
  40. import InstallExtension from '@/components/InstallExtension.vue'
  41. import { getBrowserType, baseURL, appVersionCode } from '../../utils/help.js'
  42. import axios from 'axios'
  43. export default {
  44. name: 'tool_box',
  45. data() {
  46. return {
  47. device: '',
  48. detail: {
  49. cover: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F4k%2Fs%2F02%2F2109242306111155-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1659266146&t=f2eab2e388056d2799b66cdf2e0e39b8'
  50. }
  51. }
  52. },
  53. components: {
  54. VLogo,
  55. InstallChrome,
  56. InstallExtension
  57. },
  58. async asyncData(params) {
  59. let { route } = params;
  60. let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
  61. baseInfo: {
  62. appVersionCode: appVersionCode,
  63. mid: function () {
  64. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  65. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  66. return v.toString(16);
  67. });
  68. }()
  69. },
  70. params: {
  71. postId: route.params.id || ''
  72. }
  73. })
  74. if (data.code == 0) {
  75. if (data.data && data.data.postBizData && typeof data.data.postBizData == 'string') {
  76. data.data.postBizData = JSON.parse(data.data.postBizData)
  77. }
  78. if (data.data.postBizData === null) {
  79. data.data.postBizData = {
  80. postUserInfo: {}
  81. }
  82. }
  83. console.log('detail', data.data)
  84. return {
  85. detail: data.data,
  86. }
  87. }
  88. },
  89. mounted() {
  90. this.device = getBrowserType()
  91. console.log(this.device)
  92. },
  93. methods: {
  94. clickCopy() {
  95. },
  96. clickExtension() {
  97. window.open('https://chrome.google.com/webstore/detail/denet/inlfbeejfdgkknpiodhemfcokbdgofja')
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss" >
  103. html,
  104. body,
  105. #__nuxt,
  106. #__layout {
  107. margin: 0;
  108. padding: 0;
  109. width: 100%;
  110. height: 100%;
  111. background: #F5FAFF;
  112. }
  113. .main {
  114. width: 100%;
  115. height: 100%;
  116. .tool-cover {
  117. min-width: 400px;
  118. margin-right: 90px;
  119. img {
  120. height: 270px;
  121. }
  122. }
  123. .content {
  124. width: 100%;
  125. height: 100%;
  126. display: flex;
  127. justify-content: center;
  128. align-items: center;
  129. padding-bottom: 70px;
  130. .txt {
  131. width: 400px;
  132. font-weight: 700;
  133. font-size: 36px;
  134. line-height: 44px;
  135. /* or 122% */
  136. letter-spacing: 0.3px;
  137. color: #323232;
  138. margin-bottom: 40px;
  139. }
  140. }
  141. .mobile {
  142. .mobile-content {
  143. padding: 36px 16px 0 16px;
  144. img {
  145. width: 100%;
  146. margin-bottom: 25px;
  147. border-radius: 5px;
  148. }
  149. .title {
  150. font-weight: 700;
  151. font-size: 22px;
  152. line-height: 26px;
  153. text-align: center;
  154. letter-spacing: 0.3px;
  155. color: #000000;
  156. width: 240px;
  157. margin: 0 auto;
  158. }
  159. }
  160. .area-button {
  161. position: fixed;
  162. width: 100%;
  163. padding: 27px 16px 25px 16px;
  164. bottom: 0;
  165. height: 170px;
  166. .btn1 {
  167. height: 50px;
  168. line-height: 50px;
  169. background: #1D9BF0;
  170. border-radius: 100px;
  171. width: 100%;
  172. font-weight: 600;
  173. font-size: 18px;
  174. text-align: center;
  175. letter-spacing: 0.3px;
  176. color: #FFFFFF;
  177. margin-bottom: 16px;
  178. }
  179. .btn2 {
  180. height: 50px;
  181. line-height: 50px;
  182. background: rgba(29, 155, 240, 0.01);
  183. border: 1px solid #1D9BF0;
  184. border-radius: 100px;
  185. width: 100%;
  186. font-weight: 600;
  187. font-size: 18px;
  188. text-align: center;
  189. letter-spacing: 0.3px;
  190. color: #1D9BF0;
  191. }
  192. }
  193. }
  194. }
  195. </style>