trade.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <div>
  3. <Header></Header>
  4. <div class="top">
  5. <div class="videoContainer">
  6. <!-- <video id="back_video" class="video fillWidth" muted :autoplay="autoplay" loop :controls="false"playsinline preload="auto" crossorigin="anoymous">
  7. <source :src="pageData.video" type="video/mp4" />
  8. </video> -->
  9. <video id="back_video" class="video fillWidth" :src="pageData.k_url1" muted :autoplay="autoplay" loop :controls="false" :webkit-playsinline="true" playsinline x5-playsinline="true" x-webkit-airplay="true" crossorigin="anoymous" v-if="!flag">
  10. <!-- <source :src="pageData.k_url1" type="video/mp4" /> -->
  11. </video>
  12. <el-image :src="pageData.k_url" class="video fillWidth" fit="cover" v-if="flag && pageData.k_url !== undefined"></el-image>
  13. </div>
  14. <div class="title">{{ pageData.k_title }}</div>
  15. <div class="subTitle" v-html="pageData.x_subtitle"></div>
  16. <div class="line"></div>
  17. </div>
  18. <div class="center">
  19. <div class="info">
  20. <div class="info-h hflex acenter jbetween">
  21. <div class="info-text">
  22. <div v-html="pageData.k_content" style="margin-bottom: 99px;"></div>
  23. <!-- <div v-html="pageData.info.subTitle"></div> -->
  24. </div>
  25. <div class="info-img">
  26. <el-image fit="cover" :src="pageData.k_pic" alt="" v-if="pageData.k_pic !== undefind">
  27. </el-image>
  28. <img src="@/assets/images/common/img_top_bg.png" alt="" class="img_bg">
  29. </div>
  30. </div>
  31. </div>
  32. <div class="list">
  33. <div class="line"></div>
  34. <div class="hflex acenter fwrap imgs">
  35. <div v-for="(item,index) in pageList" :key="index" class="list_item">
  36. <el-image fit="cover" :src="item.url" alt="" class="img" v-if="item.url !== undefind"/>
  37. <div class="text">{{ item.title }}</div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="topping hflex acenter jcenter point" v-if="scroll_top > 1000" @click="toTop">
  43. <img src="@/assets/images/common/topping.png" alt="">
  44. </div>
  45. <Footer :footer="footer"></Footer>
  46. </div>
  47. </template>
  48. <script>
  49. import Header from '@/components/header.vue'
  50. import Footer from '@/components/footer.vue'
  51. var that = ''
  52. export default {
  53. name: 'Trade',
  54. components: {
  55. Header,
  56. Footer
  57. },
  58. data() {
  59. return {
  60. pageData: {},
  61. pageList: [],
  62. footer: {},
  63. scroll_top: 0,
  64. autoplay: true,
  65. flag: true
  66. }
  67. },
  68. created() {
  69. that = this
  70. that.getConfig()
  71. that.getList()
  72. that.isBrow()
  73. let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
  74. that.flag = flag
  75. },
  76. mounted() {
  77. window.addEventListener('scroll', this.handleScroll) // 监听页面滚动
  78. },
  79. methods: {
  80. isBrow() {
  81. var ua = navigator.userAgent.toLowerCase();
  82. if(ua.match(/MicroMessenger/i)=="micromessenger" || ua.match(/QQ/i) == "qq") {
  83. that.autoplay = false
  84. }
  85. },
  86. // 获取基础配置信息
  87. getConfig() {
  88. that.$http.getConfig().then((res) => {
  89. if(res.data.code == 1) {
  90. that.pageData = res.data.data
  91. var temp = that.pageData.k_url.substr(that.pageData.k_url.length - 3,3)
  92. var type = ''
  93. if(temp == 'jpg' || temp == 'png' || temp == 'gif') {
  94. type = 'image'
  95. } else if(temp == 'mp4' || temp == 'avi') {
  96. type = 'video'
  97. }
  98. that.$set(that.pageData,'type',type)
  99. that.footer = {
  100. company: that.pageData.company,
  101. phone: that.pageData.phone,
  102. address: that.pageData.address,
  103. }
  104. }
  105. })
  106. },
  107. // 获取跨境贸易信息
  108. getList() {
  109. that.$http.getTradeList().then((res) => {
  110. // console.log('跨境贸易',res);
  111. if(res.data.code == 1) {
  112. that.pageList = res.data.data.list
  113. }
  114. })
  115. },
  116. // 监听页面滚动
  117. handleScroll() {
  118. this.scroll_top = document.documentElement.scrollTop
  119. },
  120. // 返回顶部
  121. toTop() {
  122. document.body.scrollTop = 0
  123. document.documentElement.scrollTop = 0
  124. this.scroll_top = document.documentElement.scrollTop
  125. }
  126. }
  127. }
  128. </script>
  129. <style scoped>
  130. .top {
  131. box-sizing: border-box;
  132. padding: 500px 100px 0;
  133. min-height: 100vh;
  134. }
  135. .top .title {
  136. font-size: 60px;
  137. font-weight: 500;
  138. color: #fff;
  139. padding-bottom: 200px;
  140. padding-left: 151px;
  141. }
  142. .top .subTitle {
  143. font-size: 60px;
  144. font-weight: 500;
  145. color: #fff;
  146. padding-left: 151px;
  147. line-height: 90px;
  148. }
  149. .top .line {
  150. width: 1720px;
  151. height: 4px;
  152. background: #FFFFFF;
  153. margin: 58px 0;
  154. }
  155. .center {
  156. background: #fff;
  157. box-sizing: border-box;
  158. padding: 0 202px;
  159. min-height: 100vh;
  160. }
  161. .info {
  162. width: 100%;
  163. padding: 150px 0 75px;
  164. /* padding: 129px 0 0; */
  165. }
  166. .info-h {
  167. padding: 129px 0 0;
  168. border-top: 4px solid #ccc;
  169. }
  170. .info-h .info-text {
  171. font-size: 80px;
  172. font-weight: 500;
  173. color: #333333;
  174. margin-right: 38px;
  175. }
  176. .info-h .info-img {
  177. width: 1058px;
  178. height: 722px;
  179. position: relative;
  180. }
  181. /deep/ .info-h .info-img .el-image {
  182. width: 100%;
  183. height: 100%;
  184. }
  185. .info-h .info-img .img_bg {
  186. position: absolute;
  187. top: 0;
  188. left: 0;
  189. width: 100%;
  190. height: 100%;
  191. }
  192. .center .list {
  193. width: 100%;
  194. padding: 150px 0 75px;
  195. }
  196. .center .list .line {
  197. width: 100%;
  198. height: 4px;
  199. background: #CCCCCC;
  200. }
  201. .center .list .imgs {
  202. margin: 66px 0 80px;
  203. }
  204. .center .list .list_item {
  205. width: 470px;
  206. height: 376px;
  207. background: #FFFFFF;
  208. margin: 0 30px 28px 0;
  209. position: relative;
  210. }
  211. .center .list .list_item .img {
  212. width: 100%;
  213. height: 100%;
  214. border-radius: 10px;
  215. }
  216. .center .list .list_item:nth-child(3n+3) {
  217. margin: 0 0 28px;
  218. }
  219. .center .list .list_item .text {
  220. width: 100%;
  221. text-align: center;
  222. max-width: 470px;
  223. height: 128px;
  224. line-height: 128px;
  225. color: #fff;
  226. background: rgba(0,0,0,.4);
  227. opacity: 0;
  228. border-radius: 0px 0px 10px 10px;
  229. position: absolute;
  230. bottom: 0;
  231. transition-delay: 500ms;
  232. white-space: nowrap;
  233. overflow: hidden;
  234. text-overflow:ellipsis;
  235. }
  236. .center .list .list_item:hover .text {
  237. opacity: 1;
  238. }
  239. .topping {
  240. position: fixed;
  241. bottom: 100px;
  242. right: 45px;
  243. z-index: 999;
  244. width: 100px;
  245. height: 100px;
  246. background: #000000;
  247. opacity: 0.3;
  248. border-radius: 10px;
  249. }
  250. .topping img {
  251. width: 53px;
  252. height: 57px;
  253. }
  254. @media (max-width: 750px) {
  255. .top {
  256. box-sizing: border-box;
  257. padding: 464px 100px 0;
  258. min-height: 1080px !important;
  259. }
  260. .center {
  261. min-height: 1080px !important;
  262. }
  263. .top .title {
  264. padding: 0 151px 200px;
  265. }
  266. .center .list .list_item .text {
  267. opacity: 1 !important;
  268. }
  269. }
  270. </style>