Browse Source

init

pull/19/head
zyronon 4 years ago
parent
commit
3aaa0b20dd
  1. 2
      README.md
  2. 5
      babel.config.js
  3. 17
      index.html
  4. 0
      output.js
  5. 12821
      package-lock.json
  6. 47
      package.json
  7. 26
      src/App.vue
  8. 66
      src/assets/data/resource.js
  9. BIN
      src/assets/img/icon/avatar/0.png
  10. BIN
      src/assets/img/icon/avatar/1.png
  11. BIN
      src/assets/img/icon/avatar/10.png
  12. BIN
      src/assets/img/icon/avatar/12.png
  13. BIN
      src/assets/img/icon/avatar/13.png
  14. BIN
      src/assets/img/icon/avatar/15.png
  15. BIN
      src/assets/img/icon/avatar/16.png
  16. BIN
      src/assets/img/icon/avatar/17.png
  17. BIN
      src/assets/img/icon/avatar/19.png
  18. BIN
      src/assets/img/icon/avatar/25.png
  19. BIN
      src/assets/img/icon/avatar/4.png
  20. BIN
      src/assets/img/icon/avatar/5.png
  21. BIN
      src/assets/img/icon/avatar/7.png
  22. BIN
      src/assets/img/icon/avatar/8.png
  23. BIN
      src/assets/img/icon/avatar/9.png
  24. BIN
      src/assets/img/icon/search-light.png
  25. 6
      src/assets/less/custom.less
  26. 2
      src/components/Back.vue
  27. 18
      src/components/Comment.vue
  28. 2
      src/components/Video.vue
  29. 150
      src/components/mobile-select/mobile-select.css
  30. 719
      src/components/mobile-select/mobile-select.js
  31. 2
      src/components/slide/Indicator.vue
  32. 2
      src/components/slide/IndicatorLight.vue
  33. 3
      src/main.js
  34. 2
      src/pages/Test2.vue
  35. 2
      src/pages/Test3.vue
  36. 12
      src/pages/home/Attention.vue
  37. 2
      src/pages/home/Index2.vue
  38. 6
      src/pages/home/LivePage.vue
  39. 2
      src/pages/home/Music.vue
  40. 36
      src/pages/home/MusicRankList.vue
  41. 36
      src/pages/home/SearchPage.vue
  42. 2
      src/pages/home/SubmitReport.vue
  43. 4
      src/pages/login/Login.vue
  44. 12
      src/pages/me/Me.vue
  45. 2
      src/pages/me/MyMusic.vue
  46. 4
      src/pages/me/Uploader.vue
  47. 4
      src/pages/me/components/SlideItemMusic.vue
  48. 8
      src/pages/me/userinfo/AddSchool.vue
  49. 2
      src/pages/me/userinfo/ChooseDepartment.vue
  50. 2
      src/pages/me/userinfo/ChooseLocation.vue
  51. 2
      src/pages/me/userinfo/ChooseProvince.vue
  52. 4
      src/pages/me/userinfo/ChooseSchool.vue
  53. 12
      src/pages/me/userinfo/EditUserInfo.vue
  54. 2
      src/pages/me/userinfo/EditUserInfoItem.vue
  55. 16
      src/pages/message/Chat.vue
  56. 148
      src/pages/message/Message.vue
  57. 67
      src/pages/message/MoreSearch.vue
  58. 2
      src/pages/people/FollowAndFans.vue
  59. 17
      src/pages/people/components/People.vue
  60. 32
      src/router/index.js
  61. 65
      src/store/index.js
  62. 5
      src/utils/global-methods.jsx
  63. 26
      vite.config.js
  64. 35
      vue.config.js

2
README.md

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# 使用 Vue 模仿抖音, 本项目持续更新
## 开发进度
页面|进度
---|---
首页|50%

5
babel.config.js

@ -1,5 +0,0 @@ @@ -1,5 +0,0 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

17
public/index.html → index.html

