web123456

Music Website Design

Design Content:

Music website website is a website that provides online music playback and download music function, with three sections of music charts, singer charts, music classification, and provide query function, the requirements are as follows:

① Reasonable page layout, color harmony, correct links and illustrations, with a total of no less than 8 pages.

② The website is well structured, and the files in the website should be stored in appropriate folders according to the file types.

③ To use HTML, CSS andJavascriptskill

④ The following techniques are optional according to your actual mastery:

1)HTML5

2)Jquery

3)Bootstrap

  1. (or or)

Summary

Music website design is the design and development of a music broadcasting and music recommendation platform, the platform can be recommended according to the user's preferences for music, but also for the user to recommend the current popular songs and popularity ranking and other popular favorite songs recommended to the user to meet the user's music needs. html, css, andvue frameworkThe music broadcasting and music recommendation platform has been realized with such technologies as user login, song search, popular song recommendation, user favorite song recommendation, song ranking recommendation and other main functions.

Keywords:Music Web site; requirements analysis; system design

1. Description of the subject

Internet-based music dissemination has completely changed the original traditional audio dissemination channels and methods, convenient dissemination channels, efficient dissemination efficiency, conducive to the maximization of the use of social resources [5]. Due to the ease of use of the music platform, it is becoming more and more popular. However, this has also led to the proliferation of the number of music web platforms in China, the website in order to have their own stable users, the competition between the websites has never been more intense, in order to be able to play a leading role in China's many music platforms, the establishment of a music playback and music recommendation platform with its own characteristics, detailed features, practicality is particularly important.

The music website uses computers to manage the music, giving users a good visual presentation of the results, through the layout of the page elements so that users can directly make inquiriessearch functionAfter logging in, you can design your personal information and manage your favorite songs.

2 Applied Technology

This practical training is about the design of the music website, mainly to carry out the computer front-end content writing, front-end development is the process of creating WEB pages or APP and other front-end interface presented to the user, through HTML, CSS and JavaScript and the derivation of a variety of technologies, this paper is used in the VUE framework, the solution to the realization of the user interface of the Internet product interaction.

2.1HTML5

HTML5 is the latest version of the standard that defines HTML. The term is expressed through two different concepts: it is a new version of the HTML language with new elements, attributes and behaviors, and it has a larger set of technologies that allow to build more diverse and powerful websites and applications. This collection is sometimes called HTML5 and its friends, although most of the time it is abbreviated to just one word HTML5.

It enables you to more appropriately describe what your content is. It enables communication between you and the server through innovative new technological methods. It allows web pages to store data locally on the client side and run more efficiently offline. Makes video and audio first-class citizens in all of the Web. Provides a more discrete range of presentation options. Provides significant performance optimization and more efficient use of computer hardware. Handles a wide range of input and output devices and styles.

2.2 CSS

CSS stands for CascadingStyle Sheets, a set of rules for formatting and defining appearance styles.M. CSS plays an important role in the interface of Web applications:CSS simplifies the code of a Web page and improves the speed of access to the page. Because the external CSS file will be saved by the browser in the cache, thus speeding up the speed of the page display, but also reduces the amount of code uploaded; CSS makes the web page easier to maintain, its easy to modify the style of the site, only need to modify the CSS file can be changed throughout the site's type of features, avoiding a one-by-one web page modification, which greatly reduces the amount of work of the developer, and has been defined The css file can be reused, that is, reuse the style of the original web page; css makes the web page more powerful, the user can define the type of page display according to their own needs, as well as some of the page's special effects, etc.; at the same time, it will be displayed on the page with the display of the contents of the style of the separation of the two can be a separate file that is. html file and. css file, easy to developers of the modification and maintenance.

2.3 js

JavaScript is a scripting language that belongs to the network, has been widely used in Web development, often used to add a variety of dynamic functions to the web page, to provide users with a more smooth and beautiful browsing effect. Usually JavaScript is embedded in HTML to realize its function.

1. It is an interpreted scripting language.

2, mainly used to add interactive behavior to the HTML page language.

3, can be directly embedded in the HTML page, but written as a separate JS file is more conducive to the separation of the code, conducive to the maintenance of the latter.

4, cross-platform features, can be in the vast majority of browser support, you can run under a variety of platforms.

2.4 vue framework

Vue is a JavaScript framework for building user interfaces. It is built on standard HTML, CSS, and JavaScript, and provides a declarative, componentized programming model to help you develop user interfaces efficiently. Whether you have a simple or complex interface, Vue can handle it.

2.5 Database MYSQL

A database is a warehouse for storing data. In order to facilitate the management and storage of data, it stores the data on disk according to specific conditions. The data stored in a database can be efficiently processed and managed through a database management system. And MySQL database can be said to be the fastest running SQL language database. It has the advantages of fast, convenient, easy to use, efficient, secure, and high volume.

3 Requirements analysis

Requirements analysis is the process of determining what the system must do after thorough research and analysis to accurately understand the user's and project's specific requirements such as functionality, performance, reliability, etc., and to transform the user's non-formal requirements statement into a complete requirements definition. This system is a music website designed to provide a platform for users to listen to songs and recommend songs of their personal interest. After registering as a user of the system the user can play the songs in the system, look up the songs in the system's page search, the user can comment on the songs, the platform displays the popular songs to the user, recommends personalized songs for the user, and the user manages his information in the platform.

