index2.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="page">
  3. <view class="wd">
  4. <view class="qw">28°</view>
  5. <view class="xs">
  6. <view>中雨 东风2级</view>
  7. <view>空气优23</view>
  8. </view>
  9. </view>
  10. <view class="ms">
  11. <text class="icon">&#xe64a;</text>
  12. <text>谢通门县欢迎您</text>
  13. <navigator url="/pages/index/index" class="jb">旧版首页</navigator>
  14. </view>
  15. <view class="top"><image :src="aboutUs.bgImg1 ? ip + aboutUs.bgImg1 : '../../static/bj.jpg'"></image></view>
  16. <view class="flex menu">
  17. <view class="f" @click="tab('/pages/travel/index')">
  18. <view class="icon" style="background-color: #0f0b51;">&#xe605;</view>
  19. <view class="title">景区介绍</view>
  20. </view>
  21. <view class="f" @click="navigate('/pages/travel/introduction')">
  22. <view class="icon" style="background-color: #2cc937;">&#xe647;</view>
  23. <view class="title">旅游攻略</view>
  24. </view>
  25. <view class="f" @click="navigate('/pages/government/activity')">
  26. <view class="icon" style="background-color: #e23e33;">&#xe645;</view>
  27. <view class="title">热门活动</view>
  28. </view>
  29. <view class="f" @click="navigate('/pages/government/index')">
  30. <view class="icon" style="background-color: #e23e33;">&#xe695;</view>
  31. <view class="title">党政服务</view>
  32. </view>
  33. </view>
  34. <!-- <view class="flex" style="margin-top: 10px;">
  35. <view class="f a1"><image @click="tab('/pages/travel/index')" src="../../static/img11.jpg" style="height: 170px;width: 93%;"></image></view>
  36. <view class="f a1">
  37. <image @click="tab('/pages/shop/hotel/index')" src="../../static/aa2.jpg" style="height: 80px;width: 100%;"></image>
  38. <image @click="navigate('/pages/travel/introduction')" src="../../static/aa3.jpg" style="height: 80px;width: 100%;margin-top: 5px;position: relative;"></image>
  39. </view>
  40. </view> -->
  41. <view class="it">
  42. <view class="v_title">
  43. <image src="../../static/lo.png" class="lo" mode="widthFix"></image>
  44. <view class="hd">热门景区</view>
  45. <view class="more" @click="tab('/pages/travel/index')">
  46. 更多
  47. <text class="arrow icon">&#xe62d;</text>
  48. </view>
  49. <view class="clear"></view>
  50. </view>
  51. <view class="jq_item" v-for="(item, index) in hot_list" :key="index" @click="detail(item)">
  52. <image :src="ip + item.showPictures" class="bmg"></image>
  53. <view class="tit omit">{{ item.title }}</view>
  54. <view class="desc omit">{{ item.briefContent }}</view>
  55. </view>
  56. </view>
  57. <view class="it">
  58. <view class="v_title">
  59. <image src="../../static/lo.png" class="lo" mode="widthFix"></image>
  60. <view class="hd">攻略指南</view>
  61. <view class="more" @click="navigate('/pages/travel/introduction')">
  62. 更多
  63. <text class="arrow icon">&#xe62d;</text>
  64. </view>
  65. <view class="clear"></view>
  66. </view>
  67. <view class="jq_item flex" v-for="(item, index) in zn_list" :key="index" @click="detail(item)">
  68. <view class="f" style="height: 200px;border-radius: 5px;"><image :src="ip + item.showPictures" class="img"></image></view>
  69. <view class="f" style="padding: 10px;">
  70. <view class="tit omit">{{ item.title }}</view>
  71. <view class="str-summery">{{ item.briefContent }}</view>
  72. <view class="lx">浏览</view>
  73. </view>
  74. </view>
  75. </view>
  76. <u-back-top :scroll-top="scrollTop"></u-back-top>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. data() {
  82. return {
  83. ip: this.$http.urls.ip,
  84. scrollTop: 0,
  85. hot_list: [],
  86. zn_list: [],
  87. aboutUs: {}
  88. };
  89. },
  90. onPageScroll(e) {
  91. this.scrollTop = e.scrollTop;
  92. },
  93. onLoad(e) {
  94. this.getData();
  95. //uni.setStorageSync("user",{"searchValue":null,"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"params":{},"memberId":2,"name":"wx_5259072147","mobile":"13097850972","email":null,"registerTime":"2021-09-30","lastLoginTime":"2021-11-04","lastLoginIp":"127.0.0.1","loginNum":2,"unionid":null,"openid":"oHYRz5QirxH4-tmZWP0D84HDCv1Q","nickName":"西域男孩","avatarUrl":"https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJCNYUsTpmibmbGAJa6icVT1RZ5uNmusrtibIBgFu112ibe4f0jEvicZlWf0DkeS3l0YlnYkq178W2h8fw/132","gender":"1","province":"广西","city":"玉林","country":"中国","language":"zh_CN","lastLat":null,"lastLng":null,"isShop":2,"apiToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyIiwiaWF0IjoxNjM2NjE4Mjc2LCJleHAiOjE2MzcyMjMwNzZ9.c4reK2ce_SfKOaWuaK8CdWv2kLQl4xl92-HLfWuvLySaRNp1oBrW51KToxggbvOcFgRS0bBpl7UCSOMKIkff5A"})
  96. },
  97. methods: {
  98. getData() {
  99. this.$http.request({
  100. url: this.$http.urls.home,
  101. success: res => {
  102. this.hot_list = res.data.data.hot_list;
  103. this.zn_list = res.data.data.zn_list;
  104. this.aboutUs = res.data.data.aboutUs;
  105. uni.setStorageSync('aboutUs', this.aboutUs);
  106. }
  107. });
  108. },
  109. tab(url) {
  110. console.log('zxx');
  111. uni.switchTab({
  112. url: url
  113. });
  114. },
  115. //详情
  116. detail(item) {
  117. uni.navigateTo({ url: '/pages/travel/detail?id=' + item.contentId });
  118. },
  119. navigate(url) {
  120. uni.navigateTo({ url: url });
  121. }
  122. },
  123. //下拉刷新
  124. onPullDownRefresh() {
  125. setTimeout(() => {
  126. uni.stopPullDownRefresh();
  127. this.getData();
  128. }, 1000);
  129. }
  130. };
  131. </script>
  132. <style lang="scss">
  133. .page {
  134. padding: 10px;
  135. overflow-x: hidden;
  136. }
  137. .wd {
  138. margin-top: 28px;
  139. z-index: 111111;
  140. .qw {
  141. font-size: 25px;
  142. float: left;
  143. font-weight: bold;
  144. }
  145. .xs {
  146. margin-left: 45px;
  147. width: 100%;
  148. margin-top: 6px;
  149. font-size: 13px;
  150. }
  151. }
  152. .ms {
  153. font-size: 22px;
  154. font-weight: bold;
  155. margin-bottom: 15px;
  156. margin-top: 10px;
  157. .jb {
  158. float: right;
  159. font-size: 13px;
  160. font-weight: normal;
  161. margin-top: 6px;
  162. }
  163. }
  164. .top {
  165. image {
  166. width: 100%;
  167. height: 150px;
  168. border-radius: 5px;
  169. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  170. }
  171. }
  172. .a1 {
  173. padding: 5px 0px 5px 0px;
  174. image {
  175. border-radius: 5px;
  176. }
  177. }
  178. .it {
  179. margin-top: 15px;
  180. }
  181. .v_title {
  182. .hd {
  183. left: 25px;
  184. }
  185. }
  186. </style>