2022-07-20 03:29:47 星期三

Daily 部分
音乐没开自动播放
好困啊,明天还要练车,绝了
此页面随时消失嗷,说不定那天我又把服务器重启了,ngnix 又开不了了,这个页面就 g 了
图片放在我另外一个网站上了也是随时会 g 掉
明天还要处理一堆拍的照片


2022_07_19 施工进度

点击 http://vue_music.bandao.ltd 再点击歌单

网址是 http://vue_music.bandao.ltd/itemMusic?id=5349291073 (好像直接点击进不去耶,显示 404 我也没搞懂)

施工页面

今天做的事情:上面的歌单信息展示部分写了 200 多行,大部分都是样式,写得我自己都要看不懂了

已知 bug :

  1. 直接点击链接或者再次刷新会 404,但是本地运行没有这个情况
  2. 歌单描述部分的箭头需要更改样式
  3. pc 端显示大概率异常

需要努力的地方:

  1. 还需要了解一下 flex 布局
  2. 加快学习的速度啊
  3. (原神活动主要都肝完了要好好学习了)

下面是代码部分

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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<template>
<img :src="playlist.coverImgUrl" alt="" class="bgImg">
<van-row justify="space-between" align="center" class="itemMusicTop">
<van-col span="8" class="itemLeft">
<van-icon name="arrow-left" @click="$router.go(-1)" size="25" />
<span>歌单</span>
</van-col>
<van-col span="8" class="itemRight">
<van-icon name="search" class="search" size="25" />
<van-icon name="wap-nav" class="wap-nav" size="25" />
</van-col>
</van-row>
<van-row justify="space-between" align="center" class="itemMusicCenter">
<van-col span="10" class="imgBox">
<div class="imgBoxAndplayCount">
<span class="playCount">
<svg class="icon" aria-hidden="true">
<use xlink:href='#icon-bofang1'></use>
</svg>
{{ changeCount(playlist.playCount) }}
</span>
<img :src="playlist.coverImgUrl" alt="" class="coverImg">
</div>


</van-col>
<van-col span="14">
<van-row justify="center" class="listInfo">
<van-col span="30" class="title">{{ playlist.name }}</van-col>
<van-col span="30" class="creator">
<img :src="playlist.creator.avatarUrl" alt="">
<span>
{{ playlist.creator.nickname }}
<van-icon name="arrow" size="15" />
</span>
</van-col>
<van-col span="30" class="description">
<div class="text">
{{ playlist.description }}
</div>
<van-icon name="arrow" size="15" />
</van-col>
</van-row>
</van-col>
</van-row>
<van-row justify="space-between" align="center" class="functionButtons">
<van-col span="6">
<van-icon name="chat-o" size="30" />
<span>{{ playlist.commentCount }}</span>
</van-col>
<van-col span="6">
<van-icon name="share-o" size="30" />
<span>{{ playlist.shareCount }}</span>
</van-col>
<van-col span="6">
<van-icon name="down" size="30" />
<span>下载</span>
</van-col>
<van-col span="6">
<van-icon name="add-o" size="30" />
<span>多选</span>
</van-col>
</van-row>
</template>

<script>
import { getMusicItemList } from '@/request/api/item'
export default {
name: "itemMusicTop",
props: ['playlist'],
setup(props) {
// console.log(props);
// 通过props进行传值,判断如果没有,则从sessionStorage获取
if ((props.playlist.creator = "")) {
try {
console.log("here");
props.playlist.creator = JSON.parse(sessionStorage.getItem('itemDetail')).playlist.creator
}
catch {
console.log("here");
let response = getMusicItemList(playlistId)
playlist = response.data.playlist
}

}
function changeCount(num) {
if (num >= 100000000) {
// toFixed(1) 小数点后一位
return (num / 100000000).toFixed(1) + "亿"
} else if (num >= 10000) {
return (num / 10000).toFixed(1) + "万"
}
}
return {
changeCount
}
}

}
</script>

<style lang="less" scoped>
.itemMusicTop {
height: 50px;
padding: 10px;

.itemLeft,
.itemRight {

.van-icon {
color: #fff;
}
}

.itemLeft {
span {
position: relative;
font-size: 25px;
margin-left: 30px;
top: -2.5px;
color: #fff;
text-align: center;
}
}

.itemRight {
position: absolute;
right: 10px;

.search {
margin-right: 40px;
}
}

}

.bgImg {
position: fixed;
width: 100%;
height: 350px;
z-index: -1;
filter: blur(40px);
}

.itemMusicCenter {
margin-top: -15px;
padding: 10px;
height: 180px;

.imgBox {
padding: 5px;
width: 150px;
text-align: center;

.imgBoxAndplayCount {
position: relative;
height: 130px;
width: 130px;

.coverImg {
border-radius: 0.4rem;
height: 130px;
width: 130px;
}

.playCount {
position: absolute;
right: 0.1rem;
top: 0.1rem;
font-size: 0.25rem;
color: #ccc;
display: flex;
align-items: center;
background-color: rgba(0, 0, 0, 0.2);
margin: 4px;
padding: 3px;
border-radius: 0.4rem;

.icon {
width: 15px;
fill: #ccc;
}
}
}

}

.listInfo {
padding: 5px;
flex-flow: column;
width: 100%;
height: 150px;

.title {
font-weight: 900;
color: #fff;
font-size: .39rem;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}

.creator {
padding: 10px 5px;
color: #ccc;

img {
position: relative;
border-radius: 0.6rem;
height: 30px;
}

span {
position: absolute;
padding-left: 10px;
width: 160px;
font-size: .32rem;
line-height: 30px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;

}

.van-icon {
position: absolute;
bottom: 7.5px;
padding-left: 15px;
}


}

.description {
position: relative;
color: #ccc;
// width: 80%;
height: 80px;

.text {
position: absolute;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4;
overflow: hidden;
width: 85%;
}

.van-icon {
position: absolute;
right: 13px;
top: 27px;
}
}
}
}

.functionButtons {
color: #fff;
height: 1.5rem;
padding: 5px;
margin-bottom: 10px;

.van-col {
display: flex;
flex-direction: column;
align-items: center;
}

}
</style>