3.1 Functional analysis

The main function of the music playback and music recommendation platform is to satisfy users to listen to songs and recommend songs for users. Users can query the song information and evaluate the songs in the system to provide personalized service for users.

The main modules of this system:

1.User Login

Login is for the security of the system, the user enters the account password and then logs in to enter the main interface of the system.

2.Main interface

The main interface is the interface where the main functions of the system are displayed, providing the user with the core functions and guiding the user's operation.

3.Song Search

Song information can be searched.

4. Recommendations of popular songs

Suggest popular songs to users.

5. User favorite song recommendation

The platform recommends songs that the user might like.

6. Song Ranking Recommendations

A ranking of the platform songs to give users information on song selection.

7. Song reviews and presentations

Users can comment on songs and see other users' comments.

8. Song Category Display

Songs can be categorized and displayed for users to view.

3.2 Performance Analysis

Each user's own needs are different, considering the future development and simultaneous use of the system, the system is required to have the following performance:

1) The system should fulfill the user registration and login function, which is convenient for each user.

  1. The system should satisfy the user's search function and facilitate the user's choice of music.

4 System Design

System design is the process of designing a new system that maximizes the satisfaction of the required objectives based on the results of system analysis and the application of the ideas and methods of system science. System design includes determining system functions, design approaches and methods, generating an ideal system and making a draft, amending the draft by collecting information to generate an alternative design, decomposing the system into a number of subsystems, carrying out the detailed design of the subsystems and the total system and evaluating them, and justifying the system solution and making performance and effect predictions.

4.1 Overall Layout

The overall layout of the page is three parts: header, body and bottom, with three columns in the top, middle and bottom. The header navigation bar and the bottom are fixed, when clicking on the navigation bar of the home page, song list, singer, my music, search box, login and register, in the main part will display the corresponding content, the effect is shown in Figure 1 below.

Figure 4.1 Overall Layout

5 Website and Web Design Content

The internal part is mainly stated through the following modules: registration part, login part, navigation bar part, home part people, singer part, song part, my music seven major parts.

5.1 Registration component

First of all, the user can first register an account, through the form to write personal information, of which the user name, password, gender and birthday for the mandatory content, cell phone number, e-mail, the region for the non-required items.

Figure 5.1 Registration Chart

  1. <template>
  2. <div class="info">
  3. <p class="title"> edit profile</p>
  4. <hr/>
  5. <div class="personal">
  6. <el-form :model="registerForm" class="demo-ruleForm" label-width="80px">
  7. <el-form-item prop="username" label="username">
  8. <el-input v-model="" placeholder="username"></el-input>
  9. </el-form-item>
  10. <el-form-item prop="password" label="password">
  11. <el-input type="password" placeholder="cryptographic" v-model=""></el-input>
  12. </el-form-item>
  13. <el-form-item label="gender">
  14. <el-radio-group v-model="">
  15. <el-radio :label="0"> female</el-radio>
  16. <el-radio :label="1"> male</el-radio>
  17. </el-radio-group>
  18. </el-form-item>
  19. <el-form-item prop="phoneNum" label="cell phone">
  20. <el-input placeholder="cell phone" v-model="" ></el-input>
  21. </el-form-item>
  22. <el-form-item prop="email" label="mailbox">
  23. <el-input v-model="" placeholder="mailbox"></el-input>
  24. </el-form-item>
  25. <el-form-item prop="birth" label="birthday">
  26. <el-date-picker type="date" placeholder="Select date" v-model="" style="width: 100%;"></el-date-picker>
  27. </el-form-item>
  28. <el-form-item prop="introduction" label="signature">
  29. <el-input type="textarea" placeholder="sign (one's name with a pen etc)" v-model="" ></el-input>
  30. </el-form-item>
  31. <el-form-item prop="location" label="region">
  32. <el-select v-model="" placeholder="as suffix city name, means prefecture or county (area administered by a prefecture level city or county level city)" style="width:100%">
  33. <el-option
  34. v-for="item in cities"
  35. :key=""
  36. :label=""
  37. :value="">
  38. </el-option>
  39. </el-select>
  40. </el-form-item>
  41. </el-form>
  42. <div class="btn">
  43. <div @click="saveMsg()"> save </div>
  44. <div @click="goback">cancel</div>
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import { mapGetters } from 'vuex'
  51. import mixin from '../mixins'
  52. import { cities } from '../assets/data/form'
  53. import { updateUserMsg, getUserOfId } from '../api/index'
  54. export default {
  55. name: 'info',
  56. mixins: [mixin],
  57. data: function () {
  58. return {
  59. registerForm: { // register
  60. username: '',
  61. password: '',
  62. sex: '',
  63. phoneNum: '',
  64. email: '',
  65. birth: '',
  66. introduction: '',
  67. location: ''
  68. },
  69. cities: []
  70. }
  71. },
  72. computed: {
  73. ...mapGetters([
  74. 'userId'
  75. ])
  76. },
  77. created () {
  78. = cities
  79. },
  80. mounted () {
  81. ()
  82. },
  83. methods: {
  84. getMsg (id) {
  85. getUserOfId(id)
  86. .then(res => {
  87. = res[0].username
  88. = res[0].password
  89. = res[0].sex
  90. = res[0].phoneNum
  91. = res[0].email
  92. = res[0].birth
  93. = res[0].introduction
  94. = res[0].location
  95. = res[0].avator
  96. })
  97. .catch(err => {
  98. (err)
  99. })
  100. },
  101. goback () {
  102. this.$(-1)
  103. },
  104. saveMsg () {
  105. let d = new Date()
  106. let datetime = () + '-' + (() + 1) + '-' + ()
  107. let params = new URLSearchParams()
  108. ('id', )
  109. ('username', )
  110. ('password', )
  111. ('sex', )
  112. ('phone_num', )
  113. ('email', )
  114. ('birth', datetime)
  115. ('introduction', )
  116. ('location', )
  117. updateUserMsg(params)
  118. .then(res => {
  119. if ( === 1) {
  120. = false
  121. = true
  122. this.$('setUsername', )
  123. this.$({
  124. title: 'Edit Successful',
  125. showClose: true
  126. })
  127. setTimeout(function () {
  128. this.$(-1)
  129. }, 2000)
  130. } else {
  131. = false
  132. = true
  133. this.$({
  134. title: 'Edit Failure',
  135. showClose: true
  136. })
  137. }
  138. })
  139. .catch(err => {
  140. (err)
  141. })
  142. }
  143. }
  144. }
  145. </script>

