index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <view class="main">
  3. <!--轮播图-->
  4. <view class="banner">
  5. <u-swiper circular :radius="5" :indicator="true" keyName="pic" :list="bannerList" :height="150" class="uni-swiper" @click="click"></u-swiper>
  6. </view>
  7. <!--菜单-->
  8. <view class="menu">
  9. <view class="cd">
  10. <view class="out">
  11. <view class="int">
  12. <view class="icon" style="background-color: #f44336">&#xe6be;</view>
  13. <view class="title">失业登记</view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="cd">
  18. <view class="out">
  19. <view class="int">
  20. <view class="icon" style="background-color: #4caf50">&#xe64a;</view>
  21. <view class="title">就业补贴</view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="cd">
  26. <view class="out">
  27. <view class="int">
  28. <view class="icon" style="background-color: #ff9800">&#xe73c;</view>
  29. <view class="title">培训指导</view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="cd">
  34. <view class="out">
  35. <view class="int">
  36. <view class="icon" style="background-color: #607d8b">&#xe998;</view>
  37. <view class="title">法务服务</view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="cd" @click="go('/pages/index/index')">
  42. <view class="out">
  43. <view class="int">
  44. <view class="icon" style="background-color: #03a9f4">&#xe725;</view>
  45. <view class="title">结算广场</view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="cd">
  50. <view class="out">
  51. <view class="int">
  52. <view class="icon" style="background-color: #795548">&#xe6a6;</view>
  53. <view class="title">社保窗口</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <!--新闻-->
  59. <view class="news">
  60. <view class="gg">
  61. <view class="title">最新资讯</view>
  62. <view class="bor"></view>
  63. <view class="more" @click="go('/pages/news/index')">
  64. <text>更多</text>
  65. <text class="icon">&#xe62b;</text>
  66. </view>
  67. </view>
  68. <view class="item" v-for="(item, index) in newsList" :key="index" @click="go('/pages/news/detail?id=' + item.id)">
  69. <view class="title omit">{{ item.title }}</view>
  70. <view class="date">{{ item.createTime.substring(5, 10) }}</view>
  71. </view>
  72. </view>
  73. <!--横幅-->
  74. <image src="../../static/banner.jpg" mode="widthFix" class="hengfu" @click="webview('https://chenglantimes.com/a1')"></image>
  75. <!--图片内容-->
  76. <view class="ad" style="margin-left: -10px; margin-right: -10px">
  77. <view class="item" style="height: 190px">
  78. <view class="out" @click="webview('https://chenglantimes.com/a1')">
  79. <view class="int" style="height: 175px; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2)">
  80. <image src="https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716197779982.jpg" mode="heightFix" style="height: 180px; width: 100%"></image>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="item" style="height: 190px">
  85. <view class="out">
  86. <view class="int">
  87. <view class="it" style="height: 80px" @click="webview('https://chenglantimes.com/a1')">
  88. <image src="https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716195826603.jpg" mode="aspectFill" style="height: 85px; width: 100%"></image>
  89. </view>
  90. <view class="it" style="height: 80px; margin-top: 15px" @click="webview('https://chenglantimes.com/a1')">
  91. <image src="https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716198212203.jpg" mode="aspectFill" style="height: 77px; width: 100%"></image>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </template>
  99. <script>
  100. export default {
  101. data() {
  102. return {
  103. bannerList: [],
  104. newsList: []
  105. };
  106. },
  107. onLoad() {
  108. this.getData();
  109. },
  110. methods: {
  111. getData() {
  112. this.http.request({
  113. url: '/app/home/index',
  114. success: (res) => {
  115. this.contract = res.data.data.contract;
  116. this.bannerList = res.data.data.bannerList;
  117. this.newsList = res.data.data.newsList;
  118. }
  119. });
  120. },
  121. go(url) {
  122. uni.navigateTo({ url: url });
  123. },
  124. webview(src) {
  125. uni.navigateTo({
  126. url: '/pages/other/webview?src=' + src
  127. });
  128. }
  129. }
  130. };
  131. </script>
  132. <style lang="scss">
  133. .banner {
  134. margin-top: -10px;
  135. }
  136. .news {
  137. margin-top: 10px;
  138. background-color: white;
  139. border-radius: 7px;
  140. overflow: hidden;
  141. padding: 12px;
  142. box-shadow: $box-shadow;
  143. .gg {
  144. font-weight: bold;
  145. margin-bottom: 5px;
  146. border-bottom: 1px solid $line;
  147. padding-bottom: 10px;
  148. .title {
  149. margin-left: 10px;
  150. }
  151. .bor {
  152. width: 5px;
  153. height: 12px;
  154. background-color: $main-color;
  155. border-radius: 20px;
  156. float: left;
  157. margin-top: -16px;
  158. }
  159. .more {
  160. float: right;
  161. font-size: 14px;
  162. font-weight: normal;
  163. margin-top: -20px;
  164. }
  165. }
  166. .item {
  167. padding-top: 9px;
  168. font-size: 14px;
  169. overflow: hidden;
  170. .title {
  171. float: left;
  172. width: 80%;
  173. }
  174. .date {
  175. float: right;
  176. }
  177. }
  178. }
  179. .hengfu {
  180. width: 100%;
  181. border-radius: 7px;
  182. margin-top: 10px;
  183. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  184. }
  185. .ad {
  186. .item {
  187. float: left;
  188. width: 50%;
  189. overflow: hidden;
  190. .out {
  191. padding: 10px 10px 10px 10px;
  192. .int {
  193. overflow: hidden;
  194. border-radius: 7px;
  195. image {
  196. border-radius: 7px;
  197. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  198. }
  199. }
  200. }
  201. }
  202. .it {
  203. overflow: hidden;
  204. border-radius: 7px;
  205. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  206. }
  207. }
  208. </style>