index2.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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. </view>
  18. <view class="top"><image :src="aboutUs.bgImg1 ? ip + aboutUs.bgImg1 : '../../static/loading.gif'" mode="aspectFill"></image></view>
  19. <view class="flex menu">
  20. <view class="f" @click="tab('/pages/travel/index')">
  21. <image src="../../static/icon3.png" mode="widthFix" class="icon1"></image>
  22. <view class="title">景区介绍</view>
  23. </view>
  24. <view class="f" @click="navigate('/pages/travel/introduction')">
  25. <image src="../../static/icon1.png" mode="widthFix" class="icon1"></image>
  26. <view class="title">旅游攻略</view>
  27. </view>
  28. <view class="f" @click="navigate('/pages/government/activity')">
  29. <image src="../../static/icon2.png" mode="widthFix" class="icon1"></image>
  30. <view class="title">热门活动</view>
  31. </view>
  32. <view class="f" @click="navigate('/pages/government/index')">
  33. <image src="../../static/icon4.png" mode="widthFix" class="icon1"></image>
  34. <view class="title">党政服务</view>
  35. </view>
  36. </view>
  37. <view class="flex" style="margin-top: 10px;">
  38. <view class="f" style="padding-right:8px;">
  39. <image
  40. @click="navigate('/pages/travel/detail?id=41')"
  41. :src="aboutUs.bgImg1 ? ip + aboutUs.bgImg2 : '../../static/loading.gif'"
  42. style="height: 164px;width: 100%;border-radius: 5px;"
  43. mode="aspectFill"
  44. /></image>
  45. </view>
  46. <view class="f">
  47. <image
  48. @click="navigate('/pages/travel/detail?id=42')"
  49. :src="aboutUs.bgImg1 ? ip + aboutUs.bgImg3 : '../../static/loading.gif'"
  50. style="height: 77px;width: 100%;border-radius: 5px;"
  51. mode="aspectFill"
  52. ></image>
  53. <image
  54. @click="navigate('/pages/other/feedback')"
  55. :src="aboutUs.bgImg1 ? ip + aboutUs.bgImg4 : '../../static/loading.gif'"
  56. style="height: 77px;width: 100%;margin-top: 5px;border-radius: 5px;"
  57. mode="aspectFill"
  58. ></image>
  59. </view>
  60. </view>
  61. <view class="it">
  62. <view class="v_title">
  63. <image src="../../static/lo.png" class="lo" mode="widthFix"></image>
  64. <view class="hd">热门景区</view>
  65. <view class="more" @click="tab('/pages/travel/index')">
  66. 更多
  67. <text class="arrow icon">&#xe62d;</text>
  68. </view>
  69. <view class="clear"></view>
  70. </view>
  71. <view class="jq_item" v-for="(item, index) in hot_list" :key="index" @click="detail(item)">
  72. <image :src="ip + item.showPictures" class="bmg" mode="aspectFill"></image>
  73. <view class="cons">
  74. <view class="tit omit">{{ item.title }}</view>
  75. <view class="desc omit">{{ item.briefContent }}</view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="it">
  80. <view class="v_title">
  81. <image src="../../static/lo.png" class="lo" mode="widthFix"></image>
  82. <view class="hd">攻略指南</view>
  83. <view class="more" @click="navigate('/pages/travel/introduction')">
  84. 更多
  85. <text class="arrow icon">&#xe62d;</text>
  86. </view>
  87. <view class="clear"></view>
  88. </view>
  89. <view class="jq_item flex" v-for="(item, index) in zn_list" :key="index" @click="detail(item)">
  90. <view class="f" style="height: 213px;border-radius: 5px 0px 0px 5px;"><image :src="ip + item.showPictures" mode="aspectFill"></image></view>
  91. <view class="f" style="padding: 10px;">
  92. <view class="cons">
  93. <view class="tit omit">{{ item.title }}</view>
  94. <view class="str-summery">{{ item.briefContent }}</view>
  95. <view class="lx">浏览</view>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. <u-back-top :scroll-top="scrollTop"></u-back-top>
  101. </view>
  102. </template>
  103. <script>
  104. export default {
  105. data() {
  106. return {
  107. ip: this.$http.urls.ip,
  108. scrollTop: 0,
  109. hot_list: [],
  110. zn_list: [],
  111. aboutUs: {},
  112. weather: { tem: '0', wea: '晴', win: '北风', win_speed: '0级', win_meter: '0km/h' }
  113. };
  114. },
  115. onPageScroll(e) {
  116. this.scrollTop = e.scrollTop;
  117. },
  118. onLoad(e) {
  119. this.getData();
  120. this.getWeather();
  121. //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"})
  122. },
  123. methods: {
  124. getWeather() {
  125. //天气接口
  126. uni.request({
  127. url: this.$http.urls.weather,
  128. success: res => {
  129. if (!res.data.errcode) {
  130. this.weather = res.data;
  131. }
  132. }
  133. });
  134. },
  135. getData() {
  136. this.$http.request({
  137. url: this.$http.urls.home,
  138. success: res => {
  139. this.hot_list = res.data.data.hot_list;
  140. this.zn_list = res.data.data.zn_list;
  141. this.aboutUs = res.data.data.aboutUs;
  142. uni.setStorageSync('aboutUs', this.aboutUs);
  143. }
  144. });
  145. },
  146. tab(url) {
  147. uni.switchTab({
  148. url: url
  149. });
  150. },
  151. //详情
  152. detail(item) {
  153. uni.navigateTo({ url: '/pages/travel/detail?id=' + item.contentId });
  154. },
  155. navigate(url) {
  156. uni.navigateTo({ url: url });
  157. },
  158. //拨打求助电话
  159. call() {
  160. this.$http.call(this.aboutUs);
  161. }
  162. },
  163. //下拉刷新
  164. onPullDownRefresh() {
  165. setTimeout(() => {
  166. uni.stopPullDownRefresh();
  167. this.getData();
  168. }, 1000);
  169. }
  170. };
  171. </script>
  172. <style lang="scss">
  173. .page {
  174. padding: 10px;
  175. overflow-x: hidden;
  176. }
  177. .wd {
  178. margin-top: 28px;
  179. z-index: 111111;
  180. .qw {
  181. font-size: 25px;
  182. float: left;
  183. font-weight: bold;
  184. }
  185. .xs {
  186. margin-left: 45px;
  187. width: 100%;
  188. font-size: 13px;
  189. line-height: 20px;
  190. }
  191. }
  192. .ms {
  193. font-size: 20px;
  194. font-weight: bold;
  195. margin-bottom: 15px;
  196. margin-top: 10px;
  197. .jb {
  198. float: right;
  199. font-size: 13px;
  200. font-weight: normal;
  201. margin-top: 6px;
  202. }
  203. }
  204. .top {
  205. image {
  206. width: 100%;
  207. height: 150px;
  208. border-radius: 5px;
  209. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  210. }
  211. }
  212. .a1 {
  213. border-radius: 3px;
  214. }
  215. .it {
  216. margin-top: 15px;
  217. }
  218. .v_title {
  219. .hd {
  220. left: 25px;
  221. }
  222. }
  223. </style>