5.2 Login section

First of all, the user can first register an account, through the form to write personal information, of which the user name, password, gender and birthday for the mandatory content, cell phone number, e-mail, the region for the non-required items.

Figure 5.2 Login Map

  1. <script>
  2. export default {
  3. data() {
  4. return {
  5. uname: '',
  6. upwd: '',
  7. isSee: false,
  8. tips: ''
  9. }
  10. },
  11. methods: {
  12. showInfo() {
  13. if ( === '' && === '') {
  14. = true;
  15. = 'User name password cannot be null'.
  16. return;
  17. } else {
  18. = false;
  19. if ( === 'admin' && === 'zzz') {
  20. this.$({
  21. path: '/index:id',
  22. name: 'A',
  23. props:true,
  24. })
  25. } else {
  26. = true;
  27. = "User name or password error".
  28. }
  29. }
  30. },
  31. }
  32. }
  33. </script>
  34. <template>
  35. <div class="main">
  36. <h2> login page </h2>
  37. <div class="form">
  38. User Name.
  39. <input type="text" name="username" v-model="uname"><br>
  40. Security&nbsp;&nbsp;&nbsp;Code.
  41. <input type="password" name="password" v-model="upwd"><br>
  42. <button v-on:click="showInfo">login</button><br>
  43. </div>
  44. <h2 :class="{ tip: isSee }" v-show="isSee">{{ tips }}</h2>
  45. </div>
  46. </template>
  47. The code for the navigation bar section is as follows:
  48. <template>
  49. <div class="the-header">
  50. <! --icon-->.
  51. <div class="header-logo" @click="goHome">
  52. <svg class="icon" aria-hidden="true">
  53. <use xlink:href="#icon-erji"></use>
  54. </svg>
  55. <span>{{musicName}}</span>
  56. </div>
  57. <ul class="navbar" ref="change">
  58. <li :class="{active: === activeName}" v-for="item in navMsg" :key="" @click="goPage(, )">
  59. {{}}
  60. </li>
  61. <li>
  62. <div class="header-search">
  63. <input type="text" placeholder="Search Music" @="goSearch()" v-model="keywords">
  64. <div class="search-btn" @click="goSearch()" >
  65. <svg class="icon" aria-hidden="true">
  66. <use xlink:href="#icon-sousuo"></use>
  67. </svg>
  68. </div>
  69. </div>
  70. </li>
  71. <li v-show="!loginIn" :class="{active: === activeName}" v-for="item in loginMsg" :key="" @click="goPage(, )">{{}}</li>
  72. </ul>
  73. <! --Setup->.
  74. <div class="header-right" v-show="loginIn">
  75. <div >
  76. <img :src="attachImageUrl(avator)" alt="">
  77. </div>
  78. <ul class="menu">
  79. <li v-for="(item, index) in menuList" :key="index" @click="goMenuList()">{{}}</li>
  80. </ul>
  81. </div>
  82. </div>
  83. </template>
  84. <script>
  85. import { mapGetters } from 'vuex'
  86. import mixin from '../mixins'
  87. import { navMsg, loginMsg, menuList } from '../assets/data/header'
  88. export default {
  89. name: 'the-header',
  90. mixins: [mixin],
  91. data () {
  92. return {
  93. musicName: 'Personal-music',
  94. navMsg: [], // left navigation bar
  95. loginMsg: [], // right navigation bar
  96. menuList: [], // user dropdown menu items
  97. keywords: ''
  98. }
  99. },
  100. computed: {
  101. ...mapGetters([
  102. 'userId',
  103. 'activeName',
  104. 'avator',
  105. 'username',
  106. 'loginIn'
  107. ])
  108. },
  109. created () {
  110. = navMsg
  111. = loginMsg
  112. = menuList
  113. },
  114. mounted () {
  115. ('#user').addEventListener('click', function (e) {
  116. ('.menu').('show')
  117. ()// The key is to stop bubbling
  118. }, false)
  119. // Stop events from bubbling when clicking inside the "menu". (so that the menu doesn't close when you click inside)
  120. ('.menu').addEventListener('click', function (e) {
  121. ()
  122. }, false)
  123. ('click', function () {
  124. ('.menu').('show')
  125. }, false)
  126. },
  127. methods: {
  128. goHome () {
  129. this.$({path: '/'})
  130. },
  131. goPage (path, value) {
  132. ('.menu').('show')
  133. (value)
  134. if (! && path === '/my-music') {
  135. ('Please log in first', 'warning')
  136. } else {
  137. this.$({path: path})
  138. }
  139. },
  140. changeIndex (value) {
  141. this.$('setActiveName', value)
  142. },
  143. goMenuList (path) {
  144. if (path === 0) {
  145. this.$('setIsActive', false)
  146. }
  147. ('.menu').('show')
  148. if (path) {
  149. this.$({path: path})
  150. } else {
  151. this.$('setLoginIn', false)
  152. this.$(0)
  153. }
  154. },
  155. goSearch () {
  156. this.$('setSearchword', )
  157. this.$({path: '/search', query: {keywords: }})
  158. }
  159. }
  160. }

