number_book.vue
2.6 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
<view>
<view v-if="!data_list || data_list.length == 0 " class="gloabal-empty-content-c">
<image class="gloabal-empty-image-c" src="../../static/empty-icon.jpeg"></image>
<text>暂无号码</text>
</view>
<view v-else v-for="(item,index) in data_list" class="item-c">
<view style="display: flex; justify-content: space-between;">
<view class="qihao_c">{{'双色球' + item.qihao + '期选号'}}</view>
<view class="type_name">{{item.typeName}}</view>
</view>
<view v-for="(item2, index2) in item.codes" style="margin-top: 12rpx; margin-bottom: 12rpx;">
<NumberQiu :data_info="item2"></NumberQiu>
</view>
<view style="display: flex; margin: 30rpx;">
<view @click="copyNumber(item.codes)">
复制选号
</view>
<view style="margin-left: 30rpx;" @click="deleteDate(index)">
删除选号
</view>
</view>
</view>
</view>
</template>
<script>
import NumberQiu from '../../components/NumberQiu.vue'
export default {
components: {
NumberQiu
},
data() {
return {
data_list: []
}
},
async onLoad() {
var temp_data = await uni.getStorageSync("number_book")
console.log(temp_data)
if (temp_data.length > 0) {
let temp_list = JSON.parse(temp_data)
temp_list.reverse()
this.data_list.push(...temp_list)
}
},
methods: {
copyNumber(codes) {
let value = JSON.stringify(codes)
uni.setClipboardData({
data: value,
success: function() {
uni.getClipboardData({
success: function(res) {
console.log(res.data);
uni.showToast({
title: "已复制到剪贴板",
icon: "none"
});
},
});
},
});
},
deleteDate(index) {
this.data_list.splice(index, 1);
let str = JSON.stringify(this.data_list)
uni.setStorageSync("number_book", str)
uni.showToast({
title: "已删除",
icon: "none"
});
}
}
}
</script>
<style>
.gloabal-empty-content-c {
min-height: 80vh;
}
.item-c {
line-height: 20px;
border-radius: 10px;
background-color: rgba(255, 245, 245, 1);
text-align: center;
padding: 30rpx;
margin: 30rpx;
}
.qihao_c {
color: rgba(16, 16, 16, 1);
font-size: 14px;
text-align: left;
}
.type_name {
padding: 6rpx 12rpx;
line-height: 20px;
border-radius: 4px;
background: linear-gradient(88.38deg, rgba(255, 111, 56, 1) 2.07%, rgba(255, 160, 75, 1) 102.13%);
color: rgba(255, 255, 255, 1);
font-size: 12px;
text-align: center;
font-family: -apple-system;
}
</style>