ReedawFoodApp/pageTwo/business/addDevice.vue

75 lines
1.3 KiB
Vue

<template>
<view class="content">
<view class="list">
<view class="item" v-for="(item,index) in list" @click="handlebinging(item)">
<image :src="item.pic"></image>
<view class="name">{{item.name}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: []
}
},
onLoad() {
this.handleUserDeviceList()
},
methods: {
handleUserDeviceList() {
let that = this
that.$model.getDeviceList({}).then(res => {
if (res.code != 0) {
that.$tools.msg(res.msg)
return
}
that.list = res.data.list
}).catch(err => {})
},
handlebinging(item) {
console.log("item", item)
uni.redirectTo({
url: "/pageTwo/business/search?id=" + item.id
})
}
}
}
</script>
<style scoped lang="scss">
.list {
width: 100%;
.item {
width: 33.3%;
padding-top: 8px;
display: flex;
float: left;
flex-direction: column;
box-sizing: border-box;
justify-content: center;
border-right: 1px solid #dfdfdf;
border-bottom: 1px solid #dfdfdf;
image {
width: 60px;
height: 60px;
margin: 0 auto 10px;
}
.name {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
margin-bottom: 10px;
}
}
}
</style>