5.3 Navigation bar section

The navigation part is the head part of the whole page, it will not change with the content, using tab switching, when clicking on the button in the navigation bar part, it will display the corresponding content in the home page.

Figure 5.3 Navigation bar diagram

  1. <template>
  2. <div class="the-header">
  3. <! --icon-->.
  4. <div class="header-logo" @click="goHome">
  5. <svg class="icon" aria-hidden="true">
  6. <use xlink:href="#icon-erji"></use>
  7. </svg>
  8. <span>{{musicName}}</span>
  9. </div>
  10. <ul class="navbar" ref="change">
  11. <li :class="{active: === activeName}" v-for="item in navMsg" :key="" @click="goPage(, )">
  12. {{}}
  13. </li>
  14. <li>
  15. <div class="header-search">
  16. <input type="text" placeholder="Search Music" @="goSearch()" v-model="keywords">
  17. <div class="search-btn" @click="goSearch()" >
  18. <svg class="icon" aria-hidden="true">
  19. <use xlink:href="#icon-sousuo"></use>
  20. </svg>
  21. </div>
  22. </div>
  23. </li>
  24. <li v-show="!loginIn" :class="{active: === activeName}" v-for="item in loginMsg" :key="" @click="goPage(, )">{{}}</li>
  25. </ul>
  26. <! --Setup->.
  27. <div class="header-right" v-show="loginIn">
  28. <div >
  29. <img :src="attachImageUrl(avator)" alt="">
  30. </div>
  31. <ul class="menu">
  32. <li v-for="(item, index) in menuList" :key="index" @click="goMenuList()">{{}}</li>
  33. </ul>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import { mapGetters } from 'vuex'
  39. import mixin from '../mixins'
  40. import { navMsg, loginMsg, menuList } from '../assets/data/header'
  41. export default {
  42. name: 'the-header',
  43. mixins: [mixin],
  44. data () {
  45. return {
  46. musicName: 'Personal-music',
  47. navMsg: [], // left navigation bar
  48. loginMsg: [], // right navigation bar
  49. menuList: [], // user dropdown menu items
  50. keywords: ''
  51. }
  52. },
  53. computed: {
  54. ...mapGetters([
  55. 'userId',
  56. 'activeName',
  57. 'avator',
  58. 'username',
  59. 'loginIn'
  60. ])
  61. },
  62. created () {
  63. = navMsg
  64. = loginMsg
  65. = menuList
  66. },
  67. mounted () {
  68. ('#user').addEventListener('click', function (e) {
  69. ('.menu').('show')
  70. ()// The key is to stop bubbling
  71. }, false)
  72. // Stop events from bubbling when clicking inside the "menu". (so that the menu doesn't close when you click inside)
  73. ('.menu').addEventListener('click', function (e) {
  74. ()
  75. }, false)
  76. ('click', function () {
  77. ('.menu').('show')
  78. }, false)
  79. },
  80. methods: {
  81. goHome () {
  82. this.$({path: '/'})
  83. },
  84. goPage (path, value) {
  85. ('.menu').('show')
  86. (value)
  87. if (! && path === '/my-music') {
  88. ('Please log in first', 'warning')
  89. } else {
  90. this.$({path: path})
  91. }
  92. },
  93. changeIndex (value) {
  94. this.$('setActiveName', value)
  95. },
  96. goMenuList (path) {
  97. if (path === 0) {
  98. this.$('setIsActive', false)
  99. }
  100. ('.menu').('show')
  101. if (path) {
  102. this.$({path: path})
  103. } else {
  104. this.$('setLoginIn', false)
  105. this.$(0)
  106. }
  107. },
  108. goSearch () {
  109. this.$('setSearchword', )
  110. this.$({path: '/search', query: {keywords: }})
  111. }
  112. }
  113. }
  114. </script>

