index2.vue 5.5 KB

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