12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <template>
- <view>
- <view class="list">
- <view class="r_item" v-for="(item, index) in list" :key="index" @click="detail(item)">
- <image :src="ip + item.showPictures[0]" mode="aspectFill" class="pic"></image>
- <view class="con">
- <view class="title omit">{{ item.name }}</view>
- <view class="ms omit">{{ item.addres }}</view>
- <view class="ms">
- <u-rate :count="5" v-model="value" active-color="#FF9800" :disabled="true"></u-rate>
- <text>(5.0)</text>
- </view>
- </view>
- <view class="clear"></view>
- </view>
- <view class="loading" v-if="list.length >0"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
- <view class="noLogin" v-if="list.length == 0">
- <image class="u-error-icon" src="../../../static/sj.png" mode="widthFix"></image>
- <view class="dll" @click="go()">暂无酒店</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- ip: this.$http.urls.ip,
- value: 5,
- list: [],
- loadMore:false
- };
- },
- onLoad() {
- this.getData();
- },
- methods: {
- //获取数据
- getData() {
- this.$http.request({
- url: this.$http.urls.hotelList,
- success: res => {
- this.list = res.data.data;
- this.list.forEach(item => {
- item.showPictures = item.showPictures.split(',');
- });
- }
- });
- },
- //详情
- detail(item) {
- uni.navigateTo({ url: '/pages/shop/detail?shopId=' + item.shopId });
- }
- },
- //下拉刷新
- onPullDownRefresh() {
- setTimeout(() => {
- uni.stopPullDownRefresh();
- this.getData();
- }, 1000);
- }
- };
- </script>
- <style lang="scss">
- .list {
- padding: 0px 10px 70px 10px;
- }
- </style>
|