5.4 Home page section

The main body of the home page is divided into three parts, the upper part of a rotating chart, the middle part is the list, when the user clicks on the list will jump to the list page at the same time at the bottom will play music, the lower part is the singer, when clicking on the singer page will jump to the singer page, displaying the singer's information, the effect of the picture shown below.

Figure 5.4 Home Page Map

5.5 Singer's section

By clicking on the singers on the home page or clicking on the singers button on the navigation bar, the user will be shown male singers, female singers and group singers.

Figure 5.5 Singer's diagram

  1. template>
  2. <div class="content">
  3. <h1 class="title">
  4. <slot name="title"></slot>
  5. </h1>
  6. <hr>
  7. <ul>
  8. <li class="list-title">
  9. <div class="song-item">
  10. <span class="item-index"></span>
  11. <span class="item-title"> song title</span>
  12. <span class="item-name"> artist</span>
  13. <span class="item-intro"> album</span>
  14. </div>
  15. </li>
  16. <li class="list-content" v-for="(item, index) in songList" :key="index">
  17. <div class="song-item" :class="{'is-play': id === }" @click="toplay(, , , index, , )">
  18. <span class="item-index">
  19. <span v-if="id !== ">{{index + 1}}</span>
  20. <svg v-if="id === " class="icon" aria-hidden="true">
  21. <use xlink:href="#icon-yinliang"></use>
  22. </svg>
  23. </span>
  24. <span class="item-title">{{replaceFName()}}</span>
  25. <span class="item-name">{{replaceLName()}}</span>
  26. <span class="item-intro">{{}}</span>
  27. </div>
  28. </li>
  29. </ul>
  30. </div>
  31. </template>
  32. <script>
  33. import { mapGetters } from 'vuex'
  34. import mixin from '../mixins'
  35. export default {
  36. name: 'album-content',
  37. mixins: [mixin],
  38. props: {
  39. songList: Array
  40. },
  41. computed: {
  42. ...mapGetters([
  43. 'id' // music id
  44. ])
  45. }
  46. }
  47. </script>

5.6 Song section

When the user clicks on a song or clicks on a song in the home page layout, it will show the song category Chinese Cantonese European American Japanese Korean Light Music BGM Instrumental.

  1. template>
  2. <div class="content">
  3. <h1 class="title">
  4. <slot name="title"></slot>
  5. </h1>
  6. <hr>
  7. <ul>
  8. <li class="list-title">
  9. <div class="song-item">
  10. <span class="item-index"></span>
  11. <span class="item-title"> song title</span>
  12. <span class="item-name"> artist</span>
  13. <span class="item-intro"> album</span>
  14. </div>
  15. </li>
  16. <li class="list-content" v-for="(item, index) in songList" :key="index">
  17. <div class="song-item" :class="{'is-play': id === }" @click="toplay(, , , index, , )">
  18. <span class="item-index">
  19. <span v-if="id !== ">{{index + 1}}</span>
  20. <svg v-if="id === " class="icon" aria-hidden="true">
  21. <use xlink:href="#icon-yinliang"></use>
  22. </svg>
  23. </span>
  24. <span class="item-title">{{replaceFName()}}</span>
  25. <span class="item-name">{{replaceLName()}}</span>
  26. <span class="item-intro">{{}}</span>
  27. </div>
  28. </li>
  29. </ul>
  30. </div>
  31. </template>
  32. <script>
  33. import { mapGetters } from 'vuex'
  34. import mixin from '../mixins'
  35. export default {
  36. name: 'album-content',
  37. mixins: [mixin],
  38. props: {
  39. songList: Array
  40. },
  41. computed: {
  42. ...mapGetters([
  43. 'id' // music id
  44. ])
  45. }
  46. }
  47. </script>

5.7 My Music Section

The music downloaded by the user is displayed in My Music with the name of the music, the name of the artist and the name of the album.

  1. <template>
  2. <div class="upload">
  3. <p class="title"> change avatar</p>
  4. <hr/>
  5. <div class="section">
  6. <el-upload
  7. drag
  8. :action="uploadUrl()"
  9. :show-file-list="false"
  10. :on-success="handleAvatarSuccess"
  11. :before-upload="beforeAvatarUpload">
  12. <i class="el-icon-upload"></i>
  13. <div class="el-upload__text"> drag the file here, or <em> change the avatar </em> </div>
  14. <div class="el-upload__tip" slot="tip"> Only jpg/png files can be uploaded, and no more than 10M</div>
  15. </el-upload>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import { mapGetters } from 'vuex'
  21. import mixin from '../mixins'
  22. export default {
  23. name: 'upload',
  24. mixins: [mixin],
  25. data () {
  26. return {
  27. imageUrl: ''
  28. }
  29. },
  30. computed: {
  31. ...mapGetters([
  32. 'userId'
  33. ])
  34. },
  35. methods: {
  36. uploadUrl () {
  37. return `${this.$}/user/avatar/update?id=${}`
  38. },
  39. handleAvatarSuccess (res, file) {
  40. if ( === 1) {
  41. = ()
  42. this.$('setAvator', )
  43. this.$message({
  44. message: 'Modification succeeded',
  45. type: 'success'
  46. })
  47. } else {
  48. ('Modification failed', 'error')
  49. }
  50. },
  51. beforeAvatarUpload (file) {
  52. const isJPG = === 'image/jpeg'
  53. const isLt2M = / 1024 / 1024 < 10
  54. if (!isJPG) {
  55. this.$('Upload avatar image in JPG format only!')
  56. }
  57. if (!isLt2M) {
  58. this.$('Upload avatar image size cannot exceed 10MB!')
  59. }
  60. return isJPG && isLt2M
  61. }
  62. }
  63. }
  64. </script>

