index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view class="page">
  3. <view class="qj" @click="call()">
  4. <view class="icon">&#xe6d1;</view>
  5. SOS
  6. </view>
  7. <view class="top">
  8. <view class="wz">
  9. <text class="icon">&#xe64a;</text>
  10. <text>谢通门县欢迎您!</text>
  11. </view>
  12. <view class="wd">
  13. <view class="qw">28°</view>
  14. <view class="xs">
  15. <view>中雨 东风2级</view>
  16. <view>空气优23</view>
  17. </view>
  18. </view>
  19. <view class="ms">城市后花园·温泉养生地·胜境谢通门</view>
  20. <image src="../../static/bg.jpg" mode="aspectFill"></image>
  21. </view>
  22. <view class="main">
  23. <view class="flex menu">
  24. <view class="f" @click="tab('/pages/travel/index')">
  25. <view class="icon" style="background-color: #0f0b51;">&#xe605;</view>
  26. <view class="title">景区介绍</view>
  27. </view>
  28. <view class="f" @click="tab('/pages/government/index')">
  29. <view class="icon" style="background-color: #e23e33;">&#xe695;</view>
  30. <view class="title">党政服务</view>
  31. </view>
  32. <view class="f">
  33. <view class="icon" style="background-color: #2cc937;">&#xe647;</view>
  34. <view class="title">旅游攻略</view>
  35. </view>
  36. <view class="f">
  37. <view class="icon" style="background-color: #e23e33;">&#xe645;</view>
  38. <view class="title">热门活动</view>
  39. </view>
  40. </view>
  41. <view class="flex mt10">
  42. <view class="item">
  43. <view class="tag">热门活动</view>
  44. <image src="../../static/img1.jpg" mode="aspectFill" class="gray"></image>
  45. <view class="more">点击显示更多</view>
  46. </view>
  47. <view class="item">
  48. <view class="tag">党政服务信息</view>
  49. <image src="../../static/img1.jpg" mode="aspectFill" class="gray"></image>
  50. <view class="more">点击显示更多</view>
  51. </view>
  52. </view>
  53. <view class="flex">
  54. <view class="item">
  55. <view class="tag">旅游攻略</view>
  56. <image src="../../static/img2.jpg" mode="aspectFill" class="gray"></image>
  57. <view class="more">点击显示更多</view>
  58. </view>
  59. <view class="item">
  60. <view class="tag">热门活动</view>
  61. <image src="../../static/img4.jpg" mode="aspectFill" class="gray"></image>
  62. <view class="more">点击显示更多</view>
  63. </view>
  64. </view>
  65. </view>
  66. <u-back-top :scroll-top="scrollTop"></u-back-top>
  67. </view>
  68. </template>
  69. <script>
  70. export default {
  71. data() {
  72. return {
  73. ip: this.$http.urls.ip,
  74. goods_list: [],
  75. scrollTop: 0
  76. };
  77. },
  78. onPageScroll(e) {
  79. this.scrollTop = e.scrollTop;
  80. },
  81. onLoad(e) {
  82. //this.init();
  83. },
  84. methods: {
  85. call() {
  86. uni.showModal({
  87. title: '提示',
  88. content: '是否拨打0892-88888888求援电话?',
  89. success: res => {
  90. if (res.confirm) {
  91. }
  92. }
  93. });
  94. },
  95. init() {
  96. this.$http.request({
  97. url: this.$http.urls.home,
  98. success: res => {
  99. this.goods_list = res.data.data.goods_list;
  100. }
  101. });
  102. },
  103. tab(url) {
  104. uni.switchTab({
  105. url: url
  106. });
  107. },
  108. detail(item) {
  109. uni.navigateTo({ url: '/pages/goods/detail?id=' + item.id });
  110. }
  111. }
  112. };
  113. </script>
  114. <style lang="scss">
  115. .top {
  116. position: relative;
  117. height: 300px;
  118. color: white;
  119. .wz {
  120. position: absolute;
  121. top: 10px;
  122. left: 20px;
  123. z-index: 111111;
  124. .icon {
  125. padding-right: 5px;
  126. }
  127. }
  128. .wd {
  129. position: absolute;
  130. top: 70px;
  131. left: 20px;
  132. z-index: 111111;
  133. .qw {
  134. font-size: 40px;
  135. float: left;
  136. font-weight: bold;
  137. }
  138. .xs {
  139. margin-left: 75px;
  140. width: 100%;
  141. font-weight: bold;
  142. margin-top: 6px;
  143. }
  144. }
  145. .ms {
  146. position: absolute;
  147. top: 155px;
  148. left: 20px;
  149. z-index: 111111;
  150. font-size: 17px;
  151. font-weight: bold;
  152. }
  153. image {
  154. width: 100%;
  155. height: 300px;
  156. position: absolute;
  157. }
  158. }
  159. .main {
  160. padding: 15px 15px 50px 15px;
  161. width: 100%;
  162. margin-top: -50px;
  163. overflow: hidden;
  164. position: absolute;
  165. .menu {
  166. background-color: white;
  167. border-radius: 10px;
  168. padding: 15px;
  169. width: 100%;
  170. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  171. .icon {
  172. font-size: 30px;
  173. background-color: red;
  174. width: 38px;
  175. height: 38px;
  176. border-radius: 5px;
  177. margin: 0 auto;
  178. color: white;
  179. padding: 3px;
  180. }
  181. .title {
  182. padding-top: 4px;
  183. font-size: 13px;
  184. }
  185. }
  186. .item {
  187. flex: 1;
  188. overflow: hidden;
  189. padding: 5px;
  190. position: relative;
  191. image {
  192. border-radius: 5px;
  193. width: 100%;
  194. height: 180px;
  195. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  196. }
  197. .tag {
  198. position: absolute;
  199. left: 10px;
  200. top: 10px;
  201. z-index: 11111;
  202. font-weight: bold;
  203. color: white;
  204. font-size: 16px;
  205. }
  206. .more {
  207. position: absolute;
  208. width: 70%;
  209. background: #e23e33;
  210. opacity: 0.78;
  211. color: white;
  212. bottom: 20px;
  213. border-radius: 5px;
  214. left: 16%;
  215. padding: 5px 7px;
  216. font-size: 13px;
  217. }
  218. }
  219. }
  220. .gray {
  221. -webkit-filter: grayscale(30%);
  222. -moz-filter: grayscale(100%);
  223. -ms-filter: grayscale(100%);
  224. -o-filter: grayscale(100%);
  225. filter: grayscale(30%);
  226. filter: black;
  227. }
  228. .qj {
  229. position: fixed;
  230. top: 53%;
  231. right: 0px;
  232. width: 50px;
  233. background: red;
  234. z-index: 111;
  235. padding: 10px 10px 5px 10px;
  236. color: white;
  237. font-size: 15px;
  238. text-align: center;
  239. border-radius: 10px 0px 0px 10px;
  240. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
  241. .icon {
  242. font-size: 25px;
  243. padding-bottom: 3px;
  244. }
  245. }
  246. </style>