forked from hzbnb/affair
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclub.vue
101 lines (99 loc) · 1.75 KB
/
club.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<template>
<view class="content">
<view class="block" v-for="(arr, index) of arrs" :key="index">
<view class="title">{{ arr.title }}</view>
<view class="list">
<view class="list_item" v-for="(list, ind) of arr.lists" :key="ind" @click="showqq(list)">
<img :src="list.img" alt="" srcset="" />
<text>{{ list.name }}</text>
</view>
</view>
</view>
</view>
</template>
<script>
const db = uniCloud.database();
export default {
data() {
return {
arrs: []
};
},
methods: {
showqq(e) {
console.log(e);
uni.showModal({
content: 'QQ群:' + e.qq,
confirmText: '复制群号',
success: res => {
if (res.confirm) {
uni.setClipboardData({
data: e.qq, //要被复制的内容
success: () => {
//复制成功的回调函数
uni.showToast({
//提示
title: '复制成功',
duration:1000
});
}
});
}
}
});
}
},
onLoad() {
uni.showLoading();
db.collection('club')
.get()
.then(res => {
this.arrs = res.result.data;
uni.hideLoading();
});
}
};
</script>
<style lang="scss">
.content {
width: 100%;
min-height: 100%;
padding: 18rpx;
box-sizing: border-box;
}
.block {
.title {
font-size: 32rpx;
letter-spacing: 3rpx;
font-weight: bolder;
padding: 20rpx 0;
}
.list {
padding: 10rpx;
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
}
.list_item {
width: 23%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 20rpx 0;
img {
width: 88rpx;
height: 88rpx;
border-radius: 100%;
}
text {
width: 90%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 28rpx;
text-align: center;
}
}
</style>