6 Website deployment and testing

6.1 Search function

The search section searches by artist and song name, the data of the artist and song comes from the data database, if you can't find the corresponding artist or song in the search, it will pop up a warning that the artist or song doesn't exist.

6.1.1 Search by song

As follows, when you enter the song "World", it will show the details of the song, artist and album, the effect is as follows

Figure 6.1 Song Search Chart

  1. <template>
  2. <div class="search-song-Lists">
  3. <content-list :contentList="albumDatas" path="song-list-album"></content-list>
  4. </div>
  5. </template>
  6. <script>
  7. import ContentList from '../ContentList'
  8. import mixin from '../../mixins'
  9. import { getSongListOfLikeTitle } from '../../api/index'
  10. export default {
  11. name: 'search-song-Lists',
  12. mixins: [mixin],
  13. components: {
  14. ContentList
  15. },
  16. data () {
  17. return {
  18. albumDatas: []
  19. }
  20. },
  21. mounted () {
  22. ()
  23. },
  24. methods: {
  25. getSearchList () {
  26. if (!this.$) return
  27. getSongListOfLikeTitle(this.$)
  28. .then(res => {
  29. if (!) {
  30. ('No content for this song', 'warning')
  31. } else {
  32. = res
  33. }
  34. })
  35. }
  36. }
  37. }
  38. </script>

6.1.2 Search queries by artist

In the search box in the navigation bar, enter the name of the singer, it will display all the songs about the singer in the database, for example, search query singer "Zhang Jie", it will display all his songs, if not, it will be judged to pop-up warning, there is no such singer.

Figure 6.2 Singer search map

  1. <template>
  2. <div class="search-songs">
  3. <album-content :songList="listOfSongs"></album-content>
  4. </div>
  5. </template>
  6. <script>
  7. import { mapGetters } from 'vuex'
  8. import mixin from '../../mixins'
  9. import AlbumContent from '../AlbumContent'
  10. export default {
  11. name: 'search-songs',
  12. mixins: [mixin],
  13. components: {
  14. AlbumContent
  15. },
  16. computed: {
  17. ...mapGetters([
  18. 'listOfSongs' // music to store
  19. ])
  20. },
  21. mounted () {
  22. ()
  23. }
  24. }
  25. </script>

6.2 Playback section

When the user clicks on the music, the music will be played and stopped.

