基于vue+百度音樂(lè)api +express + mongodb + elementUi定義自己的音樂(lè)播放器(五)

接下來(lái)實(shí)現(xiàn)將歌曲信息添加到數(shù)據(jù)庫(kù)

1.我們先要定義好結(jié)構(gòu),在我們之前通過(guò)express xxx構(gòu)建的項(xiàng)目中定義一個(gè)models文件夾,創(chuàng)建一個(gè)music.js文件,寫(xiě)入以下代碼

var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// 定義表結(jié)構(gòu)
var musicObj = new Schema({
    song_id: String,
    author: String,
    title: String,
    hot: String
});
module.exports = mongoose.model('musics',musicObj);//暴露出去

2.在我們的routes文件夾下創(chuàng)建一個(gè)music.js文件,寫(xiě)入以下代碼

var express = require('express');
var Router = express.Router();
//引入剛剛暴露出來(lái)的表模型
var musicModel = require('../models/music');
//定義添加到收藏的接口
Router.post('/collect',function(req,res,next){
      // 這里是post請(qǐng)求,使用req.body來(lái)獲取前端傳過(guò)來(lái)的數(shù)據(jù)
      let musiCollect = new musicModel({
        song_id: req.body.song_id, 
        author: req.body.author,
        title: req.body.title,
        hot: req.body.hot
      });
      // 保存
      musiCollect.save(function(err,doc){
        if(err) {
            res.json({
                states: 0,
                msg: err.message
            });
        }else {
            res.json({
                states: 1,
                msg: '保存成功'
            });
        }
      });
});
//查詢(xún)收藏的數(shù)據(jù)
Router.post('/list',function(req,res,next){
    musicModel.find({},function(err,doc){
      if(err) {
          res.json({
              states: 0,
              msg: err.message
          });
      }else {
          res.json({
              states: 1,
              msg: doc //查詢(xún)到的數(shù)據(jù),以json格式返回
          });
      }
    });
});
module.exports = Router;//暴露出路由

3.在app.js里面引入暴露出的路由var musicRouter = require('./routes/music');
4.使用該路由app.use('/music', musicRouter);
5.這樣我們就可以在前端通過(guò)/music/collect來(lái)請(qǐng)求我們的添加收藏接口
6.這里需要注意的是前端的端口是8080,后端是3000所以存在跨域問(wèn)題,在vue項(xiàng)目的config文件夾下有個(gè)index.js文件,將反向代理加上

//這里的意思是凡是以/music開(kāi)頭的接口都會(huì)指向3000的端口
 proxyTable: {
      '/music/*':{
        target: 'http://localhost:3000'
      }
    },

7.注意的是這里的配置文件修改后的重啟服務(wù)
8.先引入import axios from "axios",這里不知道的可以先了解下vue的基礎(chǔ)知識(shí),你也可以用vuex來(lái)封裝這些請(qǐng)求,這里就不做介紹

// 添加到收藏
            addMusic(item) {
                    let datas  = {
                        song_id: item.song_id,
                        author: item.author,
                        title: item.title,
                        hot: item.hot
                    }
                axios.post('/music/collect',datas).then(data=>{
                    this.$message({
                      message: '收藏成功',
                      type: 'success'
                    });  
                 })
            },

9.如果你使用mongoVUE就可以看到數(shù)據(jù)已經(jīng)保存成功

22.png

這樣首頁(yè)的列表和查詢(xún)接口實(shí)現(xiàn)完了,添加到數(shù)據(jù)庫(kù)也實(shí)現(xiàn)了,下面是music.vue的全部代碼

