index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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/组-74@2x.jpg" mode="aspectFill"></image>
  21. </view>
  22. <view class="main">
  23. <view class="flex menu">
  24. <view class="f">
  25. <view class="icon" style="background-color: #0f0b51;">&#xe605;</view>
  26. <view class="title">景区介绍</view>
  27. </view>
  28. <view class="f">
  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. //let user={id:35,nickName:'微信用户',openId:'oD2_E4sMkz3zF_0xjhX_C4vaI_xo',sex:0,phone:'13097850972',token:'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6Ijc2NTVmOGM0LWY3YTAtNGU0Mi04MDU3LTdkNTA4NGY5NjE2NyJ9.f6xqQVYkm6zlfhZFbCOyj1-iOZtpkHJbUyCB2MNtTW-jgz1_9zcKKOdnw9uX_WJ_2VNrgOn6R5hmQAIm79YIZw'}
  103. // uni.setStorageSync('user',user);
  104. },
  105. detail(item) {
  106. uni.navigateTo({ url: '/pages/goods/detail?id=' + item.id });
  107. }
  108. }
  109. };
  110. </script>
  111. <style lang="scss">
  112. .top {
  113. position: relative;
  114. height: 300px;
  115. color: white;
  116. .wz {
  117. position: absolute;
  118. top: 10px;
  119. left: 20px;
  120. z-index: 111111;
  121. .icon {
  122. padding-right: 5px;
  123. }
  124. }
  125. .wd {
  126. position: absolute;
  127. top: 70px;
  128. left: 20px;
  129. z-index: 111111;
  130. .qw {
  131. font-size: 40px;
  132. float: left;
  133. font-weight: bold;
  134. }
  135. .xs {
  136. margin-left: 75px;
  137. width: 100%;
  138. font-weight: bold;
  139. margin-top: 6px;
  140. }
  141. }
  142. .ms {
  143. position: absolute;
  144. top: 155px;
  145. left: 20px;
  146. z-index: 111111;
  147. font-size: 17px;
  148. font-weight: bold;
  149. }
  150. image {
  151. width: 100%;
  152. height: 300px;
  153. position: absolute;
  154. }
  155. }
  156. .main {
  157. padding: 15px 15px 50px 15px;
  158. width: 100%;
  159. margin-top: -50px;
  160. overflow: hidden;
  161. position: absolute;
  162. .menu {
  163. background-color: white;
  164. border-radius: 10px;
  165. padding: 15px;
  166. width: 100%;
  167. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  168. .icon {
  169. font-size: 30px;
  170. background-color: red;
  171. width: 38px;
  172. height: 38px;
  173. border-radius: 5px;
  174. margin: 0 auto;
  175. color: white;
  176. padding: 3px;
  177. }
  178. .title {
  179. padding-top: 4px;
  180. font-size: 13px;
  181. }
  182. }
  183. .item {
  184. flex: 1;
  185. overflow: hidden;
  186. padding: 5px;
  187. position: relative;
  188. image {
  189. border-radius: 5px;
  190. width: 100%;
  191. height: 180px;
  192. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  193. }
  194. .tag {
  195. position: absolute;
  196. left: 10px;
  197. top: 10px;
  198. z-index: 11111;
  199. font-weight: bold;
  200. color: white;
  201. font-size: 16px;
  202. }
  203. .more {
  204. position: absolute;
  205. width: 70%;
  206. background: #e23e33;
  207. opacity: 0.78;
  208. color: white;
  209. bottom: 20px;
  210. border-radius: 5px;
  211. left: 16%;
  212. padding: 5px 7px;
  213. font-size: 13px;
  214. }
  215. }
  216. }
  217. .gray {
  218. -webkit-filter: grayscale(30%);
  219. -moz-filter: grayscale(100%);
  220. -ms-filter: grayscale(100%);
  221. -o-filter: grayscale(100%);
  222. filter: grayscale(30%);
  223. filter: black;
  224. }
  225. .qj {
  226. position: fixed;
  227. top: 53%;
  228. right: 0px;
  229. width: 50px;
  230. background: red;
  231. z-index: 111;
  232. padding: 10px 10px 5px 10px;
  233. color: white;
  234. font-size: 15px;
  235. text-align: center;
  236. border-radius: 10px 0px 0px 10px;
  237. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
  238. .icon {
  239. font-size: 25px;
  240. padding-bottom: 3px;
  241. }
  242. }
  243. </style>