@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Eslint config file
|
||||
* Documentation: https://eslint.org/docs/user-guide/configuring/
|
||||
* Install the Eslint extension before using this feature.
|
||||
*/
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true,
|
||||
node: true,
|
||||
},
|
||||
ecmaFeatures: {
|
||||
modules: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
wx: true,
|
||||
App: true,
|
||||
Page: true,
|
||||
getCurrentPages: true,
|
||||
getApp: true,
|
||||
Component: true,
|
||||
requirePlugin: true,
|
||||
requireMiniProgram: true,
|
||||
},
|
||||
// extends: 'eslint:recommended',
|
||||
rules: {},
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
# music
|
||||
![](截图1.png)
|
||||
![](截图2.png)
|
||||
![](截图3.png)
|
||||
# music1
|
||||
|
||||
![](1.png)
|
||||
![](2.png)
|
||||
![](3.png)
|
@ -1,19 +0,0 @@
|
||||
// app.js
|
||||
App({
|
||||
onLaunch() {
|
||||
// 展示本地存储能力
|
||||
const logs = wx.getStorageSync('logs') || []
|
||||
logs.unshift(Date.now())
|
||||
wx.setStorageSync('logs', logs)
|
||||
|
||||
// 登录
|
||||
wx.login({
|
||||
success: res => {
|
||||
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
||||
}
|
||||
})
|
||||
},
|
||||
globalData: {
|
||||
userInfo: null
|
||||
}
|
||||
})
|
@ -1,13 +1,7 @@
|
||||
{
|
||||
"pages":[
|
||||
"pages/index/index",
|
||||
"pages/logs/logs"
|
||||
],
|
||||
"window":{
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"navigationBarTitleText": "音乐",
|
||||
"navigationBarTextStyle": "black"
|
||||
},
|
||||
"style": "v2",
|
||||
"sitemapLocation": "sitemap.json"
|
||||
"pages/test/test"
|
||||
]
|
||||
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
/* *app.wxss*
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 200rpx 0;
|
||||
box-sizing: border-box;
|
||||
} */
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 223 KiB |
After Width: | Height: | Size: 263 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 233 KiB |
After Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 375 KiB |
After Width: | Height: | Size: 137 KiB |
After Width: | Height: | Size: 8.3 KiB |
@ -1,6 +1,5 @@
|
||||
{
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"navigationBarTitleText": "音乐",
|
||||
"navigationBarTextStyle": "black",
|
||||
"usingComponents": {}
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
@ -1,55 +1,58 @@
|
||||
<!-- 轮播图 -->
|
||||
<scroll-view class="content-info" scroll-y>
|
||||
<view style="background: rgb(17, 17, 17);height: 1000px;">
|
||||
<swiper class="content-info-slide" indicator-color="rgba(255,255,255)" indicator-active-color="#fff" indicator-dots circular autoplay>
|
||||
<swiper class="content-info-slide" indicator-color="rgba(255,255,255,.5)" indicator-active-color="#fff" indicator-dots circular autoplay>
|
||||
<swiper-item>
|
||||
<image src="./images/banner.jpg"/>
|
||||
<image src="../images/banner1.jpg"/>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<image src="./images/banner.jpg"/>
|
||||
<image src="../images/banner2.jpg"/>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<image src="./images/banner.jpg"/>
|
||||
<image src="../images/banner3.jpg"/>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<!-- 功能按钮 -->
|
||||
<view class="content-info-portal">
|
||||
<view>
|
||||
<image src="./images/04.png"/>
|
||||
<image src="../images/04.png"/>
|
||||
<text>私人FM</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="./images/05.png"/>
|
||||
<image src="../images/05.png"/>
|
||||
<text>每日歌曲推荐</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="./images/06.png"/>
|
||||
<text>云音乐听歌榜</text>
|
||||
<image src="../images/06.png"/>
|
||||
<text>云音乐新歌榜</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content-info-list">
|
||||
<view class="list-title">推荐歌曲</view>
|
||||
<view class="list-inner">
|
||||
<view class="list-item">
|
||||
<image src="./images/cover.jpg"/><view>紫罗兰</view>
|
||||
<image src="../images/mjz.png"/>
|
||||
<view>稻香</view>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<image src="./images/cover.jpg"/><view>菩提树</view>
|
||||
<image src="../images/qlx.png"/>
|
||||
<view>七里香</view>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<image src="./images/cover.jpg"/><view>五月之歌</view>
|
||||
<image src="../images/syydxb.png"/>
|
||||
<view>夜曲</view>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<image src="./images/cover.jpg"/><view>欢乐颂</view>
|
||||
<image src="../images/mjz.png"/>
|
||||
<view>花海</view>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<image src="./images/cover.jpg"/><view>安魂曲</view>
|
||||
<image src="../images/ylxb.png"/>
|
||||
<view>一路向北</view>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<image src="./images/cover.jpg"/><view>摇篮曲</view>
|
||||
<image src="../images/yhm.png"/>
|
||||
<view>以父之名</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>已到达底部</view>
|
||||
</scroll-view>
|
||||
|
@ -1,3 +1,20 @@
|
||||
<view style="background: #ddd; color: #000;height: 100%;">
|
||||
play
|
||||
<!-- 播放器 -->
|
||||
<view class="content-play">
|
||||
<!--显示音乐信息-->
|
||||
<view class="content-play-info">
|
||||
<text>{{play.title}}</text>
|
||||
<view>—— {{play.singer}} ——</view>
|
||||
</view>
|
||||
<!-- 显示专辑封面 -->
|
||||
<view class="content-play-cover">
|
||||
<image src="{{play.coverImgUrl}}" sty1e="animation-play-state:{{state}}" />
|
||||
</view>
|
||||
<!--显示播放进度和时间-->
|
||||
<view class="content-play-progress">
|
||||
<text>{{play.currentTime}}</text>
|
||||
<view>
|
||||
<slider bindchange="sliderChange" activeColor="#d33a31" block-size="12" backgroundColor="#dadada" value="{{play. percent}}" />
|
||||
</view>
|
||||
<text>{{play.duration}}</text>
|
||||
</view>
|
||||
</view>
|
@ -1,3 +1,12 @@
|
||||
<view style="background: #eee; color: #000;height: 100%;">
|
||||
playllist
|
||||
<scroll-view cclass="content-playlist" scroll-y>
|
||||
<view class="playlist-item" wx:for="{{playlist}}" wx:key="id" bindtap="change" data-index="{{index}}">
|
||||
<image class="playlist-cover" src="{{item.converImgUrl}}" />
|
||||
<view class="playlist-info">
|
||||
<view class="playlist-info-title">{{item.title}}</view>
|
||||
<view cclass="playlist-info-singer">{{item.singer}}</view>
|
||||
</view>
|
||||
<view class="playlist-controls">
|
||||
<text wx:if="{{index==playIndex}}">正在播放</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
@ -1,18 +0,0 @@
|
||||
// logs.js
|
||||
const util = require('../../utils/util.js')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
logs: []
|
||||
},
|
||||
onLoad() {
|
||||
this.setData({
|
||||
logs: (wx.getStorageSync('logs') || []).map(log => {
|
||||
return {
|
||||
date: util.formatTime(new Date(log)),
|
||||
timeStamp: log
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "查看启动日志",
|
||||
"usingComponents": {}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<!--logs.wxml-->
|
||||
<view class="container log-list">
|
||||
<block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
|
||||
<text class="log-item">{{index + 1}}. {{log.date}}</text>
|
||||
</block>
|
||||
</view>
|
@ -1,8 +0,0 @@
|
||||
.log-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 40rpx;
|
||||
}
|
||||
.log-item {
|
||||
margin: 10rpx;
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
// pages/swiper.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
imgUrls:Array,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
currentIndex:0,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
swiperChange(e){
|
||||
this.setData({
|
||||
currentIndex:e.detail.cuurrent
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
@ -1,2 +0,0 @@
|
||||
<!--pages/swiper.wxml-->
|
||||
<text>pages/swiper.wxml</text>
|
@ -1 +0,0 @@
|
||||
/* pages/swiper.wxss */
|
@ -0,0 +1,68 @@
|
||||
// pages/test/test.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
scroll:function(e){
|
||||
console.log(e.detail)
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
@ -1,4 +1,3 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<scroll-view scroll-x scroll-y style="height:200px" bindscroll="srcll">
|
||||
<view style="width:200%;height:400px;background: #ccc"></view>
|
||||
</scroll-view>
|
||||
<view>缩放模式测试</view>
|
||||
<image style="width:200px;height:200px;background-color:#eee;"
|
||||
mode="scaleToFill" src="/image/test.jpj">
|
||||
</image>
|
||||
<view>裁剪模式测试</view>
|
||||
<image style="width:200px;height:200px;background-color:#eee;"
|
||||
mode="scaleToFill" src="/image/test.jpg">
|
||||
</image>
|
@ -0,0 +1 @@
|
||||
/* pages/test/test.wxss */
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
|
||||
"rules": [{
|
||||
"action": "allow",
|
||||
"page": "*"
|
||||
}]
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
const formatTime = date => {
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
|
||||
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
|
||||
}
|
||||
|
||||
const formatNumber = n => {
|
||||
n = n.toString()
|
||||
return n[1] ? n : `0${n}`
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
formatTime
|
||||
}
|