更新
This commit is contained in:
1 parent
f37f31627e
commit
7494f9f790
5 files changed
+137
-3
No files matched your search
+14
-2
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<scroll-view scroll-y="true" class="list-scroll-box" :enable-flex="true">
|
||||
<view class="list-item" v-for="(item,index) in roomList" :key="item.id">
|
||||
<view class="list-item" v-for="(item,index) in roomList" :key="item.id" @click="toRoomAction(item)">
|
||||
<image class="item-image" mode="aspectFill" :src="item.img" @error="imageError(index)"></image>
|
||||
<text class="item-text">{{item.roomName}}</text>
|
||||
<text class="item-text">{{item.roomHost}}</text>
|
||||
@@ -80,6 +80,18 @@
|
||||
methods: {
|
||||
imageError(index) {
|
||||
this.roomList[index].img = require('@/static/image/errImage.jpeg')
|
||||
},
|
||||
toRoomAction(item) {
|
||||
console.log(item)
|
||||
uni.navigateTo({
|
||||
url: '/pages/room/index?id=' + item.id,
|
||||
success() {
|
||||
console.log('success')
|
||||
},
|
||||
fail(err) {
|
||||
console.log('fail',err)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,7 +111,7 @@
|
||||
}
|
||||
.list-item {
|
||||
width: 197px;
|
||||
margin: 0 20px 30px 20px;
|
||||
margin: 0 20px 35px 20px;
|
||||
}
|
||||
|
||||
.item-image {
|
||||
|
||||
Reference in new issue
Block a user