更新
This commit is contained in:
1 parent
f37f31627e
commit
7494f9f790
5 files changed
+137
-3
No files matched your search
+21
@@ -0,0 +1,21 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/unpackage
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
+7
-1
@@ -9,7 +9,13 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "test项目"
|
"navigationBarTitleText": "test项目"
|
||||||
}
|
}
|
||||||
}],
|
}, {
|
||||||
|
"path": "pages/room/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "room"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarTitleText": "uni-app",
|
"navigationBarTitleText": "uni-app",
|
||||||
|
|||||||
+14
-2
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<scroll-view scroll-y="true" class="list-scroll-box" :enable-flex="true">
|
<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>
|
<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.roomName}}</text>
|
||||||
<text class="item-text">{{item.roomHost}}</text>
|
<text class="item-text">{{item.roomHost}}</text>
|
||||||
@@ -80,6 +80,18 @@
|
|||||||
methods: {
|
methods: {
|
||||||
imageError(index) {
|
imageError(index) {
|
||||||
this.roomList[index].img = require('@/static/image/errImage.jpeg')
|
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 {
|
.list-item {
|
||||||
width: 197px;
|
width: 197px;
|
||||||
margin: 0 20px 30px 20px;
|
margin: 0 20px 35px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-image {
|
.item-image {
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="avatar-icon"></view>
|
||||||
|
<view class="avatar-image">
|
||||||
|
<image class="image-style" mode="aspectFill" :src="showImage" @error="imageError"></image>
|
||||||
|
</view>
|
||||||
|
<text class="avatar-text">{{name}}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
image: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
defaultImage: require('@/static/image/errImage.jpeg'),
|
||||||
|
imageErrorStatus: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
showImage() {
|
||||||
|
if (this.imageErrorStatus) {
|
||||||
|
returnthis.defaultImage
|
||||||
|
} else {
|
||||||
|
return this.image || this.defaultImage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
imageError() {
|
||||||
|
this.imageErrorStatus = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.avatar-icon {}
|
||||||
|
|
||||||
|
.avatar-image {
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-style {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-text {}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="top-block">
|
||||||
|
<view class="mike-site-block">
|
||||||
|
<view class="mike-site-top">
|
||||||
|
<avatar></avatar>
|
||||||
|
</view>
|
||||||
|
<view class="mike-site-main">
|
||||||
|
<avatar></avatar>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="bottom-block">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import avatar from './avatar.vue'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in new issue
Block a user