@ -1,11 +1,10 @@ @@ -1,11 +1,10 @@
<!DOCTYPE html>
<html lang="">
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<meta charset="UTF-8"/>
<link rel="icon" href="/favicon.ico"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Vite App</title>
<style>
::-webkit-scrollbar {
display: none; /* Chrome Safari */
@ -43,11 +42,7 @@ @@ -43,11 +42,7 @@
src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script type="module" src="/src/main.js"></script>
</body>
</html>

12821
package-lock.json generated

File diff suppressed because it is too large Load Diff

47
package.json

@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
{
"name": "douyin",
"version": "0.1.0",
"private": true,
"name": "my-vue-app",
"version": "0.0.0",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"dependencies": {
"vue": "^3.2.16",
"@jambonn/vue-lazyload": "^1.0.8",
"axios": "^0.21.1",
"core-js": "^3.6.5",
@ -16,41 +16,16 @@ @@ -16,41 +16,16 @@
"mitt": "^2.1.0",
"mockjs": "^1.1.0",
"pinyin": "^2.9.0",
"vue": "^3.0.0",
"vue-router": "^4.0.8",
"vue-switches": "^2.0.1",
"vuex": "^4.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0",
"@vitejs/plugin-vue": "^1.9.3",
"@vitejs/plugin-vue-jsx": "^1.2.0",
"vite": "^2.6.4",
"less": "^4.1.1",
"less-loader": "^7.0.0",
"mobile-select": "^1.1.2",
"raw-loader": "^4.0.2"
},
"eslintConfig": {
"root": false,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
"mobile-select": "^1.1.2"
}
}

26
src/App.vue

@ -51,7 +51,7 @@ export default { @@ -51,7 +51,7 @@ export default {
'/home/report',
'/home/search',
'/message/more-search',
'/message/share-to-friend',
'/message/joined-group-chat',
'/message/fans',
@ -64,25 +64,25 @@ export default { @@ -64,25 +64,25 @@ export default {
'/message/money-notice',
'/message/notice-setting',
'/country-choose',
'/edit-userinfo',
'/edit-userinfo-item',
'/me/country-choose',
'/me/edit-userinfo',
'/me/edit-userinfo-item',
'/video-detail',
'/add-school',
'/choose-school',
'/choose-department',
'/declare-school',
'/display-type',
'/choose-location',
'/choose-province',
'/choose-city',
'/me/add-school',
'/me/choose-school',
'/me/choose-department',
'/me/declare-school',
'/me/display-type',
'/me/choose-location',
'/me/choose-province',
'/me/choose-city',
'/people/follow-and-fans',
'/people/find-acquaintance',
'/address-list',
'/video-detail',
'/my-card',
'/me/my-card',
'/scan',
'/face-to-face',
'/message/chat',

66
src/assets/data/resource.js

@ -59,7 +59,7 @@ export default { @@ -59,7 +59,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "10040050",
"favoriting_count": 143,
"avatar": require('../img/icon/avatar/3.png'),
"avatar": new URL('../img/icon/avatar/3.png', import.meta.url).href,
school: {
name: '中央戏剧学院',
department: null,
@ -158,7 +158,7 @@ export default { @@ -158,7 +158,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "2",
"favoriting_count": 143,
"avatar": require('../img/icon/avatar/13.png'),
"avatar": new URL('../img/icon/avatar/13.png', import.meta.url).href,
"city": "",
"province": '',
"country": "",
@ -270,7 +270,7 @@ export default { @@ -270,7 +270,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "2342312",
"favoriting_count": 54,
"avatar": require('../img/icon/avatar/1.png'),
"avatar": new URL('../img/icon/avatar/1.png', import.meta.url).href,
"city": "",
"province": "上海",
"country": "中国",
@ -360,7 +360,7 @@ export default { @@ -360,7 +360,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "travels520",
"favoriting_count": 54,
"avatar": require('../img/icon/avatar/11.png'),
"avatar": new URL('../img/icon/avatar/11.png', import.meta.url).href,
"city": "",
"province": '',
"country": "",
@ -428,7 +428,7 @@ export default { @@ -428,7 +428,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "dygdsg123",
"favoriting_count": 2823,
"avatar": require('../img/icon/avatar/2.png'),
"avatar": new URL('../img/icon/avatar/2.png', import.meta.url).href,
"city": "",
"province": '',
"country": "",
@ -496,7 +496,7 @@ export default { @@ -496,7 +496,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "QQ2342342",
"favoriting_count": 143,
"avatar": require('../img/icon/avatar/3.png'),
"avatar": new URL('../img/icon/avatar/3.png', import.meta.url).href,
"city": "",
"province": '',
"country": "",
@ -594,7 +594,7 @@ export default { @@ -594,7 +594,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "",
"favoriting_count": 143,
"avatar": require('../img/icon/avatar/25.png'),
"avatar": new URL('../img/icon/avatar/25.png', import.meta.url).href,
"city": "",
"province": '',
"country": "",
@ -670,7 +670,7 @@ export default { @@ -670,7 +670,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "VFSD",
"favoriting_count": 143,
"avatar": require('../img/icon/avatar/8.png'),
"avatar": new URL('../img/icon/avatar/8.png', import.meta.url).href,
"city": "广州",
"province": '广东',
"country": "",
@ -747,7 +747,7 @@ export default { @@ -747,7 +747,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "10040050",
"favoriting_count": 550,
"avatar": require('../img/icon/avatar/9.png'),
"avatar": new URL('../img/icon/avatar/9.png', import.meta.url).href,
"city": "南平",
"province": '',
"country": "",
@ -831,7 +831,7 @@ export default { @@ -831,7 +831,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "hpsdfw102",
"favoriting_count": 143,
"avatar": require('../img/icon/avatar/10.png'),
"avatar": new URL('../img/icon/avatar/10.png', import.meta.url).href,
"city": "厦门市",
"province": '福建省',
"country": "",
@ -900,7 +900,7 @@ export default { @@ -900,7 +900,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "ZXS_12334",
"favoriting_count": 143,
"avatar": require('../img/icon/avatar/11.png'),
"avatar": new URL('../img/icon/avatar/11.png', import.meta.url).href,
"city": "南平",
"province": '',
"country": "",
@ -991,7 +991,7 @@ export default { @@ -991,7 +991,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "sg4005",
"favoriting_count": 4565,
"avatar": require('../img/icon/avatar/12.png'),
"avatar": new URL('../img/icon/avatar/12.png', import.meta.url).href,
"city": "德州",
"province": '山东',
"country": "",
@ -1089,7 +1089,7 @@ export default { @@ -1089,7 +1089,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "XQE456533",
"favoriting_count": 143,
"avatar": require('../img/icon/avatar/13.png'),
"avatar": new URL('../img/icon/avatar/13.png', import.meta.url).href,
"city": "成都",
"province": '四川',
"country": "",
@ -1151,7 +1151,7 @@ export default { @@ -1151,7 +1151,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "mmaawu",
"favoriting_count": 0,
"avatar": require('../img/icon/avatar/14.png'),
"avatar": new URL('../img/icon/avatar/14.png', import.meta.url).href,
"city": "上海",
"province": "上海",
"country": "中国",
@ -1235,7 +1235,7 @@ export default { @@ -1235,7 +1235,7 @@ export default {
"unique_id_modify_time": "1630393144",
"unique_id": "",
"favoriting_count": 143,
"avatar": require('../img/icon/avatar/25.png'),
"avatar": new URL('../img/icon/avatar/25.png', import.meta.url).href,
"city": "",
"province": '',
"country": "",
@ -14446,7 +14446,7 @@ export default { @@ -14446,7 +14446,7 @@ export default {
{
name: '龙卷风',
"mp3": "http://im5.tongbu.com/rings/singerring/zt_uunGo_1/5605.mp3",
cover: require('../../assets/img/music-cover/1.png'),
cover: new URL('../../assets/img/music-cover/1.png', import.meta.url).href,
author: '周杰伦',
duration: 99,
use_count: 37441000,
@ -14456,7 +14456,7 @@ export default { @@ -14456,7 +14456,7 @@ export default {
{
name: '爱在西元前',
mp3: 'https://m3.8js.net:99/1916/501204165042405.mp3',
cover: require('../../assets/img/music-cover/2.png'),
cover: new URL('../../assets/img/music-cover/2.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14466,7 +14466,7 @@ export default { @@ -14466,7 +14466,7 @@ export default {
{
name: '蜗牛',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/3684.mp3',
cover: require('../../assets/img/music-cover/3.png'),
cover: new URL('../../assets/img/music-cover/3.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14476,7 +14476,7 @@ export default { @@ -14476,7 +14476,7 @@ export default {
{
name: '半岛铁盒',
mp3: 'https://m3.8js.net:99/2016n/46/94745.mp3',
cover: require('../../assets/img/music-cover/4.png'),
cover: new URL('../../assets/img/music-cover/4.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14486,7 +14486,7 @@ export default { @@ -14486,7 +14486,7 @@ export default {
{
name: '轨迹',
mp3: 'https://m3.8js.net:99/1832/411204324135934.mp3',
cover: require('../../assets/img/music-cover/5.png'),
cover: new URL('../../assets/img/music-cover/5.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14496,7 +14496,7 @@ export default { @@ -14496,7 +14496,7 @@ export default {
{
name: '七里香',
mp3: 'https://m3.8js.net:99/2016n/14/53717.mp3',
cover: require('../../assets/img/music-cover/6.png'),
cover: new URL('../../assets/img/music-cover/6.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14506,7 +14506,7 @@ export default { @@ -14506,7 +14506,7 @@ export default {
{
name: '发如雪',
mp3: 'https://m3.8js.net:99/2014/211204142150965.mp3',
cover: require('../../assets/img/music-cover/7.png'),
cover: new URL('../../assets/img/music-cover/7.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14516,7 +14516,7 @@ export default { @@ -14516,7 +14516,7 @@ export default {
{
name: '霍元甲',
mp3: 'https://m3.8js.net:99/1921/261204212643140.mp3',
cover: require('../../assets/img/music-cover/8.png'),
cover: new URL('../../assets/img/music-cover/8.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14526,7 +14526,7 @@ export default { @@ -14526,7 +14526,7 @@ export default {
{
name: '千里之外(周杰伦/费玉清)',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/121.mp3',
cover: require('../../assets/img/music-cover/9.png'),
cover: new URL('../../assets/img/music-cover/9.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14536,7 +14536,7 @@ export default { @@ -14536,7 +14536,7 @@ export default {
{
name: '菊花台',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/2022.mp3',
cover: require('../../assets/img/music-cover/10.png'),
cover: new URL('../../assets/img/music-cover/10.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14546,7 +14546,7 @@ export default { @@ -14546,7 +14546,7 @@ export default {
{
name: '不能说的秘密',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/165.mp3',
cover: require('../../assets/img/music-cover/11.png'),
cover: new URL('../../assets/img/music-cover/11.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14556,7 +14556,7 @@ export default { @@ -14556,7 +14556,7 @@ export default {
{
name: '牛仔很忙',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/219.mp3',
cover: require('../../assets/img/music-cover/12.png'),
cover: new URL('../../assets/img/music-cover/12.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14566,7 +14566,7 @@ export default { @@ -14566,7 +14566,7 @@ export default {
{
name: '给我一首歌的时间',
mp3: 'https://m3.8js.net:99/1938/041204380445445.mp3',
cover: require('../../assets/img/music-cover/13.jpg'),
cover: new URL('../../assets/img/music-cover/13.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14576,7 +14576,7 @@ export default { @@ -14576,7 +14576,7 @@ export default {
{
name: '烟花易冷',
mp3: 'https://m3.8js.net:99/1828/051204280535192.mp3',
cover: require('../../assets/img/music-cover/14.jpg'),
cover: new URL('../../assets/img/music-cover/14.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14586,7 +14586,7 @@ export default { @@ -14586,7 +14586,7 @@ export default {
{
name: '惊叹号',
mp3: 'https://m3.8js.net:99/20111103/150.mp3',
cover: require('../../assets/img/music-cover/15.jpg'),
cover: new URL('../../assets/img/music-cover/15.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14596,7 +14596,7 @@ export default { @@ -14596,7 +14596,7 @@ export default {
{
name: '明明就',
mp3: 'https://m3.8js.net:99/2016n/27/96537.mp3',
cover: require('../../assets/img/music-cover/16.jpg'),
cover: new URL('../../assets/img/music-cover/16.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14606,7 +14606,7 @@ export default { @@ -14606,7 +14606,7 @@ export default {
{
name: '算什么男人',
mp3: 'https://m3.8js.net:99/20150107/429.mp3',
cover: require('../../assets/img/music-cover/17.jpg'),
cover: new URL('../../assets/img/music-cover/17.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -14616,7 +14616,7 @@ export default { @@ -14616,7 +14616,7 @@ export default {
{
name: '告白气球',
mp3: 'https://m3.8js.net:99/20161016/481.mp3',
cover: require('../../assets/img/music-cover/18.jpg'),
cover: new URL('../../assets/img/music-cover/18.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,

BIN
src/assets/img/icon/avatar/0.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 83 KiB

BIN
src/assets/img/icon/avatar/1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 83 KiB

BIN
src/assets/img/icon/avatar/10.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 48 KiB

BIN
src/assets/img/icon/avatar/12.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 57 KiB

BIN
src/assets/img/icon/avatar/13.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 KiB

After

Width:  |  Height:  |  Size: 87 KiB

BIN
src/assets/img/icon/avatar/15.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

After

Width:  |  Height:  |  Size: 58 KiB

BIN
src/assets/img/icon/avatar/16.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 68 KiB

BIN
src/assets/img/icon/avatar/17.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 KiB

After

Width:  |  Height:  |  Size: 64 KiB

BIN
src/assets/img/icon/avatar/19.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 48 KiB

BIN
src/assets/img/icon/avatar/25.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 56 KiB

BIN
src/assets/img/icon/avatar/4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

After

Width:  |  Height:  |  Size: 54 KiB

BIN
src/assets/img/icon/avatar/5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 KiB

After

Width:  |  Height:  |  Size: 88 KiB

BIN
src/assets/img/icon/avatar/7.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 KiB

After

Width:  |  Height:  |  Size: 66 KiB

BIN
src/assets/img/icon/avatar/8.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 91 KiB

BIN
src/assets/img/icon/avatar/9.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 72 KiB

BIN
src/assets/img/icon/search-light.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

6
src/assets/less/custom.less

@ -157,9 +157,3 @@ p { @@ -157,9 +157,3 @@ p {
.link {
color: rgb(18, 100, 149);
}
.sub-title-g{
margin-top: @padding-page;
color: @second-text-color;
font-size: 1.2rem;
}

2
src/components/Back.vue

@ -27,7 +27,7 @@ export default { @@ -27,7 +27,7 @@ export default {
},
computed: {
src() {
return require(`../assets/img/icon/components/${this.mode}-${this.img}.png`)
return new URL(`../assets/img/icon/components/${this.mode}-${this.img}.png`, import.meta.url).href
}
},
mounted() {

18
src/components/Comment.vue

@ -169,7 +169,7 @@ export default { @@ -169,7 +169,7 @@ export default {
send() {
this.comments.push({
id: '2',
avatar: require('../assets/img/icon/avatar/4.png'),
avatar: new URL('../assets/img/icon/avatar/4.png', import.meta.url).href,
name: '成都旅行',
text: this.comment,
loveNum: 27,
@ -185,7 +185,7 @@ export default { @@ -185,7 +185,7 @@ export default {
this.comments = [
{
id: '1',
avatar: require('../assets/img/icon/avatar/1.png'),
avatar: new URL('../assets/img/icon/avatar/1.png', import.meta.url).href,
name: '彭雨晏',
text: '这到底是怎么了?艺人一个接一个的出事',
loveNum: 57000,
@ -194,7 +194,7 @@ export default { @@ -194,7 +194,7 @@ export default {
children: [
{
id: '10',
avatar: require('../assets/img/icon/avatar/2.png'),
avatar: new URL('../assets/img/icon/avatar/2.png', import.meta.url).href,
name: 'sugar少吃一点',
replay: '',
text: '要么之前吴京说了一句话对一个小女孩说,以后别来娱乐圈',
@ -204,7 +204,7 @@ export default { @@ -204,7 +204,7 @@ export default {
},
{
id: '11',
avatar: require('../assets/img/icon/avatar/3.png'),
avatar: new URL('../assets/img/icon/avatar/3.png', import.meta.url).href,
name: '我不吃晚饭了',
replay: 'sugar少吃一点',
text: '@nana max',
@ -214,7 +214,7 @@ export default { @@ -214,7 +214,7 @@ export default {
},
{
id: '12',
avatar: require('../assets/img/icon/avatar/4.png'),
avatar: new URL('../assets/img/icon/avatar/4.png', import.meta.url).href,
name: '我劝你善良',
replay: 'sugar少吃一点',
text: '对对 我也刷到过这个视频',
@ -226,7 +226,7 @@ export default { @@ -226,7 +226,7 @@ export default {
},
{
id: '2',
avatar: require('../assets/img/icon/avatar/4.png'),
avatar: new URL('../assets/img/icon/avatar/4.png', import.meta.url).href,
name: '成都旅行',
text: '开车回来4个小时,爬山两小时,如果当天天气好,你一定会喜欢上这里,是真的美!一日游',
loveNum: 27,
@ -235,7 +235,7 @@ export default { @@ -235,7 +235,7 @@ export default {
children: [
{
id: '20',
avatar: require('../assets/img/icon/avatar/4.png'),
avatar: new URL('../assets/img/icon/avatar/4.png', import.meta.url).href,
name: '成都旅行',
replay: '',
text: '甘海子,汶川转经楼村',
@ -245,7 +245,7 @@ export default { @@ -245,7 +245,7 @@ export default {
},
{
id: '21',
avatar: require('../assets/img/icon/avatar/5.png'),
avatar: new URL('../assets/img/icon/avatar/5.png', import.meta.url).href,
name: 'August',
replay: '成都旅行',
text: '@NickyOO @AW%',
@ -255,7 +255,7 @@ export default { @@ -255,7 +255,7 @@ export default {
},
{
id: '22',
avatar: require('../assets/img/icon/avatar/6.png'),
avatar: new URL('../assets/img/icon/avatar/6.png', import.meta.url).href,
name: '用户121342411',
replay: '成都旅行',
text: '自己可以开私家车进去不',

2
src/components/Video.vue

@ -219,7 +219,7 @@ export default { @@ -219,7 +219,7 @@ export default {
let id = 'a' + Date.now()
let elWidth = 80
let rotate = this.randomNum(0, 1)
let template = `<img class="${rotate ? 'left love-dbclick' : 'right love-dbclick'}" id="${id}" src="${require('../assets/img/icon/loved.svg')}" alt="">`
let template = `<img class="${rotate ? 'left love-dbclick' : 'right love-dbclick'}" id="${id}" src="${new URL('../assets/img/icon/loved.svg')}" alt="">`
let el = new Dom().create(template)
el.css({top: e.y - elWidth, left: e.x - elWidth / 2,})
new Dom('#home-index').append(el)

150
src/components/mobile-select/mobile-select.css

@ -0,0 +1,150 @@ @@ -0,0 +1,150 @@
.mobileSelect {
position: relative;
z-index: 0;
opacity: 0;
visibility: hidden;
-webkit-transition: opacity 0.4s, z-index 0.4s;
transition: opacity 0.4s, z-index 0.4s;
}
.mobileSelect * {
margin: 0;
padding: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.mobileSelect .grayLayer {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: #eee;
background: rgba(0, 0, 0, 0.7);
z-index: 888;
display: block;
}
.mobileSelect .content {
width: 100%;
display: block;
position: fixed;
z-index: 889;
color: black;
-webkit-transition: all 0.4s;
transition: all 0.4s;
bottom: -350px;
left: 0;
background: white;
}
.mobileSelect .content .fixWidth {
width: 90%;
margin: 0 auto;
position: relative;
}
.mobileSelect .content .fixWidth:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.mobileSelect .content .btnBar {
border-bottom: 1px solid #DCDCDC;
font-size: 15px;
height: 45px;
position: relative;
text-align: center;
line-height: 45px;
}
.mobileSelect .content .btnBar .cancel,
.mobileSelect .content .btnBar .ensure {
height: 45px;
width: 55px;
cursor: pointer;
position: absolute;
top: 0;
}
.mobileSelect .content .btnBar .cancel {
left: 0;
color: #666;
}
.mobileSelect .content .btnBar .ensure {
right: 0;
color: #1e83d3;
}
.mobileSelect .content .btnBar .title {
font-size: 15px;
padding: 0 15%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.mobileSelect .content .panel:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.mobileSelect .content .panel .wheels {
width: 100%;
height: 200px;
overflow: hidden;
}
.mobileSelect .content .panel .wheel {
position: relative;
z-index: 0;
float: left;
width: 50%;
height: 200px;
overflow: hidden;
-webkit-transition: width 0.3s ease;
transition: width 0.3s ease;
}
.mobileSelect .content .panel .wheel .selectContainer {
display: block;
text-align: center;
-webkit-transition: -webkit-transform 0.18s ease-out;
transition: -webkit-transform 0.18s ease-out;
transition: transform 0.18s ease-out;
transition: transform 0.18s ease-out, -webkit-transform 0.18s ease-out;
}
.mobileSelect .content .panel .wheel .selectContainer li {
font-size: 15px;
display: block;
height: 40px;
line-height: 40px;
cursor: pointer;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.mobileSelect .content .panel .selectLine {
height: 40px;
width: 100%;
position: absolute;
top: 80px;
pointer-events: none;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-top: 1px solid #DCDCDC;
border-bottom: 1px solid #DCDCDC;
}
.mobileSelect .content .panel .shadowMask {
position: absolute;
top: 0;
width: 100%;
height: 200px;
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), color-stop(rgba(255, 255, 255, 0)), to(#ffffff));
background: -webkit-linear-gradient(top, #ffffff, rgba(255, 255, 255, 0), #ffffff);
background: linear-gradient(to bottom, #ffffff, rgba(255, 255, 255, 0), #ffffff);
opacity: 0.9;
pointer-events: none;
}
.mobileSelect-show {
opacity: 1;
z-index: 10000;
visibility: visible;
}
.mobileSelect-show .content {
bottom: 0;
}

719
src/components/mobile-select/mobile-select.js

@ -0,0 +1,719 @@ @@ -0,0 +1,719 @@
/*!
* mobileSelect.js
* (c) 2017-present onlyhom
* Released under the MIT License.
*/
import './mobile-select.css'
function getClass(dom, string) {
return dom.getElementsByClassName(string);
}
//构造器
function MobileSelect(config) {
this.mobileSelect;
this.wheelsData = config.wheels;
this.jsonType = false;
this.cascadeJsonData = [];
this.displayJson = [];
this.curValue = [];
this.curIndexArr = [];
this.cascade = false;
this.startY;
this.moveEndY;
this.moveY;
this.oldMoveY;
this.offset = 0;
this.offsetSum = 0;
this.oversizeBorder;
this.curDistance = [];
this.clickStatus = false;
this.isPC = true;
this.init(config);
}
MobileSelect.prototype = {
constructor: MobileSelect,
init: function (config) {
var _this = this;
if (config.wheels[0].data.length == 0) {
console.error('mobileSelect has been successfully installed, but the data is empty and cannot be initialized.');
return false;
}
_this.keyMap = config.keyMap ? config.keyMap : {id: 'id', value: 'value', childs: 'childs'};
_this.checkDataType();
_this.renderWheels(_this.wheelsData, config.cancelBtnText, config.ensureBtnText);
_this.trigger = document.querySelector(config.trigger);
if (!_this.trigger) {
console.error('mobileSelect has been successfully installed, but no trigger found on your page.');
return false;
}
_this.wheel = getClass(_this.mobileSelect, 'wheel');
_this.slider = getClass(_this.mobileSelect, 'selectContainer');
_this.wheels = _this.mobileSelect.querySelector('.wheels');
_this.liHeight = _this.mobileSelect.querySelector('li').offsetHeight;
_this.ensureBtn = _this.mobileSelect.querySelector('.ensure');
_this.cancelBtn = _this.mobileSelect.querySelector('.cancel');
_this.grayLayer = _this.mobileSelect.querySelector('.grayLayer');
_this.popUp = _this.mobileSelect.querySelector('.content');
_this.callback = config.callback || function () {
};
_this.cancel = config.cancel || function () {
};
_this.transitionEnd = config.transitionEnd || function () {
};
_this.onShow = config.onShow || function () {
};
_this.onHide = config.onHide || function () {
};
_this.initPosition = config.position || [];
_this.titleText = config.title || '';
_this.connector = config.connector || ' ';
_this.triggerDisplayData = !(typeof (config.triggerDisplayData) == 'undefined') ? config.triggerDisplayData : true;
_this.trigger.style.cursor = 'pointer';
_this.setStyle(config);
_this.setTitle(_this.titleText);
_this.checkIsPC();
_this.checkCascade();
_this.addListenerAll();
if (_this.cascade) {
_this.initCascade();
}
//定位 初始位置
if (_this.initPosition.length < _this.slider.length) {
var diff = _this.slider.length - _this.initPosition.length;
for (var i = 0; i < diff; i++) {
_this.initPosition.push(0);
}
}
_this.setCurDistance(_this.initPosition);
//按钮监听
_this.cancelBtn.addEventListener('click', function () {
_this.hide();
_this.cancel(_this.curIndexArr, _this.curValue);
});
_this.ensureBtn.addEventListener('click', function () {
_this.hide();
if (!_this.liHeight) {
_this.liHeight = _this.mobileSelect.querySelector('li').offsetHeight;
}
var tempValue = '';
for (var i = 0; i < _this.wheel.length; i++) {
i == _this.wheel.length - 1 ? tempValue += _this.getInnerHtml(i) : tempValue += _this.getInnerHtml(i) + _this.connector;
}
if (_this.triggerDisplayData) {
_this.trigger.innerHTML = tempValue;
}
_this.curIndexArr = _this.getIndexArr();
_this.curValue = _this.getCurValue();
_this.callback(_this.curIndexArr, _this.curValue);
});
_this.trigger.addEventListener('click', function () {
_this.show();
});
_this.grayLayer.addEventListener('click', function () {
_this.hide();
_this.cancel(_this.curIndexArr, _this.curValue);
});
_this.popUp.addEventListener('click', function () {
event.stopPropagation();
});
_this.fixRowStyle(); //修正列数
},
setTitle: function (string) {
var _this = this;
_this.titleText = string;
_this.mobileSelect.querySelector('.title').innerHTML = _this.titleText;
},
setStyle: function (config) {
var _this = this;
if (config.ensureBtnColor) {
_this.ensureBtn.style.color = config.ensureBtnColor;
}
if (config.cancelBtnColor) {
_this.cancelBtn.style.color = config.cancelBtnColor;
}
if (config.titleColor) {
_this.title = _this.mobileSelect.querySelector('.title');
_this.title.style.color = config.titleColor;
}
if (config.textColor) {
_this.panel = _this.mobileSelect.querySelector('.panel');
_this.panel.style.color = config.textColor;
}
if (config.titleBgColor) {
_this.btnBar = _this.mobileSelect.querySelector('.btnBar');
_this.btnBar.style.backgroundColor = config.titleBgColor;
}
if (config.bgColor) {
_this.panel = _this.mobileSelect.querySelector('.panel');
_this.shadowMask = _this.mobileSelect.querySelector('.shadowMask');
_this.panel.style.backgroundColor = config.bgColor;
_this.shadowMask.style.background = 'linear-gradient(to bottom, ' + config.bgColor + ', rgba(255, 255, 255, 0), ' + config.bgColor + ')';
}
if (!isNaN(config.maskOpacity)) {
_this.grayMask = _this.mobileSelect.querySelector('.grayLayer');
_this.grayMask.style.background = 'rgba(0, 0, 0, ' + config.maskOpacity + ')';
}
},
checkIsPC: function () {
var _this = this;
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
if ((bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
_this.isPC = false;
}
},
show: function () {
this.mobileSelect.classList.add('mobileSelect-show');
if (typeof this.onShow === 'function') {
this.onShow(this);
}
},
hide: function () {
this.mobileSelect.classList.remove('mobileSelect-show');
if (typeof this.onHide === 'function') {
this.onHide(this);
}
},
renderWheels: function (wheelsData, cancelBtnText, ensureBtnText) {
var _this = this;
var cancelText = cancelBtnText ? cancelBtnText : '取消';
var ensureText = ensureBtnText ? ensureBtnText : '确认';
_this.mobileSelect = document.createElement("div");
_this.mobileSelect.className = "mobileSelect";
_this.mobileSelect.innerHTML =
'<div class="grayLayer"></div>' +
'<div class="content">' +
'<div class="btnBar">' +
'<div class="fixWidth">' +
'<div class="cancel">' + cancelText + '</div>' +
'<div class="title"></div>' +
'<div class="ensure">' + ensureText + '</div>' +
'</div>' +
'</div>' +
'<div class="panel">' +
'<div class="fixWidth">' +
'<div class="wheels">' +
'</div>' +
'<div class="selectLine"></div>' +
'<div class="shadowMask"></div>' +
'</div>' +
'</div>' +
'</div>';
document.body.appendChild(_this.mobileSelect);
//根据数据长度来渲染
var tempHTML = '';
for (var i = 0; i < wheelsData.length; i++) {
//列
tempHTML += '<div class="wheel"><ul class="selectContainer">';
if (_this.jsonType) {
for (var j = 0; j < wheelsData[i].data.length; j++) {
//行
tempHTML += '<li data-id="' + wheelsData[i].data[j][_this.keyMap.id] + '">' + wheelsData[i].data[j][_this.keyMap.value] + '</li>';
}
} else {
for (var j = 0; j < wheelsData[i].data.length; j++) {
//行
tempHTML += '<li>' + wheelsData[i].data[j] + '</li>';
}
}
tempHTML += '</ul></div>';
}
_this.mobileSelect.querySelector('.wheels').innerHTML = tempHTML;
},
addListenerAll: function () {
var _this = this;
for (var i = 0; i < _this.slider.length; i++) {
//手势监听
(function (i) {
_this.addListenerWheel(_this.wheel[i], i);
})(i);
}
},
addListenerWheel: function (theWheel, index) {
var _this = this;
theWheel.addEventListener('touchstart', function () {
_this.touch(event, this.firstChild, index);
}, false);
theWheel.addEventListener('touchend', function () {
_this.touch(event, this.firstChild, index);
}, false);
theWheel.addEventListener('touchmove', function () {
_this.touch(event, this.firstChild, index);
}, false);
if (_this.isPC) {
//如果是PC端则再增加拖拽监听 方便调试
theWheel.addEventListener('mousedown', function () {
_this.dragClick(event, this.firstChild, index);
}, false);
theWheel.addEventListener('mousemove', function () {
_this.dragClick(event, this.firstChild, index);
}, false);
theWheel.addEventListener('mouseup', function () {
_this.dragClick(event, this.firstChild, index);
}, true);
}
},
checkDataType: function () {
var _this = this;
if (typeof (_this.wheelsData[0].data[0]) == 'object') {
_this.jsonType = true;
}
},
checkCascade: function () {
var _this = this;
if (_this.jsonType) {
var node = _this.wheelsData[0].data;
for (var i = 0; i < node.length; i++) {
if (_this.keyMap.childs in node[i] && node[i][_this.keyMap.childs].length > 0) {
_this.cascade = true;
_this.cascadeJsonData = _this.wheelsData[0].data;
break;
}
}
} else {
_this.cascade = false;
}
},
generateArrData: function (targetArr) {
var tempArr = [];
var keyMap_id = this.keyMap.id;
var keyMap_value = this.keyMap.value;
for (var i = 0; i < targetArr.length; i++) {
var tempObj = {};
tempObj[keyMap_id] = targetArr[i][this.keyMap.id];
tempObj[keyMap_value] = targetArr[i][this.keyMap.value];
tempArr.push(tempObj);
}
return tempArr;
},
initCascade: function () {
var _this = this;
_this.displayJson.push(_this.generateArrData(_this.cascadeJsonData));
if (_this.initPosition.length > 0) {
_this.initDeepCount = 0;
_this.initCheckArrDeep(_this.cascadeJsonData[_this.initPosition[0]]);
} else {
_this.checkArrDeep(_this.cascadeJsonData[0]);
}
_this.reRenderWheels();
},
initCheckArrDeep: function (parent) {
var _this = this;
if (parent) {
if (_this.keyMap.childs in parent && parent[_this.keyMap.childs].length > 0) {
_this.displayJson.push(_this.generateArrData(parent[_this.keyMap.childs]));
_this.initDeepCount++;
var nextNode = parent[_this.keyMap.childs][_this.initPosition[_this.initDeepCount]];
if (nextNode) {
_this.initCheckArrDeep(nextNode);
} else {
_this.checkArrDeep(parent[_this.keyMap.childs][0]);
}
}
}
},
checkArrDeep: function (parent) {
//检测子节点深度 修改 displayJson
var _this = this;
if (parent) {
if (_this.keyMap.childs in parent && parent[_this.keyMap.childs].length > 0) {
_this.displayJson.push(_this.generateArrData(parent[_this.keyMap.childs])); //生成子节点数组
_this.checkArrDeep(parent[_this.keyMap.childs][0]);//检测下一个子节点
}
}
},
checkRange: function (index, posIndexArr) {
var _this = this;
var deleteNum = _this.displayJson.length - 1 - index;
for (var i = 0; i < deleteNum; i++) {
_this.displayJson.pop(); //修改 displayJson
}
var resultNode;
for (var i = 0; i <= index; i++) {
if (i == 0)
resultNode = _this.cascadeJsonData[posIndexArr[0]];
else {
resultNode = resultNode[_this.keyMap.childs][posIndexArr[i]];
}
}
_this.checkArrDeep(resultNode);
//console.log(_this.displayJson);
_this.reRenderWheels();
_this.fixRowStyle();
_this.setCurDistance(_this.resetPosition(index, posIndexArr));
},
resetPosition: function (index, posIndexArr) {
var _this = this;
var tempPosArr = posIndexArr;
var tempCount;
if (_this.slider.length > posIndexArr.length) {
tempCount = _this.slider.length - posIndexArr.length;
for (var i = 0; i < tempCount; i++) {
tempPosArr.push(0);
}
} else if (_this.slider.length < posIndexArr.length) {
tempCount = posIndexArr.length - _this.slider.length;
for (var i = 0; i < tempCount; i++) {
tempPosArr.pop();
}
}
for (var i = index + 1; i < tempPosArr.length; i++) {
tempPosArr[i] = 0;
}
return tempPosArr;
},
reRenderWheels: function () {
var _this = this;
//删除多余的wheel
if (_this.wheel.length > _this.displayJson.length) {
var count = _this.wheel.length - _this.displayJson.length;
for (var i = 0; i < count; i++) {
_this.wheels.removeChild(_this.wheel[_this.wheel.length - 1]);
}
}
for (var i = 0; i < _this.displayJson.length; i++) {
//列
(function (i) {
var tempHTML = '';
if (_this.wheel[i]) {
//console.log('插入Li');
for (var j = 0; j < _this.displayJson[i].length; j++) {
//行
tempHTML += '<li data-id="' + _this.displayJson[i][j][_this.keyMap.id] + '">' + _this.displayJson[i][j][_this.keyMap.value] + '</li>';
}
_this.slider[i].innerHTML = tempHTML;
} else {
var tempWheel = document.createElement("div");
tempWheel.className = "wheel";
tempHTML = '<ul class="selectContainer">';
for (var j = 0; j < _this.displayJson[i].length; j++) {
//行
tempHTML += '<li data-id="' + _this.displayJson[i][j][_this.keyMap.id] + '">' + _this.displayJson[i][j][_this.keyMap.value] + '</li>';
}
tempHTML += '</ul>';
tempWheel.innerHTML = tempHTML;
_this.addListenerWheel(tempWheel, i);
_this.wheels.appendChild(tempWheel);
}
//_this.·(i);
})(i);
}
},
updateWheels: function (data) {
var _this = this;
if (_this.cascade) {
_this.cascadeJsonData = data;
_this.displayJson = [];
_this.initCascade();
if (_this.initPosition.length < _this.slider.length) {
var diff = _this.slider.length - _this.initPosition.length;
for (var i = 0; i < diff; i++) {
_this.initPosition.push(0);
}
}
_this.setCurDistance(_this.initPosition);
_this.fixRowStyle();
}
},
updateWheel: function (sliderIndex, data) {
var _this = this;
var tempHTML = '';
if (_this.cascade) {
console.error('级联格式不支持updateWheel(),请使用updateWheels()更新整个数据源');
return false;
} else if (_this.jsonType) {
for (var j = 0; j < data.length; j++) {
tempHTML += '<li data-id="' + data[j][_this.keyMap.id] + '">' + data[j][_this.keyMap.value] + '</li>';
}
_this.wheelsData[sliderIndex] = {data: data};
} else {
for (var j = 0; j < data.length; j++) {
tempHTML += '<li>' + data[j] + '</li>';
}
_this.wheelsData[sliderIndex] = data;
}
_this.slider[sliderIndex].innerHTML = tempHTML;
},
fixRowStyle: function () {
var _this = this;
var width = (100 / _this.wheel.length).toFixed(2);
for (var i = 0; i < _this.wheel.length; i++) {
_this.wheel[i].style.width = width + '%';
}
},
getIndex: function (distance) {
return Math.round((2 * this.liHeight - distance) / this.liHeight);
},
getIndexArr: function () {
var _this = this;
var temp = [];
for (var i = 0; i < _this.curDistance.length; i++) {
temp.push(_this.getIndex(_this.curDistance[i]));
}
return temp;
},
getCurValue: function () {
var _this = this;
var temp = [];
var positionArr = _this.getIndexArr();
if (_this.cascade) {
for (var i = 0; i < _this.wheel.length; i++) {
temp.push(_this.displayJson[i][positionArr[i]]);
}
} else if (_this.jsonType) {
for (var i = 0; i < _this.curDistance.length; i++) {
temp.push(_this.wheelsData[i].data[_this.getIndex(_this.curDistance[i])]);
}
} else {
for (var i = 0; i < _this.curDistance.length; i++) {
temp.push(_this.getInnerHtml(i));
}
}
return temp;
},
getValue: function () {
return this.curValue;
},
calcDistance: function (index) {
return 2 * this.liHeight - index * this.liHeight;
},
setCurDistance: function (indexArr) {
var _this = this;
var temp = [];
for (var i = 0; i < _this.slider.length; i++) {
temp.push(_this.calcDistance(indexArr[i]));
_this.movePosition(_this.slider[i], temp[i]);
}
_this.curDistance = temp;
},
fixPosition: function (distance) {
return -(this.getIndex(distance) - 2) * this.liHeight;
},
movePosition: function (theSlider, distance) {
theSlider.style.webkitTransform = 'translate3d(0,' + distance + 'px, 0)';
theSlider.style.transform = 'translate3d(0,' + distance + 'px, 0)';
},
locatePosition: function (index, posIndex) {
var _this = this;
this.curDistance[index] = this.calcDistance(posIndex);
this.movePosition(this.slider[index], this.curDistance[index]);
if (_this.cascade) {
_this.checkRange(index, _this.getIndexArr());
}
},
updateCurDistance: function (theSlider, index) {
if (theSlider.style.transform) {
this.curDistance[index] = parseInt(theSlider.style.transform.split(',')[1]);
} else {
this.curDistance[index] = parseInt(theSlider.style.webkitTransform.split(',')[1]);
}
},
getDistance: function (theSlider) {
if (theSlider.style.transform) {
return parseInt(theSlider.style.transform.split(',')[1]);
} else {
return parseInt(theSlider.style.webkitTransform.split(',')[1]);
}
},
getInnerHtml: function (sliderIndex) {
var _this = this;
var index = _this.getIndex(_this.curDistance[sliderIndex]);
return _this.slider[sliderIndex].getElementsByTagName('li')[index].innerHTML;
},
touch: function (event, theSlider, index) {
var _this = this;
event = event || window.event;
switch (event.type) {
case "touchstart":
_this.startY = event.touches[0].clientY;
_this.startY = parseInt(_this.startY);
_this.oldMoveY = _this.startY;
break;
case "touchend":
_this.moveEndY = parseInt(event.changedTouches[0].clientY);
_this.offsetSum = _this.moveEndY - _this.startY;
_this.oversizeBorder = -(theSlider.getElementsByTagName('li').length - 3) * _this.liHeight;
if (_this.offsetSum == 0) {
//offsetSum为0,相当于点击事件
// 0 1 [2] 3 4
var clickOffetNum = parseInt((document.documentElement.clientHeight - _this.moveEndY) / 40);
if (clickOffetNum != 2) {
var offset = clickOffetNum - 2;
var newDistance = _this.curDistance[index] + (offset * _this.liHeight);
if ((newDistance <= 2 * _this.liHeight) && (newDistance >= _this.oversizeBorder)) {
_this.curDistance[index] = newDistance;
_this.movePosition(theSlider, _this.curDistance[index]);
_this.transitionEnd(_this.getIndexArr(), _this.getCurValue());
}
}
} else {
//修正位置
_this.updateCurDistance(theSlider, index);
_this.curDistance[index] = _this.fixPosition(_this.curDistance[index]);
_this.movePosition(theSlider, _this.curDistance[index]);
//反弹
if (_this.curDistance[index] + _this.offsetSum > 2 * _this.liHeight) {
_this.curDistance[index] = 2 * _this.liHeight;
setTimeout(function () {
_this.movePosition(theSlider, _this.curDistance[index]);
}, 100);
} else if (_this.curDistance[index] + _this.offsetSum < _this.oversizeBorder) {
_this.curDistance[index] = _this.oversizeBorder;
setTimeout(function () {
_this.movePosition(theSlider, _this.curDistance[index]);
}, 100);
}
_this.transitionEnd(_this.getIndexArr(), _this.getCurValue());
}
if (_this.cascade) {
_this.checkRange(index, _this.getIndexArr());
}
break;
case "touchmove":
event.preventDefault();
_this.moveY = event.touches[0].clientY;
_this.offset = _this.moveY - _this.oldMoveY;
_this.updateCurDistance(theSlider, index);
_this.curDistance[index] = _this.curDistance[index] + _this.offset;
_this.movePosition(theSlider, _this.curDistance[index]);
_this.oldMoveY = _this.moveY;
break;
}
},
dragClick: function (event, theSlider, index) {
var _this = this;
event = event || window.event;
switch (event.type) {
case "mousedown":
_this.startY = event.clientY;
_this.oldMoveY = _this.startY;
_this.clickStatus = true;
break;
case "mouseup":
_this.moveEndY = event.clientY;
_this.offsetSum = _this.moveEndY - _this.startY;
_this.oversizeBorder = -(theSlider.getElementsByTagName('li').length - 3) * _this.liHeight;
if (_this.offsetSum == 0) {
var clickOffetNum = parseInt((document.documentElement.clientHeight - _this.moveEndY) / 40);
if (clickOffetNum != 2) {
var offset = clickOffetNum - 2;
var newDistance = _this.curDistance[index] + (offset * _this.liHeight);
if ((newDistance <= 2 * _this.liHeight) && (newDistance >= _this.oversizeBorder)) {
_this.curDistance[index] = newDistance;
_this.movePosition(theSlider, _this.curDistance[index]);
_this.transitionEnd(_this.getIndexArr(), _this.getCurValue());
}
}
} else {
//修正位置
_this.updateCurDistance(theSlider, index);
_this.curDistance[index] = _this.fixPosition(_this.curDistance[index]);
_this.movePosition(theSlider, _this.curDistance[index]);
//反弹
if (_this.curDistance[index] + _this.offsetSum > 2 * _this.liHeight) {
_this.curDistance[index] = 2 * _this.liHeight;
setTimeout(function () {
_this.movePosition(theSlider, _this.curDistance[index]);
}, 100);
} else if (_this.curDistance[index] + _this.offsetSum < _this.oversizeBorder) {
_this.curDistance[index] = _this.oversizeBorder;
setTimeout(function () {
_this.movePosition(theSlider, _this.curDistance[index]);
}, 100);
}
_this.transitionEnd(_this.getIndexArr(), _this.getCurValue());
}
_this.clickStatus = false;
if (_this.cascade) {
_this.checkRange(index, _this.getIndexArr());
}
break;
case "mousemove":
event.preventDefault();
if (_this.clickStatus) {
_this.moveY = event.clientY;
_this.offset = _this.moveY - _this.oldMoveY;
_this.updateCurDistance(theSlider, index);
_this.curDistance[index] = _this.curDistance[index] + _this.offset;
_this.movePosition(theSlider, _this.curDistance[index]);
_this.oldMoveY = _this.moveY;
}
break;
}
}
};
export default MobileSelect

2
src/components/slide/Indicator.vue

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<script>
<script lang="jsx">
import bus from "../../utils/bus";
export default {

2
src/components/slide/IndicatorLight.vue

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<script>
<script lang="jsx">
import bus from "../../utils/bus";
export default {

3
src/main.js

@ -12,10 +12,9 @@ import VueLazyload from '@jambonn/vue-lazyload' @@ -12,10 +12,9 @@ import VueLazyload from '@jambonn/vue-lazyload'
const app = Vue.createApp(App)
app.config.globalProperties.$api = {...api}
// app.config.compilerOptions.isCustomElement = tag => tag.startsWith('video1')
const loadImage = require('./assets/img/icon/img-loading.png')
const loadImage = new URL('./assets/img/icon/img-loading.png', import.meta.url).href
app.provide('mitt', mitt())
app.mixin(mixin)

2
src/pages/Test2.vue

@ -111,7 +111,7 @@ export default { @@ -111,7 +111,7 @@ export default {
},
emoji() {
let span = document.createElement('img')
span.setAttribute('src', require('../assets/img/icon/message/emoji/4.webp'))
span.setAttribute('src', new URL('../assets/img/icon/message/emoji/4.webp'))
span.classList.add('emoji')
this.$refs.input.append(span)
}

2
src/pages/Test3.vue

@ -50,7 +50,7 @@ export default { @@ -50,7 +50,7 @@ export default {
let id = 'a' + Date.now()
let elWidth = 80
let rotate = this.randomNum(0, 1)
let template = `<img class="${rotate ? 'left' : 'right'}" id="${id}" src="${require('../assets/img/icon/loved.svg')}" alt="">`
let template = `<img class="${rotate ? 'left' : 'right'}" id="${id}" src="${new URL('../assets/img/icon/loved.svg')}" alt="">`
let el = new Dom().create(template)
el.css({top: e.y - elWidth, left: e.x - elWidth / 2,})
new Dom().find('.test').append(el)

12
src/pages/home/Attention.vue

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<template>
<div id="attention">
<header ref="header">
<span @click="$nav('/country-choose')">双流</span>
<span @click="$nav('/me/country-choose')">双流</span>
<div class="arrow"></div>
</header>
<div class="scroller"
@ -247,23 +247,23 @@ export default { @@ -247,23 +247,23 @@ export default {
mounted() {
for (let i = 1; i < 12; i++) {
let temp = {
src: require(`../../assets/img/poster/${i}.jpg`),
author: require(`../../assets/img/avatar.png`),
src: new URL(`../../assets/img/poster/${i}.jpg`, import.meta.url).href,
author: new URL(`../../assets/img/avatar.png`, import.meta.url).href,
}
temp.type = i - 1 > 3 ? 3 : i - 1
if (temp.type === 2) {
temp.desc = '成都市好友聚会美食榜'
temp.ads = [
{
src: require(`../../assets/img/poster/${i}.jpg`),
src: new URL(`../../assets/img/poster/${i}.jpg`, import.meta.url).href,
name: '烧江南烧肉'
},
{
src: require(`../../assets/img/poster/${i}.jpg`),
src: new URL(`../../assets/img/poster/${i}.jpg`, import.meta.url).href,
name: '欧叶无国界料理餐厅'
},
{
src: require(`../../assets/img/poster/${i}.jpg`),
src: new URL(`../../assets/img/poster/${i}.jpg`, import.meta.url).href,
name: '陆派玛歌庄园'
}
]

2
src/pages/home/Index2.vue

@ -173,7 +173,7 @@ @@ -173,7 +173,7 @@
</div>
</template>
<script>
<script lang="jsx">
import Video1 from "../../components/Video.vue";
import Comment from "../../components/Comment";
import Share from "../../components/Share";

6
src/pages/home/LivePage.vue

@ -117,7 +117,7 @@ export default { @@ -117,7 +117,7 @@ export default {
`
},
userJoinedTemplate: () => {
let src = require('../../assets/img/icon/home/level.webp')
let src = new URL('../../assets/img/icon/home/level.webp')
return `
<div class="user-joined">
<div class="level">
@ -132,8 +132,8 @@ export default { @@ -132,8 +132,8 @@ export default {
`
},
sendGiftTemplate: () => {
let avatar = require('../../assets/img/icon/avatar/3.png')
let gift = require('../../assets/img/icon/home/love.webp')
let avatar = new URL('../../assets/img/icon/avatar/3.png')
let gift = new URL('../../assets/img/icon/home/love.webp')
return `
<div class="send-gift">
<div class="left">

2
src/pages/home/Music.vue

@ -134,7 +134,7 @@ export default { @@ -134,7 +134,7 @@ export default {
music: {
name: '发如雪',
mp3: 'https://m3.8js.net:99/2014/211204142150965.mp3',
cover: require('../../assets/img/music-cover/7.png'),
cover: new URL('../../assets/img/music-cover/7.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,

36
src/pages/home/MusicRankList.vue

@ -183,7 +183,7 @@ export default { @@ -183,7 +183,7 @@ export default {
{
name: '龙卷风',
"mp3": "http://im5.tongbu.com/rings/singerring/zt_uunGo_1/5605.mp3",
cover: require('../../assets/img/music-cover/1.png'),
cover: new URL('../../assets/img/music-cover/1.png', import.meta.url).href,
author: '周杰伦',
duration: 99,
use_count: 37441000,
@ -193,7 +193,7 @@ export default { @@ -193,7 +193,7 @@ export default {
{
name: '爱在西元前',
mp3: 'https://m3.8js.net:99/1916/501204165042405.mp3',
cover: require('../../assets/img/music-cover/2.png'),
cover: new URL('../../assets/img/music-cover/2.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -203,7 +203,7 @@ export default { @@ -203,7 +203,7 @@ export default {
{
name: '蜗牛',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/3684.mp3',
cover: require('../../assets/img/music-cover/3.png'),
cover: new URL('../../assets/img/music-cover/3.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -213,7 +213,7 @@ export default { @@ -213,7 +213,7 @@ export default {
{
name: '半岛铁盒',
mp3: 'https://m3.8js.net:99/2016n/46/94745.mp3',
cover: require('../../assets/img/music-cover/4.png'),
cover: new URL('../../assets/img/music-cover/4.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -223,7 +223,7 @@ export default { @@ -223,7 +223,7 @@ export default {
{
name: '轨迹',
mp3: 'https://m3.8js.net:99/1832/411204324135934.mp3',
cover: require('../../assets/img/music-cover/5.png'),
cover: new URL('../../assets/img/music-cover/5.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -233,7 +233,7 @@ export default { @@ -233,7 +233,7 @@ export default {
{
name: '七里香',
mp3: 'https://m3.8js.net:99/2016n/14/53717.mp3',
cover: require('../../assets/img/music-cover/6.png'),
cover: new URL('../../assets/img/music-cover/6.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -243,7 +243,7 @@ export default { @@ -243,7 +243,7 @@ export default {
{
name: '发如雪',
mp3: 'https://m3.8js.net:99/2014/211204142150965.mp3',
cover: require('../../assets/img/music-cover/7.png'),
cover: new URL('../../assets/img/music-cover/7.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -253,7 +253,7 @@ export default { @@ -253,7 +253,7 @@ export default {
{
name: '霍元甲',
mp3: 'https://m3.8js.net:99/1921/261204212643140.mp3',
cover: require('../../assets/img/music-cover/8.png'),
cover: new URL('../../assets/img/music-cover/8.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -263,7 +263,7 @@ export default { @@ -263,7 +263,7 @@ export default {
{
name: '千里之外(周杰伦/费玉清)',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/121.mp3',
cover: require('../../assets/img/music-cover/9.png'),
cover: new URL('../../assets/img/music-cover/9.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -273,7 +273,7 @@ export default { @@ -273,7 +273,7 @@ export default {
{
name: '菊花台',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/2022.mp3',
cover: require('../../assets/img/music-cover/10.png'),
cover: new URL('../../assets/img/music-cover/10.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -283,7 +283,7 @@ export default { @@ -283,7 +283,7 @@ export default {
{
name: '不能说的秘密',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/165.mp3',
cover: require('../../assets/img/music-cover/11.png'),
cover: new URL('../../assets/img/music-cover/11.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -293,7 +293,7 @@ export default { @@ -293,7 +293,7 @@ export default {
{
name: '牛仔很忙',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/219.mp3',
cover: require('../../assets/img/music-cover/12.png'),
cover: new URL('../../assets/img/music-cover/12.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -303,7 +303,7 @@ export default { @@ -303,7 +303,7 @@ export default {
{
name: '给我一首歌的时间',
mp3: 'https://m3.8js.net:99/1938/041204380445445.mp3',
cover: require('../../assets/img/music-cover/13.jpg'),
cover: new URL('../../assets/img/music-cover/13.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -313,7 +313,7 @@ export default { @@ -313,7 +313,7 @@ export default {
{
name: '烟花易冷',
mp3: 'https://m3.8js.net:99/1828/051204280535192.mp3',
cover: require('../../assets/img/music-cover/14.jpg'),
cover: new URL('../../assets/img/music-cover/14.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -323,7 +323,7 @@ export default { @@ -323,7 +323,7 @@ export default {
{
name: '惊叹号',
mp3: 'https://m3.8js.net:99/20111103/150.mp3',
cover: require('../../assets/img/music-cover/15.jpg'),
cover: new URL('../../assets/img/music-cover/15.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -333,7 +333,7 @@ export default { @@ -333,7 +333,7 @@ export default {
{
name: '明明就',
mp3: 'https://m3.8js.net:99/2016n/27/96537.mp3',
cover: require('../../assets/img/music-cover/16.jpg'),
cover: new URL('../../assets/img/music-cover/16.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -343,7 +343,7 @@ export default { @@ -343,7 +343,7 @@ export default {
{
name: '算什么男人',
mp3: 'https://m3.8js.net:99/20150107/429.mp3',
cover: require('../../assets/img/music-cover/17.jpg'),
cover: new URL('../../assets/img/music-cover/17.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -353,7 +353,7 @@ export default { @@ -353,7 +353,7 @@ export default {
{
name: '告白气球',
mp3: 'https://m3.8js.net:99/20161016/481.mp3',
cover: require('../../assets/img/music-cover/18.jpg'),
cover: new URL('../../assets/img/music-cover/18.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,

36
src/pages/home/SearchPage.vue

@ -307,7 +307,7 @@ export default { @@ -307,7 +307,7 @@ export default {
{
name: '龙卷风',
"mp3": "http://im5.tongbu.com/rings/singerring/zt_uunGo_1/5605.mp3",
cover: require('../../assets/img/music-cover/1.png'),
cover: new URL('../../assets/img/music-cover/1.png', import.meta.url).href,
author: '周杰伦',
duration: 99,
use_count: 37441000,
@ -317,7 +317,7 @@ export default { @@ -317,7 +317,7 @@ export default {
{
name: '爱在西元前',
mp3: 'https://m3.8js.net:99/1916/501204165042405.mp3',
cover: require('../../assets/img/music-cover/2.png'),
cover: new URL('../../assets/img/music-cover/2.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -327,7 +327,7 @@ export default { @@ -327,7 +327,7 @@ export default {
{
name: '蜗牛',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/3684.mp3',
cover: require('../../assets/img/music-cover/3.png'),
cover: new URL('../../assets/img/music-cover/3.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -337,7 +337,7 @@ export default { @@ -337,7 +337,7 @@ export default {
{
name: '半岛铁盒',
mp3: 'https://m3.8js.net:99/2016n/46/94745.mp3',
cover: require('../../assets/img/music-cover/4.png'),
cover: new URL('../../assets/img/music-cover/4.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -347,7 +347,7 @@ export default { @@ -347,7 +347,7 @@ export default {
{
name: '轨迹',
mp3: 'https://m3.8js.net:99/1832/411204324135934.mp3',
cover: require('../../assets/img/music-cover/5.png'),
cover: new URL('../../assets/img/music-cover/5.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -357,7 +357,7 @@ export default { @@ -357,7 +357,7 @@ export default {
{
name: '七里香',
mp3: 'https://m3.8js.net:99/2016n/14/53717.mp3',
cover: require('../../assets/img/music-cover/6.png'),
cover: new URL('../../assets/img/music-cover/6.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -367,7 +367,7 @@ export default { @@ -367,7 +367,7 @@ export default {
{
name: '发如雪',
mp3: 'https://m3.8js.net:99/2014/211204142150965.mp3',
cover: require('../../assets/img/music-cover/7.png'),
cover: new URL('../../assets/img/music-cover/7.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -377,7 +377,7 @@ export default { @@ -377,7 +377,7 @@ export default {
{
name: '霍元甲',
mp3: 'https://m3.8js.net:99/1921/261204212643140.mp3',
cover: require('../../assets/img/music-cover/8.png'),
cover: new URL('../../assets/img/music-cover/8.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -387,7 +387,7 @@ export default { @@ -387,7 +387,7 @@ export default {
{
name: '千里之外(周杰伦/费玉清)',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/121.mp3',
cover: require('../../assets/img/music-cover/9.png'),
cover: new URL('../../assets/img/music-cover/9.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -397,7 +397,7 @@ export default { @@ -397,7 +397,7 @@ export default {
{
name: '菊花台',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/2022.mp3',
cover: require('../../assets/img/music-cover/10.png'),
cover: new URL('../../assets/img/music-cover/10.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -407,7 +407,7 @@ export default { @@ -407,7 +407,7 @@ export default {
{
name: '不能说的秘密',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/165.mp3',
cover: require('../../assets/img/music-cover/11.png'),
cover: new URL('../../assets/img/music-cover/11.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -417,7 +417,7 @@ export default { @@ -417,7 +417,7 @@ export default {
{
name: '牛仔很忙',
mp3: 'http://im5.tongbu.com/rings/singerring/zt_uunGo_1/219.mp3',
cover: require('../../assets/img/music-cover/12.png'),
cover: new URL('../../assets/img/music-cover/12.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -427,7 +427,7 @@ export default { @@ -427,7 +427,7 @@ export default {
{
name: '给我一首歌的时间',
mp3: 'https://m3.8js.net:99/1938/041204380445445.mp3',
cover: require('../../assets/img/music-cover/13.jpg'),
cover: new URL('../../assets/img/music-cover/13.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -437,7 +437,7 @@ export default { @@ -437,7 +437,7 @@ export default {
{
name: '烟花易冷',
mp3: 'https://m3.8js.net:99/1828/051204280535192.mp3',
cover: require('../../assets/img/music-cover/14.jpg'),
cover: new URL('../../assets/img/music-cover/14.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -447,7 +447,7 @@ export default { @@ -447,7 +447,7 @@ export default {
{
name: '惊叹号',
mp3: 'https://m3.8js.net:99/20111103/150.mp3',
cover: require('../../assets/img/music-cover/15.jpg'),
cover: new URL('../../assets/img/music-cover/15.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -457,7 +457,7 @@ export default { @@ -457,7 +457,7 @@ export default {
{
name: '明明就',
mp3: 'https://m3.8js.net:99/2016n/27/96537.mp3',
cover: require('../../assets/img/music-cover/16.jpg'),
cover: new URL('../../assets/img/music-cover/16.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -467,7 +467,7 @@ export default { @@ -467,7 +467,7 @@ export default {
{
name: '算什么男人',
mp3: 'https://m3.8js.net:99/20150107/429.mp3',
cover: require('../../assets/img/music-cover/17.jpg'),
cover: new URL('../../assets/img/music-cover/17.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,
@ -477,7 +477,7 @@ export default { @@ -477,7 +477,7 @@ export default {
{
name: '告白气球',
mp3: 'https://m3.8js.net:99/20161016/481.mp3',
cover: require('../../assets/img/music-cover/18.jpg'),
cover: new URL('../../assets/img/music-cover/18.jpg', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,

2
src/pages/home/SubmitReport.vue

@ -62,7 +62,7 @@ export default { @@ -62,7 +62,7 @@ export default {
await this.$sleep(500)
this.$hideLoading()
this.photos.push(
require(`../../assets/img/poster/${this.photos.length}.jpg`)
new URL(`../../assets/img/poster/${this.photos.length}.jpg`)
)
}

4
src/pages/login/Login.vue

@ -74,10 +74,10 @@ export default { @@ -74,10 +74,10 @@ export default {
login: false,
getPhone: false,
}
}
},
computed: {},
computed: {
},
created() {
this.getPhone()
},

12
src/pages/me/Me.vue

@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
@touchmove="touchMove($event)"
@touchend="touchEnd($event)">
<div ref="desc" class="desc">
<header ref="header" @click="previewImg = require('../../assets/img/header-bg.png')"></header>
<header ref="header" @click="previewImg = new URL('../../assets/img/header-bg.png')"></header>
<div class="detail">
<div class="head">
<img :src="$imgPreview(userinfo.avatar)" class="head-image"
@ -52,16 +52,16 @@ @@ -52,16 +52,16 @@
<div class="number mb1r">
<span class="mr1r" v-if="userinfo.is_private">私密账号</span>
<span>抖音号{{ userinfo.unique_id }}</span>
<img src="../../assets/img/icon/me/qrcode-gray.png" alt="" @click.stop="$nav('/my-card')">
<img src="../../assets/img/icon/me/qrcode-gray.png" alt="" @click.stop="$nav('/me/my-card')">
</div>
<div class="signature f12" @click="$nav('/edit-userinfo-item',{type:3})">
<div class="signature f12" @click="$nav('/me/edit-userinfo-item',{type:3})">
<template v-if="!userinfo.desc">
<span>点击添加介绍让大家认识你...</span>
<img src="../../assets/img/icon/me/write-gray.png" alt="">
</template>
<div v-else class="text" v-html="userinfo.desc"></div>
</div>
<div class="more" @click="$nav('/edit-userinfo')">
<div class="more" @click="$nav('/me/edit-userinfo')">
<div class="age item" v-if="userinfo.birthday">
<img v-if="userinfo.sex == 0" src="../../assets/img/icon/me/woman.png" alt="">
<img v-if="userinfo.sex == 1" src="../../assets/img/icon/me/man.png" alt="">
@ -97,7 +97,7 @@ @@ -97,7 +97,7 @@
</div>
</div>
<div class="my-buttons">
<div class="button" @click="$nav('/edit-userinfo')">
<div class="button" @click="$nav('/me/edit-userinfo')">
<span>编辑资料</span>
</div>
<div class="button" @click="$nav('/people/find-acquaintance')">
@ -222,7 +222,7 @@ @@ -222,7 +222,7 @@
</div>
<div class="line"></div>
<div class="li" @click="$nav('/my-card')">
<div class="li" @click="$nav('/me/my-card')">
<img src="../../assets/img/icon/newicon/left_menu/qrcode.png" alt="">
<span>我的二维码</span>
</div>

2
src/pages/me/MyMusic.vue

@ -140,7 +140,7 @@ export default { @@ -140,7 +140,7 @@ export default {
currentMusic: {
name: '告白气球',
mp3: 'https://mp32.9ku.com/upload/128/2017/02/05/858423.mp3',
cover: require('../../assets/img/music-cover/7.png'),
cover: new URL('../../assets/img/music-cover/7.png', import.meta.url).href,
author: '周杰伦',
duration: 60,
use_count: 37441000,

4
src/pages/me/Uploader.vue

@ -207,7 +207,7 @@ @@ -207,7 +207,7 @@
</div>
</template>
<script>
<script lang="jsx">
import Posters from '../../components/Posters'
import Indicator from '../../components/slide/Indicator'
import {nextTick} from 'vue'
@ -244,7 +244,7 @@ export default { @@ -244,7 +244,7 @@ export default {
<span>喜欢</span>
{
this.localAuthor.is_private === 1 &&
<img src={require('../../assets/img/icon/components/follow/lock.png')} alt=""/>
<img src={new URL('../../assets/img/icon/components/follow/lock.png', import.meta.url).href} alt=""/>
}
</div>
</div>

4
src/pages/me/components/SlideItemMusic.vue

@ -67,9 +67,9 @@ @@ -67,9 +67,9 @@
</div>
</template>
<script>
import {nextTick} from "_vue@3.2.4@vue";
import {nextTick} from "vue";
import globalMethods from "../../../utils/global-methods";
import gaobaiqiqiu from "../../../assets/data/lyrics/gaobaiqiqiu.lrc";
import gaobaiqiqiu from "../../../assets/data/lyrics/gaobaiqiqiu.lrc?raw";
export default {
name: "SlideItemMusic",

8
src/pages/me/userinfo/AddSchool.vue

@ -11,14 +11,14 @@ @@ -11,14 +11,14 @@
</template>
</BaseHeader>
<div class="content">
<div class="row" @click="$nav('/choose-school')">
<div class="row" @click="$nav('/me/choose-school')">
<div class="left">学校</div>
<div class="right">
<span>{{ isEmpty(localSchool.name) }}</span>
<back scale='1' direction="right"></back>
</div>
</div>
<div class="row" @click="checkGo('/choose-department')">
<div class="row" @click="checkGo('/me/choose-department')">
<div class="left">院系</div>
<div class="right">
<span>{{ isEmpty(localSchool.department) }}</span>
@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
<back scale='1' direction="right"></back>
</div>
</div>
<div class="row" @click="$nav('/display-type',{displayType : localSchool.displayType})">
<div class="row" @click="$nav('/me/display-type',{displayType : localSchool.displayType})">
<div class="left">展示范围</div>
<div class="right">
<span>{{ displayType }}</span>
@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
import {mapState} from 'vuex'
import enums from '../../../utils/enums'
import {inject} from "vue";
import MobileSelect from "mobile-select";
import MobileSelect from "../../../components/mobile-select/mobile-select";
import ConfirmDialog from "../../../components/dialog/ConfirmDialog";
import Loading from "../../../components/Loading";

2
src/pages/me/userinfo/ChooseDepartment.vue

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<span class="f16">选择院系</span>
</template>
<template v-slot:right>
<span class="f14" @click="$nav('/declare-school',{type:2})">没有找到?</span>
<span class="f14" @click="$nav('/me/declare-school',{type:2})">没有找到?</span>
</template>
</BaseHeader>
<div class="content">

2
src/pages/me/userinfo/ChooseLocation.vue

@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
<div class="title">
<span>其他地区</span>
</div>
<div class="row" @click="$nav('/choose-province')">
<div class="row" @click="$nav('/me/choose-province')">
<span>中国</span>
<div class="right">
<back scale=".8" direction="right"></back>

2
src/pages/me/userinfo/ChooseProvince.vue

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
</BaseHeader>
<div class="content">
<div class="schools">
<div class="row" @click="$nav('/choose-city')" v-for="item in list">
<div class="row" @click="$nav('/me/choose-city')" v-for="item in list">
<span>{{ item }}</span>
<div class="right">
<back scale=".8" direction="right"></back>

4
src/pages/me/userinfo/ChooseSchool.vue

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<span class="f16">添加学校</span>
</template>
<template v-slot:right>
<span class="f14" @click="$nav('/declare-school',{type:1})">没有找到?</span>
<span class="f14" @click="$nav('/me/declare-school',{type:1})">没有找到?</span>
</template>
<template v-slot:bottom>
<Search class="mt1r mb1r ml2r mr2r" placeholder="搜索大学名称"
@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
<img src="../../../assets/img/icon/head-image.jpeg" alt="">
<div class="title">搜索结果为空</div>
<div class="sub-title">没有搜索到相关的内容</div>
<div class="btn" @click="$nav('/declare-school')">没有学校信息去申报</div>
<div class="btn" @click="$nav('/me/declare-school')">没有学校信息去申报</div>
</div>
</div>
</div>

12
src/pages/me/userinfo/EditUserInfo.vue

@ -16,21 +16,21 @@ @@ -16,21 +16,21 @@
</div>
<span>点击更换头像</span>
</div>
<div class="row" @click="$nav('/edit-userinfo-item',{type:1})">
<div class="row" @click="$nav('/me/edit-userinfo-item',{type:1})">
<div class="left">名字</div>
<div class="right">
<span>{{ isEmpty(userinfo.nickname) }}</span>
<back scale=".8" direction="right"></back>
</div>
</div>
<div class="row" @click="$nav('/edit-userinfo-item',{type:2})">
<div class="row" @click="$nav('/me/edit-userinfo-item',{type:2})">
<div class="left">抖音号</div>
<div class="right">
<span>{{ isEmpty(userinfo.unique_id) }}</span>
<back scale=".8" direction="right"></back>
</div>
</div>
<div class="row" @click="$nav('/edit-userinfo-item',{type:3})">
<div class="row" @click="$nav('/me/edit-userinfo-item',{type:3})">
<div class="left">简介</div>
<div class="right">
<span>{{ isEmpty(userinfo.desc) }}</span>
@ -52,14 +52,14 @@ @@ -52,14 +52,14 @@
<back scale=".8" direction="right"></back>
</div>
</div>
<div class="row" @click="$nav('/choose-location')">
<div class="row" @click="$nav('/me/choose-location')">
<div class="left">所在地</div>
<div class="right">
<span>{{ isEmpty(userinfo.location) }}</span>
<back scale=".8" direction="right"></back>
</div>
</div>
<div class="row" @click="$nav('/add-school')">
<div class="row" @click="$nav('/me/add-school')">
<div class="left">学校</div>
<div class="right">
<span>{{ isEmpty(userinfo.school.name) }}</span>
@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
</template>
<script>
import MobileSelect from "mobile-select";
import MobileSelect from "../../../components/mobile-select/mobile-select";
import {mapState} from "vuex";
export default {

2
src/pages/me/userinfo/EditUserInfoItem.vue

@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
//TODO 12
import MobileSelect from "mobile-select";
import MobileSelect from "../../../components/mobile-select/mobile-select";
import {mapState} from "vuex";
export default {

16
src/pages/message/Chat.vue

@ -160,7 +160,7 @@ export default { @@ -160,7 +160,7 @@ export default {
{
type: MESSAGE_TYPE.MEME,
state: AUDIO_STATE.NORMAL,
data: require('../../assets/img/poster/1.jpg'),
data: new URL('../../assets/img/poster/1.jpg', import.meta.url).href,
time: '2021-01-02 21:21',
user: {
id: 2,
@ -180,7 +180,7 @@ export default { @@ -180,7 +180,7 @@ export default {
{
type: MESSAGE_TYPE.IMAGE,
state: AUDIO_STATE.NORMAL,
data: require('../../assets/img/poster/1.jpg'),
data: new URL('../../assets/img/poster/1.jpg', import.meta.url).href,
time: '2021-01-02 21:21',
user: {
id: 1,
@ -190,7 +190,7 @@ export default { @@ -190,7 +190,7 @@ export default {
{
type: MESSAGE_TYPE.IMAGE,
state: AUDIO_STATE.NORMAL,
data: require('../../assets/img/poster/1.jpg'),
data: new URL('../../assets/img/poster/1.jpg', import.meta.url).href,
time: '2021-01-02 21:21',
user: {
id: 1,
@ -324,10 +324,10 @@ export default { @@ -324,10 +324,10 @@ export default {
type: MESSAGE_TYPE.DOUYIN_VIDEO,
state: VIDEO_STATE.VALID,
data: {
poster: require('../../assets/img/poster/3.jpg'),
poster: new URL('../../assets/img/poster/3.jpg', import.meta.url).href,
author: {
name: 'safasdfassafasdfassafasdfassafasdfas',
avatar: require('../../assets/img/icon/head-image.jpeg')
avatar: new URL('../../assets/img/icon/head-image.jpeg',import.meta.url).href
},
title: '服了asd'
},
@ -341,10 +341,10 @@ export default { @@ -341,10 +341,10 @@ export default {
type: MESSAGE_TYPE.DOUYIN_VIDEO,
state: VIDEO_STATE.VALID,
data: {
poster: require('../../assets/img/poster/3.jpg'),
poster: new URL('../../assets/img/poster/3.jpg', import.meta.url).href,
author: {
name: 'safasdfassafasdfassafasdfassafasdfas',
avatar: require('../../assets/img/icon/head-image.jpeg')
avatar: new URL('../../assets/img/icon/head-image.jpeg',import.meta.url).href
},
title: '服了asd'
},
@ -358,7 +358,7 @@ export default { @@ -358,7 +358,7 @@ export default {
type: MESSAGE_TYPE.VIDEO,
state: VIDEO_STATE.VALID,
data: {
poster: require('../../assets/img/poster/3.jpg'),
poster: new URL('../../assets/img/poster/3.jpg', import.meta.url).href,
},
time: '2021-01-02 21:21',
user: {

148
src/pages/message/Message.vue

@ -366,16 +366,39 @@ @@ -366,16 +366,39 @@
@notice="searching = false"
:isShowRightText="true"/>
<div class="more-chat">
<div class="sub-title-g">更多聊天</div>
<People v-for="(item,index) in moreChat"
:key="item.id"
:people="item"/>
<template v-if="searchKey">
<div class="sub-title" v-if="searchFriendsAll.length">
<span>联系人</span>
<div class="right" v-if="searchFriendsAll.length > 3" @click="$nav('/message/more-search',{key:searchKey})">
<span>更多联系人</span>
<back mode="gray" img="back" scale=".6" direction="right"/>
</div>
</div>
<People v-for="(item,index) in searchFriendsAll.slice(0,3)"
:key="item.id"
mode="search"
:searchKey="searchKey"
:people="item"/>
<div class="goto-search-page" @click="$nav('/home/search',{key:searchKey})">
<img class="icon" src="../../assets/img/icon/search-light.png" alt="">
<div class="right">
<div class="left">
<span>搜索 <span style="color: yellow">{{ searchKey }}</span></span>
<span class="second-text-color f12">视频用户音乐话题地点等</span>
</div>
<back mode="gray" img="back" direction="right" scale=".7"/>
</div>
</div>
</template>
<template v-else>
<div class="sub-title">更多聊天</div>
<People v-for="(item,index) in moreChat"
:key="item.id"
:people="item"/>
</template>
</div>
</div>
</div>
</template>
@ -405,7 +428,7 @@ export default { @@ -405,7 +428,7 @@ export default {
data() {
return {
isShowRecommend: false,
searching: true,
searching: false,
searchKey: '',
createChatSearchKey: '',
showJoinedChat: false,
@ -413,56 +436,6 @@ export default { @@ -413,56 +436,6 @@ export default {
createChatDialog: false,
isShowRightText: false,
text: 'AAAAAAAAA、BBBBBBBBBBBBB、CCCCCCCC',
// friends: [
// {
// avatar: '',
// name: '11',
// account: '173123141231qoqo',
// select: false
// },
// {
// avatar: '',
// name: 'Boooo',
// account: '234242ooo',
// select: false
// },
// {
// avatar: '',
// name: '',
// account: '3029342',
// select: false
// },
// {
// avatar: '',
// name: 'zzzzz',
// account: '6034592',
// select: false
// },
// {
// avatar: '',
// name: 'zzzzz',
// account: '6034592',
// select: false
// },
// {
// avatar: '',
// name: 'zzzzz',
// account: '6034592',
// select: false
// },
// {
// avatar: '',
// name: 'zzzzz',
// account: '6034592',
// select: false
// },
// {
// avatar: '',
// name: 'zzzzz',
// account: '6034592',
// select: false
// },
// ],
searchFriends: [],
recommend: [],
@ -473,6 +446,11 @@ export default { @@ -473,6 +446,11 @@ export default {
...mapState(['friends', 'userinfo']),
selectFriends() {
return this.friends.all.filter(v => v.select).length
},
searchFriendsAll() {
return this.friends.all.filter(v => {
return v.name.search(this.searchKey) !== -1 || v.account.search(this.searchKey) !== -1
})
}
},
watch: {
@ -771,7 +749,7 @@ export default { @@ -771,7 +749,7 @@ export default {
}
}
/deep/ #BaseHeader .header {
:deep(#BaseHeader .header) {
border-bottom: none;
.left {
@ -779,6 +757,7 @@ export default { @@ -779,6 +757,7 @@ export default {
}
}
.content {
padding-top: @header-height;
}
@ -1035,7 +1014,7 @@ export default { @@ -1035,7 +1014,7 @@ export default {
color: black !important;
}
/deep/ .People .content .left .name {
:deep(.People .content .left .name) {
color: black !important;
}
}
@ -1046,6 +1025,55 @@ export default { @@ -1046,6 +1025,55 @@ export default {
.searching {
padding: @padding-page;
.sub-title {
margin-top: @padding-page;
color: @second-text-color;
font-size: 1.2rem;
display: flex;
align-items: center;
justify-content: space-between;
.right {
display: flex;
align-items: center;
}
}
.goto-search-page {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: @padding-page;
margin-top: @padding-page;
border-top: 1px solid @line-color;
.icon {
border-radius: 50%;
padding: 1.3rem;
background: @second-btn-color-tran;
width: 2.2rem;
height: 2.2rem;
margin-right: 1rem;
}
.right {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
.left {
display: flex;
flex-direction: column;
justify-content: space-between;
.second-text-color {
margin-top: .5rem;
}
}
}
}
}
}

67
src/pages/message/MoreSearch.vue

@ -0,0 +1,67 @@ @@ -0,0 +1,67 @@
<template>
<div id="MoreSearch">
<div class="content">
<Search v-model="searchKey"
right-text="取消"
right-text-color="white"
@notice="$back"
:isShowRightText="true"/>
<People v-for="(item,index) in searchFriendsAll"
:key="item.id"
mode="search"
:searchKey="searchKey"
:people="item"/>
</div>
</div>
</template>
<script>
import Search from "../../components/Search";
import {mapState} from "vuex";
import People from "../people/components/People";
export default {
name: "MoreSearch",
components: {
Search,
People
},
data() {
return {
searchKey: ''
}
},
computed: {
...mapState(['friends', 'userinfo']),
searchFriendsAll() {
return this.friends.all.filter(v => {
return v.name.search(this.searchKey) !== -1 || v.account.search(this.searchKey) !== -1
})
}
},
watch: {},
created() {
this.searchKey = this.$route.query.key
},
methods: {}
}
</script>
<style scoped lang="less">
@import "@/assets/less/index";
#MoreSearch {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow: auto;
color: white;
font-size: 1.4rem;
.content {
padding: @padding-page;
}
}
</style>

2
src/pages/people/FollowAndFans.vue

@ -51,7 +51,7 @@ import People from './components/People' @@ -51,7 +51,7 @@ import People from './components/People'
import Search from '../../components/Search'
import Indicator from '../../components/slide/Indicator'
import FromBottomDialog from "../../components/dialog/FromBottomDialog";
import {mapState} from "_vuex@4.0.2@vuex";
import {mapState} from "vuex";
export default {
name: "FindAcquaintance",

17
src/pages/people/components/People.vue

@ -7,6 +7,19 @@ @@ -7,6 +7,19 @@
<div class="name">{{ people.name }}</div>
</div>
</template>
<template v-if="mode === 'search'">
<div class="left">
<div class="name">
<span v-if="people.name.indexOf(searchKey) > -1">{{ people.name.substr(0, people.name.indexOf(searchKey)) }}<span style="color: yellow">{{ searchKey }}</span>{{ people.name.substr(people.name.indexOf(searchKey) + searchKey.length) }}</span>
<span v-else>{{ people.name }}</span>
</div>
<div class="name f12">抖音id:
<span v-if="people.account.indexOf(searchKey) > -1">{{ people.account.substr(0, people.account.indexOf(searchKey)) }}<span style="color: yellow">{{ searchKey }}</span>{{ people.account.substr(people.account.indexOf(searchKey) + searchKey.length) }}</span>
<span v-else>{{ people.account }}</span>
</div>
</div>
</template>
<template v-if="mode === 'fans'">
@ -121,6 +134,10 @@ export default { @@ -121,6 +134,10 @@ export default {
mode: {
type: String,
default: 'normal'
},
searchKey: {
type: String,
default: ''
}
},
data() {

32
src/router/index.js

@ -67,6 +67,7 @@ import NoticeSetting from "../pages/message/notice/NoticeSetting"; @@ -67,6 +67,7 @@ import NoticeSetting from "../pages/message/notice/NoticeSetting";
import TaskNotice from "../pages/message/notice/TaskNotice";
import LiveNotice from "../pages/message/notice/LiveNotice";
import MoneyNotice from "../pages/message/notice/MoneyNotice";
import MoreSearch from "../pages/message/MoreSearch";
const routes = [
// {path: '', component: Music},
@ -85,12 +86,13 @@ const routes = [ @@ -85,12 +86,13 @@ const routes = [
{path: '/home/search', component: Search},
{path: '/home/live', component: LivePage},
{path: '/video-detail', component: VideoDetail},
{path: '/attention', component: Attention},
{path: '/publish', component: Publish},
{path: '/message', component: Message},
{path: '/message/more-search', component: MoreSearch},
{path: '/message/share-to-friend', component: Share2Friend},
{path: '/message/joined-group-chat', component: JoinedGroupChat},
{path: '/message/chat', component: Chat},
@ -106,21 +108,6 @@ const routes = [ @@ -106,21 +108,6 @@ const routes = [
{path: '/message/notice-setting', component: NoticeSetting},
{path: '/edit-userinfo', component: EditUserInfo},
{path: '/edit-userinfo-item', component: EditUserInfoItem},
{path: '/country-choose', component: countryChoose},
{path: '/my-card', component: MyCard},
{path: '/my-collect', component: MyCollect},
{path: '/video-detail', component: VideoDetail},
{path: '/add-school', component: AddSchool},
{path: '/choose-school', component: ChooseSchool},
{path: '/declare-school', component: DeclareSchool},
{path: '/choose-department', component: ChooseDepartment},
{path: '/display-type', component: DisplayType},
{path: '/choose-location', component: ChooseLocation},
{path: '/choose-province', component: ChooseProvince},
{path: '/choose-city', component: ChooseCity},
{path: '/people/find-acquaintance', component: FindAcquaintance},
{path: '/people/follow-and-fans', component: FollowAndFans},
@ -131,6 +118,19 @@ const routes = [ @@ -131,6 +118,19 @@ const routes = [
{path: '/set-remark', component: SetRemark},
{path: '/me', component: Me},
{path: '/me/edit-userinfo', component: EditUserInfo},
{path: '/me/edit-userinfo-item', component: EditUserInfoItem},
{path: '/me/country-choose', component: countryChoose},
{path: '/me/my-card', component: MyCard},
{path: '/me/my-collect', component: MyCollect},
{path: '/me/add-school', component: AddSchool},
{path: '/me/choose-school', component: ChooseSchool},
{path: '/me/declare-school', component: DeclareSchool},
{path: '/me/choose-department', component: ChooseDepartment},
{path: '/me/display-type', component: DisplayType},
{path: '/me/choose-location', component: ChooseLocation},
{path: '/me/choose-province', component: ChooseProvince},
{path: '/me/choose-city', component: ChooseCity},
{path: '/me/right-menu/look-history', component: LookHistory},
{path: '/me/right-menu/minor-protection/index', component: MinorProtectionIndex},
{path: '/me/right-menu/minor-protection/detail-setting', component: MinorProtectionDetailSetting},

65
src/store/index.js

@ -28,7 +28,7 @@ const store = Vuex.createStore({ @@ -28,7 +28,7 @@ const store = Vuex.createStore({
"unique_id_modify_time": "1630393144",
"unique_id": "10040050",
"favoriting_count": 143,
"avatar": require('../assets/img/icon/avatar/2.png'),
"avatar": new URL('../assets/img/icon/avatar/2.png', import.meta.url).href,
"city": "成都",
"province": '四川',
"country": "中国",
@ -50,7 +50,7 @@ const store = Vuex.createStore({ @@ -50,7 +50,7 @@ const store = Vuex.createStore({
"all": [
{
"id": "224e9a00-ffa0-4bc1-bb07-c318c7b02fa5",
"avatar": require('../assets/img/icon/avatar/1.png'),
"avatar": new URL('../assets/img/icon/avatar/1.png', import.meta.url).href,
"name": "何以为家",
"sex": "",
"age": null,
@ -69,7 +69,7 @@ const store = Vuex.createStore({ @@ -69,7 +69,7 @@ const store = Vuex.createStore({
},
{
"id": "2b446aa8-5d31-429a-8e39-d4705eb4e900",
"avatar": require('../assets/img/icon/avatar/19.png'),
"avatar": new URL('../assets/img/icon/avatar/19.png', import.meta.url).href,
"name": "浅唱↘我们的歌",
"sex": "",
"age": null,
@ -88,7 +88,7 @@ const store = Vuex.createStore({ @@ -88,7 +88,7 @@ const store = Vuex.createStore({
},
{
"id": "2d8622b4-7112-4bc7-a0cf-00a268a85504",
"avatar": require('../assets/img/icon/avatar/25.png'),
"avatar": new URL('../assets/img/icon/avatar/25.png', import.meta.url).href,
"name": "‘心’之天空",
"sex": "",
"age": null,
@ -107,7 +107,7 @@ const store = Vuex.createStore({ @@ -107,7 +107,7 @@ const store = Vuex.createStore({
},
{
"id": "2e38900b-65f7-426a-8e8b-edb403df35fb",
"avatar": require('../assets/img/icon/avatar/18.png'),
"avatar": new URL('../assets/img/icon/avatar/18.png', import.meta.url).href,
"name": "◇、_保持微笑ゞ",
"sex": "",
"age": null,
@ -126,7 +126,7 @@ const store = Vuex.createStore({ @@ -126,7 +126,7 @@ const store = Vuex.createStore({
},
{
"id": "3cd53cb5-04f8-4439-ad2b-e57b3f9b8c73",
"avatar": require('../assets/img/icon/avatar/26.png'),
"avatar": new URL('../assets/img/icon/avatar/26.png', import.meta.url).href,
"name": "好◇°我会Yi直在●",
"sex": "",
"age": null,
@ -144,7 +144,7 @@ const store = Vuex.createStore({ @@ -144,7 +144,7 @@ const store = Vuex.createStore({
},
{
"id": "46c77017-9dc6-4a48-bf96-560c6e7db06f",
"avatar": require('../assets/img/icon/avatar/4.png'),
"avatar": new URL('../assets/img/icon/avatar/4.png', import.meta.url).href,
"name": "甫韦茹",
"sex": "",
"age": null,
@ -162,7 +162,7 @@ const store = Vuex.createStore({ @@ -162,7 +162,7 @@ const store = Vuex.createStore({
},
{
"id": "4df770d7-a414-4e02-8f9e-72ebd87eb93e",
"avatar": require('../assets/img/icon/avatar/12.png'),
"avatar": new URL('../assets/img/icon/avatar/12.png', import.meta.url).href,
"name": "幸福泡泡",
"sex": "",
"age": null,
@ -180,7 +180,7 @@ const store = Vuex.createStore({ @@ -180,7 +180,7 @@ const store = Vuex.createStore({
},
{
"id": "5ebb4d7a-c7ad-43c7-a830-9eb3ee423cb7",
"avatar": require('../assets/img/icon/avatar/3.png'),
"avatar": new URL('../assets/img/icon/avatar/3.png', import.meta.url).href,
"name": "蔡傲安",
"sex": "",
"age": null,
@ -198,7 +198,7 @@ const store = Vuex.createStore({ @@ -198,7 +198,7 @@ const store = Vuex.createStore({
},
{
"id": "7226092d-a2c5-4ffd-98d7-3b7ac814bca3",
"avatar": require('../assets/img/icon/avatar/16.png'),
"avatar": new URL('../assets/img/icon/avatar/16.png', import.meta.url).href,
"name": "心若向阳无谓伤悲",
"sex": "",
"age": null,
@ -216,7 +216,7 @@ const store = Vuex.createStore({ @@ -216,7 +216,7 @@ const store = Vuex.createStore({
},
{
"id": "72aef2a9-5573-4205-9288-706e19bccc7f",
"avatar": require('../assets/img/icon/avatar/10.png'),
"avatar": new URL('../assets/img/icon/avatar/10.png', import.meta.url).href,
"name": "A倒影着稚嫩的少年",
"sex": "",
"age": null,
@ -234,7 +234,7 @@ const store = Vuex.createStore({ @@ -234,7 +234,7 @@ const store = Vuex.createStore({
},
{
"id": "77c82d2e-9be1-45c2-a733-00445d2e7f2c",
"avatar": require('../assets/img/icon/avatar/22.png'),
"avatar": new URL('../assets/img/icon/avatar/22.png', import.meta.url).href,
"name": "一只喵的旅行。",
"sex": "",
"age": null,
@ -252,7 +252,7 @@ const store = Vuex.createStore({ @@ -252,7 +252,7 @@ const store = Vuex.createStore({
},
{
"id": "7b30566d-70eb-4a31-ae43-200917269a43",
"avatar": require('../assets/img/icon/avatar/14.png'),
"avatar": new URL('../assets/img/icon/avatar/14.png', import.meta.url).href,
"name": "℉阳光下的小情绪",
"sex": "",
"age": null,
@ -270,7 +270,7 @@ const store = Vuex.createStore({ @@ -270,7 +270,7 @@ const store = Vuex.createStore({
},
{
"id": "90c6ccd8-0653-4789-9348-28fba06d6ae3",
"avatar": require('../assets/img/icon/avatar/11.png'),
"avatar": new URL('../assets/img/icon/avatar/11.png', import.meta.url).href,
"name": "思念一直在",
"sex": "",
"age": null,
@ -288,7 +288,7 @@ const store = Vuex.createStore({ @@ -288,7 +288,7 @@ const store = Vuex.createStore({
},
{
"id": "a2c1310f-1a3c-430f-9b7c-557b9ccdd33d",
"avatar": require('../assets/img/icon/avatar/9.png'),
"avatar": new URL('../assets/img/icon/avatar/9.png', import.meta.url).href,
"name": "阎韶丽",
"sex": "",
"age": null,
@ -306,7 +306,7 @@ const store = Vuex.createStore({ @@ -306,7 +306,7 @@ const store = Vuex.createStore({
},
{
"id": "a7443b4f-b0fa-4409-a693-5f090aa763ee",
"avatar": require('../assets/img/icon/avatar/5.png'),
"avatar": new URL('../assets/img/icon/avatar/5.png', import.meta.url).href,
"name": "马佳婉清",
"sex": "",
"age": null,
@ -324,7 +324,7 @@ const store = Vuex.createStore({ @@ -324,7 +324,7 @@ const store = Vuex.createStore({
},
{
"id": "b49fd828-f8a7-4be0-a3bc-0a8fa312b2e8",
"avatar": require('../assets/img/icon/avatar/0.png'),
"avatar": new URL('../assets/img/icon/avatar/0.png', import.meta.url).href,
"name": "倒影着稚嫩的少年",
"sex": "",
"age": null,
@ -342,7 +342,7 @@ const store = Vuex.createStore({ @@ -342,7 +342,7 @@ const store = Vuex.createStore({
},
{
"id": "b632bffe-1cfb-408a-8255-b558e2faf49a",
"avatar": require('../assets/img/icon/avatar/8.png'),
"avatar": new URL('../assets/img/icon/avatar/8.png', import.meta.url).href,
"name": "买易槐",
"sex": "",
"age": null,
@ -360,7 +360,7 @@ const store = Vuex.createStore({ @@ -360,7 +360,7 @@ const store = Vuex.createStore({
},
{
"id": "c01f10dd-a270-42ab-876f-64a8beb22a69",
"avatar": require('../assets/img/icon/avatar/7.png'),
"avatar": new URL('../assets/img/icon/avatar/7.png', import.meta.url).href,
"name": "章昊苍",
"sex": "",
"age": null,
@ -378,7 +378,7 @@ const store = Vuex.createStore({ @@ -378,7 +378,7 @@ const store = Vuex.createStore({
},
{
"id": "d0bf11a3-a25b-4865-a047-c67de8e8af7b",
"avatar": require('../assets/img/icon/avatar/2.png'),
"avatar": new URL('../assets/img/icon/avatar/2.png', import.meta.url).href,
"name": "凌依晨",
"sex": "",
"age": null,
@ -396,7 +396,7 @@ const store = Vuex.createStore({ @@ -396,7 +396,7 @@ const store = Vuex.createStore({
},
{
"id": "d300b7a5-115d-41ba-a071-7d1781da331f",
"avatar": require('../assets/img/icon/avatar/23.png'),
"avatar": new URL('../assets/img/icon/avatar/23.png', import.meta.url).href,
"name": "为你锁住心",
"sex": "",
"age": null,
@ -414,7 +414,7 @@ const store = Vuex.createStore({ @@ -414,7 +414,7 @@ const store = Vuex.createStore({
},
{
"id": "deceba30-80fc-45c2-bd56-8d65091bb104",
"avatar": require('../assets/img/icon/avatar/13.png'),
"avatar": new URL('../assets/img/icon/avatar/13.png', import.meta.url).href,
"name": "原味青春",
"sex": "",
"age": null,
@ -432,7 +432,7 @@ const store = Vuex.createStore({ @@ -432,7 +432,7 @@ const store = Vuex.createStore({
},
{
"id": "e0c3d20d-5978-4339-962f-cffc6e29aff1",
"avatar": require('../assets/img/icon/avatar/24.png'),
"avatar": new URL('../assets/img/icon/avatar/24.png', import.meta.url).href,
"name": "一起走过的日子°",
"sex": "",
"age": null,
@ -450,7 +450,7 @@ const store = Vuex.createStore({ @@ -450,7 +450,7 @@ const store = Vuex.createStore({
},
{
"id": "e1fb6274-10fa-4d50-b9b1-6eefacfc2341",
"avatar": require('../assets/img/icon/avatar/15.png'),
"avatar": new URL('../assets/img/icon/avatar/15.png', import.meta.url).href,
"name": "看,熟悉旳风景",
"sex": "",
"age": null,
@ -468,7 +468,7 @@ const store = Vuex.createStore({ @@ -468,7 +468,7 @@ const store = Vuex.createStore({
},
{
"id": "eab1ef9b-70e6-4249-8d78-b4f6e1b0cb08",
"avatar": require('../assets/img/icon/avatar/20.png'),
"avatar": new URL('../assets/img/icon/avatar/20.png', import.meta.url).href,
"name": "dear°学会微笑",
"sex": "",
"age": null,
@ -486,7 +486,7 @@ const store = Vuex.createStore({ @@ -486,7 +486,7 @@ const store = Vuex.createStore({
},
{
"id": "ecb405e2-d057-4c85-a12b-a5fe9a7b8a05",
"avatar": require('../assets/img/icon/avatar/6.png'),
"avatar": new URL('../assets/img/icon/avatar/6.png', import.meta.url).href,
"name": "富察昕昕",
"sex": "",
"age": null,
@ -504,7 +504,7 @@ const store = Vuex.createStore({ @@ -504,7 +504,7 @@ const store = Vuex.createStore({
},
{
"id": "f09652a3-d6e1-4517-a15e-583a24a250e1",
"avatar": require('../assets/img/icon/avatar/17.png'),
"avatar": new URL('../assets/img/icon/avatar/17.png', import.meta.url).href,
"name": "蓝天下的迷彩?",
"sex": "",
"age": null,
@ -522,7 +522,7 @@ const store = Vuex.createStore({ @@ -522,7 +522,7 @@ const store = Vuex.createStore({
},
{
"id": "f676cc30-cc81-487a-9450-cbb1f3c5cde8",
"avatar": require('../assets/img/icon/avatar/21.png'),
"avatar": new URL('../assets/img/icon/avatar/21.png', import.meta.url).href,
"name": "伱的微笑",
"sex": "",
"age": null,
@ -542,7 +542,7 @@ const store = Vuex.createStore({ @@ -542,7 +542,7 @@ const store = Vuex.createStore({
"recent": [
{
"id": "3cd53cb5-04f8-4439-ad2b-e57b3f9b8c73",
"avatar": require('../assets/img/icon/avatar/26.png'),
"avatar": new URL('../assets/img/icon/avatar/26.png', import.meta.url).href,
"name": "好◇°我会Yi直在●",
"sex": "",
"age": null,
@ -560,7 +560,7 @@ const store = Vuex.createStore({ @@ -560,7 +560,7 @@ const store = Vuex.createStore({
},
{
"id": "77c82d2e-9be1-45c2-a733-00445d2e7f2c",
"avatar": require('../assets/img/icon/avatar/22.png'),
"avatar": new URL('../assets/img/icon/avatar/22.png', import.meta.url).href,
"name": "一只喵的旅行。",
"sex": "",
"age": null,
@ -580,7 +580,7 @@ const store = Vuex.createStore({ @@ -580,7 +580,7 @@ const store = Vuex.createStore({
"eachOther": [
{
"id": "2b446aa8-5d31-429a-8e39-d4705eb4e900",
"avatar": require('../assets/img/icon/avatar/19.png'),
"avatar": new URL('../assets/img/icon/avatar/19.png', import.meta.url).href,
"name": "浅唱↘我们的歌",
"sex": "",
"age": null,
@ -598,7 +598,7 @@ const store = Vuex.createStore({ @@ -598,7 +598,7 @@ const store = Vuex.createStore({
},
{
"id": "eab1ef9b-70e6-4249-8d78-b4f6e1b0cb08",
"avatar": require('../assets/img/icon/avatar/20.png'),
"avatar": new URL('../assets/img/icon/avatar/20.png', import.meta.url).href,
"name": "dear°学会微笑",
"sex": "",
"age": null,
@ -616,6 +616,7 @@ const store = Vuex.createStore({ @@ -616,6 +616,7 @@ const store = Vuex.createStore({
}
]
}
},
mutations: {
setUserinfo(store, val) {

5
src/utils/global-methods.js → src/utils/global-methods.jsx

@ -2,12 +2,15 @@ import * as Vue from "vue"; @@ -2,12 +2,15 @@ import * as Vue from "vue";
import SelectDialog from "../components/dialog/SelectDialog";
import SimpleConfirmDialog from "../components/dialog/SimpleConfirmDialog";
import ConfirmDialog from "../components/dialog/ConfirmDialog";
import Loading from "../components/Loading";
import Loading from "../components/Loading.vue";
import Config from '../config'
import NoticeDialog from "../components/dialog/NoticeDialog";
import dayjs from 'dayjs'
export default {
require2(url) {
return new URL(url, import.meta.url).href
},
$showLoading() {
const app = Vue.createApp({
render() {

26
vite.config.js

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import {resolve} from 'path'
function pathResolve(dir) {
return resolve(__dirname, ".", dir)
}
// https://vitejs.dev/config/
export default defineConfig({
base: './',
plugins: [
vue(),
vueJsx(),
],
resolve: {
alias: {
"@": pathResolve("src"),
},
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
},
build: {
sourcemap: false
}
})

35
vue.config.js

@ -1,35 +0,0 @@ @@ -1,35 +0,0 @@
// vue.config.js
const path = require('path')
const isProduction = process.env.NODE_ENV === 'production'
module.exports = {
publicPath: isProduction ? '' : '',
assetsDir: isProduction ? './' : './',
// productionSourceMap: false,
lintOnSave: false, //关闭eslint检查
devServer: {
open: true,
},
// chainWebpack: config => {
// config.module
// .rule('txt')
// .test( /\.(txt|lrc)$/)
// .use('raw-loader')
// .loader('raw-loader')
// .end()
// },
configureWebpack: {
module: {
rules: [
{
//解析txt、lrc文件
test: /\.(txt|lrc)$/,
exclude: /node_modules/,
include: path.join(__dirname, 'src'),
use: ['raw-loader']
}
]
},
}
}
Loading…
Cancel
Save