<template>
    <div>
        <div class="bg_player" style="background-image: url(&quot;https://y.gtimg.cn/music/photo_new/T002R300x300M000000eilSQ2dYUzX.jpg?max_age=2592000&quot;);"></div>
        <div id="container">
            <!-- <div class="logo" title="? 老D在線(xiàn)音樂(lè)播放器">
                ? 莫沫達(dá)在線(xiàn)音樂(lè)播放器
            </div> -->
            <div class="left-col">
                <div class="overlay" style="background-color: rgb(255, 148, 92); opacity: 0.3;"></div>
                <div class="intrude-less">
                     <header class="inner" id="header">
                        <a href="/" class="profilepic">
                            <img src="http://www.shawnzeng.com/img/me.JPG" class="animated zoomIn">
                        </a>
                        <hgroup>
                            <h1 class="header-author" style="width:100%"><a href="/">莫沫達(dá)</a></h1>
                        </hgroup>
                        <p class="header-subtitle">? 在線(xiàn)音樂(lè)播放器</p>
                        <p  v-for="(item,index) in myType" :key="index" @click="personMusic(item.name)" :class="myChoose === item.name ? 'collectActive' : '' " class="header-subtitle collect">
                            <i :class="item.icon" style="padding-right:5px"></i>{{item.name}}
                        </p>
                        <!-- <audio src="http://sc1.111ttt.com/2017/4/05/10/298101104389.mp3" id="audio"></audio> collectActive-->
                        <!-- <div id="switch-area" class="switch-area">
                            <div class="switch-wrap">
                               <section class="switch-part switch-part1">
                                    <nav class="header-menu">
                                        <a href="javascript:void(0)" title="全部">全部</a>
                                        <a href="javascript:void(0)" title="語(yǔ)言">語(yǔ)言</a>
                                        <a href="javascript:void(0)" title="流派">流派</a>
                                        <a href="javascript:void(0)" title="主題">主題</a>
                                        <a href="javascript:void(0)" title="心情">心情</a>
                                        <a href="javascript:void(0)" title="場(chǎng)景">場(chǎng)景</a>
                                    </nav>
                                </section>
                            </div>
                        </div> -->
                    </header>
                </div>
            </div>
            <div class="pop-music" title="音樂(lè)"></div>
            <div class="mid-col" v-if="myChoose === '我的首頁(yè)'">
               <div class="myIndex">
                    <div class="mod_search" style="background-image:url(https://y.gtimg.cn/mediastyle/yqq/img/bg_search.jpg);">
                        <div class="search">
                            <el-input placeholder="請(qǐng)輸入內(nèi)容" v-model="searchParams.query" class="search-input">
                                <el-button slot="append" icon="el-icon-search" @click="searchMusic"></el-button>
                            </el-input>
                        </div>
                    </div>
                    <!-- <div class="index__hd">
                        <h3 class="index__tit"><i class="icon_txt">歌單推薦</i></h3>
                    </div> -->
                    <div style="margin-top: 20px;text-align: center;">
                        <el-radio-group v-model="musicType" size="small" @change="typeChange">
                            <el-radio-button label="1">新歌榜</el-radio-button>
                            <el-radio-button label="2">熱歌榜</el-radio-button>
                            <el-radio-button label="11">搖滾榜</el-radio-button>
                            <el-radio-button label="12">爵士</el-radio-button>
                            <el-radio-button label="16">流行</el-radio-button>
                            <el-radio-button label="21">歐美金曲榜</el-radio-button>
                            <el-radio-button label="22">經(jīng)典老歌榜</el-radio-button>
                            <el-radio-button label="23">情歌對(duì)唱榜</el-radio-button>
                            <el-radio-button label="24">影視金曲榜</el-radio-button>
                            <el-radio-button label="25">網(wǎng)絡(luò)歌曲榜</el-radio-button>
                        </el-radio-group>
                    </div>
                    <div class="htmleaf-container">
                        <div class="full-length" v-loading="loading">
                            <div class="container">
                                <div class="row" v-if="ifSearch">
                                    <div v-for="(item,index) in searchData" :key="index" class="col-md-4 col-sm-6" style="width:22%;float:left;margin-left:2%;margin-top:10px">
                                        <div class="pricingTable">
                                            <h3 class="title">{{item.songname}}</h3>
                                            <div class="price-value">
                                                <span class="month">{{item.artistname}}</span>
                                            </div>
                                            <ul class="pricing-content">
                                                <li>熱度:{{item.weight}}</li>
                                            </ul>
                                            <a href="#" class="pricingTable-signup red"><span>播放</span></a>
                                            <a href="#" class="pricingTable-signup red"><span>添加</span></a>
                                            <!-- <a href="#" class="pricingTable-signup red"><span>下載</span></a> -->
                                        </div>
                                    </div>
                                </div>
                                <!-- <h1 class="player_logo">QQ音樂(lè)</h1> -->
                                <!-- <el-table :data="tableData" style="width: 100%" height="500">
                                    <el-table-column fixed prop="name" align="center" label="歌曲" width="150"> </el-table-column>
                                    <el-table-column label="歌手" align="center" width="120">
                                        <template slot-scope="scope">
                                            <span>{{ scope.row.singer[0].name }}</span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="專(zhuān)輯" align="center" width="120">
                                        <template slot-scope="scope">
                                            <span>{{ scope.row.album.name }}</span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="time_public" label="發(fā)布日期" align="center" width="120"></el-table-column>
                                    <el-table-column align="center" label="時(shí)長(zhǎng)">
                                        <template slot-scope="scope">
                                            <span>{{ scope.row.interval }}</span>
                                        </template>
                                    </el-table-column>
                                </el-table> -->
                                <ul v-if="!ifSearch" class="geBan">
                                    <li v-for="(item,index) in jsonpData" :key="index">
                                        <div class="port-1 effect-1">
                                            <div class="image-box">
                                                <img :src="item.pic_premium" alt="pic_premium">
                                            </div>
                                            <div class="text-desc">
                                                <h3>{{item.title}}</h3>
                                                <p>歌手:{{item.author}} <span style="padding-left:5px">語(yǔ)言:{{item.language}}</span> </p>
                                                <p>熱度:{{item.hot}}</p>
                                                <a href="javascript:void(0)" @click="playMusic(item.song_id)" class="btn">播放</a>
                                                <a href="javascript:void(0)" @click="addMusic(item)" class="btn">添加</a>
                                                <a href="javascript:void(0)" @click="playMusic(item.song_id)" class="btn">下載</a>
                                            </div>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <!-- 列表結(jié)束 -->
                    <div class="pageMusic" v-if="jsonpData.length > 0 && !ifSearch">
                        <!-- <el-button-group>
                            <el-button type="primary" icon="el-icon-arrow-left" style="margin-right:10px" >上一頁(yè)</el-button>
                            <el-button type="primary">下一頁(yè)<i class="el-icon-arrow-right el-icon--right"></i></el-button>
                        </el-button-group> -->
                        <el-pagination
                            background
                            layout="prev, pager, next"
                            :current-page.sync="currentPage"
                            @current-change="handleCurrentChange"
                            :page-size="commonParams.size"
                            :total="totalMusic">
                        </el-pagination>
                    </div>
                    <div class="audioUrl">
                        <audio :src="musicUrl" controls="controls" autoplay="autoplay"></audio>
                    </div>
               </div>  
            </div>       
            <!-- 我的收藏  -->
            <div class="mid-col mycollectList" v-if="myChoose === '我的收藏'" style="background: #4A424A;">
                <my-collect></my-collect>
            </div>
        </div>
    </div>   
