index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="list">
  3. <view class="msearch">
  4. <u-search v-model="param.title" :animation="true" action-text="取消" placeholder="输入搜索内容" shape="round" @search="search" @clear="clear"></u-search>
  5. </view>
  6. <view class="r_item" v-for="(item, index) in list" :key="index" @click="detail(item)">
  7. <image :src="ip + item.showPictures[0]" mode="aspectFill" class="pic"></image>
  8. <view class="con">
  9. <view class="title omit">{{ item.name }}</view>
  10. <view class="ms omit">
  11. <text class="icon">&#xe64a;</text>
  12. <text class="tti">{{ item.addres }}</text>
  13. </view>
  14. <view class="ms">
  15. <u-rate :count="5" v-model="value" active-color="#FF9800" :disabled="true"></u-rate>
  16. <text>5.0</text>
  17. </view>
  18. </view>
  19. <view class="clear"></view>
  20. </view>
  21. <view class="loading" v-if="list.length > 0"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  22. <view class="noLogin" v-if="list.length == 0">
  23. <image class="u-error-icon" src="../../../static/sj.png" mode="widthFix"></image>
  24. <view class="dll" @click="go()">暂无酒店</view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. ip: this.$http.urls.ip,
  33. value: 5,
  34. list: [],
  35. param: {},
  36. loadMore: false
  37. };
  38. },
  39. onLoad() {
  40. this.getData();
  41. },
  42. methods: {
  43. //获取数据
  44. getData() {
  45. this.$http.request({
  46. url: this.$http.urls.hotelList,
  47. success: res => {
  48. this.list = res.data.data;
  49. this.list.forEach(item => {
  50. item.showPictures = item.showPictures.split(',');
  51. });
  52. }
  53. });
  54. },
  55. //详情
  56. detail(item) {
  57. uni.navigateTo({ url: '/pages/shop/detail?shopId=' + item.shopId });
  58. }
  59. },
  60. //下拉刷新
  61. onPullDownRefresh() {
  62. setTimeout(() => {
  63. uni.stopPullDownRefresh();
  64. this.getData();
  65. }, 1000);
  66. }
  67. };
  68. </script>
  69. <style lang="scss">
  70. .list {
  71. padding: 10px 17px 70px 17px;
  72. }
  73. </style>