Figure 6.3 Playback diagram

  1. <template>
  2. <div class="play-bar" :class="{show:!toggle}">
  3. <div @click="toggle=!toggle" class="item-up" :class="{turn: toggle}">
  4. <svg class="icon" aria-hidden="true">
  5. <use xlink:href="#icon-jiantou-xia-cuxiantiao"></use>
  6. </svg>
  7. </div>
  8. <div class="kongjian" >
  9. <! --Previous song-->
  10. <div class="item" @click="prev">
  11. <svg class="icon" aria-hidden="true">
  12. <use xlink:href="#icon-ziyuanldpi"></use>
  13. </svg>
  14. </div>
  15. <! --play->
  16. <div class="item" @click="togglePlay">
  17. <svg class="icon" aria-hidden="true">
  18. <use :xlink:href="playButtonUrl"></use>
  19. </svg>
  20. </div>
  21. <! --Next song-->!
  22. <div class="item" @click="next">
  23. <svg class="icon" aria-hidden="true">
  24. <use xlink:href="#icon-ziyuanldpi1"></use>
  25. </svg>
  26. </div>
  27. <! --Song Pictures-->!
  28. <div class="item-img" @click="goPlayerPage">
  29. <img :src=picUrl alt="">
  30. </div>
  31. <! --Playback Progress-->!
  32. <div class="playing-speed">
  33. <! --playback start time->!
  34. <div class="current-time">{{ nowTime }}</div>
  35. <div class="progress-box">
  36. <div class="item-song-title">
  37. <div>{{}}</div>
  38. <div>{{}}</div>
  39. </div>
  40. <div ref="progress" class="progress" @mousemove="mousemove">
  41. <! --progress bar-->!
  42. <div ref="bg" class="bg" @click="updatemove">
  43. <div ref="curProgress" class="cur-progress" :style="{width: curLength+'%'}"></div>
  44. </div>
  45. <! --progress bar end -->!
  46. <! --dragging dots-->!
  47. <div ref="idot" class="idot" :style="{left: curLength+'%'}" @mousedown="mousedown" @mouseup="mouseup"></div>
  48. <! -- Dragged dots end -->!
  49. </div>
  50. </div>
  51. <! --playback end time-->!
  52. <div class="left-time">{{ songTime }}</div>
  53. </div>
  54. <! --volume-->
  55. <div class="item icon-volume" >
  56. <svg v-if="volume !== 0" class="icon" aria-hidden="true">
  57. <use xlink:href="#icon-yinliang1"></use>
  58. </svg>
  59. <svg v-else class="icon" aria-hidden="true">
  60. <use xlink:href="#icon-yinliangjingyinheix"></use>
  61. </svg>
  62. <el-slider class="volume" v-model="volume" :vertical="true"></el-slider>
  63. </div>
  64. <! --add-->.
  65. <div class="item" @click="collection">
  66. <svg :class="{ active: isActive }" class="icon" aria-hidden="true">
  67. <use xlink:href="#icon-xihuan-shi"></use>
  68. </svg>
  69. </div>
  70. <! --Downloads-->!
  71. <div class="item" @click="download">
  72. <svg class="icon" aria-hidden="true">
  73. <use xlink:href="#icon-xiazai"></use>
  74. </svg>
  75. </div>
  76. <! --Song List-->.
  77. <div class="item" @click="changeAside">
  78. <svg class="icon" aria-hidden="true">
  79. <use xlink:href="#icon-liebiao"></use>
  80. </svg>
  81. </div>
  82. </div>
  83. </div>
  84. </template>
  85. <script>
  86. import { mapGetters } from 'vuex'
  87. import mixin from '../mixins'
  88. import { setCollection, download } from '../api/index'
  89. export default {
  90. name: 'play-bar',
  91. mixins: [mixin],
  92. data () {
  93. return {
  94. tag: false,
  95. nowTime: '00:00',
  96. songTime: '00:00',
  97. curLength: 0, // position of the progress bar
  98. progressLength: 0, // progress bar length
  99. mouseStartX: 0, // drag start position
  100. toggle: true,
  101. volume: 50
  102. }
  103. },
  104. computed: {
  105. ...mapGetters([
  106. 'loginIn', // user login status
  107. 'userId', // user id
  108. 'isPlay', // Play status
  109. 'playButtonUrl', // icon for play state
  110. 'id', // music id
  111. 'url', // music address
  112. 'title', // song title
  113. 'artist', // singer's name
  114. 'picUrl', // song picture
  115. 'curTime', // current music playback position
  116. 'duration', // music duration
  117. 'listOfSongs', // list of current song lists
  118. 'listIndex', // the current song's position in the song list
  119. 'showAside', // whether or not to show the sidebar
  120. 'autoNext', // for triggering autoplay of the next song
  121. 'isActive'
  122. ])
  123. },
  124. watch: {
  125. // Toggle playback status icon
  126. isPlay (val) {
  127. if (val) {
  128. this.$('setPlayButtonUrl', '#icon-zanting')
  129. } else {
  130. this.$('setPlayButtonUrl', '#icon-bofang')
  131. }
  132. },
  133. volume () {
  134. this.$('setVolume', / 100)
  135. },
  136. // Start and end of playback time
  137. curTime () {
  138. = ()
  139. = ()
  140. // Move the progress bar
  141. = ( / ) * 100
  142. // Handle lyric placement and color
  143. },
  144. // Autoplay the next song
  145. autoNext () {
  146. ()
  147. }
  148. },
  149. mounted () {
  150. = this.$().width
  151. ('.icon-volume').addEventListener('click', function (e) {
  152. ('.volume').('show-volume')
  153. ()
  154. }, false)
  155. ('.volume').addEventListener('click', function (e) {
  156. ()
  157. }, false)
  158. ('click', function () {
  159. ('.volume').('show-volume')
  160. }, false)
  161. },
  162. methods: {
  163. // Download
  164. download () {
  165. download()
  166. .then(res => {
  167. let content =
  168. let eleLink = ('a')
  169. = `${}-${}.mp3`
  170. = 'none'
  171. // Character content to blob address
  172. let blob = new Blob([content])
  173. = (blob)
  174. // Trigger clicks
  175. (eleLink)
  176. ()
  177. // And then remove
  178. (eleLink)
  179. })
  180. .catch(err => {
  181. (err)
  182. })
  183. },
  184. changeAside () {
  185. let temp = !
  186. this.$('setShowAside', temp)
  187. },
  188. // Control music play/pause
  189. togglePlay () {
  190. if () {
  191. this.$('setIsPlay', false)
  192. } else {
  193. this.$('setIsPlay', true)
  194. }
  195. },
  196. // Parse the playback time
  197. formatSeconds (value) {
  198. let theTime = parseInt(value)
  199. let theTime1 = 0
  200. let theTime2 = 0
  201. if (theTime > 60) {
  202. theTime1 = parseInt(theTime / 60) // minutes
  203. theTime = parseInt(theTime % 60) // seconds
  204. // Whether more than one hour
  205. if (theTime1 > 60) {
  206. theTime2 = parseInt(theTime1 / 60) // hour
  207. theTime1 = 60 // minutes
  208. }
  209. }
  210. // How many seconds?
  211. if (parseInt(theTime) < 10) {
  212. var result = '0:0' + parseInt(theTime)
  213. } else {
  214. result = '0:' + parseInt(theTime)
  215. }
  216. // How many minutes
  217. if (theTime1 > 0) {
  218. if (parseInt(theTime) < 10) {
  219. result = '0' + parseInt(theTime)
  220. } else {
  221. result = parseInt(theTime)
  222. }
  223. result = parseInt(theTime1) + ':' + result
  224. }
  225. // How many hours
  226. if (theTime2 > 0) {
  227. if (parseInt(theTime) < 10) {
  228. result = '0' + parseInt(theTime)
  229. } else {
  230. result = parseInt(theTime)
  231. }
  232. result = parseInt(theTime2) + ':' + parseInt(theTime1) + ':' + result
  233. }
  234. return result
  235. },
  236. // Drag and drop to start
  237. mousedown (e) {
  238. =
  239. = true
  240. },
  241. // End of drag and drop
  242. mouseup () {
  243. = false
  244. },
  245. // Drag and Drop
  246. mousemove (e) {
  247. if (!) {
  248. return false
  249. }
  250. if () {
  251. let movementX = -
  252. let curLength = this.$().width
  253. // Calculate the percentage
  254. = this.$().width
  255. let newPercent = ((curLength + movementX) / ) * 100
  256. if (newPercent > 100) {
  257. newPercent = 100
  258. }
  259. = newPercent
  260. =
  261. // The corresponding playback time is introduced based on the percentage
  262. (newPercent)
  263. }
  264. },
  265. // Change song progress
  266. changeTime (percent) {
  267. let newCurTime = * (percent * 0.01)
  268. this.$('setChangeTime', newCurTime)
  269. },
  270. updatemove (e) {
  271. if (!) {
  272. let curLength = this.$
  273. = this.$().width
  274. let newPercent = (( - curLength) / ) * 100
  275. if (newPercent < 0) {
  276. newPercent = 0
  277. } else if (newPercent > 100) {
  278. newPercent = 100
  279. }
  280. = newPercent
  281. (newPercent)
  282. }
  283. },
  284. // Previous song
  285. prev () {
  286. if ( !== -1 && > 1) {
  287. if ( > 0) {
  288. this.$('setListIndex', - 1)
  289. ([].url)
  290. } else {
  291. this.$('setListIndex', - 1)
  292. ([].url)
  293. }
  294. }
  295. },
  296. // Next
  297. next () {
  298. if ( !== -1 && > 1) {
  299. if ( < - 1) {
  300. this.$('setListIndex', + 1)
  301. ([].url)
  302. } else {
  303. this.$('setListIndex', 0)
  304. ([0].url)
  305. }
  306. }
  307. },
  308. // Selected for playback
  309. toPlay (url) {
  310. if (url && url !== ) {
  311. this.$('setId', [].id)
  312. this.$('setUrl', this.$ + url)
  313. this.$('setpicUrl', this.$ + [].pic)
  314. this.$('setTitle', ([].name))
  315. this.$('setArtist', ([].name))
  316. this.$('setLyric', ([].lyric))
  317. }
  318. },
  319. goPlayerPage () {
  320. this.$({path: `/lyric/${}`})
  321. },
  322. collection () {
  323. if () {
  324. var params = new URLSearchParams()
  325. ('userId', )
  326. ('type', 0) // 0 for the song, 1 for the song list
  327. ('songId', )
  328. setCollection(params)
  329. .then(res => {
  330. if ( === 1) {
  331. this.$('setIsActive', true)
  332. ('Favorite Success', 'success')
  333. } else if ( === 2) {
  334. ('Bookmarked', 'warning')
  335. } else {
  336. this.$({
  337. title: 'Favorite Failure',
  338. showClose: false
  339. })
  340. }
  341. })
  342. .catch(err => {
  343. (err)
  344. })
  345. } else {
  346. ('Please log in first', 'warning')
  347. }
  348. }
  349. }
  350. }
  351. </script>