</template>
<style>
 .mod_search .el-input-group__append{
    text-align: center;
  }  
  .container .el-table::before{
    height: 0px;
  }
  .container .el-table__row:hover{
      cursor: pointer;
  }
</style>
<style scoped>
/* .mycollectList{
    background: #4A424A;
    opacity: .9;
} */
@import '../../../static/css/hover-effects.css';
.audioUrl{
    position: fixed;
    bottom:20px;
    right:5px;
    background:white;
    z-index: 5;
}
.bg_player {
    display: block;
}
.bg_player {
    display: none;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 50%;
    -webkit-filter: blur(65px);
    filter: blur(65px);
    opacity: .6;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}
.bg_player, .bg_player_mask {
    position: absolute;
    top: 0;
    left: 0;
}
.mod_search {
    position: relative;
    height: 147px;
    background-position: 50%;
    background-size: cover;
}
.mod_search .mod_search_input, .mod_search .search_input__input {
    width: 554px;
    height: 50px;
}
.search-input{
    position: absolute;
    width: 500px;
    left: 50%;
    margin-left: -250px;
    top: 50px;
}
.pageMusic{
    clear: both;
    text-align: center;
    margin-bottom: 80px;
}
.pageMusic .el-pager{
    padding: 10px;
    line-height: 12px;
    font-size: 15px;
}
.index__tit {
    display: block;
    margin: 0 auto;
    width: 196px;
    height: 40px;
    font-size: 28px
}
#container .mid-col {
    position: absolute;
    right: 0;
    min-height: 100%;
    /* background-color: #292a2b; */
    left: 310px;
    width: auto;
}
.pop-music {
    width: 36px;
    height: 36px;
    background: url(http://www.shawnzeng.com/img/player.png);
    cursor: pointer;
    position: absolute;
    top: 10px;
    left: 10px;
    border-bottom: none;
    -webkit-animation: spin 3s infinite linear;
    -moz-animation: spin 3s infinite linear;
    -ms-animation: spin 3s infinite linear;
    animation: spin 3s infinite linear;
    -moz-animation: spin 3s infinite linear;
    -ms-animation: spin 3s infinite linear;
    -webkit-animation: spin 3s infinite linear;
}
#header .switch-area {
    position: relative;
    width: 100%;
    overflow: hidden;
    min-height: 260px;
    font-size: 0.875rem;
}
#header .header-menu {
    margin-top: 20px;
    width: 100%;
    position: absolute;
    -webkit-transition: -webkit-transform 0.3s ease-in;
    -moz-transition: -moz-transform 0.3s ease-in;
    -ms-transition: -ms-transform 0.3s ease-in;
    transition: transform 0.3s ease-in;
}
a {
    text-decoration: none;
    outline-width: 0;
    color: #0bf;
    outline: none;
    cursor: pointer;
}
#header .header-menu a{
    display: inline-block;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 14px;
    margin: 2px;
    color: rgba(0,0,0,0.5);
    border: 2px solid rgba(0,0,0,0.1);
    -webkit-transition: all 0.3s ease-in-out;
    -webkit-transition: all 0.3s ease-in-out;
    -moz-transition: all 0.3s ease-in-out;
    -ms-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    font-style: normal;
}
#header .switch-area .switch-wrap {
    -webkit-transition: -webkit-transform 0.3s ease-in;
    -moz-transition: -moz-transform 0.3s ease-in;
    -ms-transition: -ms-transform 0.3s ease-in;
    transition: transform 0.3s ease-in;
    position: relative;
}
#header .switch-part1 {
    left: 0;
}

