当前位置:   article > 正文

音乐播放器微信小程序的设计与实现(附源码)_微信小程序开发音乐播放器_微信小程序音乐播放器源码

微信小程序音乐播放器源码

最后

我还为大家准备了一套体系化的架构师学习资料包以及BAT面试资料,供大家参考及学习

已经将知识体系整理好(源码,笔记,PPT,学习视频)

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

需要这份系统化的资料的朋友,可以点击这里获取

			this.user = res.data;
			this.btnColor = this.btnColor.sort(() => {
				return (0.5 - Math.random());
			});
			this.getThumbsup();
			let cleanType = uni.getStorageSync('pingluenStateState')
			if (cleanType) {
				uni.removeStorageSync('pingluenStateState')
				this.mescroll.num = 1
				this.upCallback(this.mescroll)
			}
		},
		destroyed: function() {
			//window.clearInterval(this.inter);
		},
		methods: {
            //打开评分留言窗口
            async onScoreOrComment() {
                this.commentData = null
                this.scoreData = 0
                this.$refs.deliver.open()
            },
            // 关闭评分留言窗口
            closeScoreOrComment() {
                this.$refs.deliver.close()
            },
            //提交数据
            async submitData() {
                if (1 == 2)
                    return this.$utils.msg('不会进入的地方,如果进来请联系管理员');
                else if (this.commentData == null || this.commentData == '')
                    return this.$utils.msg('留言不能为空');
                let data = {
                    yinyueId: this.yinyueId,
                    yonghuId: this.user.yonghuId,
					yinyueLiuyanPingfenNumber: this.scoreData,
                    yinyueLiuyanText: this.commentData,
                }
                await this.$api.save(`yinyueLiuyan`, data);
                this.$refs.deliver.close()
                this.mescroll.num = 1
                this.upCallback(this.mescroll)
            },
			//返回
			async fanhui(){
				this.$utils.tab("list")
			},
			//下载
			download(url) {
				let _this = this;
				uni.downloadFile({
					url: url,
					success: (res) => {
						if (res.statusCode === 200) {
							_this.$utils.msg('下载成功');
							// window.open(url);
						}
					}
				});
			},
			// 获取详情
			async init() {
				let res = await this.$api.detail('yinyue', this.yinyueId);
                this.detail = res.data
				this.detail.yinyueContent = this.detail.yinyueContent.replace("<img","<img class=\"daxiao\"").replace("src=\"upload/","src=\""+this.$base.url+"upload/");
				// 主图
				this.swiperList = this.detail.yinyuePhoto ? this.detail.yinyuePhoto.split(",") : [];
			},
			/\* && !nameList?seq\_contains('zuowei\_number')\*/
			// 收藏
			async getyinyueCollection() {
				let params = {
					page: 1,
					limit: 1,
					yinyueId: this.yinyueId,
					yinyueCollectionTypes:'1'
				}
				let res = await this.$api.page(`yinyueCollection`, params);
				if(res.data.list.length > 0){
					this.collectionFlag = res.data.list.length;
				}else{
					this.collectionFlag = 0
				}
			},
			async shoucang() {
				let _this = this;
				let params = {
					page: 1,
					limit: 1,
					yinyueId: _this.detail.id,
					yonghuId: _this.user.id,
					yinyueCollectionTypes:'1'
				}
				let res = await _this.$api.list(`yinyueCollection`, params);
				if (res.data.list.length == 1) {
					let yinyueCollectionId = res.data.list[0].id;
					uni.showModal({
						title: '提示',
						content: '是否取消',
						success: async function(res) {
							if (res.confirm) {
								await _this.$api.del('yinyueCollection', JSON.stringify([yinyueCollectionId]));
								_this.$utils.msg('取消成功');
								_this.getyinyueCollection();
							}
						}
					});
					return;
				}
				uni.showModal({
					title: '提示',
					content: '是否收藏',
					success: async function(res) {
						if (res.confirm) {
							await _this.$api.add('yinyueCollection', {
								yonghuId: _this.user.id,
								yinyueId: _this.detail.id,
								yinyueCollectionTypes:1
							});
							_this.$utils.msg('收藏成功');
							_this.getyinyueCollection();
						}
					}
				});
			},
			// mescroll组件初始化的回调,可获取到mescroll对象
			mescrollInit(mescroll) {
				this.mescroll = mescroll;
			},

			/\*下拉刷新的回调 \*/
			downCallback(mescroll) {
				this.hasNext = true
				mescroll.resetUpScroll()
			},

			/\*上拉加载的回调: mescroll携带page的参数, 其中num:当前页 从1开始, size:每页数据条数,默认10 \*/
			async upCallback(mescroll) {
				let res = await this.$api.list('yinyueLiuyan', {
					page: mescroll.num,
					limit: mescroll.size,
					yinyueId: this.yinyueId
				});
				// 如果是第一页数据置空
				if (mescroll.num == 1) this.commentList = [];
				this.commentList = this.commentList.concat(res.data.list);
				if (res.data.list.length == 0) this.hasNext = false;
				mescroll.endSuccess(mescroll.size, this.hasNext);
			},
			// 获取赞踩
			async getThumbsup() {
				let _this = this;
				let params = {
					page: 1,
					limit: 1,
					yinyueId: _this.detail.id,
					yonghuId: _this.user.id,
				}
				let res = await _this.$api.list(`yinyueCollection`, params);
				if (res.data.list.length > 0) {
					if (res.data.list[0].yinyueCollectionTypes == '2') {
						_this.thumbsupFlag = true;
					}
					if (res.data.list[0].yinyueCollectionTypes == '3') {
						_this.crazilyFlag = true;
					}
				}

			},
			// 点赞
			async zan() {
				let _this = this;
				let params = {
					page: 1,
					limit: 1,
					yinyueId: _this.detail.id,
					yonghuId: _this.user.id,
					yinyueCollectionTypes: '2',
				}
				let res = await _this.$api.list(`yinyueCollection`, params);
				if (res.data.list.length > 0) {
					let yinyueCollectionId = res.data.list[0].id;
					uni.showModal({
						title: '提示',
						content: '是否取消点赞',
						success: async function(res) {
							if (res.confirm) {
								await _this.$api.del('yinyueCollection', JSON.stringify([yinyueCollectionId]));
								_this.detail.zanNumber = parseInt(_this.detail.zanNumber) - 1;
								await _this.$api.update('yinyue', _this.detail);
								_this.$utils.msg('取消成功');
								_this.thumbsupFlag = false;
							}
						}
					});
					return;
				}
				uni.showModal({
					title: '提示',
					content: '是否点赞',
					success: async function(res) {
						if (res.confirm) {
							await _this.$api.add('yinyueCollection', {
								yonghuId: _this.user.id,
								yinyueId: _this.detail.id,
								yinyueCollectionTypes: '2'
							});
							_this.detail.zanNumber = parseInt(_this.detail.zanNumber) + 1;
							await _this.$api.update('yinyue', _this.detail);
							_this.$utils.msg('点赞成功');
							_this.thumbsupFlag = true;
						}
					}
				});
			},
			// 踩
			async cai() {
				let _this = this;
				let params = {
					page: 1,
					limit: 1,
					yinyueId: _this.detail.id,
					yonghuId: _this.user.id,
					yinyueCollectionTypes: '3',
				}
				let res = await _this.$api.list(`yinyueCollection`, params);
				if (res.data.list.length > 0) {
					let yinyueCollectionId = res.data.list[0].id;
					uni.showModal({
						title: '提示',
						content: '是否取消点踩',
						success: async function(res) {
							if (res.confirm) {
								await _this.$api.del('yinyueCollection', JSON.stringify([yinyueCollectionId]));
								_this.detail.caiNumber = parseInt(_this.detail.caiNumber) - 1;
								await _this.$api.update('yinyue', _this.detail);
								_this.$utils.msg('取消成功');
								_this.crazilyFlag = false;
							}
						}
					});
					return;
				}
				uni.showModal({
					title: '提示',
					content: '是否点踩',
					success: async function(res) {
						if (res.confirm) {
							await _this.$api.add('yinyueCollection', {
								yonghuId: _this.user.id,
								yinyueId: _this.detail.id,
								yinyueCollectionTypes: '3'
							});
							_this.detail.caiNumber = parseInt(_this.detail.caiNumber) + 1;
							await _this.$api.update('yinyue', _this.detail);
							_this.$utils.msg('点踩成功');
							_this.crazilyFlag = true;
						}
					}
				});
			},
			async baoming() {
				let _this = this;
				uni.showModal({
					title: '提示',
					content: '确定要报名么',
					success: async function(res) {
						if (res.confirm) {
							await _this.$api.add('yinyueYuyue', {
								yonghuId: _this.user.id,
								yinyueId: _this.detail.id,
							});
							_this.$utils.msg('报名成功');
							_this.$utils.jump('/pages/yinyueYuyue/list');
						}
					}
				});
			},
			async onErweima() {//打开模态框
				// this.erweimaText = "画师名称:["+this.detail.huashiName+"]所属画院:["+this.detail.huayuanName+"]画师称号:["+this.detail.huashiChenghao+"]画师性别:["+this.detail.sexValue+"]"
				this.erweimaText = "二维码内容";
				this.$refs.erweimaModal.open()
			},
			async closeErweima() {//关闭模态框
				this.$refs.erweimaModal.close()
			},
			async saveErweima() {//保存二维码
				uni.showLoading({title: '保存中',mask: true});
				const ref = this.$refs['qr'];
				ref.save({
					success: res => {
  • 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
  • 272
  • 273
  • 274
  • 275
  • 276
  • 277
  • 278
  • 279
  • 280
  • 281
  • 282
  • 283
  • 284
  • 285
  • 286
  • 287
  • 288
  • 289
  • 290
  • 291

最后

分享一些资料给大家,我觉得这些都是很有用的东西,大家也可以跟着来学习,查漏补缺。

《Java高级面试》

《Java高级架构知识》

《算法知识》

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

需要这份系统化的资料的朋友,可以点击这里获取

知识》**

[外链图片转存中…(img-SDg9Ol1f-1715720439009)]

《算法知识》

[外链图片转存中…(img-5Z6C6QoM-1715720439009)]

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

需要这份系统化的资料的朋友,可以点击这里获取

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号