Index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="hello">
  3. <div class="block">
  4. <div class="row header ">
  5. <div class="right pull-right">
  6. <ul class="inline pull-right">
  7. <li ><router-link :to="link">{{link_text}}</router-link> &nbsp;&nbsp;&nbsp;<a target="_blank" v-if="lang =='zh-cn'" href="https://www.showdoc.cc/app">App</a></li>
  8. </ul>
  9. </div>
  10. </div>
  11. <el-carousel :height="height" :autoplay="false" arrow="always">
  12. <el-carousel-item style="background-color: #1bbc9b;">
  13. <div class="slide">
  14. <img src="static/logo/b_64.png" alt="">
  15. <h2>{{$t("section_title1")}}</h2>
  16. <p><span v-html="$t('section_description1')"></span></p>
  17. <p>
  18. <a class="el-button " href="https://www.showdoc.cc/demo" target="_blank">{{$t("demo")}}</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  19. <a class="el-button" href="https://www.showdoc.cc/help" target="_blank" >{{$t("help")}}&nbsp;</i></a>
  20. </p>
  21. </div>
  22. </el-carousel-item>
  23. <el-carousel-item style="background-color: #2C606A;">
  24. <div class="slide">
  25. <h2>{{$t("section_title2")}}</h2>
  26. <p><span v-html="$t('section_description2')"></span></p>
  27. </div>
  28. </el-carousel-item>
  29. <el-carousel-item style="background-color: #f90;">
  30. <div class="slide">
  31. <h2>{{$t("section_title3")}}</h2>
  32. <p><span v-html="$t('section_description3')"></span></p>
  33. </div>
  34. </el-carousel-item>
  35. <el-carousel-item style="background-color: #7CBD9D;">
  36. <div class="slide">
  37. <h2>{{$t("section_title4")}}</h2>
  38. <p><span v-html="$t('section_description4')"></span></p>
  39. </div>
  40. </el-carousel-item>
  41. <el-carousel-item style="background-color: #A77DC2;">
  42. <div class="slide">
  43. <h2>{{$t("section_title5")}}</h2>
  44. <p><span v-html="$t('section_description5')"></span></p>
  45. </div>
  46. </el-carousel-item>
  47. <el-carousel-item style="background-color: #85CE92;">
  48. <div class="slide">
  49. <h2>{{$t("section_title6")}}</h2>
  50. <p><span v-html="$t('section_description6')"></span></p>
  51. </div>
  52. </el-carousel-item>
  53. <el-carousel-item style="background-color: #4BBFC3;">
  54. <div class="slide">
  55. <h2>{{$t("section_title7")}}</h2>
  56. <p><span v-html="$t('section_description7')"></span></p>
  57. </div>
  58. </el-carousel-item>
  59. <el-carousel-item style="background-color: #1bbc9b;">
  60. <div class="slide">
  61. <h2></h2>
  62. <p>{{$t("section_description8")}}</p>
  63. <p>
  64. <el-button><router-link to="/user/login">{{$t("section_title8")}}</router-link></el-button>
  65. </p>
  66. </div>
  67. </el-carousel-item>
  68. </el-carousel>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. export default {
  74. name: 'Index',
  75. data () {
  76. return {
  77. height: '',
  78. link:'',
  79. link_text:'',
  80. lang:""
  81. }
  82. },
  83. methods:{
  84. getHeight(){
  85. if (window.innerHeight){
  86. var winHeight = window.innerHeight;
  87. }
  88. else if ((document.body) && (document.body.clientHeight)){
  89. var winHeight = document.body.clientHeight;
  90. }
  91. this.height = winHeight+'px' ;
  92. },
  93. homePageSetting(){
  94. var url = DocConfig.server+'/api/common/homePageSetting';
  95. this.axios.post(url, this.form)
  96. .then( (response) =>{
  97. if (response.data.error_code === 0 ) {
  98. if (response.data.data.home_page == 2) {
  99. //跳转到登录页面
  100. this.$router.replace({
  101. path: "/user/login"
  102. });
  103. };
  104. if (response.data.data.home_page == 3 && response.data.data.home_item ) {
  105. //跳转到指定项目
  106. this.$router.replace({
  107. path: "/"+response.data.data.home_item
  108. });
  109. };
  110. }
  111. });
  112. },
  113. },
  114. mounted () {
  115. var that = this ;
  116. this.lang = DocConfig.lang ;
  117. this.getHeight();
  118. this.homePageSetting();
  119. that.link = '/user/login';
  120. that.link_text = that.$t("index_login_or_register");
  121. this.get_user_info(function(response){
  122. if (response.data.error_code === 0 ) {
  123. that.link = '/item/index';
  124. that.link_text = that.$t("my_item");
  125. }
  126. });
  127. }
  128. }
  129. </script>
  130. <!-- Add "scoped" attribute to limit CSS to this component only -->
  131. <style scoped>
  132. .el-carousel__item {
  133. text-align: center;
  134. font: 25px "Microsoft Yahei";
  135. color: #fff;
  136. }
  137. .header{
  138. padding-right: 50px;
  139. padding-top: 30px;
  140. font-size: 18px;
  141. position: fixed;
  142. right: 0;
  143. left: 0;
  144. z-index: 1030;
  145. margin-bottom: 0;
  146. }
  147. .header a {
  148. color: white;
  149. font-size: 12px;
  150. font-weight: bold;
  151. }
  152. .slide{
  153. width:100%;
  154. max-width: 700px;
  155. position : absolute;
  156. top : 50%;
  157. left : 50%;
  158. transform : translate(-50%,-50%);
  159. padding-top: 0px;
  160. padding-left: 15px;
  161. padding-right: 15px;
  162. padding-bottom: 0px;
  163. box-sizing: border-box;
  164. }
  165. @media only screen and (max-width: 800px) {
  166. .slide p {
  167. font-size: 14px;
  168. }
  169. }
  170. </style>