#header .switch-part {
    width: 100%;
    position: absolute;
}
#header .header-subtitle {
    text-align: center;
    color: #333;
    font-size: 0.875rem;
    line-height: 1.75;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.header-author {
    text-align: center;
    margin: 13px 0;
    font-family: Georgia, "Nimbus Roman No9 L", "Songti SC", "Courier New", Times, Georgia, serif;
    font-size: 30px;
    -webkit-transition: 0.3s;
    -moz-transition: 0.3s;
    -ms-transition: 0.3s;
    transition: 0.3s;
}
#header .profilepic {
    text-align: center;
    display: block;
    border: 5px solid #fff;
    border-radius: 50%;
    width: 128px;
    height: 128px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: #88acdb;
    -webkit-box-orient: horizontal;
    -webkit-box-pack: center;
    -webkit-box-align: center;
    text-align: center;
}
#header a {
    color: #000;
}
#header .profilepic img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
#container .left-col .intrude-less {
    width: 76%;
    text-align: center;
    margin: 112px auto 0;
}
#header {
    width: 100%;
}
.inner {
    width: 1000px;
    margin: 0 auto;
}
#container .left-col .overlay {
    width: 100%;
    height: 180px;
    background-color: #000;
    position: absolute;
    opacity: 0.7;
}
#container .left-col {
    background: rgba(255,255,255,0.85);
    width: 310px;
    position: fixed;
    opacity: 1;
    -webkit-transition: all 0.2s ease-in;
    -moz-transition: all 0.2s ease-in;
    -ms-transition: all 0.2s ease-in;
    transition: all 0.2s ease-in;
    height: 100%;
    /* overflow-y: auto; */
    -webkit-box-shadow: 3px 2px 8px #333 !important;
    -webkit-box-shadow: 3px 2px 8px #333 !important;
    box-shadow: 3px 2px 8px #333 !important;
}
#header .collect{
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #ccc;
}
#header .collectActive{
    background: #ccc;
    border: 1px solid #4d92d9
}
</style>
<script>
    import myCollect from './myCollect'
    import axios from "axios"
    export default{
        components: {
           myCollect
        },
        data(){
            return{
               ifSearch: false,
               autoplay:true,
               tableData: [],
               myChoose: '我的首頁(yè)',
               myType: [
                   {
                      name: '我的首頁(yè)',
                      icon: 'iconfont icon-shouyefill'
                   },
                   {
                      name: '我的收藏',
                      icon: 'iconfont icon-xiangqufill'
                   },
                   {
                      name: '我的喜歡',
                      icon: 'iconfont icon-zanfill'
                   }
               ],
               auObj: null,
               loading: false,
               musicUrl: '',
               musicType: '1',
               api: 'http://tingapi.ting.baidu.com/v1/restserver/ting',
               jsonpData: [],
               searchData: [],
               currentPage: 1,
               totalMusic: 0,
               dataObj: {
                    format: 'json',
                    calback: '',
                    from: 'webapp_music'
               },
               commonParams: {
                    method: 'baidu.ting.billboard.billList',
                    type: '',
                    size: 20,
                    offset: 0 
               },
               searchParams: {
                    method: 'baidu.ting.search.catalogSug',
                    query: ''
               },
               playParams: {
                    method: 'baidu.ting.song.play',
                    songid: ''
               }
            }
        },
        methods: {
            // 喜歡與收藏
            personMusic(type) {
              this.myChoose = type;
            },
            // 添加到收藏
            addMusic(item) {
                    let datas  = {
                        song_id: item.song_id ? item.song_id : item.songid,
                        author: item.author ? item.author : item.artistname,
                        title: item.title ? item.title : item.songname,
                        hot: item.hot ? item.hot : item.weight
                    }
                axios.post('/music/collect',datas).then(data=>{
                    this.$message({
                      message: '收藏成功',
                      type: 'success'
                    });  
                 })
            },
            //播放音樂(lè)
            playMusic(songId){
                this.playParams.songid = songId;
                const dataMusic = Object.assign({}, this.playParams, this.dataObj)
                this.$jsonp(this.api, dataMusic).then(json => {
                    this.musicUrl = json.bitrate.file_link;
                })
            },
           // 音樂(lè)類(lèi)型改變
           typeChange(val) {
              this.ifSearch = false;
              this.commonParams.offset = 0;
              this.currentPage = 1;
              this.getMusicList();
           },
           // 頁(yè)數(shù)改變
           handleCurrentChange(val) {
               window.scrollTo(0,0);// 請(qǐng)求成功滾動(dòng)條滾到頂部
               this.commonParams.offset = (parseInt(val)-1)*(this.commonParams.size);
               this.getMusicList();
           },
           searchMusic() {
              this.ifSearch = true;
              this.loading = true;
              const dataMusic = Object.assign({}, this.searchParams, this.dataObj)
              this.$jsonp(this.api, dataMusic).then(json => {               
                     this.searchData = json.song;
                       this.loading = false;
//                   this.totalMusic = parseInt(json.billboard.billboard_songnum);
              })
           },
           // 獲取音樂(lè)列表
           getMusicList() {
               this.loading = true;
               this.commonParams.type = this.musicType;
               const dataMusic = Object.assign({}, this.commonParams, this.dataObj)
               this.$jsonp(this.api, dataMusic).then(json => {               
                  this.jsonpData = json.song_list;
                    this.loading = false;
                  this.totalMusic = parseInt(json.billboard.billboard_songnum);
              })
           }
        },
        mounted(){
            this.getMusicList();
        }

    }
