index.vue 1.6 KB

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