7 Summary

In this course design, through my own analysis and design of related systems, I have gained a deeper understanding of information systems analysis and design and become more comfortable with the use of PD modeling tools. In the course design process, the first step is to start from the requirements analysis, in-depth analysis of the system. Requirements analysis is a prerequisite, only a good analysis, the design of the system can meet the user's needs, the content of the front-end html, css, js preliminary understanding by consulting the relevant book information, as well as recalling the contents of the previous learning, the use of vue framework to complete the training, summed up a lot of valuable and meaningful learning experience, but also allows me to consolidate the knowledge I have learned before and further improve the understanding of the knowledge I have learned now. Improve my understanding of what I've learned now, and make me realize my shortcomings in my previous learning. I need to continue to work hard in the future.

bibliography

[1] H. Wang, Y. Liu. Information system analysis and design [M]. Jiangsu: Nanjing University Press, 2021.

[2] J.L. Zhang. Database principles and applications [M]. Beijing:Tsinghua University Press, 2010.

[3] Xuelan Miao, Ruixin Liu, Song Ge. Principles of database systems [M]. Beijing: Machinery Industry Press, 2007.

[4] Liu Yajun, Gao Lisha. Database Design and Applications [M]. Beijing: Tsinghua University Press, 2007.

[5] He, Dongjian. Web Design and Web Programming [M]. Xi'an: Xi'an Jiaotong University Press, 2004.