</script>

中間引入了一個(gè)hover-effects.css


.container{margin: 0 auto; max-width: 1160px;}
h2{color: #fff; float: left; width: 100%; font-size: 24px; font-weight: 400; text-align: center; padding: 50px 0 40px; position: relative; z-index: 50;}
h2 span{position: relative; padding-bottom: 10px;}
h2 span:after{content: ""; width: 50%; height: 3px; background-color: #fff; position: absolute; left: 25%; bottom: 0;}
*{margin: 0; padding: 0; box-sizing: border-box;}
.full-length img{max-width: 100%; vertical-align: middle;}
.full-length{width: 100%; float: left; padding-bottom: 30px;overflow: hidden;padding-left: 5%;}
ul{margin: 0 -1.5%;}
.geBan li[data-v-7c5ce25b] {
    float: left;
    width: 22%;
    margin: 10px 1%;
    list-style: none;
}

h3{font-size: 14px; margin: 5px 0 10px;}
p{font-weight: 300; line-height: 20px; font-size: 14px; margin-bottom: 15px;}
.btn{display: inline-block; padding: 5px 10px; font-size: 14px; color: #fff; border: 2px solid #4d92d9; background-color: #4d92d9; text-decoration: none; transition: 0.4s;}
.btn:hover{background-color: transparent; color: #4d92d9; transition: 0.4s;}
.text-desc{position: absolute; left: 0; top: 0; background-color: #fff; height: 100%; opacity: 0; width: 100%; padding: 20px;}
/*= Reset CSS End
================= *

/* effect-1 css */
.port-1{float: left; width: 100%; position: relative; overflow: hidden; text-align: center; border: 4px solid rgba(255, 255, 255, 0.9);}
.port-1 .text-desc{opacity: 0.9; top: -100%; transition: 0.5s; color: #000; padding: 55px 20px 20px;}
.port-1 img{transition: 0.5s;}
.port-1:hover img{transform: scale(1.2);}

.port-1.effect-1:hover .text-desc{top: 0;}

.port-1.effect-2 .text-desc{top: auto; bottom: -100%;}
.port-1.effect-2:hover .text-desc{bottom: 0;}

.port-1.effect-3 .text-desc{top: 50%; left: 50%; width: 0; height: 0; overflow: hidden; padding: 0;}
.port-1.effect-3:hover .text-desc{width: 100%; top: 0; left: 0; height: 100%; padding: 15px 20px 20px;}

/*= Media Screen CSS
==================== */
@media only screen and (max-width: 1090px){
    ul{width: 340px; margin: 0 auto;}
    li{width: 100%; margin: 20px 0;}
    .port-5.effect-1 {z-index: 19;}
}

@media only screen and (max-width: 360px){
    ul{width: 300px;}
    .port-1 .text-desc, 
    .port-1.effect-3:hover .text-desc, 
    .port-3.effect-1 .text-desc, 
    .port-3.effect-3 .text-desc,
    .port-4.effect-1 .text-desc,
    .port-4.effect-2 .text-desc,
    .port-4.effect-3 .text-desc, .port-8 .text-desc{padding: 20px;}
    .text-desc{padding: 7px;}
    .port-5.effect-1 .text-desc{padding: 13px 20px 20px 90px;}
    .port-5.effect-2 .text-desc{padding: 10px;}
    .port-5.effect-3 .text-desc{padding: 16px 90px 20px 20px;}
    .port-6.effect-1 .text-desc .btn, 
    .port-6.effect-2 .text-desc .btn,
    .port-6.effect-3 .text-desc .btn,
    .port-7.effect-1 .text-desc .btn,
    .port-7.effect-2 .text-desc .btn,
    .port-7.effect-3 .text-desc .btn,
    .port-8.effect-3 .text-desc .btn{display: none;}
    .port-6.effect-2 .text-desc{padding: 20px 120px 20px 20px;}
    .port-6.effect-3 .text-desc{padding: 75px 20px 10px;}
    .port-7.effect-1 .text-desc{padding: 12px 10px;}
    .port-8.effect-3 .text-desc{padding: 28px 70px 20px;}
}
/*= Media Screen CSS End
======================== */

.pricingTable{
    padding: 100px 0 20px;
    border: 1px solid #ddd;
    text-align: center;
    position: relative;
    transition: all 0.5s ease 0s;
}
.pricingTable .title{
    width: 100%;
    padding: 10px 0;
    margin: 0;
    background: #f7f2f0;
    border: 1px solid #ddd;
    font-size: 22px;
    font-weight: 800;
    color: #25283d;
    text-transform: uppercase;
    position: absolute;
    top: 30px;
    left: -15px;
    transition: all 0.5s ease 0s;
}
.pricingTable:hover,
.pricingTable:hover .title{ border: 1px solid #25283d; }
.pricingTable .title:after{
    content: "";
    border-top: 15px solid #d2d2d2;
    border-left: 15px solid transparent;
    border-bottom: 15px solid transparent;
    position: absolute;
    bottom: -30px;
    left: -1px;
    transition: all 0.5s ease 0s;
}
.pricingTable:hover .title:after{ border-top: 15px solid #000; }
.pricingTable .price-value{
    font-size: 50px;
    color: #25283d;
    margin-bottom: 40px;
}
.pricingTable .month{
    display: block;
    font-size: 14px;
    color: #bb69a2;
    line-height: 0;
    text-transform: uppercase;
}
.pricingTable .pricing-content{
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}
.pricingTable .pricing-content li{
    font-size: 17px;
    color: #848484;
    line-height: 45px;
    border-bottom: 1px solid #ddd;
}
.pricingTable .pricing-content li:nth-child(odd){ background: #f7f2f0; }
.pricingTable .pricing-content li:first-child{ border-top: 1px solid #ddd; }
.pricingTable .pricingTable-signup{
    display: inline-block;
    font-size: 18px;
    font-weight: 600;
    color: #25283d;
    text-transform: uppercase;
    position: relative;
    transition: all 0.3s ease 0s;
}
.pricingTable .pricingTable-signup:hover{ color: #bb69a2; }
.pricingTable .pricingTable-signup span{
    display: block;
    padding: 7px 30px;
}
.pricingTable .pricingTable-signup:before,
.pricingTable .pricingTable-signup:after,
.pricingTable .pricingTable-signup span:before,
.pricingTable .pricingTable-signup span:after{
    content: "";
    background: #bb69a2;
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.15s ease-in-out 0s;
}
.pricingTable .pricingTable-signup:before,
.pricingTable .pricingTable-signup:after{
    width: 2px;
    height: 0;
}
.pricingTable .pricingTable-signup span:before,
.pricingTable .pricingTable-signup span:after{
    width: 0;
    height: 2px;
    transition-delay: 0.15s;
}
.pricingTable .pricingTable-signup:after{
    top: auto;
    left: auto;
    right: 0;
    bottom: 0;
}
.pricingTable .pricingTable-signup span:before{
    right: 0;
    left: auto;
}
.pricingTable .pricingTable-signup span:after{
    top: auto;
    bottom: 0;
}
.pricingTable .pricingTable-signup:hover:before,
.pricingTable .pricingTable-signup:hover:after{
    height: 100%;
    transition-delay: 0.15s;
}
.pricingTable .pricingTable-signup:hover span:before,
.pricingTable .pricingTable-signup:hover span:after{
    width: 100%;
    transition-delay: 0s;
}
@media only screen and (max-width: 990px){
    .pricingTable{ margin-bottom: 30px; }
}              

下節(jié)將介紹收藏頁(yè)的數(shù)據(jù)展示以及歌詞滾動(dòng),進(jìn)度條樣式控制等

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • # 傳智播客vue 學(xué)習(xí)## 1. 什么是 Vue.js* Vue 開(kāi)發(fā)手機(jī) APP 需要借助于 Weex* Vu...
    再見(jiàn)天才閱讀 3,800評(píng)論 0 6
  • 1.unittest的屬性如下:['BaseTestSuite', 'FunctionTestCase', 'Sk...
    奕劍聽(tīng)雨閱讀 229評(píng)論 0 0
  • 第一次下載簡(jiǎn)書(shū)不知道怎么應(yīng)用呢,慢慢來(lái)吧。
    Nicole肉肉兒閱讀 195評(píng)論 0 0
  • 想到即將到來(lái)的一個(gè)人一個(gè)辦公室的工作,心里就莫名的興奮起來(lái)。平時(shí)四人一間屋的辦公環(huán)境實(shí)在是太吵啦。
    琦麗_819e閱讀 155評(píng)論 0 0
  • 您和我不過(guò)是萍水相逢,但自此,“馬姐”這個(gè)稱(chēng)呼卻響當(dāng)當(dāng)?shù)牧粼诹宋倚睦?,記憶里?“你怎么還有準(zhǔn)考證?”正在侍弄物品...
    靈魂的天空閱讀 994評(píng)論 1 5

友情鏈接更多精彩內(nèi)容