index2.vue 6.6 KB

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