├── .gitignore
├── App.vue
├── LICENSE
├── README.md
├── main.js
├── manifest.json
├── node_modules
├── .bin
│ ├── xml2js
│ └── xml2js.cmd
├── .yarn-integrity
├── fast-xml-parser
│ ├── LICENSE
│ ├── README.md
│ ├── cli.js
│ ├── package.json
│ ├── src
│ │ ├── json2xml.js
│ │ ├── nimndata.js
│ │ ├── node2json.js
│ │ ├── node2json_str.js
│ │ ├── parser.d.ts
│ │ ├── parser.js
│ │ ├── read.js
│ │ ├── util.js
│ │ ├── validator.js
│ │ ├── xmlNode.js
│ │ └── xmlstr2xmlnode.js
│ ├── tasks
│ │ └── postinstall.js
│ └── yarn.lock
├── uni-ajax
│ ├── README.md
│ ├── dist
│ │ └── index.js
│ ├── package.json
│ └── src
│ │ ├── index.js
│ │ └── lib
│ │ ├── ajax.js
│ │ ├── defaults.js
│ │ ├── handle.js
│ │ ├── helpers.js
│ │ ├── interceptor.js
│ │ └── utils.js
└── uview-ui
│ ├── LICENSE
│ ├── README.md
│ ├── components
│ ├── u-action-sheet
│ │ └── u-action-sheet.vue
│ ├── u-alert-tips
│ │ └── u-alert-tips.vue
│ ├── u-avatar-cropper
│ │ ├── u-avatar-cropper.vue
│ │ └── weCropper.js
│ ├── u-avatar
│ │ └── u-avatar.vue
│ ├── u-back-top
│ │ └── u-back-top.vue
│ ├── u-badge
│ │ └── u-badge.vue
│ ├── u-button
│ │ └── u-button.vue
│ ├── u-calendar
│ │ └── u-calendar.vue
│ ├── u-car-keyboard
│ │ └── u-car-keyboard.vue
│ ├── u-card
│ │ └── u-card.vue
│ ├── u-cell-group
│ │ └── u-cell-group.vue
│ ├── u-cell-item
│ │ └── u-cell-item.vue
│ ├── u-checkbox-group
│ │ └── u-checkbox-group.vue
│ ├── u-checkbox
│ │ └── u-checkbox.vue
│ ├── u-circle-progress
│ │ └── u-circle-progress.vue
│ ├── u-col
│ │ └── u-col.vue
│ ├── u-collapse-item
│ │ └── u-collapse-item.vue
│ ├── u-collapse
│ │ └── u-collapse.vue
│ ├── u-column-notice
│ │ └── u-column-notice.vue
│ ├── u-count-down
│ │ └── u-count-down.vue
│ ├── u-count-to
│ │ └── u-count-to.vue
│ ├── u-divider
│ │ └── u-divider.vue
│ ├── u-dropdown-item
│ │ └── u-dropdown-item.vue
│ ├── u-dropdown
│ │ └── u-dropdown.vue
│ ├── u-empty
│ │ └── u-empty.vue
│ ├── u-field
│ │ └── u-field.vue
│ ├── u-form-item
│ │ └── u-form-item.vue
│ ├── u-form
│ │ └── u-form.vue
│ ├── u-full-screen
│ │ └── u-full-screen.vue
│ ├── u-gap
│ │ └── u-gap.vue
│ ├── u-grid-item
│ │ └── u-grid-item.vue
│ ├── u-grid
│ │ └── u-grid.vue
│ ├── u-icon
│ │ └── u-icon.vue
│ ├── u-image
│ │ └── u-image.vue
│ ├── u-index-anchor
│ │ └── u-index-anchor.vue
│ ├── u-index-list
│ │ └── u-index-list.vue
│ ├── u-input
│ │ └── u-input.vue
│ ├── u-keyboard
│ │ └── u-keyboard.vue
│ ├── u-lazy-load
│ │ └── u-lazy-load.vue
│ ├── u-line-progress
│ │ └── u-line-progress.vue
│ ├── u-line
│ │ └── u-line.vue
│ ├── u-link
│ │ └── u-link.vue
│ ├── u-loading-page
│ │ └── u-loading-page.vue
│ ├── u-loading
│ │ └── u-loading.vue
│ ├── u-loadmore
│ │ └── u-loadmore.vue
│ ├── u-mask
│ │ └── u-mask.vue
│ ├── u-message-input
│ │ └── u-message-input.vue
│ ├── u-modal
│ │ └── u-modal.vue
│ ├── u-navbar
│ │ └── u-navbar.vue
│ ├── u-no-network
│ │ └── u-no-network.vue
│ ├── u-notice-bar
│ │ └── u-notice-bar.vue
│ ├── u-number-box
│ │ └── u-number-box.vue
│ ├── u-number-keyboard
│ │ └── u-number-keyboard.vue
│ ├── u-parse
│ │ ├── libs
│ │ │ ├── CssHandler.js
│ │ │ ├── MpHtmlParser.js
│ │ │ ├── config.js
│ │ │ ├── handler.wxs
│ │ │ └── trees.vue
│ │ └── u-parse.vue
│ ├── u-picker
│ │ └── u-picker.vue
│ ├── u-popup
│ │ └── u-popup.vue
│ ├── u-radio-group
│ │ └── u-radio-group.vue
│ ├── u-radio
│ │ └── u-radio.vue
│ ├── u-rate
│ │ └── u-rate.vue
│ ├── u-read-more
│ │ └── u-read-more.vue
│ ├── u-row-notice
│ │ └── u-row-notice.vue
│ ├── u-row
│ │ └── u-row.vue
│ ├── u-search
│ │ └── u-search.vue
│ ├── u-section
│ │ └── u-section.vue
│ ├── u-select
│ │ └── u-select.vue
│ ├── u-skeleton
│ │ └── u-skeleton.vue
│ ├── u-slider
│ │ └── u-slider.vue
│ ├── u-steps
│ │ └── u-steps.vue
│ ├── u-sticky
│ │ └── u-sticky.vue
│ ├── u-subsection
│ │ └── u-subsection.vue
│ ├── u-swipe-action
│ │ └── u-swipe-action.vue
│ ├── u-swiper
│ │ └── u-swiper.vue
│ ├── u-switch
│ │ └── u-switch.vue
│ ├── u-tabbar
│ │ └── u-tabbar.vue
│ ├── u-table
│ │ └── u-table.vue
│ ├── u-tabs-swiper
│ │ └── u-tabs-swiper.vue
│ ├── u-tabs
│ │ └── u-tabs.vue
│ ├── u-tag
│ │ └── u-tag.vue
│ ├── u-td
│ │ └── u-td.vue
│ ├── u-th
│ │ └── u-th.vue
│ ├── u-time-line-item
│ │ └── u-time-line-item.vue
│ ├── u-time-line
│ │ └── u-time-line.vue
│ ├── u-toast
│ │ └── u-toast.vue
│ ├── u-top-tips
│ │ └── u-top-tips.vue
│ ├── u-tr
│ │ └── u-tr.vue
│ ├── u-upload
│ │ └── u-upload.vue
│ ├── u-verification-code
│ │ └── u-verification-code.vue
│ └── u-waterfall
│ │ └── u-waterfall.vue
│ ├── iconfont.css
│ ├── index.js
│ ├── index.scss
│ ├── libs
│ ├── config
│ │ ├── config.js
│ │ └── zIndex.js
│ ├── css
│ │ ├── color.scss
│ │ ├── common.scss
│ │ ├── style.components.scss
│ │ ├── style.h5.scss
│ │ ├── style.mp.scss
│ │ ├── style.nvue.scss
│ │ └── style.vue.scss
│ ├── function
│ │ ├── $parent.js
│ │ ├── addUnit.js
│ │ ├── bem.js
│ │ ├── color.js
│ │ ├── colorGradient.js
│ │ ├── debounce.js
│ │ ├── deepClone.js
│ │ ├── deepMerge.js
│ │ ├── getParent.js
│ │ ├── guid.js
│ │ ├── md5.js
│ │ ├── queryParams.js
│ │ ├── random.js
│ │ ├── randomArray.js
│ │ ├── route.js
│ │ ├── sys.js
│ │ ├── test.js
│ │ ├── throttle.js
│ │ ├── timeFormat.js
│ │ ├── timeFrom.js
│ │ ├── toast.js
│ │ ├── trim.js
│ │ └── type2icon.js
│ ├── mixin
│ │ ├── mixin.js
│ │ └── mpShare.js
│ ├── request
│ │ └── index.js
│ ├── store
│ │ └── index.js
│ └── util
│ │ ├── area.js
│ │ ├── async-validator.js
│ │ ├── city.js
│ │ ├── emitter.js
│ │ └── province.js
│ ├── package.json
│ └── theme.scss
├── package-lock.json
├── package.json
├── pages.json
├── pages
├── detail
│ └── detail.vue
├── film
│ └── film.vue
├── history
│ └── history.vue
├── index
│ └── index.vue
├── me
│ └── me.vue
├── play
│ └── play.vue
├── site
│ └── site.vue
└── star
│ └── star.vue
├── static
└── images
│ ├── history1.png
│ ├── history2.png
│ ├── home1.png
│ ├── home2.png
│ ├── logo.png
│ ├── me1.png
│ ├── me2.png
│ ├── recommend1.png
│ ├── recommend2.png
│ ├── star1.png
│ └── star2.png
├── uni.scss
├── unpackage
├── dist
│ └── build
│ │ ├── .automator
│ │ └── app-plus
│ │ │ └── .automator.json
│ │ └── app-plus
│ │ ├── __uniappchooselocation.js
│ │ ├── __uniappes6.js
│ │ ├── __uniappopenlocation.js
│ │ ├── __uniapppicker.js
│ │ ├── __uniappquill.js
│ │ ├── __uniappquillimageresize.js
│ │ ├── __uniappscan.js
│ │ ├── __uniappsuccess.png
│ │ ├── __uniappview.html
│ │ ├── app-config-service.js
│ │ ├── app-config.js
│ │ ├── app-service.js
│ │ ├── app-view.js
│ │ ├── manifest.json
│ │ ├── static
│ │ └── images
│ │ │ ├── home1.png
│ │ │ ├── home2.png
│ │ │ ├── logo.png
│ │ │ ├── me1.png
│ │ │ ├── me2.png
│ │ │ ├── star1.png
│ │ │ └── star2.png
│ │ ├── view.css
│ │ └── view.umd.min.js
└── res
│ └── icons
│ ├── 1024x1024.png
│ ├── 120x120.png
│ ├── 144x144.png
│ ├── 152x152.png
│ ├── 167x167.png
│ ├── 180x180.png
│ ├── 192x192.png
│ ├── 20x20.png
│ ├── 29x29.png
│ ├── 40x40.png
│ ├── 58x58.png
│ ├── 60x60.png
│ ├── 72x72.png
│ ├── 76x76.png
│ ├── 80x80.png
│ ├── 87x87.png
│ └── 96x96.png
├── utils
├── database.js
├── initSetting.json
├── initSite.json
└── request.js
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | unpackage/dist/dev/
3 |
--------------------------------------------------------------------------------
/App.vue:
--------------------------------------------------------------------------------
1 |
16 |
17 |
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Hunlongyu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 官网
6 | 反馈
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
ZY Player APP
24 |
25 | ### ✨特性
26 |
27 | - 🍔 视频源支持自定义, 支持链接导入
28 | - 🌭 播放历史, 自动跳转历史进度
29 | - 🥪 支持搜索功能, 搜索结果图片显示
30 | - 🍿 支持收藏夹功能
31 | - 🍤 支持青少年模式
32 |
33 | ### 下载
34 |
35 | - 🍓 [Github -- 官方下载](https://github.com/Hunlongyu/ZY-Player-APP/releases)
36 |
37 | - 🍷 [Android](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-aliyun-fusdvvo5hcqnfd09ae/91e864a0-2e06-11eb-bd01-97bc1429a9ff.apk)
38 |
39 | - 🥤 [IOS](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-aliyun-fusdvvo5hcqnfd09ae/9298a1d0-2e06-11eb-899d-733ae62bed2f.ipa)
40 |
41 | **IOS 手机只能越狱安装, [IOS 自签教程, 适用于非越狱手机](https://www.i4.cn/news_detail_38195.html)**
42 |
43 | ### 🎨 截图
44 |
45 | | 🥼 首页 | 🧥 详情 | 👔 播放 |
46 | | :---: | :---: | :---: |
47 | |  |  |  |
48 | | 👕 收藏 | 👖 播放记录 | 🩳 视频源管理 |
49 | |  |  |  |
50 |
51 | ### 🍭 开发者
52 |
53 | | [Hunlongyu](https://github.com/Hunlongyu) | [cuiocean](https://github.com/cuiocean) |
54 | | :----------------------------------------------------------: | :----------------------------------------------------------: |
55 | |
|
|
56 |
--------------------------------------------------------------------------------
/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App'
3 |
4 | Vue.config.productionTip = false
5 |
6 | App.mpType = 'app'
7 |
8 | import uView from "uview-ui";
9 | Vue.use(uView);
10 |
11 | const app = new Vue({
12 | ...App
13 | })
14 | app.$mount()
15 |
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "ZY Player",
3 | "appid" : "__UNI__B85B395",
4 | "description" : "ZY Player 移动端 APP",
5 | "versionName" : "0.1.2",
6 | "versionCode" : 102,
7 | "transformPx" : false,
8 | /* 5+App特有相关 */
9 | "app-plus" : {
10 | "usingComponents" : true,
11 | "nvueCompiler" : "uni-app",
12 | "compilerVersion" : 3,
13 | "splashscreen" : {
14 | "alwaysShowBeforeRender" : false,
15 | "waiting" : true,
16 | "autoclose" : true,
17 | "delay" : 0
18 | },
19 | /* 模块配置 */
20 | "modules" : {
21 | "VideoPlayer" : {}
22 | },
23 | /* 应用发布信息 */
24 | "distribute" : {
25 | /* android打包配置 */
26 | "android" : {
27 | "permissions" : [
28 | "",
29 | "",
30 | ""
31 | ]
32 | },
33 | /* ios打包配置 */
34 | "ios" : {},
35 | /* SDK配置 */
36 | "sdkConfigs" : {
37 | "ad" : {}
38 | },
39 | "icons" : {
40 | "android" : {
41 | "hdpi" : "unpackage/res/icons/72x72.png",
42 | "xhdpi" : "unpackage/res/icons/96x96.png",
43 | "xxhdpi" : "unpackage/res/icons/144x144.png",
44 | "xxxhdpi" : "unpackage/res/icons/192x192.png"
45 | },
46 | "ios" : {
47 | "appstore" : "unpackage/res/icons/1024x1024.png",
48 | "ipad" : {
49 | "app" : "unpackage/res/icons/76x76.png",
50 | "app@2x" : "unpackage/res/icons/152x152.png",
51 | "notification" : "unpackage/res/icons/20x20.png",
52 | "notification@2x" : "unpackage/res/icons/40x40.png",
53 | "proapp@2x" : "unpackage/res/icons/167x167.png",
54 | "settings" : "unpackage/res/icons/29x29.png",
55 | "settings@2x" : "unpackage/res/icons/58x58.png",
56 | "spotlight" : "unpackage/res/icons/40x40.png",
57 | "spotlight@2x" : "unpackage/res/icons/80x80.png"
58 | },
59 | "iphone" : {
60 | "app@2x" : "unpackage/res/icons/120x120.png",
61 | "app@3x" : "unpackage/res/icons/180x180.png",
62 | "notification@2x" : "unpackage/res/icons/40x40.png",
63 | "notification@3x" : "unpackage/res/icons/60x60.png",
64 | "settings@2x" : "unpackage/res/icons/58x58.png",
65 | "settings@3x" : "unpackage/res/icons/87x87.png",
66 | "spotlight@2x" : "unpackage/res/icons/80x80.png",
67 | "spotlight@3x" : "unpackage/res/icons/120x120.png"
68 | }
69 | }
70 | }
71 | },
72 | "nativePlugins" : {},
73 | "uniStatistics" : {
74 | "enable" : true
75 | }
76 | },
77 | /* 快应用特有相关 */
78 | "quickapp" : {},
79 | /* 小程序特有相关 */
80 | "mp-weixin" : {
81 | "appid" : "",
82 | "setting" : {
83 | "urlCheck" : false
84 | },
85 | "usingComponents" : true
86 | },
87 | "mp-alipay" : {
88 | "usingComponents" : true
89 | },
90 | "mp-baidu" : {
91 | "usingComponents" : true
92 | },
93 | "mp-toutiao" : {
94 | "usingComponents" : true
95 | },
96 | "uniStatistics" : {
97 | "enable" : false
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/node_modules/.bin/xml2js:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 |
4 | case `uname` in
5 | *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6 | esac
7 |
8 | if [ -x "$basedir/node" ]; then
9 | "$basedir/node" "$basedir/../fast-xml-parser/cli.js" "$@"
10 | ret=$?
11 | else
12 | node "$basedir/../fast-xml-parser/cli.js" "$@"
13 | ret=$?
14 | fi
15 | exit $ret
16 |
--------------------------------------------------------------------------------
/node_modules/.bin/xml2js.cmd:
--------------------------------------------------------------------------------
1 | @IF EXIST "%~dp0\node.exe" (
2 | "%~dp0\node.exe" "%~dp0\..\fast-xml-parser\cli.js" %*
3 | ) ELSE (
4 | @SETLOCAL
5 | @SET PATHEXT=%PATHEXT:;.JS;=;%
6 | node "%~dp0\..\fast-xml-parser\cli.js" %*
7 | )
--------------------------------------------------------------------------------
/node_modules/.yarn-integrity:
--------------------------------------------------------------------------------
1 | {
2 | "systemParams": "win32-x64-83",
3 | "modulesFolders": [
4 | "node_modules"
5 | ],
6 | "flags": [],
7 | "linkedModules": [],
8 | "topLevelPatterns": [
9 | "fast-xml-parser@^3.17.4",
10 | "uni-ajax@^2.1.8",
11 | "uview-ui@^1.8.1"
12 | ],
13 | "lockfileEntries": {
14 | "fast-xml-parser@^3.17.4": "https://registry.npm.taobao.org/fast-xml-parser/download/fast-xml-parser-3.17.4.tgz#d668495fb3e4bbcf7970f3c24ac0019d82e76477",
15 | "uni-ajax@^2.1.8": "https://registry.npm.taobao.org/uni-ajax/download/uni-ajax-2.1.8.tgz#113de6d7cc162546f890467079e13e1d5c61e821",
16 | "uview-ui@^1.8.1": "https://registry.npm.taobao.org/uview-ui/download/uview-ui-1.8.2.tgz#701fa30be0704afff30cd048342db796004a7dc9"
17 | },
18 | "files": [],
19 | "artifacts": {}
20 | }
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Amit Kumar Gupta
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | If you use this library in a public repository then you give us the right to mention your company name and logo in user's list without further permission required, but you can request them to be taken down within 30 days.
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
24 |
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/cli.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | 'use strict';
3 | /*eslint-disable no-console*/
4 | const fs = require('fs');
5 | const path = require('path');
6 | const parser = require('./src/parser');
7 | const readToEnd = require('./src/read').readToEnd;
8 |
9 | if (process.argv[2] === '--help' || process.argv[2] === '-h') {
10 | console.log('Fast XML Parser ' + require(path.join(__dirname + '/package.json')).version);
11 | console.log('----------------');
12 | console.log('xml2js [-ns|-a|-c|-v|-V] [-o outputfile.json]');
13 | console.log('cat xmlfile.xml | xml2js [-ns|-a|-c|-v|-V] [-o outputfile.json]');
14 | console.log('-ns: remove namespace from tag and atrribute name.');
15 | console.log("-a: don't parse attributes.");
16 | console.log('-c: parse values to premitive type.');
17 | console.log('-v: validate before parsing.');
18 | console.log('-V: validate only.');
19 | } else if (process.argv[2] === '--version') {
20 | console.log(require(path.join(__dirname + '/package.json')).version);
21 | } else {
22 | const options = {
23 | ignoreNameSpace: true,
24 | ignoreAttributes: false,
25 | parseNodeValue: true,
26 | parseAttributeValue: true,
27 | };
28 | let fileName = '';
29 | let outputFileName;
30 | let validate = false;
31 | let validateOnly = false;
32 | for (let i = 2; i < process.argv.length; i++) {
33 | if (process.argv[i] === '-ns') {
34 | options.ignoreNameSpace = false;
35 | } else if (process.argv[i] === '-a') {
36 | options.ignoreAttributes = true;
37 | } else if (process.argv[i] === '-c') {
38 | options.parseNodeValue = false;
39 | options.parseAttributeValue = false;
40 | } else if (process.argv[i] === '-o') {
41 | outputFileName = process.argv[++i];
42 | } else if (process.argv[i] === '-v') {
43 | validate = true;
44 | } else if (process.argv[i] === '-V') {
45 | validateOnly = true;
46 | } else {
47 | //filename
48 | fileName = process.argv[i];
49 | }
50 | }
51 | const callback = function(xmlData) {
52 | let output = '';
53 | if (validate) {
54 | const result = parser.validate(xmlData);
55 | if (result === true) {
56 | output = JSON.stringify(parser.parse(xmlData, options), null, 4);
57 | } else {
58 | output = result;
59 | }
60 | } else if (validateOnly) {
61 | output = parser.validate(xmlData);
62 | process.exitCode = output === true ? 0 : 1;
63 | } else {
64 | output = JSON.stringify(parser.parse(xmlData, options), null, 4);
65 | }
66 | if (outputFileName) {
67 | writeToFile(outputFileName, output);
68 | } else {
69 | console.log(output);
70 | }
71 | };
72 |
73 | try {
74 | if (!fileName) {
75 | readToEnd(process.stdin, function(err, data) {
76 | if (err) {
77 | throw err;
78 | }
79 | callback(data.toString());
80 | });
81 | } else {
82 | fs.readFile(fileName, function(err, data) {
83 | if (err) {
84 | throw err;
85 | }
86 | callback(data.toString());
87 | });
88 | }
89 | } catch (e) {
90 | console.log('Seems an invalid file or stream.' + e);
91 | }
92 | }
93 |
94 | function writeToFile(fileName, data) {
95 | fs.writeFile(fileName, data, function(err) {
96 | if (err) {
97 | throw err;
98 | }
99 | console.log('JSON output has been written to ' + fileName);
100 | });
101 | }
102 |
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fast-xml-parser",
3 | "version": "3.17.4",
4 | "description": "Validate XML or Parse XML to JS/JSON very fast without C/C++ based libraries",
5 | "main": "./src/parser.js",
6 | "scripts": {
7 | "test": "jasmine spec/*spec.js",
8 | "unit": "jasmine",
9 | "perf": "node ./benchmark/perfTest3.js",
10 | "lint": "eslint src/*.js spec/*.js",
11 | "bundle": "webpack && webpack --config webpack-prod.config.js",
12 | "coverage": "istanbul cover -x \"cli.js\" -x \"spec/*spec.js\" jasmine spec/*spec.js;",
13 | "coverage:check": "istanbul check-coverage --branch 90 --statement 90",
14 | "postinstall": "node tasks/postinstall.js || exit 0",
15 | "prettier": "prettier --write src/**/*.js",
16 | "publish-please": "publish-please",
17 | "prepublishOnly": "publish-please guard"
18 | },
19 | "bin": {
20 | "xml2js": "./cli.js"
21 | },
22 | "repository": {
23 | "type": "git",
24 | "url": "https://github.com/NaturalIntelligence/fast-xml-parser"
25 | },
26 | "keywords": [
27 | "fast",
28 | "xml",
29 | "json",
30 | "parser",
31 | "xml2js",
32 | "x2js",
33 | "xml2json",
34 | "js",
35 | "traversable",
36 | "cli",
37 | "command",
38 | "validator",
39 | "validate",
40 | "transformer",
41 | "checker",
42 | "assert",
43 | "big",
44 | "js2xml",
45 | "json2xml",
46 | "nimn",
47 | "xml2nimn",
48 | "locale",
49 | "html"
50 | ],
51 | "author": "Amit Gupta (https://amitkumargupta.work/)",
52 | "contributors": [
53 | {
54 | "name": "Alfonso Muñoz-Pomer Fuentes",
55 | "email": "amunoz@ebi.ac.uk",
56 | "url": "https://github.com/alfonsomunozpomer"
57 | },
58 | {
59 | "name": "Steve Reichenbach",
60 | "url": "https://github.com/EyesOnlyNet"
61 | },
62 | {
63 | "name": "Vohmyanin Sergey Vasilevich",
64 | "url": "http://delagen.livejournal.com"
65 | },
66 | {
67 | "name": "Andrew Udvare",
68 | "url": "https://github.com/Tatsh"
69 | }
70 | ],
71 | "license": "MIT",
72 | "devDependencies": {
73 | "@babel/core": "^7.10.2",
74 | "@babel/plugin-transform-runtime": "^7.10.1",
75 | "@babel/preset-env": "^7.10.2",
76 | "@babel/register": "^7.10.1",
77 | "babel-loader": "^8.1.0",
78 | "eslint": "^5.16.0",
79 | "he": "^1.2.0",
80 | "http-server": "^0.12.3",
81 | "istanbul": "^0.4.5",
82 | "jasmine": "^3.5.0",
83 | "nimnjs": "^1.3.2",
84 | "prettier": "^1.19.1",
85 | "publish-please": "^5.5.1",
86 | "webpack": "^4.43.0",
87 | "webpack-cli": "^3.3.11"
88 | },
89 | "typings": "src/parser.d.ts",
90 | "funding": {
91 | "type": "paypal",
92 | "url": "https://paypal.me/naturalintelligence"
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/src/node2json.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const util = require('./util');
4 |
5 | const convertToJson = function(node, options) {
6 | const jObj = {};
7 |
8 | //when no child node or attr is present
9 | if ((!node.child || util.isEmptyObject(node.child)) && (!node.attrsMap || util.isEmptyObject(node.attrsMap))) {
10 | return util.isExist(node.val) ? node.val : '';
11 | } else {
12 | //otherwise create a textnode if node has some text
13 | if (util.isExist(node.val)) {
14 | if (!(typeof node.val === 'string' && (node.val === '' || node.val === options.cdataPositionChar))) {
15 | if(options.arrayMode === "strict"){
16 | jObj[options.textNodeName] = [ node.val ];
17 | }else{
18 | jObj[options.textNodeName] = node.val;
19 | }
20 | }
21 | }
22 | }
23 |
24 | util.merge(jObj, node.attrsMap, options.arrayMode);
25 |
26 | const keys = Object.keys(node.child);
27 | for (let index = 0; index < keys.length; index++) {
28 | var tagname = keys[index];
29 | if (node.child[tagname] && node.child[tagname].length > 1) {
30 | jObj[tagname] = [];
31 | for (var tag in node.child[tagname]) {
32 | jObj[tagname].push(convertToJson(node.child[tagname][tag], options));
33 | }
34 | } else {
35 | if(options.arrayMode === true){
36 | const result = convertToJson(node.child[tagname][0], options)
37 | if(typeof result === 'object')
38 | jObj[tagname] = [ result ];
39 | else
40 | jObj[tagname] = result;
41 | }else if(options.arrayMode === "strict"){
42 | jObj[tagname] = [convertToJson(node.child[tagname][0], options) ];
43 | }else{
44 | jObj[tagname] = convertToJson(node.child[tagname][0], options);
45 | }
46 | }
47 | }
48 |
49 | //add value
50 | return jObj;
51 | };
52 |
53 | exports.convertToJson = convertToJson;
54 |
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/src/node2json_str.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const util = require('./util');
4 | const buildOptions = require('./util').buildOptions;
5 | const x2j = require('./xmlstr2xmlnode');
6 |
7 | //TODO: do it later
8 | const convertToJsonString = function(node, options) {
9 | options = buildOptions(options, x2j.defaultOptions, x2j.props);
10 |
11 | options.indentBy = options.indentBy || '';
12 | return _cToJsonStr(node, options, 0);
13 | };
14 |
15 | const _cToJsonStr = function(node, options, level) {
16 | let jObj = '{';
17 |
18 | //traver through all the children
19 | const keys = Object.keys(node.child);
20 |
21 | for (let index = 0; index < keys.length; index++) {
22 | var tagname = keys[index];
23 | if (node.child[tagname] && node.child[tagname].length > 1) {
24 | jObj += '"' + tagname + '" : [ ';
25 | for (var tag in node.child[tagname]) {
26 | jObj += _cToJsonStr(node.child[tagname][tag], options) + ' , ';
27 | }
28 | jObj = jObj.substr(0, jObj.length - 1) + ' ] '; //remove extra comma in last
29 | } else {
30 | jObj += '"' + tagname + '" : ' + _cToJsonStr(node.child[tagname][0], options) + ' ,';
31 | }
32 | }
33 | util.merge(jObj, node.attrsMap);
34 | //add attrsMap as new children
35 | if (util.isEmptyObject(jObj)) {
36 | return util.isExist(node.val) ? node.val : '';
37 | } else {
38 | if (util.isExist(node.val)) {
39 | if (!(typeof node.val === 'string' && (node.val === '' || node.val === options.cdataPositionChar))) {
40 | jObj += '"' + options.textNodeName + '" : ' + stringval(node.val);
41 | }
42 | }
43 | }
44 | //add value
45 | if (jObj[jObj.length - 1] === ',') {
46 | jObj = jObj.substr(0, jObj.length - 2);
47 | }
48 | return jObj + '}';
49 | };
50 |
51 | function stringval(v) {
52 | if (v === true || v === false || !isNaN(v)) {
53 | return v;
54 | } else {
55 | return '"' + v + '"';
56 | }
57 | }
58 |
59 | function indentate(options, level) {
60 | return options.indentBy.repeat(level);
61 | }
62 |
63 | exports.convertToJsonString = convertToJsonString;
64 |
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/src/parser.d.ts:
--------------------------------------------------------------------------------
1 | type X2jOptions = {
2 | attributeNamePrefix: string;
3 | attrNodeName: false | string;
4 | textNodeName: string;
5 | ignoreAttributes: boolean;
6 | ignoreNameSpace: boolean;
7 | allowBooleanAttributes: boolean;
8 | parseNodeValue: boolean;
9 | parseAttributeValue: boolean;
10 | arrayMode: boolean | 'strict';
11 | trimValues: boolean;
12 | cdataTagName: false | string;
13 | cdataPositionChar: string;
14 | parseTrueNumberOnly: boolean;
15 | tagValueProcessor: (tagValue: string, tagName: string) => string;
16 | attrValueProcessor: (attrValue: string, attrName: string) => string;
17 | stopNodes: string[];
18 | };
19 | type X2jOptionsOptional = Partial;
20 | type validationOptions = {
21 | allowBooleanAttributes: boolean;
22 | };
23 | type validationOptionsOptional = Partial;
24 | type J2xOptions = {
25 | attributeNamePrefix: string;
26 | attrNodeName: false | string;
27 | textNodeName: string;
28 | ignoreAttributes: boolean;
29 | cdataTagName: false | string;
30 | cdataPositionChar: string;
31 | format: boolean;
32 | indentBy: string;
33 | supressEmptyNode: boolean;
34 | tagValueProcessor: (tagValue: string) => string;
35 | attrValueProcessor: (attrValue: string) => string;
36 | };
37 | type J2xOptionsOptional = Partial;
38 |
39 | type ESchema = string | object | Array;
40 |
41 | type ValidationError = {
42 | err: { code: string; msg: string, line: number };
43 | };
44 |
45 | export function parse(xmlData: string, options?: X2jOptionsOptional, validationOptions?: validationOptionsOptional | boolean): any;
46 | export function convert2nimn(
47 | node: any,
48 | e_schema: ESchema,
49 | options?: X2jOptionsOptional
50 | ): any;
51 | export function getTraversalObj(
52 | xmlData: string,
53 | options?: X2jOptionsOptional
54 | ): any;
55 | export function convertToJson(node: any, options?: X2jOptionsOptional): any;
56 | export function convertToJsonString(
57 | node: any,
58 | options?: X2jOptionsOptional
59 | ): string;
60 | export function validate(
61 | xmlData: string,
62 | options?: validationOptionsOptional
63 | ): true | ValidationError;
64 | export class j2xParser {
65 | constructor(options: J2xOptionsOptional);
66 | parse(options: any): any;
67 | }
68 | export function parseToNimn(
69 | xmlData: string,
70 | schema: any,
71 | options: Partial
72 | ): any;
73 |
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/src/parser.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const nodeToJson = require('./node2json');
4 | const xmlToNodeobj = require('./xmlstr2xmlnode');
5 | const x2xmlnode = require('./xmlstr2xmlnode');
6 | const buildOptions = require('./util').buildOptions;
7 | const validator = require('./validator');
8 |
9 | exports.parse = function(xmlData, options, validationOption) {
10 | if( validationOption){
11 | if(validationOption === true) validationOption = {}
12 |
13 | const result = validator.validate(xmlData, validationOption);
14 | if (result !== true) {
15 | throw Error( result.err.msg)
16 | }
17 | }
18 | options = buildOptions(options, x2xmlnode.defaultOptions, x2xmlnode.props);
19 | const traversableObj = xmlToNodeobj.getTraversalObj(xmlData, options)
20 | //print(traversableObj, " ");
21 | return nodeToJson.convertToJson(traversableObj, options);
22 | };
23 | exports.convertTonimn = require('../src/nimndata').convert2nimn;
24 | exports.getTraversalObj = xmlToNodeobj.getTraversalObj;
25 | exports.convertToJson = nodeToJson.convertToJson;
26 | exports.convertToJsonString = require('./node2json_str').convertToJsonString;
27 | exports.validate = validator.validate;
28 | exports.j2xParser = require('./json2xml');
29 | exports.parseToNimn = function(xmlData, schema, options) {
30 | return exports.convertTonimn(exports.getTraversalObj(xmlData, options), schema, options);
31 | };
32 |
33 |
34 | function print(xmlNode, indentation){
35 | if(xmlNode){
36 | console.log(indentation + "{")
37 | console.log(indentation + " \"tagName\": \"" + xmlNode.tagname + "\", ");
38 | if(xmlNode.parent){
39 | console.log(indentation + " \"parent\": \"" + xmlNode.parent.tagname + "\", ");
40 | }
41 | console.log(indentation + " \"val\": \"" + xmlNode.val + "\", ");
42 | console.log(indentation + " \"attrs\": " + JSON.stringify(xmlNode.attrsMap,null,4) + ", ");
43 |
44 | if(xmlNode.child){
45 | console.log(indentation + "\"child\": {")
46 | const indentation2 = indentation + indentation;
47 | Object.keys(xmlNode.child).forEach( function(key) {
48 | const node = xmlNode.child[key];
49 |
50 | if(Array.isArray(node)){
51 | console.log(indentation + "\""+key+"\" :[")
52 | node.forEach( function(item,index) {
53 | //console.log(indentation + " \""+index+"\" : [")
54 | print(item, indentation2);
55 | })
56 | console.log(indentation + "],")
57 | }else{
58 | console.log(indentation + " \""+key+"\" : {")
59 | print(node, indentation2);
60 | console.log(indentation + "},")
61 | }
62 | });
63 | console.log(indentation + "},")
64 | }
65 | console.log(indentation + "},")
66 | }
67 | }
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/src/read.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // Copyright 2013 Timothy J Fontaine
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the 'Software'), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE
22 |
23 | /*
24 |
25 | Read any stream all the way to the end and trigger a single cb
26 |
27 | const http = require('http');
28 |
29 | const rte = require('readtoend');
30 |
31 | http.get('http://nodejs.org', function(response) {
32 | rte.readToEnd(response, function(err, body) {
33 | console.log(body);
34 | });
35 | });
36 |
37 | */
38 |
39 | let stream = require('stream');
40 | const util = require('util');
41 |
42 | if (!stream.Transform) {
43 | stream = require('readable-stream');
44 | }
45 |
46 | function ReadToEnd(opts) {
47 | if (!(this instanceof ReadToEnd)) {
48 | return new ReadToEnd(opts);
49 | }
50 |
51 | stream.Transform.call(this, opts);
52 |
53 | this._rte_encoding = opts.encoding || 'utf8';
54 |
55 | this._buff = '';
56 | }
57 |
58 | module.exports = ReadToEnd;
59 | util.inherits(ReadToEnd, stream.Transform);
60 |
61 | ReadToEnd.prototype._transform = function(chunk, encoding, done) {
62 | this._buff += chunk.toString(this._rte_encoding);
63 | this.push(chunk);
64 | done();
65 | };
66 |
67 | ReadToEnd.prototype._flush = function(done) {
68 | this.emit('complete', undefined, this._buff);
69 | done();
70 | };
71 |
72 | ReadToEnd.readToEnd = function(stream, options, cb) {
73 | if (!cb) {
74 | cb = options;
75 | options = {};
76 | }
77 |
78 | const dest = new ReadToEnd(options);
79 |
80 | stream.pipe(dest);
81 |
82 | stream.on('error', function(err) {
83 | stream.unpipe(dest);
84 | cb(err);
85 | });
86 |
87 | dest.on('complete', cb);
88 |
89 | dest.resume();
90 |
91 | return dest;
92 | };
93 |
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/src/util.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const nameStartChar = ':A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
4 | const nameChar = nameStartChar + '\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
5 | const nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*'
6 | const regexName = new RegExp('^' + nameRegexp + '$');
7 |
8 | const getAllMatches = function(string, regex) {
9 | const matches = [];
10 | let match = regex.exec(string);
11 | while (match) {
12 | const allmatches = [];
13 | const len = match.length;
14 | for (let index = 0; index < len; index++) {
15 | allmatches.push(match[index]);
16 | }
17 | matches.push(allmatches);
18 | match = regex.exec(string);
19 | }
20 | return matches;
21 | };
22 |
23 | const isName = function(string) {
24 | const match = regexName.exec(string);
25 | return !(match === null || typeof match === 'undefined');
26 | };
27 |
28 | exports.isExist = function(v) {
29 | return typeof v !== 'undefined';
30 | };
31 |
32 | exports.isEmptyObject = function(obj) {
33 | return Object.keys(obj).length === 0;
34 | };
35 |
36 | /**
37 | * Copy all the properties of a into b.
38 | * @param {*} target
39 | * @param {*} a
40 | */
41 | exports.merge = function(target, a, arrayMode) {
42 | if (a) {
43 | const keys = Object.keys(a); // will return an array of own properties
44 | const len = keys.length; //don't make it inline
45 | for (let i = 0; i < len; i++) {
46 | if(arrayMode === 'strict'){
47 | target[keys[i]] = [ a[keys[i]] ];
48 | }else{
49 | target[keys[i]] = a[keys[i]];
50 | }
51 | }
52 | }
53 | };
54 | /* exports.merge =function (b,a){
55 | return Object.assign(b,a);
56 | } */
57 |
58 | exports.getValue = function(v) {
59 | if (exports.isExist(v)) {
60 | return v;
61 | } else {
62 | return '';
63 | }
64 | };
65 |
66 | // const fakeCall = function(a) {return a;};
67 | // const fakeCallNoReturn = function() {};
68 |
69 | exports.buildOptions = function(options, defaultOptions, props) {
70 | var newOptions = {};
71 | if (!options) {
72 | return defaultOptions; //if there are not options
73 | }
74 |
75 | for (let i = 0; i < props.length; i++) {
76 | if (options[props[i]] !== undefined) {
77 | newOptions[props[i]] = options[props[i]];
78 | } else {
79 | newOptions[props[i]] = defaultOptions[props[i]];
80 | }
81 | }
82 | return newOptions;
83 | };
84 |
85 | exports.isName = isName;
86 | exports.getAllMatches = getAllMatches;
87 | exports.nameRegexp = nameRegexp;
88 |
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/src/xmlNode.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = function(tagname, parent, val) {
4 | this.tagname = tagname;
5 | this.parent = parent;
6 | this.child = {}; //child tags
7 | this.attrsMap = {}; //attributes map
8 | this.val = val; //text only
9 | this.addChild = function(child) {
10 | if (Array.isArray(this.child[child.tagname])) {
11 | //already presents
12 | this.child[child.tagname].push(child);
13 | } else {
14 | this.child[child.tagname] = [child];
15 | }
16 | };
17 | };
18 |
--------------------------------------------------------------------------------
/node_modules/fast-xml-parser/tasks/postinstall.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 |
4 | const msg = '\u001b[96m\u001b[1mLove fast-xml-parser? Check \u001b[32mhttps://amitkumargupta.work \u001b[96m\u001b[1mfor more projects and contribution.\u001b[0m\n';
5 | console.log(msg)
--------------------------------------------------------------------------------
/node_modules/uni-ajax/README.md:
--------------------------------------------------------------------------------
1 | ## ✨ 特性
2 |
3 | - 支持 Promise API
4 | - 加入请求拦截器、响应拦截器
5 | - 可以配置接口根地址、默认参数
6 | - 支持 method 方法请求
7 | - 支持 RequestTask 操作
8 |
9 | ## 🍟 文档
10 |
11 | **[uniajax.ponjs.com](https://uniajax.ponjs.com)**
12 |
13 | ## 🥗 安装
14 |
15 | ### 下载安装
16 |
17 | - 在 uni-app 插件市场右上角选择`使用HBuilder X 导入插件`或者`下载插件ZIP`
18 | - 如果您的项目是由 HBuilder X 创建的标准 uni-app 项目,将下载解压后的`uni-ajax`文件夹,复制到项目根目录
19 | - 如果您的项目是由 vue-cli 模式创建的, 请将下载后的`uni-ajax`文件夹放到项目的`src`文件夹中即可
20 |
21 | ### npm 安装
22 |
23 | ```
24 | // 如果您的项目是HBuilder X创建的,根目录又没有package.json文件的话,请先执行如下命令:
25 | // npm init -y
26 |
27 | // 安装
28 | npm install uni-ajax
29 |
30 | // 更新
31 | npm update uni-ajax
32 | ```
33 |
34 | ## 🥐 引入
35 |
36 | 新建`ajax.js`文件(文件名自定义)用于处理拦截器、接口根地址、默认参数等,详细配置请[查看文档][1]
37 |
38 | ```JavaScript
39 | // ajax.js
40 |
41 | import ajax from 'uni-ajax' // 引入 uni-ajax 模块
42 |
43 | const _ajax = ajax.create(config) // 创建请求实例 可配置默认项
44 |
45 | _ajax.interceptors.request.use(fulfilled, rejected) // 添加请求拦截器
46 | _ajax.interceptors.response.use(fulfilled, rejected) // 添加响应拦截器
47 |
48 | export default _ajax // 导出创建后的实例
49 | ```
50 |
51 | 然后在`main.js`引入该`ajax.js`
52 |
53 | ```JavaScript
54 | // main.js
55 |
56 | import ajax from './utils/ajax' // 路径需根据项目实际情况
57 | Vue.prototype.$ajax = ajax // 挂载在 Vue 原型链上(通过 this.$ajax 调用)
58 | ```
59 |
60 | ## 🥪 使用
61 |
62 | ### 方法
63 |
64 | **请求方法**
65 |
66 | ```JavaScript
67 | // 常规使用
68 | ajax()
69 |
70 | // 请求方式使用
71 | ajax.get()
72 | ajax.post()
73 | ajax.put()
74 | ajax.delete()
75 | ```
76 |
77 | **RequestTask 方法**
78 |
79 | ```JavaScript
80 | const request = ajax() // 常规使用或请求方式使用
81 |
82 | request.abort() // 中断请求任务
83 | request.onHeadersReceived(fn) // 监听 HTTP Response Header 事件
84 | request.offHeadersReceived(fn) // 取消监听 HTTP Response Header 事件
85 | ```
86 |
87 | **其他属性**
88 |
89 | ```JavaScript
90 | ajax.baseURL // 获取配置的接口根地址 baseURL
91 | ajax.origin // 根据配置的接口根地址获取源地址 origin
92 | ```
93 |
94 | ### 参数
95 |
96 | 上面的请求方法中,传参方式有`config`或`url[, data[, config]]`,直接返回都是封装后的[Promise 对象][2],并支持[RequestTask 方法][3]
97 |
98 | - [config][4]
99 | - `resolve` 响应成功对象 / RequestTask 对象
100 | - `reject` 请求或响应失败对象 / 无
101 |
102 | * [url[, data[, config]]][5]
103 | - `resolve` 响应成功对象
104 | - `reject` 请求或响应失败对象
105 |
106 | [1]: https://uniajax.ponjs.com/config.html
107 | [2]: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise
108 | [3]: https://uniajax.ponjs.com/usage.html#requesttask
109 | [4]: https://uniajax.ponjs.com/usage.html#config
110 | [5]: https://uniajax.ponjs.com/usage.html#url-data-config
111 |
--------------------------------------------------------------------------------
/node_modules/uni-ajax/dist/index.js:
--------------------------------------------------------------------------------
1 | !function(e,t){for(var r in t)e[r]=t[r];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{var e={713:e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},397:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var n=r(713),s=r.n(n);const o=class{constructor(){this.fulfilled=async e=>e,this.rejected=async e=>e}use(e,t){"function"==typeof e&&(this.fulfilled=e),"function"==typeof t&&(this.rejected=t)}},i=["get","post","put","delete","connect","head","options","trace"],c={method:"GET",timeout:3e4,dataType:"json",responseType:"text",sslVerify:!0,withCredentials:!1,firstIpv4:!1};function l(e){return["success","fail","complete"].includes(e)}function a(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.call(e))for(let r=0,n=e.length;rt[r]="object"==typeof t[r]&&"object"==typeof e?u(t[r],e):e));return t}async function f(e,t){const r=await this.request.interceptors.request.rejected({config:e,errMsg:t});return Promise.reject(r)}async function d(e){var t,r;let n=u(this.config,e);n.method=n.method.toUpperCase(),n.header=e.header||{},a(i,(e=>n.header[e]={}));let s=await this.request.interceptors.request.fulfilled(n);if("[object Object]"!==Object.prototype.toString.call(s))return f.call(this,s,"request:fail interrupted");s.url=function(e="",t=""){return/^https?:\/\//.test(t)?t:t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(s.baseURL,s.url);const o=s.method.toLowerCase();return s.header=u(this.config.header,null===(t=this.config.header)||void 0===t?void 0:t[o],null===(r=s.header)||void 0===r?void 0:r[o],s.header),a(i,(e=>delete s.header[e])),a(s,((e,t)=>l(t)&&delete s[t])),s}function p(e,t,r,n){return async s=>{try{const t=s.statusCode>=200&&s.statusCode<300?"fulfilled":"rejected";var o=await this.request.interceptors.response[t]({config:e,...s}),i="fulfilled"===t?"success":"fail"}catch(e){o=e,i="fail"}const c=Object.keys(t);if(!c.length)return"success"===i?r(o):n(o);c.includes(i)&&(async()=>{t[i](o)})(),c.includes("complete")&&(async()=>{t.complete(o)})()}}class h{constructor(e){s()(this,"request",((...e)=>{const{callback:t,params:r}=function(e,t,r){let n={};if("string"==typeof e){n={url:e,data:t};for(const e in r)l(e)||n.hasOwnProperty(e)||(n[e]=r[e])}else n={...e};let s={},o={};for(const e in n)l(e)?s[e]=n[e]:o[e]=n[e];return{callback:s,params:o}}(...e),n=Object.keys(t);let s,o,i,c;return new class extends Promise{abort(){var e;return s=!0,null===(e=o)||void 0===e||e.abort(),this}onHeadersReceived(e){var t;return i=e,null===(t=o)||void 0===t||t.onHeadersReceived(e),this}offHeadersReceived(e){var t;return c=e,null===(t=o)||void 0===t||t.offHeadersReceived(e),this}}((async(e,l)=>{var a,u;try{var h=await d.call(this,r);if(s)return await f.call(this,h,"request:fail abort")}catch(e){return n.includes("fail")&&(async()=>{t.fail(e)})(),n.includes("complete")&&(async()=>{t.complete(e)})(),!n.length&&l(e)}o=uni.request({...h,complete:p.call(this,h,t,e,l)}),n.length&&e(o),i&&(null===(a=o)||void 0===a||a.onHeadersReceived(i)),c&&(null===(u=o)||void 0===u||u.offHeadersReceived(c))}))})),this.config=u(c,e),this.request.interceptors={request:new o,response:new o},this.request.baseURL=this.config.baseURL||"",this.request.origin=function(e=""){if(!/^https?:\/\//.test(e))return"";const t=e.split("/");return t[0]+"//"+t[2]}(this.config.baseURL),a(i,(e=>this.request[e]=(t,r,n)=>this.request(..."string"==typeof t?[t,r,{...n,method:e}]:[{...t,method:e}])))}}function y(e){return new h(e).request}const b=y();b.create=function(e){return y(e)};const v=b}},t={};function r(n){if(t[n])return t[n].exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(397)})());
--------------------------------------------------------------------------------
/node_modules/uni-ajax/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "uni-ajax",
3 | "version": "2.1.8",
4 | "description": "封装 uni-app 的 request 请求",
5 | "main": "dist",
6 | "scripts": {
7 | "build": "webpack",
8 | "prepublishOnly": "npm run build"
9 | },
10 | "files": [
11 | "dist",
12 | "src"
13 | ],
14 | "keywords": [
15 | "uni-app",
16 | "request",
17 | "ajax",
18 | "http"
19 | ],
20 | "author": "ponjs",
21 | "license": "ISC",
22 | "repository": {
23 | "type": "git",
24 | "url": "https://github.com/ponjs/uni-ajax"
25 | },
26 | "devDependencies": {
27 | "@babel/cli": "^7.12.1",
28 | "@babel/core": "^7.12.1",
29 | "@babel/plugin-proposal-class-properties": "^7.12.1",
30 | "@babel/plugin-proposal-optional-chaining": "^7.12.1",
31 | "@babel/plugin-transform-runtime": "^7.12.1",
32 | "babel-loader": "^8.1.0",
33 | "clean-webpack-plugin": "^3.0.0",
34 | "webpack": "^5.1.2",
35 | "webpack-cli": "^4.0.0"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/node_modules/uni-ajax/src/index.js:
--------------------------------------------------------------------------------
1 | import Ajax from './lib/ajax'
2 |
3 | function createInstance(defaultConfig) {
4 | return new Ajax(defaultConfig).request
5 | }
6 |
7 | const ajax = createInstance()
8 |
9 | ajax.create = function create(instanceConfig) {
10 | return createInstance(instanceConfig)
11 | }
12 |
13 | export default ajax
14 |
--------------------------------------------------------------------------------
/node_modules/uni-ajax/src/lib/ajax.js:
--------------------------------------------------------------------------------
1 | import Interceptor from './interceptor'
2 | import defaults, { METHOD } from './defaults'
3 | import { detachRequest, originURL } from './helpers'
4 | import { forEach, merge } from './utils'
5 | import { handleRequest, handleResponse, requestRejected } from './handle'
6 |
7 | export default class Ajax {
8 | constructor(config) {
9 | this.config = merge(defaults, config)
10 |
11 | // 挂载拦截器
12 | this.request.interceptors = { request: new Interceptor(), response: new Interceptor() }
13 |
14 | // 挂载接口根地址 baseURL
15 | this.request.baseURL = this.config.baseURL || ''
16 |
17 | // 挂载接口根地址的源地址 origin
18 | this.request.origin = originURL(this.config.baseURL)
19 |
20 | // 挂载对应的 method 方法
21 | forEach(
22 | METHOD,
23 | method =>
24 | (this.request[method] = (url, data, config) =>
25 | this.request(
26 | ...(typeof url === 'string' ? [url, data, { ...config, method }] : [{ ...url, method }])
27 | ))
28 | )
29 | }
30 | request = (...args) => {
31 | // 分类请求参数
32 | const { callback, params } = detachRequest(...args)
33 | // 回调函数字段
34 | const fields = Object.keys(callback)
35 | // 定义 RequestTask 所需字段
36 | let aborted, requestTask, onHeadRcvd, offHeadRcvd
37 |
38 | // 继承 Promise 封装 RequestTask 的一些方法
39 | class Request extends Promise {
40 | // 中断请求任务
41 | abort() {
42 | aborted = true
43 | requestTask?.abort()
44 | return this
45 | }
46 | // 监听 HTTP Response Header 事件
47 | onHeadersReceived(fn) {
48 | onHeadRcvd = fn
49 | requestTask?.onHeadersReceived(fn)
50 | return this
51 | }
52 | // 取消监听 HTTP Response Header 事件
53 | offHeadersReceived(fn) {
54 | offHeadRcvd = fn
55 | requestTask?.offHeadersReceived(fn)
56 | return this
57 | }
58 | }
59 |
60 | return new Request(async (resolve, reject) => {
61 | // 统一处理请求错误
62 | try {
63 | // 请求拦截后的配置和回调
64 | var config = await handleRequest.call(this, params)
65 | // 判断是否被取消请求
66 | if (aborted) return await requestRejected.call(this, config, 'request:fail abort')
67 | } catch (error) {
68 | // 如果有回调参数 异步执行 fail / complete
69 | if (fields.includes('fail')) (async () => callback.fail(error))()
70 | if (fields.includes('complete')) (async () => callback.complete(error))()
71 | // 没有回调参数时抛出请求错误
72 | return !fields.length && reject(error)
73 | }
74 |
75 | // 发起请求
76 | requestTask = uni.request({
77 | ...config,
78 | complete: handleResponse.call(this, config, callback, resolve, reject)
79 | })
80 |
81 | // 当传入 success / fail / complete 之一时,返回 requestTask 对象
82 | fields.length && resolve(requestTask)
83 |
84 | // 判断是否执行监听 HTTP Response Header 事件
85 | onHeadRcvd && requestTask?.onHeadersReceived(onHeadRcvd)
86 | offHeadRcvd && requestTask?.offHeadersReceived(offHeadRcvd)
87 | })
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/node_modules/uni-ajax/src/lib/defaults.js:
--------------------------------------------------------------------------------
1 | export const METHOD = ['get', 'post', 'put', 'delete', 'connect', 'head', 'options', 'trace']
2 |
3 | export default {
4 | method: 'GET',
5 | timeout: 30000,
6 | dataType: 'json',
7 | responseType: 'text',
8 | sslVerify: true,
9 | withCredentials: false,
10 | firstIpv4: false
11 | }
12 |
--------------------------------------------------------------------------------
/node_modules/uni-ajax/src/lib/handle.js:
--------------------------------------------------------------------------------
1 | import { METHOD } from './defaults'
2 | import { combineURL, isCallback } from './helpers'
3 | import { forEach, merge } from './utils'
4 |
5 | /**
6 | * 请求错误
7 | * @param {object} config 请求配置
8 | * @param {string} errMsg 错误信息
9 | * @returns {Promise} 返回 Promise reject
10 | */
11 | export async function requestRejected(config, errMsg) {
12 | const error = await this.request.interceptors.request.rejected({ config, errMsg })
13 | return Promise.reject(error)
14 | }
15 |
16 | /**
17 | * 处理请求前
18 | * @param {object} request 请求参数
19 | * @returns {object} 处理后的请求参数对象
20 | */
21 | export async function handleRequest(request) {
22 | let params = merge(this.config, request)
23 | params.method = params.method.toUpperCase()
24 | params.header = request.header || {}
25 |
26 | // 给请求头加上对应的请求方式 用于请求拦截器中给请求方式加上请求头
27 | forEach(METHOD, method => (params.header[method] = {}))
28 |
29 | // 拦截后的请求参数
30 | let config = await this.request.interceptors.request.fulfilled(params)
31 |
32 | // 判断请求拦截返回是否为对象
33 | if (Object.prototype.toString.call(config) !== '[object Object]') {
34 | return requestRejected.call(this, config, 'request:fail interrupted')
35 | }
36 |
37 | // 拼接 url
38 | config.url = combineURL(config.baseURL, config.url)
39 |
40 | // header 调整优先级
41 | const method = config.method.toLowerCase()
42 | config.header = merge(
43 | this.config.header,
44 | this.config.header?.[method],
45 | config.header?.[method],
46 | config.header
47 | )
48 |
49 | // 清除多余的请求头
50 | forEach(METHOD, method => delete config.header[method])
51 |
52 | // 清除回调函数
53 | forEach(config, (fun, key) => isCallback(key) && delete config[key])
54 |
55 | return config
56 | }
57 |
58 | /**
59 | * 处理响应后
60 | * @param {object} config 请求配置
61 | * @param {object} callback 回调函数对象
62 | * @param {function} resolve Promise 的 resolve 方法
63 | * @param {function} reject Promise 的 reject 方法
64 | * @returns {function} 处理后的 complete 方法
65 | */
66 | export function handleResponse(config, callback, resolve, reject) {
67 | return async res => {
68 | try {
69 | // 根据状态码判断要执行的回调和拦截器
70 | const interceptor = res.statusCode >= 200 && res.statusCode < 300 ? 'fulfilled' : 'rejected'
71 | var result = await this.request.interceptors.response[interceptor]({ config, ...res })
72 | var field = interceptor === 'fulfilled' ? 'success' : 'fail'
73 | } catch (error) {
74 | // 拦截器返回错误
75 | result = error
76 | field = 'fail'
77 | }
78 |
79 | const fields = Object.keys(callback)
80 | // 请求参数没有回调函数
81 | if (!fields.length) return field === 'success' ? resolve(result) : reject(result)
82 | // 异步执行回调函数
83 | if (fields.includes(field)) (async () => callback[field](result))()
84 | if (fields.includes('complete')) (async () => callback.complete(result))()
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/node_modules/uni-ajax/src/lib/helpers.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 分离请求对象
3 | * @param {string|object} url 请求地址 / 请求配置
4 | * @param {object} [data] 请求参数
5 | * @param {object} [config] 请求配置
6 | * @returns {object} 回调函数对象 去除回调的请求参数
7 | */
8 | export function detachRequest(url, data, config) {
9 | let request = {}
10 | // 判断第一个参数是字符串还是对象
11 | if (typeof url === 'string') {
12 | request = { url, data }
13 |
14 | // 过滤参数 剔除 url data success fail complete
15 | for (const k in config) {
16 | if (!isCallback(k) && !request.hasOwnProperty(k)) {
17 | request[k] = config[k]
18 | }
19 | }
20 | } else {
21 | request = { ...url }
22 | }
23 |
24 | // 回调函数对象
25 | let callback = {}
26 | // 去除回调的请求参数
27 | let params = {}
28 |
29 | for (const k in request) {
30 | if (isCallback(k)) callback[k] = request[k]
31 | else params[k] = request[k]
32 | }
33 |
34 | return { callback, params }
35 | }
36 |
37 | /**
38 | * 判断参数是否含有回调参数 success / fail / complete 之一
39 | * @param {string} field 参数的 Key 值字符串
40 | * @returns {boolean} 返回判断值
41 | */
42 | export function isCallback(field) {
43 | return ['success', 'fail', 'complete'].includes(field)
44 | }
45 |
46 | /**
47 | * 根据 baseURL 和 url 拼接
48 | * @param {string} baseURL 请求跟地址
49 | * @param {string} relativeURL 请求参数地址
50 | * @returns {string} 拼接后的地址
51 | */
52 | export function combineURL(baseURL = '', relativeURL = '') {
53 | // 判断是否 http:// 或 https:// 开头
54 | if (/^https?:\/\//.test(relativeURL)) return relativeURL
55 | // 去除 baseURL 结尾斜杠,去除 relativeURL 开头斜杠,再判断拼接
56 | return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL
57 | }
58 |
59 | /**
60 | * 根据 baseURL 获取源地址
61 | * @param {string} baseURL 请求跟地址
62 | * @returns {string} 源地址
63 | */
64 | export function originURL(baseURL = '') {
65 | // 判断是否 http:// 或 https:// 开头
66 | if (!/^https?:\/\//.test(baseURL)) return ''
67 | const u = baseURL.split('/')
68 | return u[0] + '//' + u[2]
69 | }
70 |
--------------------------------------------------------------------------------
/node_modules/uni-ajax/src/lib/interceptor.js:
--------------------------------------------------------------------------------
1 | class Interceptor {
2 | constructor() {
3 | this.fulfilled = async res => res
4 | this.rejected = async err => err
5 | }
6 | /**
7 | * 拦截器
8 | * @param {function} fulfilled 拦截成功
9 | * @param {function} rejected 拦截失败
10 | */
11 | use(fulfilled, rejected) {
12 | typeof fulfilled === 'function' && (this.fulfilled = fulfilled)
13 | typeof rejected === 'function' && (this.rejected = rejected)
14 | }
15 | }
16 |
17 | export default Interceptor
18 |
--------------------------------------------------------------------------------
/node_modules/uni-ajax/src/lib/utils.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 遍历
3 | * @param {object|array} obj 要迭代的对象
4 | * @param {function} fn 为每个项调用的回调
5 | */
6 | export function forEach(obj, fn) {
7 | if (obj === null || typeof obj === 'undefined') return
8 | if (typeof obj !== 'object') obj = [obj]
9 | if (Object.prototype.toString.call(obj) === '[object Array]') {
10 | for (let i = 0, l = obj.length; i < l; i++) {
11 | fn.call(null, obj[i], i, obj)
12 | }
13 | } else {
14 | for (const k in obj) {
15 | if (Object.prototype.hasOwnProperty.call(obj, k)) {
16 | fn.call(null, obj[k], k, obj)
17 | }
18 | }
19 | }
20 | }
21 |
22 | /**
23 | * 对象深合并
24 | * @param {...object} args 对象
25 | * @returns {object} 合并后的对象
26 | */
27 | export function merge(...args) {
28 | let result = {}
29 | for (let i = 0, l = args.length; i < l; i++) {
30 | forEach(
31 | args[i] || {},
32 | (val, key) =>
33 | (result[key] =
34 | typeof result[key] === 'object' && typeof val === 'object'
35 | ? merge(result[key], val)
36 | : val)
37 | )
38 | }
39 | return result
40 | }
41 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 www.uviewui.com
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/node_modules/uview-ui/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | uView
5 | 多平台快速开发的UI框架
6 |
7 |
8 | ## 说明
9 |
10 | uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
11 |
12 | ## 特性
13 |
14 | - 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序
15 | - 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用
16 | - 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨
17 | - 众多的常用页面和布局,让您专注逻辑,事半功倍
18 | - 详尽的文档支持,现代化的演示效果
19 | - 按需引入,精简打包体积
20 |
21 |
22 | ## 安装
23 |
24 | ```bash
25 | # npm方式安装
26 | npm i uview-ui
27 | ```
28 |
29 | ## 快速上手
30 |
31 | 1. `main.js`引入uView库
32 | ```js
33 | // main.js
34 | import uView from 'uview-ui';
35 | Vue.use(uView);
36 | ```
37 |
38 | 2. `App.vue`引入基础样式(注意style标签需声明scss属性支持)
39 | ```css
40 | /* App.vue */
41 |
44 | ```
45 |
46 | 3. `uni.scss`引入全局scss变量文件
47 | ```css
48 | /* uni.scss */
49 | @import "uview-ui/theme.scss";
50 | ```
51 |
52 | 4. `pages.json`配置easycom规则(按需引入)
53 |
54 | ```js
55 | // pages.json
56 | {
57 | "easycom": {
58 | // npm安装的方式不需要前面的"@/",下载安装的方式需要"@/"
59 | // npm安装方式
60 | "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
61 | // 下载安装方式
62 | // "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
63 | },
64 | // 此为本身已有的内容
65 | "pages": [
66 | // ......
67 | ]
68 | }
69 | ```
70 |
71 | 请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
72 |
73 | ## 使用方法
74 | 配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。
75 |
76 | ```html
77 |
78 | 按钮
79 |
80 | ```
81 |
82 | 请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
83 |
84 | ## 链接
85 |
86 | - [官方文档](https://uviewui.com/)
87 | - [更新日志](https://uviewui.com/components/changelog.html)
88 | - [升级指南](https://uviewui.com/components/changelog.html)
89 | - [关于我们](https://uviewui.com/cooperation/about.html)
90 |
91 | ## 预览
92 |
93 | 您可以通过**微信**扫码,查看最佳的演示效果。
94 |
95 |
96 |
97 |
98 |
105 | ## 版权信息
106 | uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。
107 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-back-top/u-back-top.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 | {{tips}}
13 |
14 |
15 |
16 |
17 |
18 |
19 |
124 |
125 |
154 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-cell-group/u-cell-group.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{title}}
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
51 |
52 |
71 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-checkbox-group/u-checkbox-group.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
113 |
114 |
124 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-col/u-col.vue:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
95 |
96 |
157 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-collapse/u-collapse.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
96 |
97 |
100 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-dropdown-item/u-dropdown-item.vue:
--------------------------------------------------------------------------------
1 |
2 | {}" @tap.stop.prevent="() => {}">
3 |
4 |
7 |
8 |
9 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
129 |
130 |
133 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-form/u-form.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
131 |
132 |
135 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-full-screen/u-full-screen.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
38 |
39 |
53 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-gap/u-gap.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
51 |
52 |
55 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-grid-item/u-grid-item.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
81 |
82 |
127 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-grid/u-grid.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
90 |
91 |
109 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-index-anchor/u-index-anchor.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{ index }}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
68 |
69 |
90 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-line-progress/u-line-progress.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
13 |
14 | {{percent + '%'}}
15 |
16 |
17 |
18 |
19 |
20 |
102 |
103 |
148 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-line/u-line.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
77 |
78 |
85 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-link/u-link.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
82 |
83 |
90 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-loading-page/u-loading-page.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
22 |
23 |
26 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-mask/u-mask.vue:
--------------------------------------------------------------------------------
1 |
2 | {}" :class="{
3 | 'u-mask-zoom': zoom,
4 | 'u-mask-show': show
5 | }">
6 |
7 |
8 |
9 |
10 |
102 |
103 |
124 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-parse/libs/CssHandler.js:
--------------------------------------------------------------------------------
1 | const cfg = require('./config.js'),
2 | isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
3 |
4 | function CssHandler(tagStyle) {
5 | var styles = Object.assign(Object.create(null), cfg.userAgentStyles);
6 | for (var item in tagStyle)
7 | styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
8 | this.styles = styles;
9 | }
10 | CssHandler.prototype.getStyle = function(data) {
11 | this.styles = new parser(data, this.styles).parse();
12 | }
13 | CssHandler.prototype.match = function(name, attrs) {
14 | var tmp, matched = (tmp = this.styles[name]) ? tmp + ';' : '';
15 | if (attrs.class) {
16 | var items = attrs.class.split(' ');
17 | for (var i = 0, item; item = items[i]; i++)
18 | if (tmp = this.styles['.' + item])
19 | matched += tmp + ';';
20 | }
21 | if (tmp = this.styles['#' + attrs.id])
22 | matched += tmp + ';';
23 | return matched;
24 | }
25 | module.exports = CssHandler;
26 |
27 | function parser(data, init) {
28 | this.data = data;
29 | this.floor = 0;
30 | this.i = 0;
31 | this.list = [];
32 | this.res = init;
33 | this.state = this.Space;
34 | }
35 | parser.prototype.parse = function() {
36 | for (var c; c = this.data[this.i]; this.i++)
37 | this.state(c);
38 | return this.res;
39 | }
40 | parser.prototype.section = function() {
41 | return this.data.substring(this.start, this.i);
42 | }
43 | // 状态机
44 | parser.prototype.Space = function(c) {
45 | if (c == '.' || c == '#' || isLetter(c)) {
46 | this.start = this.i;
47 | this.state = this.Name;
48 | } else if (c == '/' && this.data[this.i + 1] == '*')
49 | this.Comment();
50 | else if (!cfg.blankChar[c] && c != ';')
51 | this.state = this.Ignore;
52 | }
53 | parser.prototype.Comment = function() {
54 | this.i = this.data.indexOf('*/', this.i) + 1;
55 | if (!this.i) this.i = this.data.length;
56 | this.state = this.Space;
57 | }
58 | parser.prototype.Ignore = function(c) {
59 | if (c == '{') this.floor++;
60 | else if (c == '}' && !--this.floor) {
61 | this.list = [];
62 | this.state = this.Space;
63 | }
64 | }
65 | parser.prototype.Name = function(c) {
66 | if (cfg.blankChar[c]) {
67 | this.list.push(this.section());
68 | this.state = this.NameSpace;
69 | } else if (c == '{') {
70 | this.list.push(this.section());
71 | this.Content();
72 | } else if (c == ',') {
73 | this.list.push(this.section());
74 | this.Comma();
75 | } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
76 | this.state = this.Ignore;
77 | }
78 | parser.prototype.NameSpace = function(c) {
79 | if (c == '{') this.Content();
80 | else if (c == ',') this.Comma();
81 | else if (!cfg.blankChar[c]) this.state = this.Ignore;
82 | }
83 | parser.prototype.Comma = function() {
84 | while (cfg.blankChar[this.data[++this.i]]);
85 | if (this.data[this.i] == '{') this.Content();
86 | else {
87 | this.start = this.i--;
88 | this.state = this.Name;
89 | }
90 | }
91 | parser.prototype.Content = function() {
92 | this.start = ++this.i;
93 | if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
94 | var content = this.section();
95 | for (var i = 0, item; item = this.list[i++];)
96 | if (this.res[item]) this.res[item] += ';' + content;
97 | else this.res[item] = content;
98 | this.list = [];
99 | this.state = this.Space;
100 | }
101 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-parse/libs/config.js:
--------------------------------------------------------------------------------
1 | /* 配置文件 */
2 | var cfg = {
3 | // 出错占位图
4 | errorImg: null,
5 | // 过滤器函数
6 | filter: null,
7 | // 代码高亮函数
8 | highlight: null,
9 | // 文本处理函数
10 | onText: null,
11 | // 实体编码列表
12 | entities: {
13 | quot: '"',
14 | apos: "'",
15 | semi: ';',
16 | nbsp: '\xA0',
17 | ensp: '\u2002',
18 | emsp: '\u2003',
19 | ndash: '–',
20 | mdash: '—',
21 | middot: '·',
22 | lsquo: '‘',
23 | rsquo: '’',
24 | ldquo: '“',
25 | rdquo: '”',
26 | bull: '•',
27 | hellip: '…'
28 | },
29 | blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
30 | boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
31 | // 块级标签,将被转为 div
32 | blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
33 | // 将被移除的标签
34 | ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
35 | // 只能被 rich-text 显示的标签
36 | richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
37 | // 自闭合的标签
38 | selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
39 | // 信任的标签
40 | trustTags: makeMap('a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video'),
41 | // 默认的标签样式
42 | userAgentStyles: {
43 | address: 'font-style:italic',
44 | big: 'display:inline;font-size:1.2em',
45 | blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
46 | caption: 'display:table-caption;text-align:center',
47 | center: 'text-align:center',
48 | cite: 'font-style:italic',
49 | dd: 'margin-left:40px',
50 | mark: 'background-color:yellow',
51 | pre: 'font-family:monospace;white-space:pre;overflow:scroll',
52 | s: 'text-decoration:line-through',
53 | small: 'display:inline;font-size:0.8em',
54 | u: 'text-decoration:underline'
55 | }
56 | }
57 |
58 | function makeMap(str) {
59 | var map = Object.create(null),
60 | list = str.split(',');
61 | for (var i = list.length; i--;)
62 | map[list[i]] = true;
63 | return map;
64 | }
65 |
66 | // #ifdef MP-WEIXIN
67 | if (wx.canIUse('editor')) {
68 | cfg.blockTags.pre = void 0;
69 | cfg.ignoreTags.rp = true;
70 | Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
71 | Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
72 | }
73 | // #endif
74 |
75 | // #ifdef APP-PLUS
76 | cfg.ignoreTags.iframe = void 0;
77 | Object.assign(cfg.trustTags, makeMap('embed,iframe'));
78 | // #endif
79 |
80 | module.exports = cfg;
81 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-parse/libs/handler.wxs:
--------------------------------------------------------------------------------
1 | var inline = {
2 | abbr: 1,
3 | b: 1,
4 | big: 1,
5 | code: 1,
6 | del: 1,
7 | em: 1,
8 | i: 1,
9 | ins: 1,
10 | label: 1,
11 | q: 1,
12 | small: 1,
13 | span: 1,
14 | strong: 1,
15 | sub: 1,
16 | sup: 1
17 | }
18 | module.exports = {
19 | use: function(item) {
20 | return !item.c && !inline[item.name] && (item.attrs.style || '').indexOf('display:inline') == -1
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-radio-group/u-radio-group.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
118 |
119 |
129 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-row/u-row.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
65 |
66 |
85 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-section/u-section.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
14 | {{title}}
15 |
16 |
19 |
20 |
21 | {{subTitle}}
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
117 |
118 |
155 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-table/u-table.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
76 |
77 |
85 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-td/u-td.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
51 |
52 |
67 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-th/u-th.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
48 |
49 |
63 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-time-line-item/u-time-line-item.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
52 |
53 |
84 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-time-line/u-time-line.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
23 |
24 |
44 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-top-tips/u-top-tips.vue:
--------------------------------------------------------------------------------
1 |
2 | {{ title }}
6 |
7 |
8 |
69 |
70 |
122 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/components/u-tr/u-tr.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
19 |
26 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/index.js:
--------------------------------------------------------------------------------
1 | // 引入全局mixin
2 | import mixin from './libs/mixin/mixin.js'
3 | // 引入关于是否mixin集成小程序分享的配置
4 | // import wxshare from './libs/mixin/mpShare.js'
5 | // 全局挂载引入http相关请求拦截插件
6 | import http from './libs/request'
7 |
8 | function wranning(str) {
9 | // 开发环境进行信息输出,主要是一些报错信息
10 | // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
11 | // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
12 | if (process.env.NODE_ENV === 'development') {
13 | console.warn(str)
14 | }
15 | }
16 |
17 | // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
18 | // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
19 | // let vuexStore = {};
20 | // try {
21 | // vuexStore = require("@/store/$u.mixin.js");
22 | // } catch (e) {
23 | // //TODO handle the exception
24 | // }
25 |
26 | // post类型对象参数转为get类型url参数
27 | import queryParams from './libs/function/queryParams.js'
28 | // 路由封装
29 | import route from './libs/function/route.js'
30 | // 时间格式化
31 | import timeFormat from './libs/function/timeFormat.js'
32 | // 时间戳格式化,返回多久之前
33 | import timeFrom from './libs/function/timeFrom.js'
34 | // 颜色渐变相关,colorGradient-颜色渐变,hexToRgb-十六进制颜色转rgb颜色,rgbToHex-rgb转十六进制
35 | import colorGradient from './libs/function/colorGradient.js'
36 | // 生成全局唯一guid字符串
37 | import guid from './libs/function/guid.js'
38 | // 主题相关颜色,info|success|warning|primary|default|error,此颜色已在uview.scss中定义,但是为js中也能使用,故也定义一份
39 | import color from './libs/function/color.js'
40 | // 根据type获取图标名称
41 | import type2icon from './libs/function/type2icon.js'
42 | // 打乱数组的顺序
43 | import randomArray from './libs/function/randomArray.js'
44 | // 对象和数组的深度克隆
45 | import deepClone from './libs/function/deepClone.js'
46 | // 对象深度拷贝
47 | import deepMerge from './libs/function/deepMerge.js'
48 | // 添加单位
49 | import addUnit from './libs/function/addUnit.js'
50 |
51 | // 规则检验
52 | import test from './libs/function/test.js'
53 | // 随机数
54 | import random from './libs/function/random.js'
55 | // 去除空格
56 | import trim from './libs/function/trim.js'
57 | // toast提示,对uni.showToast的封装
58 | import toast from './libs/function/toast.js'
59 | // 获取父组件参数
60 | import getParent from './libs/function/getParent.js'
61 | // 获取整个父组件
62 | import $parent from './libs/function/$parent.js'
63 | // 获取sys()和os()工具方法
64 | // 获取设备信息,挂载到$u的sys()(system的缩写)属性中,
65 | // 同时把安卓和ios平台的名称"ios"和"android"挂到$u.os()中,方便取用
66 | import {sys, os} from './libs/function/sys.js'
67 | // 防抖方法
68 | import debounce from './libs/function/debounce.js'
69 | // 节流方法
70 | import throttle from './libs/function/throttle.js'
71 |
72 |
73 | // 配置信息
74 | import config from './libs/config/config.js'
75 | // 各个需要fixed的地方的z-index配置文件
76 | import zIndex from './libs/config/zIndex.js'
77 |
78 | const $u = {
79 | queryParams: queryParams,
80 | route: route,
81 | timeFormat: timeFormat,
82 | date: timeFormat, // 另名date
83 | timeFrom,
84 | colorGradient: colorGradient.colorGradient,
85 | colorToRgba: colorGradient.colorToRgba,
86 | guid,
87 | color,
88 | sys,
89 | os,
90 | type2icon,
91 | randomArray,
92 | wranning,
93 | get: http.get,
94 | post: http.post,
95 | put: http.put,
96 | 'delete': http.delete,
97 | hexToRgb: colorGradient.hexToRgb,
98 | rgbToHex: colorGradient.rgbToHex,
99 | test,
100 | random,
101 | deepClone,
102 | deepMerge,
103 | getParent,
104 | $parent,
105 | addUnit,
106 | trim,
107 | type: ['primary', 'success', 'error', 'warning', 'info'],
108 | http,
109 | toast,
110 | config, // uView配置信息相关,比如版本号
111 | zIndex,
112 | debounce,
113 | throttle,
114 | }
115 |
116 | // $u挂载到uni对象上
117 | uni.$u = $u
118 |
119 | const install = Vue => {
120 | Vue.mixin(mixin)
121 | if (Vue.prototype.openShare) {
122 | Vue.mixin(mpShare);
123 | }
124 | // Vue.mixin(vuexStore);
125 | // 时间格式化,同时两个名称,date和timeFormat
126 | Vue.filter('timeFormat', (timestamp, format) => {
127 | return timeFormat(timestamp, format)
128 | })
129 | Vue.filter('date', (timestamp, format) => {
130 | return timeFormat(timestamp, format)
131 | })
132 | // 将多久以前的方法,注入到全局过滤器
133 | Vue.filter('timeFrom', (timestamp, format) => {
134 | return timeFrom(timestamp, format)
135 | })
136 | Vue.prototype.$u = $u
137 | }
138 |
139 | export default {
140 | install
141 | }
--------------------------------------------------------------------------------
/node_modules/uview-ui/index.scss:
--------------------------------------------------------------------------------
1 | // 引入公共基础类
2 | @import "./libs/css/common.scss";
3 | @import "./libs/css/color.scss";
4 |
5 | // 非nvue的样式
6 | /* #ifndef APP-NVUE */
7 | @import "./libs/css/style.vue.scss";
8 | /* #endif */
9 |
10 | // nvue的特有样式
11 | /* #ifdef APP-NVUE */
12 | @import "./libs/css/style.nvue.scss";
13 | /* #endif */
14 |
15 | // 小程序特有的样式
16 | /* #ifdef MP */
17 | @import "./libs/css/style.mp.scss";
18 | /* #endif */
19 |
20 | // H5特有的样式
21 | /* #ifdef H5 */
22 | @import "./libs/css/style.h5.scss";
23 | /* #endif */
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/config/config.js:
--------------------------------------------------------------------------------
1 | // 此版本发布于2020-11-19
2 | let version = '1.8.2';
3 |
4 | export default {
5 | v: version,
6 | version: version,
7 | // 主题名称
8 | type: [
9 | 'primary',
10 | 'success',
11 | 'info',
12 | 'error',
13 | 'warning'
14 | ]
15 | }
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/config/zIndex.js:
--------------------------------------------------------------------------------
1 | // uniapp在H5中各API的z-index值如下:
2 | /**
3 | * actionsheet: 999
4 | * modal: 999
5 | * navigate: 998
6 | * tabbar: 998
7 | * toast: 999
8 | */
9 |
10 | export default {
11 | toast: 10090,
12 | noNetwork: 10080,
13 | // popup包含popup,actionsheet,keyboard,picker的值
14 | popup: 10075,
15 | mask: 10070,
16 | navbar: 980,
17 | topTips: 975,
18 | sticky: 970,
19 | indexListSticky: 965,
20 | }
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/css/color.scss:
--------------------------------------------------------------------------------
1 | .u-type-primary-light {
2 | color: $u-type-primary-light;
3 | }
4 |
5 | .u-type-warning-light {
6 | color: $u-type-warning-light;
7 | }
8 |
9 | .u-type-success-light {
10 | color: $u-type-success-light;
11 | }
12 |
13 | .u-type-error-light {
14 | color: $u-type-error-light;
15 | }
16 |
17 | .u-type-info-light {
18 | color: $u-type-info-light;
19 | }
20 |
21 | .u-type-primary-light-bg {
22 | background-color: $u-type-primary-light;
23 | }
24 |
25 | .u-type-warning-light-bg {
26 | background-color: $u-type-warning-light;
27 | }
28 |
29 | .u-type-success-light-bg {
30 | background-color: $u-type-success-light;
31 | }
32 |
33 | .u-type-error-light-bg {
34 | background-color: $u-type-error-light;
35 | }
36 |
37 | .u-type-info-light-bg {
38 | background-color: $u-type-info-light;
39 | }
40 |
41 | .u-type-primary-dark {
42 | color: $u-type-primary-dark;
43 | }
44 |
45 | .u-type-warning-dark {
46 | color: $u-type-warning-dark;
47 | }
48 |
49 | .u-type-success-dark {
50 | color: $u-type-success-dark;
51 | }
52 |
53 | .u-type-error-dark {
54 | color: $u-type-error-dark;
55 | }
56 |
57 | .u-type-info-dark {
58 | color: $u-type-info-dark;
59 | }
60 |
61 | .u-type-primary-dark-bg {
62 | background-color: $u-type-primary-dark;
63 | }
64 |
65 | .u-type-warning-dark-bg {
66 | background-color: $u-type-warning-dark;
67 | }
68 |
69 | .u-type-success-dark-bg {
70 | background-color: $u-type-success-dark;
71 | }
72 |
73 | .u-type-error-dark-bg {
74 | background-color: $u-type-error-dark;
75 | }
76 |
77 | .u-type-info-dark-bg {
78 | background-color: $u-type-info-dark;
79 | }
80 |
81 | .u-type-primary-disabled {
82 | color: $u-type-primary-disabled;
83 | }
84 |
85 | .u-type-warning-disabled {
86 | color: $u-type-warning-disabled;
87 | }
88 |
89 | .u-type-success-disabled {
90 | color: $u-type-success-disabled;
91 | }
92 |
93 | .u-type-error-disabled {
94 | color: $u-type-error-disabled;
95 | }
96 |
97 | .u-type-info-disabled {
98 | color: $u-type-info-disabled;
99 | }
100 |
101 | .u-type-primary {
102 | color: $u-type-primary;
103 | }
104 |
105 | .u-type-warning {
106 | color: $u-type-warning;
107 | }
108 |
109 | .u-type-success {
110 | color: $u-type-success;
111 | }
112 |
113 | .u-type-error {
114 | color: $u-type-error;
115 | }
116 |
117 | .u-type-info {
118 | color: $u-type-info;
119 | }
120 |
121 | .u-type-primary-bg {
122 | background-color: $u-type-primary;
123 | }
124 |
125 | .u-type-warning-bg {
126 | background-color: $u-type-warning;
127 | }
128 |
129 | .u-type-success-bg {
130 | background-color: $u-type-success;
131 | }
132 |
133 | .u-type-error-bg {
134 | background-color: $u-type-error;
135 | }
136 |
137 | .u-type-info-bg {
138 | background-color: $u-type-info;
139 | }
140 |
141 | .u-main-color {
142 | color: $u-main-color;
143 | }
144 |
145 | .u-content-color {
146 | color: $u-content-color;
147 | }
148 |
149 | .u-tips-color {
150 | color: $u-tips-color;
151 | }
152 |
153 | .u-light-color {
154 | color: $u-light-color;
155 | }
156 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/css/common.scss:
--------------------------------------------------------------------------------
1 | .u-relative,
2 | .u-rela {
3 | position: relative;
4 | }
5 |
6 | .u-absolute,
7 | .u-abso {
8 | position: absolute;
9 | }
10 |
11 | // nvue不能用标签命名样式,不能放在微信组件中,否则微信开发工具会报警告,无法使用标签名当做选择器
12 | /* #ifndef APP-NVUE */
13 | image {
14 | display: inline-block;
15 | }
16 |
17 | // 在weex,也即nvue中,所有元素默认为border-box
18 | view,
19 | text {
20 | box-sizing: border-box;
21 | }
22 | /* #endif */
23 |
24 | .u-font-xs {
25 | font-size: 22rpx;
26 | }
27 |
28 | .u-font-sm {
29 | font-size: 26rpx;
30 | }
31 |
32 | .u-font-md {
33 | font-size: 28rpx;
34 | }
35 |
36 | .u-font-lg {
37 | font-size: 30rpx;
38 | }
39 |
40 | .u-font-xl {
41 | font-size: 34rpx;
42 | }
43 |
44 | .u-flex {
45 | /* #ifndef APP-NVUE */
46 | display: flex;
47 | /* #endif */
48 | flex-direction: row;
49 | align-items: center;
50 | }
51 |
52 | .u-flex-wrap {
53 | flex-wrap: wrap;
54 | }
55 |
56 | .u-flex-nowrap {
57 | flex-wrap: nowrap;
58 | }
59 |
60 | .u-col-center {
61 | align-items: center;
62 | }
63 |
64 | .u-col-top {
65 | align-items: flex-start;
66 | }
67 |
68 | .u-col-bottom {
69 | align-items: flex-end;
70 | }
71 |
72 | .u-row-center {
73 | justify-content: center;
74 | }
75 |
76 | .u-row-left {
77 | justify-content: flex-start;
78 | }
79 |
80 | .u-row-right {
81 | justify-content: flex-end;
82 | }
83 |
84 | .u-row-between {
85 | justify-content: space-between;
86 | }
87 |
88 | .u-row-around {
89 | justify-content: space-around;
90 | }
91 |
92 | .u-text-left {
93 | text-align: left;
94 | }
95 |
96 | .u-text-center {
97 | text-align: center;
98 | }
99 |
100 | .u-text-right {
101 | text-align: right;
102 | }
103 |
104 | .u-flex-col {
105 | /* #ifndef APP-NVUE */
106 | display: flex;
107 | /* #endif */
108 | flex-direction: column;
109 | }
110 |
111 | // 定义flex等分
112 | @for $i from 0 through 12 {
113 | .u-flex-#{$i} {
114 | flex: $i;
115 | }
116 | }
117 |
118 | // 定义字体(px)单位,小于20都为px单位字体
119 | @for $i from 9 to 20 {
120 | .u-font-#{$i} {
121 | font-size: $i + px;
122 | }
123 | }
124 |
125 | // 定义字体(rpx)单位,大于或等于20的都为rpx单位字体
126 | @for $i from 20 through 40 {
127 | .u-font-#{$i} {
128 | font-size: $i + rpx;
129 | }
130 | }
131 |
132 | // 定义内外边距,历遍1-80
133 | @for $i from 0 through 80 {
134 | // 只要双数和能被5除尽的数
135 | @if $i % 2 == 0 or $i % 5 == 0 {
136 | // 得出:u-margin-30或者u-m-30
137 | .u-margin-#{$i}, .u-m-#{$i} {
138 | margin: $i + rpx!important;
139 | }
140 |
141 | // 得出:u-padding-30或者u-p-30
142 | .u-padding-#{$i}, .u-p-#{$i} {
143 | padding: $i + rpx!important;
144 | }
145 |
146 | @each $short, $long in l left, t top, r right, b bottom {
147 | // 缩写版,结果如: u-m-l-30
148 | // 定义外边距
149 | .u-m-#{$short}-#{$i} {
150 | margin-#{$long}: $i + rpx!important;
151 | }
152 |
153 | // 定义内边距
154 | .u-p-#{$short}-#{$i} {
155 | padding-#{$long}: $i + rpx!important;
156 | }
157 |
158 | // 完整版,结果如:u-margin-left-30
159 | // 定义外边距
160 | .u-margin-#{$long}-#{$i} {
161 | margin-#{$long}: $i + rpx!important;
162 | }
163 |
164 | // 定义内边距
165 | .u-padding-#{$long}-#{$i} {
166 | padding-#{$long}: $i + rpx!important;
167 | }
168 | }
169 | }
170 | }
171 |
172 | // 重置nvue的默认关于flex的样式
173 | .u-reset-nvue {
174 | flex-direction: row;
175 | align-items: center;
176 | }
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/css/style.components.scss:
--------------------------------------------------------------------------------
1 | // 定义混入指令,用于在非nvue环境下的flex定义,因为nvue没有display属性,会报错
2 | @mixin vue-flex($direction: row) {
3 | /* #ifndef APP-NVUE */
4 | display: flex;
5 | flex-direction: $direction;
6 | /* #endif */
7 | }
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/css/style.h5.scss:
--------------------------------------------------------------------------------
1 | /* H5的时候,隐藏滚动条 */
2 | ::-webkit-scrollbar {
3 | display: none;
4 | width: 0 !important;
5 | height: 0 !important;
6 | -webkit-appearance: none;
7 | background: transparent;
8 | }
9 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/css/style.mp.scss:
--------------------------------------------------------------------------------
1 | /* start--微信小程序编译后页面有组件名的元素,特别处理--start */
2 | /* #ifdef MP-WEIXIN || MP-QQ */
3 | u-td, u-th {
4 | flex: 1;
5 | align-self: stretch;
6 | }
7 |
8 | .u-td {
9 | height: 100%;
10 | }
11 |
12 | u-icon {
13 | display: inline-flex;
14 | align-items: center;
15 | }
16 |
17 | // 各家小程序宫格组件外层设置为100%,避免受到父元素display: flex;的影响
18 | u-grid {
19 | width: 100%;
20 | flex: 0 0 100%;
21 | }
22 |
23 | // 避免小程序线条组件因为父组件display: flex;而失效
24 | u-line {
25 | flex: 1;
26 | }
27 |
28 | u-switch {
29 | display: inline-flex;
30 | align-items: center;
31 | }
32 |
33 | u-dropdown {
34 | flex: 1;
35 | }
36 | /* #endif */
37 | /* end-微信小程序编译后页面有组件名的元素,特别处理--end */
38 |
39 |
40 | /* #ifdef MP-QQ || MP-TOUTIAO */
41 | // 需要做这一切额外的兼容,都是因为TX的无能
42 | u-icon {
43 | line-height: 0;
44 | }
45 | /* #endif */
46 |
47 | /* start--头条小程序编译后页面有组件名的元素,特别处理--start */
48 | // 由于头条小程序不支持直接组件名形式写样式,目前只能在写组件的时候给组件加上对应的类名
49 | /* #ifdef MP-TOUTIAO */
50 | .u-td, .u-th, .u-tr {
51 | flex: 1;
52 | align-self: stretch;
53 | }
54 |
55 | .u-row, .u-col {
56 | flex: 1;
57 | align-self: stretch;
58 | }
59 |
60 | // 避免小程序线条组件因为父组件display: flex;而失效
61 | .u-line {
62 | flex: 1;
63 | }
64 |
65 | .u-dropdown {
66 | flex: 1;
67 | }
68 | /* #endif */
69 | /* end-头条小程序编译后页面有组件名的元素,特别处理--end */
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/css/style.nvue.scss:
--------------------------------------------------------------------------------
1 | .nvue {
2 | font-size: 24rpx;
3 | }
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/css/style.vue.scss:
--------------------------------------------------------------------------------
1 | page {
2 | color: $u-main-color;
3 | font-size: 28rpx;
4 | }
5 |
6 | /* start--去除webkit的默认样式--start */
7 | .u-fix-ios-appearance {
8 | -webkit-appearance:none;
9 | }
10 | /* end--去除webkit的默认样式--end */
11 |
12 | /* start--icon图标外层套一个view,让其达到更好的垂直居中的效果--start */
13 | .u-icon-wrap {
14 | display: flex;
15 | align-items: center;
16 | }
17 | /* end-icon图标外层套一个view,让其达到更好的垂直居中的效果--end */
18 |
19 | /* start--iPhoneX底部安全区定义--start */
20 | .safe-area-inset-bottom {
21 | padding-bottom: 0;
22 | padding-bottom: constant(safe-area-inset-bottom);
23 | padding-bottom: env(safe-area-inset-bottom);
24 | }
25 | /* end-iPhoneX底部安全区定义--end */
26 |
27 | /* start--各种hover点击反馈相关的类名-start */
28 | .u-hover-class {
29 | // background-color: #f7f8f9!important;
30 | opacity: 0.6;
31 | }
32 |
33 | .u-cell-hover {
34 | background-color: #f7f8f9!important;
35 | }
36 | /* end--各种hover点击反馈相关的类名--end */
37 |
38 | /* start--文本行数限制--start */
39 | .u-line-1 {
40 | overflow: hidden;
41 | white-space: nowrap;
42 | text-overflow: ellipsis;
43 | }
44 |
45 | .u-line-2 {
46 | -webkit-line-clamp: 2;
47 | }
48 |
49 | .u-line-3 {
50 | -webkit-line-clamp: 3;
51 | }
52 |
53 | .u-line-4 {
54 | -webkit-line-clamp: 4;
55 | }
56 |
57 | .u-line-5 {
58 | -webkit-line-clamp: 5;
59 | }
60 |
61 | .u-line-2, .u-line-3, .u-line-4, .u-line-5 {
62 | overflow: hidden;
63 | word-break: break-all;
64 | text-overflow: ellipsis;
65 | display: -webkit-box; // 弹性伸缩盒
66 | -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式
67 | }
68 |
69 | /* end--文本行数限制--end */
70 |
71 |
72 | /* start--Retina 屏幕下的 1px 边框--start */
73 | .u-border,
74 | .u-border-bottom,
75 | .u-border-left,
76 | .u-border-right,
77 | .u-border-top,
78 | .u-border-top-bottom {
79 | position: relative
80 | }
81 |
82 | .u-border-bottom:after,
83 | .u-border-left:after,
84 | .u-border-right:after,
85 | .u-border-top-bottom:after,
86 | .u-border-top:after,
87 | .u-border:after {
88 | /* #ifndef APP-NVUE */
89 | content: ' ';
90 | /* #endif */
91 | position: absolute;
92 | left: 0;
93 | top: 0;
94 | pointer-events: none;
95 | box-sizing: border-box;
96 | -webkit-transform-origin: 0 0;
97 | transform-origin: 0 0;
98 | // 多加0.1%,能解决有时候边框缺失的问题
99 | width: 199.8%;
100 | height: 199.7%;
101 | transform: scale(0.5, 0.5);
102 | border: 0 solid $u-border-color;
103 | z-index: 2;
104 | }
105 |
106 | .u-border-top:after {
107 | border-top-width: 1px
108 | }
109 |
110 | .u-border-left:after {
111 | border-left-width: 1px
112 | }
113 |
114 | .u-border-right:after {
115 | border-right-width: 1px
116 | }
117 |
118 | .u-border-bottom:after {
119 | border-bottom-width: 1px
120 | }
121 |
122 | .u-border-top-bottom:after {
123 | border-width: 1px 0
124 | }
125 |
126 | .u-border:after {
127 | border-width: 1px
128 | }
129 | /* end--Retina 屏幕下的 1px 边框--end */
130 |
131 |
132 | /* start--clearfix--start */
133 | .u-clearfix:after,
134 | .clearfix:after {
135 | /* #ifndef APP-NVUE */
136 | content: '';
137 | /* #endif */
138 | display: table;
139 | clear: both
140 | }
141 | /* end--clearfix--end */
142 |
143 | /* start--高斯模糊tabbar底部处理--start */
144 | .u-blur-effect-inset {
145 | width: 750rpx;
146 | height: var(--window-bottom);
147 | background-color: #FFFFFF;
148 | }
149 | /* end--高斯模糊tabbar底部处理--end */
150 |
151 | /* start--提升H5端uni.toast()的层级,避免被uView的modal等遮盖--start */
152 | /* #ifdef H5 */
153 | uni-toast {
154 | z-index: 10090;
155 | }
156 | uni-toast .uni-toast {
157 | z-index: 10090;
158 | }
159 | /* #endif */
160 | /* end--提升H5端uni.toast()的层级,避免被uView的modal等遮盖--end */
161 |
162 | /* start--去除button的所有默认样式--start */
163 | .u-reset-button {
164 | padding: 0;
165 | font-size: inherit;
166 | line-height: inherit;
167 | background-color: transparent;
168 | color: inherit;
169 | }
170 |
171 | .u-reset-button::after {
172 | border: none;
173 | }
174 | /* end--去除button的所有默认样式--end */
175 |
176 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/$parent.js:
--------------------------------------------------------------------------------
1 | // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
2 | // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
3 | // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
4 | // 值(默认为undefined),就是查找最顶层的$parent
5 | export default function $parent(name = undefined) {
6 | let parent = this.$parent;
7 | // 通过while历遍,这里主要是为了H5需要多层解析的问题
8 | while (parent) {
9 | // 父组件
10 | if (parent.$options && parent.$options.name !== name) {
11 | // 如果组件的name不相等,继续上一级寻找
12 | parent = parent.$parent;
13 | } else {
14 | return parent;
15 | }
16 | }
17 | return false;
18 | }
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/addUnit.js:
--------------------------------------------------------------------------------
1 | import validation from './test.js';
2 |
3 | // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
4 | export default function addUnit(value = 'auto', unit = 'rpx') {
5 | value = String(value);
6 | // 用uView内置验证规则中的number判断是否为数值
7 | return validation.number(value) ? `${value}${unit}` : value;
8 | }
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/bem.js:
--------------------------------------------------------------------------------
1 | function bem(name, conf) {
2 |
3 | }
4 |
5 | module.exports.bem = bem;
6 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/color.js:
--------------------------------------------------------------------------------
1 | // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
2 | // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
3 | let color = {
4 | primary: "#2979ff",
5 | primaryDark: "#2b85e4",
6 | primaryDisabled: "#a0cfff",
7 | primaryLight: "#ecf5ff",
8 | bgColor: "#f3f4f6",
9 |
10 | info: "#909399",
11 | infoDark: "#82848a",
12 | infoDisabled: "#c8c9cc",
13 | infoLight: "#f4f4f5",
14 |
15 | warning: "#ff9900",
16 | warningDark: "#f29100",
17 | warningDisabled: "#fcbd71",
18 | warningLight: "#fdf6ec",
19 |
20 | error: "#fa3534",
21 | errorDark: "#dd6161",
22 | errorDisabled: "#fab6b6",
23 | errorLight: "#fef0f0",
24 |
25 | success: "#19be6b",
26 | successDark: "#18b566",
27 | successDisabled: "#71d5a1",
28 | successLight: "#dbf1e1",
29 |
30 | mainColor: "#303133",
31 | contentColor: "#606266",
32 | tipsColor: "#909399",
33 | lightColor: "#c0c4cc",
34 | borderColor: "#e4e7ed"
35 | }
36 |
37 | export default color;
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/colorGradient.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 求两个颜色之间的渐变值
3 | * @param {string} startColor 开始的颜色
4 | * @param {string} endColor 结束的颜色
5 | * @param {number} step 颜色等分的份额
6 | * */
7 | function colorGradient(startColor = 'rgb(0, 0, 0)', endColor = 'rgb(255, 255, 255)', step = 10) {
8 | let startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
9 | let startR = startRGB[0];
10 | let startG = startRGB[1];
11 | let startB = startRGB[2];
12 |
13 | let endRGB = hexToRgb(endColor, false);
14 | let endR = endRGB[0];
15 | let endG = endRGB[1];
16 | let endB = endRGB[2];
17 |
18 | let sR = (endR - startR) / step; //总差值
19 | let sG = (endG - startG) / step;
20 | let sB = (endB - startB) / step;
21 | let colorArr = [];
22 | for (let i = 0; i < step; i++) {
23 | //计算每一步的hex值
24 | let hex = rgbToHex('rgb(' + Math.round((sR * i + startR)) + ',' + Math.round((sG * i + startG)) + ',' + Math.round((sB *
25 | i + startB)) + ')');
26 | colorArr.push(hex);
27 | }
28 | return colorArr;
29 | }
30 |
31 | // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
32 | function hexToRgb(sColor, str = true) {
33 | let reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
34 | sColor = sColor.toLowerCase();
35 | if (sColor && reg.test(sColor)) {
36 | if (sColor.length === 4) {
37 | let sColorNew = "#";
38 | for (let i = 1; i < 4; i += 1) {
39 | sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
40 | }
41 | sColor = sColorNew;
42 | }
43 | //处理六位的颜色值
44 | let sColorChange = [];
45 | for (let i = 1; i < 7; i += 2) {
46 | sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2)));
47 | }
48 | if(!str) {
49 | return sColorChange;
50 | } else {
51 | return `rgb(${sColorChange[0]},${sColorChange[1]},${sColorChange[2]})`;
52 | }
53 | } else if (/^(rgb|RGB)/.test(sColor)) {
54 | let arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",")
55 | return arr.map(val => Number(val));
56 | } else {
57 | return sColor;
58 | }
59 | };
60 |
61 | // 将rgb表示方式转换为hex表示方式
62 | function rgbToHex(rgb) {
63 | let _this = rgb;
64 | let reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
65 | if (/^(rgb|RGB)/.test(_this)) {
66 | let aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
67 | let strHex = "#";
68 | for (let i = 0; i < aColor.length; i++) {
69 | let hex = Number(aColor[i]).toString(16);
70 | hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
71 | if (hex === "0") {
72 | hex += hex;
73 | }
74 | strHex += hex;
75 | }
76 | if (strHex.length !== 7) {
77 | strHex = _this;
78 | }
79 | return strHex;
80 | } else if (reg.test(_this)) {
81 | let aNum = _this.replace(/#/, "").split("");
82 | if (aNum.length === 6) {
83 | return _this;
84 | } else if (aNum.length === 3) {
85 | let numHex = "#";
86 | for (let i = 0; i < aNum.length; i += 1) {
87 | numHex += (aNum[i] + aNum[i]);
88 | }
89 | return numHex;
90 | }
91 | } else {
92 | return _this;
93 | }
94 | }
95 |
96 |
97 | /**
98 | * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
99 | * sHex为传入的十六进制的色值
100 | * alpha为rgba的透明度
101 | */
102 | function colorToRgba(color, alpha = 0.3) {
103 | color = rgbToHex(color)
104 | // 十六进制颜色值的正则表达式
105 | var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
106 | /* 16进制颜色转为RGB格式 */
107 | let sColor = color.toLowerCase()
108 | if (sColor && reg.test(sColor)) {
109 | if (sColor.length === 4) {
110 | var sColorNew = '#'
111 | for (let i = 1; i < 4; i += 1) {
112 | sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1))
113 | }
114 | sColor = sColorNew
115 | }
116 | // 处理六位的颜色值
117 | var sColorChange = []
118 | for (let i = 1; i < 7; i += 2) {
119 | sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2)))
120 | }
121 | // return sColorChange.join(',')
122 | return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')'
123 | }
124 | else {
125 | return sColor
126 | }
127 | }
128 |
129 | export default {
130 | colorGradient,
131 | hexToRgb,
132 | rgbToHex,
133 | colorToRgba
134 | }
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/debounce.js:
--------------------------------------------------------------------------------
1 | let timeout = null;
2 |
3 | /**
4 | * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
5 | *
6 | * @param {Function} func 要执行的回调函数
7 | * @param {Number} wait 延时的时间
8 | * @param {Boolean} immediate 是否立即执行
9 | * @return null
10 | */
11 | function debounce(func, wait = 500, immediate = false) {
12 | // 清除定时器
13 | if (timeout !== null) clearTimeout(timeout);
14 | // 立即执行,此类情况一般用不到
15 | if (immediate) {
16 | var callNow = !timeout;
17 | timeout = setTimeout(function() {
18 | timeout = null;
19 | }, wait);
20 | if (callNow) typeof func === 'function' && func();
21 | } else {
22 | // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
23 | timeout = setTimeout(function() {
24 | typeof func === 'function' && func();
25 | }, wait);
26 | }
27 | }
28 |
29 | export default debounce
30 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/deepClone.js:
--------------------------------------------------------------------------------
1 | // 判断arr是否为一个数组,返回一个bool值
2 | function isArray (arr) {
3 | return Object.prototype.toString.call(arr) === '[object Array]';
4 | }
5 |
6 | // 深度克隆
7 | function deepClone (obj) {
8 | // 对常见的“非”值,直接返回原来值
9 | if([null, undefined, NaN, false].includes(obj)) return obj;
10 | if(typeof obj !== "object" && typeof obj !== 'function') {
11 | //原始类型直接返回
12 | return obj;
13 | }
14 | var o = isArray(obj) ? [] : {};
15 | for(let i in obj) {
16 | if(obj.hasOwnProperty(i)){
17 | o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
18 | }
19 | }
20 | return o;
21 | }
22 |
23 | export default deepClone;
24 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/deepMerge.js:
--------------------------------------------------------------------------------
1 | import deepClone from "./deepClone";
2 |
3 | // JS对象深度合并
4 | function deepMerge(target = {}, source = {}) {
5 | target = deepClone(target);
6 | if (typeof target !== 'object' || typeof source !== 'object') return false;
7 | for (var prop in source) {
8 | if (!source.hasOwnProperty(prop)) continue;
9 | if (prop in target) {
10 | if (typeof target[prop] !== 'object') {
11 | target[prop] = source[prop];
12 | } else {
13 | if (typeof source[prop] !== 'object') {
14 | target[prop] = source[prop];
15 | } else {
16 | if (target[prop].concat && source[prop].concat) {
17 | target[prop] = target[prop].concat(source[prop]);
18 | } else {
19 | target[prop] = deepMerge(target[prop], source[prop]);
20 | }
21 | }
22 | }
23 | } else {
24 | target[prop] = source[prop];
25 | }
26 | }
27 | return target;
28 | }
29 |
30 | export default deepMerge;
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/getParent.js:
--------------------------------------------------------------------------------
1 | // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
2 | // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
3 | export default function getParent(name, keys) {
4 | let parent = this.$parent;
5 | // 通过while历遍,这里主要是为了H5需要多层解析的问题
6 | while (parent) {
7 | // 父组件
8 | if (parent.$options.name !== name) {
9 | // 如果组件的name不相等,继续上一级寻找
10 | parent = parent.$parent;
11 | } else {
12 | let data = {};
13 | // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
14 | if(Array.isArray(keys)) {
15 | keys.map(val => {
16 | data[val] = parent[val] ? parent[val] : '';
17 | })
18 | } else {
19 | // 历遍传过来的对象参数
20 | for(let i in keys) {
21 | // 如果子组件有此值则用,无此值则用父组件的值
22 | // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
23 | if(Array.isArray(keys[i])) {
24 | if(keys[i].length) {
25 | data[i] = keys[i];
26 | } else {
27 | data[i] = parent[i];
28 | }
29 | } else if(keys[i].constructor === Object) {
30 | // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
31 | if(Object.keys(keys[i]).length) {
32 | data[i] = keys[i];
33 | } else {
34 | data[i] = parent[i];
35 | }
36 | } else {
37 | // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
38 | data[i] = (keys[i] || keys[i] === false) ? keys[i] : parent[i];
39 | }
40 | }
41 | }
42 | return data;
43 | }
44 | }
45 |
46 | return {};
47 | }
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/guid.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
3 | * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
4 | * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
5 | * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
6 | * v-for的时候,推荐使用后端返回的id而不是循环的index
7 | * @param {Number} len uuid的长度
8 | * @param {Boolean} firstU 将返回的首字母置为"u"
9 | * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
10 | */
11 | function guid(len = 32, firstU = true, radix = null) {
12 | let chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
13 | let uuid = [];
14 | radix = radix || chars.length;
15 |
16 | if (len) {
17 | // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
18 | for (let i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
19 | } else {
20 | let r;
21 | // rfc4122标准要求返回的uuid中,某些位为固定的字符
22 | uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
23 | uuid[14] = '4';
24 |
25 | for (let i = 0; i < 36; i++) {
26 | if (!uuid[i]) {
27 | r = 0 | Math.random() * 16;
28 | uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
29 | }
30 | }
31 | }
32 | // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
33 | if (firstU) {
34 | uuid.shift();
35 | return 'u' + uuid.join('');
36 | } else {
37 | return uuid.join('');
38 | }
39 | }
40 |
41 | export default guid;
42 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/queryParams.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 对象转url参数
3 | * @param {*} data,对象
4 | * @param {*} isPrefix,是否自动加上"?"
5 | */
6 | function queryParams(data = {}, isPrefix = true, arrayFormat = 'brackets') {
7 | let prefix = isPrefix ? '?' : ''
8 | let _result = []
9 | if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';
10 | for (let key in data) {
11 | let value = data[key]
12 | // 去掉为空的参数
13 | if (['', undefined, null].indexOf(value) >= 0) {
14 | continue;
15 | }
16 | // 如果值为数组,另行处理
17 | if (value.constructor === Array) {
18 | // e.g. {ids: [1, 2, 3]}
19 | switch (arrayFormat) {
20 | case 'indices':
21 | // 结果: ids[0]=1&ids[1]=2&ids[2]=3
22 | for (let i = 0; i < value.length; i++) {
23 | _result.push(key + '[' + i + ']=' + value[i])
24 | }
25 | break;
26 | case 'brackets':
27 | // 结果: ids[]=1&ids[]=2&ids[]=3
28 | value.forEach(_value => {
29 | _result.push(key + '[]=' + _value)
30 | })
31 | break;
32 | case 'repeat':
33 | // 结果: ids=1&ids=2&ids=3
34 | value.forEach(_value => {
35 | _result.push(key + '=' + _value)
36 | })
37 | break;
38 | case 'comma':
39 | // 结果: ids=1,2,3
40 | let commaStr = "";
41 | value.forEach(_value => {
42 | commaStr += (commaStr ? "," : "") + _value;
43 | })
44 | _result.push(key + '=' + commaStr)
45 | break;
46 | default:
47 | value.forEach(_value => {
48 | _result.push(key + '[]=' + _value)
49 | })
50 | }
51 | } else {
52 | _result.push(key + '=' + value)
53 | }
54 | }
55 | return _result.length ? prefix + _result.join('&') : ''
56 | }
57 |
58 | export default queryParams;
59 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/random.js:
--------------------------------------------------------------------------------
1 | function random(min, max) {
2 | if (min >= 0 && max > 0 && max >= min) {
3 | let gab = max - min + 1;
4 | return Math.floor(Math.random() * gab + min);
5 | } else {
6 | return 0;
7 | }
8 | }
9 |
10 | export default random;
11 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/randomArray.js:
--------------------------------------------------------------------------------
1 | // 打乱数组
2 | function randomArray(array = []) {
3 | // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
4 | return array.sort(() => Math.random() - 0.5);
5 | }
6 |
7 | export default randomArray
8 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/route.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
3 | * 并且带有路由拦截功能
4 | */
5 |
6 | class Router {
7 | constructor() {
8 | // 原始属性定义
9 | this.config = {
10 | type: 'navigateTo',
11 | url: '',
12 | delta: 1, // navigateBack页面后退时,回退的层数
13 | params: {}, // 传递的参数
14 | animationType: 'pop-in', // 窗口动画,只在APP有效
15 | animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
16 | intercept: false, // 是否需要拦截
17 | }
18 | // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
19 | // 这里在构造函数中进行this绑定
20 | this.route = this.route.bind(this)
21 | }
22 |
23 | // 判断url前面是否有"/",如果没有则加上,否则无法跳转
24 | addRootPath(url) {
25 | return url[0] === '/' ? url : `/${url}`
26 | }
27 |
28 | // 整合路由参数
29 | mixinParam(url, params) {
30 | url = url && this.addRootPath(url)
31 |
32 | // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
33 | // 如果有url中有get参数,转换后无需带上"?"
34 | let query = ''
35 | if (/.*\/.*\?.*=.*/.test(url)) {
36 | // object对象转为get类型的参数
37 | query = uni.$u.queryParams(params, false);
38 | // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
39 | return url += "&" + query
40 | } else {
41 | // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
42 | query = uni.$u.queryParams(params);
43 | return url += query
44 | }
45 | }
46 |
47 | // 对外的方法名称
48 | async route(options = {}, params = {}) {
49 | // 合并用户的配置和内部的默认配置
50 | let mergeConfig = {}
51 |
52 | if (typeof options === 'string') {
53 | // 如果options为字符串,则为route(url, params)的形式
54 | mergeConfig.url = this.mixinParam(options, params)
55 | mergeConfig.type = 'navigateTo'
56 | } else {
57 | mergeConfig = uni.$u.deepClone(options, this.config)
58 | // 否则正常使用mergeConfig中的url和params进行拼接
59 | mergeConfig.url = this.mixinParam(options.url, options.params)
60 | }
61 |
62 | if(params.intercept) {
63 | this.config.intercept = params.intercept
64 | }
65 | // params参数也带给拦截器
66 | mergeConfig.params = params
67 | // 合并内外部参数
68 | mergeConfig = uni.$u.deepMerge(this.config, mergeConfig)
69 | // 判断用户是否定义了拦截器
70 | if (typeof uni.$u.routeIntercept === 'function') {
71 | // 定一个promise,根据用户执行resolve(true)或者resolve(false)来决定是否进行路由跳转
72 | const isNext = await new Promise((resolve, reject) => {
73 | uni.$u.routeIntercept(mergeConfig, resolve)
74 | })
75 | // 如果isNext为true,则执行路由跳转
76 | isNext && this.openPage(mergeConfig)
77 | } else {
78 | this.openPage(mergeConfig)
79 | }
80 | }
81 |
82 | // 执行路由跳转
83 | openPage(config) {
84 | // 解构参数
85 | const {
86 | url,
87 | type,
88 | delta,
89 | animationType,
90 | animationDuration
91 | } = config
92 | if (config.type == 'navigateTo' || config.type == 'to') {
93 | uni.navigateTo({
94 | url,
95 | animationType,
96 | animationDuration
97 | });
98 | }
99 | if (config.type == 'redirectTo' || config.type == 'redirect') {
100 | uni.redirectTo({
101 | url
102 | });
103 | }
104 | if (config.type == 'switchTab' || config.type == 'tab') {
105 | uni.switchTab({
106 | url
107 | });
108 | }
109 | if (config.type == 'reLaunch' || config.type == 'launch') {
110 | uni.reLaunch({
111 | url
112 | });
113 | }
114 | if (config.type == 'navigateBack' || config.type == 'back') {
115 | uni.navigateBack({
116 | delta
117 | });
118 | }
119 | }
120 | }
121 |
122 | export default (new Router()).route
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/sys.js:
--------------------------------------------------------------------------------
1 | export function os() {
2 | return uni.getSystemInfoSync().platform;
3 | };
4 |
5 | export function sys() {
6 | return uni.getSystemInfoSync();
7 | }
8 |
9 |
10 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/throttle.js:
--------------------------------------------------------------------------------
1 | let timer, flag;
2 | /**
3 | * 节流原理:在一定时间内,只能触发一次
4 | *
5 | * @param {Function} func 要执行的回调函数
6 | * @param {Number} wait 延时的时间
7 | * @param {Boolean} immediate 是否立即执行
8 | * @return null
9 | */
10 | function throttle(func, wait = 500, immediate = true) {
11 | if (immediate) {
12 | if (!flag) {
13 | flag = true;
14 | // 如果是立即执行,则在wait毫秒内开始时执行
15 | typeof func === 'function' && func();
16 | timer = setTimeout(() => {
17 | flag = false;
18 | }, wait);
19 | }
20 | } else {
21 | if (!flag) {
22 | flag = true
23 | // 如果是非立即执行,则在wait毫秒内的结束处执行
24 | timer = setTimeout(() => {
25 | flag = false
26 | typeof func === 'function' && func();
27 | }, wait);
28 | }
29 |
30 | }
31 | };
32 | export default throttle
33 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/timeFormat.js:
--------------------------------------------------------------------------------
1 | // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
2 | // 所以这里做一个兼容polyfill的兼容处理
3 | if (!String.prototype.padStart) {
4 | // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
5 | String.prototype.padStart = function(maxLength, fillString = ' ') {
6 | if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
7 | 'fillString must be String')
8 | let str = this
9 | // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
10 | if (str.length >= maxLength) return String(str)
11 |
12 | let fillLength = maxLength - str.length,
13 | times = Math.ceil(fillLength / fillString.length)
14 | while (times >>= 1) {
15 | fillString += fillString
16 | if (times === 1) {
17 | fillString += fillString
18 | }
19 | }
20 | return fillString.slice(0, fillLength) + str;
21 | }
22 | }
23 |
24 | // 其他更多是格式化有如下:
25 | // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
26 | function timeFormat(dateTime = null, fmt = 'yyyy-mm-dd') {
27 | // 如果为null,则格式化当前时间
28 | if (!dateTime) dateTime = Number(new Date());
29 | // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
30 | if (dateTime.toString().length == 10) dateTime *= 1000;
31 | let date = new Date(Number(dateTime));
32 | let ret;
33 | let opt = {
34 | "y+": date.getFullYear().toString(), // 年
35 | "m+": (date.getMonth() + 1).toString(), // 月
36 | "d+": date.getDate().toString(), // 日
37 | "h+": date.getHours().toString(), // 时
38 | "M+": date.getMinutes().toString(), // 分
39 | "s+": date.getSeconds().toString() // 秒
40 | // 有其他格式化字符需求可以继续添加,必须转化成字符串
41 | };
42 | for (let k in opt) {
43 | ret = new RegExp("(" + k + ")").exec(fmt);
44 | if (ret) {
45 | fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
46 | };
47 | };
48 | return fmt;
49 | }
50 |
51 | export default timeFormat
52 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/timeFrom.js:
--------------------------------------------------------------------------------
1 | import timeFormat from '../../libs/function/timeFormat.js';
2 |
3 | /**
4 | * 时间戳转为多久之前
5 | * @param String timestamp 时间戳
6 | * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
7 | * 如果为布尔值false,无论什么时间,都返回多久以前的格式
8 | */
9 | function timeFrom(dateTime = null, format = 'yyyy-mm-dd') {
10 | // 如果为null,则格式化当前时间
11 | if (!dateTime) dateTime = Number(new Date());
12 | // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
13 | if (dateTime.toString().length == 10) dateTime *= 1000;
14 | let timestamp = + new Date(Number(dateTime));
15 |
16 | let timer = (Number(new Date()) - timestamp) / 1000;
17 | // 如果小于5分钟,则返回"刚刚",其他以此类推
18 | let tips = '';
19 | switch (true) {
20 | case timer < 300:
21 | tips = '刚刚';
22 | break;
23 | case timer >= 300 && timer < 3600:
24 | tips = parseInt(timer / 60) + '分钟前';
25 | break;
26 | case timer >= 3600 && timer < 86400:
27 | tips = parseInt(timer / 3600) + '小时前';
28 | break;
29 | case timer >= 86400 && timer < 2592000:
30 | tips = parseInt(timer / 86400) + '天前';
31 | break;
32 | default:
33 | // 如果format为false,则无论什么时间戳,都显示xx之前
34 | if(format === false) {
35 | if(timer >= 2592000 && timer < 365 * 86400) {
36 | tips = parseInt(timer / (86400 * 30)) + '个月前';
37 | } else {
38 | tips = parseInt(timer / (86400 * 365)) + '年前';
39 | }
40 | } else {
41 | tips = timeFormat(timestamp, format);
42 | }
43 | }
44 | return tips;
45 | }
46 |
47 | export default timeFrom;
48 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/toast.js:
--------------------------------------------------------------------------------
1 | function toast(title, duration = 1500) {
2 | uni.showToast({
3 | title: title,
4 | icon: 'none',
5 | duration: duration
6 | })
7 | }
8 |
9 | export default toast
10 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/trim.js:
--------------------------------------------------------------------------------
1 | function trim(str, pos = 'both') {
2 | if (pos == 'both') {
3 | return str.replace(/^\s+|\s+$/g, "");
4 | } else if (pos == "left") {
5 | return str.replace(/^\s*/, '');
6 | } else if (pos == 'right') {
7 | return str.replace(/(\s*$)/g, "");
8 | } else if (pos == 'all') {
9 | return str.replace(/\s+/g, "");
10 | } else {
11 | return str;
12 | }
13 | }
14 |
15 | export default trim
16 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/function/type2icon.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 根据主题type值,获取对应的图标
3 | * @param String type 主题名称,primary|info|error|warning|success
4 | * @param String fill 是否使用fill填充实体的图标
5 | */
6 | function type2icon(type = 'success', fill = false) {
7 | // 如果非预置值,默认为success
8 | if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
9 | let iconName = '';
10 | // 目前(2019-12-12),info和primary使用同一个图标
11 | switch (type) {
12 | case 'primary':
13 | iconName = 'info-circle';
14 | break;
15 | case 'info':
16 | iconName = 'info-circle';
17 | break;
18 | case 'error':
19 | iconName = 'close-circle';
20 | break;
21 | case 'warning':
22 | iconName = 'error-circle';
23 | break;
24 | case 'success':
25 | iconName = 'checkmark-circle';
26 | break;
27 | default:
28 | iconName = 'checkmark-circle';
29 | }
30 | // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
31 | if (fill) iconName += '-fill';
32 | return iconName;
33 | }
34 |
35 | export default type2icon
36 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/mixin/mixin.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | data() {
3 | return {}
4 | },
5 | onLoad() {
6 | // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
7 | this.$u.getRect = this.$uGetRect
8 | },
9 | methods: {
10 | // 查询节点信息
11 | // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
12 | // 解决办法为在组件根部再套一个没有任何作用的view元素
13 | $uGetRect(selector, all) {
14 | return new Promise(resolve => {
15 | uni.createSelectorQuery().
16 | in(this)[all ? 'selectAll' : 'select'](selector)
17 | .boundingClientRect(rect => {
18 | if (all && Array.isArray(rect) && rect.length) {
19 | resolve(rect)
20 | }
21 | if (!all && rect) {
22 | resolve(rect)
23 | }
24 | })
25 | .exec()
26 | })
27 | },
28 | getParentData(parentName = '') {
29 | // 避免在created中去定义parent变量
30 | if(!this.parent) this.parent = false;
31 | // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
32 | // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
33 | // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
34 | this.parent = this.$u.$parent.call(this, parentName);
35 | if(this.parent) {
36 | // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
37 | Object.keys(this.parentData).map(key => {
38 | this.parentData[key] = this.parent[key];
39 | });
40 | }
41 | },
42 | // 阻止事件冒泡
43 | preventEvent(e) {
44 | e && e.stopPropagation && e.stopPropagation()
45 | }
46 | },
47 | onReachBottom() {
48 | uni.$emit('uOnReachBottom')
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/mixin/mpShare.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | onLoad() {
3 | // 设置默认的转发参数
4 | this.$u.mpShare = {
5 | title: '', // 默认为小程序名称
6 | path: '', // 默认为当前页面路径
7 | imageUrl: '' // 默认为当前页面的截图
8 | }
9 | },
10 | onShareAppMessage() {
11 | return this.$u.mpShare
12 | },
13 | // #ifdef MP-WEIXIN
14 | onShareTimeline() {
15 | return this.$u.mpShare
16 | }
17 | // #endif
18 | }
19 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/store/index.js:
--------------------------------------------------------------------------------
1 | // 暂时不用vuex模块方式实现,将该方法直接放入到/store/index.js中
2 | const module = {
3 | actions: {
4 | $uStore({rootState}, params) {
5 | let nameArr = params.name.split('.');
6 | if(nameArr.length >= 2) {
7 | let obj = rootState[nameArr[0]];
8 | for(let i = 1; i < nameArr.length - 1; i ++) {
9 | obj = obj[nameArr[i]];
10 | }
11 | obj[nameArr[nameArr.length - 1]] = params.value;
12 | } else {
13 | rootState[params.name] = params.value;
14 | }
15 | }
16 | }
17 | }
18 |
19 | export default module
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/util/emitter.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 递归使用 call 方式this指向
3 | * @param componentName // 需要找的组件的名称
4 | * @param eventName // 事件名称
5 | * @param params // 需要传递的参数
6 | */
7 | function broadcast(componentName, eventName, params) {
8 | // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
9 | this.$children.map(child=>{
10 | if (componentName===child.$options.name) {
11 | child.$emit.apply(child,[eventName].concat(params))
12 | }else {
13 | broadcast.apply(child,[componentName,eventName].concat(params))
14 | }
15 | })
16 | }
17 | export default {
18 | methods: {
19 | /**
20 | * 派发 (向上查找) (一个)
21 | * @param componentName // 需要找的组件的名称
22 | * @param eventName // 事件名称
23 | * @param params // 需要传递的参数
24 | */
25 | dispatch(componentName, eventName, params) {
26 | let parent = this.$parent || this.$root;//$parent 找到最近的父节点 $root 根节点
27 | let name = parent.$options.name; // 获取当前组件实例的name
28 | // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
29 | // 循环出当前名称的一样的组件实例
30 | while (parent && (!name||name!==componentName)) {
31 | parent = parent.$parent;
32 | if (parent) {
33 | name = parent.$options.name;
34 | }
35 | }
36 | // 有节点表示当前找到了name一样的实例
37 | if (parent) {
38 | parent.$emit.apply(parent,[eventName].concat(params))
39 | }
40 | },
41 | /**
42 | * 广播 (向下查找) (广播多个)
43 | * @param componentName // 需要找的组件的名称
44 | * @param eventName // 事件名称
45 | * @param params // 需要传递的参数
46 | */
47 | broadcast(componentName, eventName, params) {
48 | broadcast.call(this,componentName, eventName, params)
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/libs/util/province.js:
--------------------------------------------------------------------------------
1 | var provinceData=[{"label":"北京市","value":"11"},{"label":"天津市","value":"12"},{"label":"河北省","value":"13"},{"label":"山西省","value":"14"},{"label":"内蒙古自治区","value":"15"},{"label":"辽宁省","value":"21"},{"label":"吉林省","value":"22"},{"label":"黑龙江省","value":"23"},{"label":"上海市","value":"31"},{"label":"江苏省","value":"32"},{"label":"浙江省","value":"33"},{"label":"安徽省","value":"34"},{"label":"福建省","value":"35"},{"label":"江西省","value":"36"},{"label":"山东省","value":"37"},{"label":"河南省","value":"41"},{"label":"湖北省","value":"42"},{"label":"湖南省","value":"43"},{"label":"广东省","value":"44"},{"label":"广西壮族自治区","value":"45"},{"label":"海南省","value":"46"},{"label":"重庆市","value":"50"},{"label":"四川省","value":"51"},{"label":"贵州省","value":"52"},{"label":"云南省","value":"53"},{"label":"西藏自治区","value":"54"},{"label":"陕西省","value":"61"},{"label":"甘肃省","value":"62"},{"label":"青海省","value":"63"},{"label":"宁夏回族自治区","value":"64"},{"label":"新疆维吾尔自治区","value":"65"},{"label":"台湾","value":"66"},{"label":"香港","value":"67"},{"label":"澳门","value":"68"}];export default provinceData;
--------------------------------------------------------------------------------
/node_modules/uview-ui/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "uview-ui",
3 | "version": "1.8.2",
4 | "description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
5 | "main": "index.js",
6 | "keywords": [
7 | "uview",
8 | "uView",
9 | "uni-app",
10 | "uni-app ui",
11 | "uniapp",
12 | "uviewui",
13 | "uview ui",
14 | "uviewUI",
15 | "uViewui",
16 | "uViewUI",
17 | "uView UI",
18 | "uni ui",
19 | "uni UI",
20 | "uniapp ui",
21 | "ui",
22 | "UI框架",
23 | "uniapp ui框架",
24 | "uniapp UI"
25 | ],
26 | "scripts": {
27 | "test": "echo \"Error: no test specified\" && exit 1"
28 | },
29 | "repository": {
30 | "type": "git",
31 | "url": ""
32 | },
33 | "devDependencies": {
34 | "node-sass": "^4.14.0",
35 | "sass-loader": "^8.0.2"
36 | },
37 | "author": "uView",
38 | "license": "MIT"
39 | }
40 |
--------------------------------------------------------------------------------
/node_modules/uview-ui/theme.scss:
--------------------------------------------------------------------------------
1 | // 此文件为uView的主题变量,这些变量目前只能通过uni.scss引入才有效,另外由于
2 | // uni.scss中引入的样式会同时混入到全局样式文件和单独每一个页面的样式中,造成微信程序包太大,
3 | // 故uni.scss只建议放scss变量名相关样式,其他的样式可以通过main.js或者App.vue引入
4 |
5 | $u-main-color: #303133;
6 | $u-content-color: #606266;
7 | $u-tips-color: #909399;
8 | $u-light-color: #c0c4cc;
9 | $u-border-color: #e4e7ed;
10 | $u-bg-color: #f3f4f6;
11 |
12 | $u-type-primary: #2979ff;
13 | $u-type-primary-light: #ecf5ff;
14 | $u-type-primary-disabled: #a0cfff;
15 | $u-type-primary-dark: #2b85e4;
16 |
17 | $u-type-warning: #ff9900;
18 | $u-type-warning-disabled: #fcbd71;
19 | $u-type-warning-dark: #f29100;
20 | $u-type-warning-light: #fdf6ec;
21 |
22 | $u-type-success: #19be6b;
23 | $u-type-success-disabled: #71d5a1;
24 | $u-type-success-dark: #18b566;
25 | $u-type-success-light: #dbf1e1;
26 |
27 | $u-type-error: #fa3534;
28 | $u-type-error-disabled: #fab6b6;
29 | $u-type-error-dark: #dd6161;
30 | $u-type-error-light: #fef0f0;
31 |
32 | $u-type-info: #909399;
33 | $u-type-info-disabled: #c8c9cc;
34 | $u-type-info-dark: #82848a;
35 | $u-type-info-light: #f4f4f5;
36 |
37 | $u-form-item-height: 70rpx;
38 | $u-form-item-border-color: #dcdfe6;
39 |
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "zyplayer",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "fast-xml-parser": {
8 | "version": "3.17.4",
9 | "resolved": "https://registry.npm.taobao.org/fast-xml-parser/download/fast-xml-parser-3.17.4.tgz",
10 | "integrity": "sha1-1mhJX7Pku895cPPCSsABnYLnZHc="
11 | },
12 | "uni-ajax": {
13 | "version": "2.1.8",
14 | "resolved": "https://registry.npm.taobao.org/uni-ajax/download/uni-ajax-2.1.8.tgz",
15 | "integrity": "sha1-ET3m18wWJUb4kEZweeE+HVxh6CE="
16 | },
17 | "uview-ui": {
18 | "version": "1.8.1",
19 | "resolved": "https://registry.npm.taobao.org/uview-ui/download/uview-ui-1.8.1.tgz",
20 | "integrity": "sha1-HVeMmx2fVsTdtIXFgP4669pFTyQ="
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "zyplayer",
3 | "version": "0.1.1",
4 | "description": "ZY Player Android by Uni-app",
5 | "main": "main.js",
6 | "dependencies": {
7 | "fast-xml-parser": "^3.17.4",
8 | "uni-ajax": "^2.1.8",
9 | "uview-ui": "^1.8.1"
10 | },
11 | "devDependencies": {},
12 | "scripts": {
13 | "test": "echo \"Error: no test specified\" && exit 1"
14 | },
15 | "keywords": [
16 | "ZY Player",
17 | "zy"
18 | ],
19 | "author": "Hunlongyu",
20 | "license": "MIT"
21 | }
22 |
--------------------------------------------------------------------------------
/pages.json:
--------------------------------------------------------------------------------
1 | {
2 | "easycom": {
3 | "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
4 | },
5 | "pages": [
6 | {
7 | "path": "pages/film/film",
8 | "style": {
9 | "navigationBarTitleText": "首页"
10 | }
11 | },
12 | {
13 | "path": "pages/star/star",
14 | "style": {
15 | "navigationBarTitleText": "收藏"
16 | }
17 | },
18 | {
19 | "path": "pages/history/history",
20 | "style": {
21 | "navigationBarTitleText": "播放记录"
22 | }
23 | },
24 | {
25 | "path": "pages/site/site",
26 | "style": {
27 | "navigationBarTitleText": "源管理"
28 | }
29 | },
30 | {
31 | "path": "pages/me/me",
32 | "style": {
33 | "navigationStyle": "custom"
34 | }
35 | },
36 | {
37 | "path": "pages/detail/detail",
38 | "style": {
39 | "navigationStyle": "custom"
40 | }
41 | },
42 | {
43 | "path": "pages/play/play",
44 | "style": {
45 | "navigationBarTitleText": "播放"
46 | }
47 | }
48 | ],
49 | "globalStyle": {
50 | "navigationBarTextStyle": "black",
51 | "navigationBarTitleText": "ZY Player",
52 | "navigationBarBackgroundColor": "#FFFFFF",
53 | "backgroundColor": "#FFFFFF"
54 | },
55 | "tabBar": {
56 | "color": "#909399",
57 | "selectedColor": "#303133",
58 | "backgroundColor": "#FFFFFF",
59 | "borderStyle": "black",
60 | "list": [
61 | {
62 | "pagePath": "pages/film/film",
63 | "iconPath": "static/images/home1.png",
64 | "selectedIconPath": "static/images/home2.png",
65 | "text": "首页"
66 | },
67 | {
68 | "pagePath": "pages/star/star",
69 | "iconPath": "static/images/star1.png",
70 | "selectedIconPath": "static/images/star2.png",
71 | "text": "收藏"
72 | },
73 | {
74 | "pagePath": "pages/me/me",
75 | "iconPath": "static/images/me1.png",
76 | "selectedIconPath": "static/images/me2.png",
77 | "text": "我"
78 | }
79 | ]
80 | }
81 | }
--------------------------------------------------------------------------------
/pages/history/history.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
15 |
16 |
17 |
55 |
--------------------------------------------------------------------------------
/pages/index/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{title}}
6 |
7 |
8 |
9 |
10 |
25 |
26 |
53 |
--------------------------------------------------------------------------------
/pages/me/me.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | ZY Player APP
8 |
9 |
15 |
21 |
27 |
33 |
39 |
45 |
46 |
47 | 所有资源来自网上, 该软件不参与任何制作, 上传, 储存等内容,
48 | 禁止传播违法资源. 该软件仅供学习参考, 请于安装后24小时内删除.
49 |
50 |
51 |
52 |
53 |
54 |
55 |
105 |
106 |
132 |
--------------------------------------------------------------------------------
/pages/star/star.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
15 |
16 |
46 |
--------------------------------------------------------------------------------
/static/images/history1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/history1.png
--------------------------------------------------------------------------------
/static/images/history2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/history2.png
--------------------------------------------------------------------------------
/static/images/home1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/home1.png
--------------------------------------------------------------------------------
/static/images/home2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/home2.png
--------------------------------------------------------------------------------
/static/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/logo.png
--------------------------------------------------------------------------------
/static/images/me1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/me1.png
--------------------------------------------------------------------------------
/static/images/me2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/me2.png
--------------------------------------------------------------------------------
/static/images/recommend1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/recommend1.png
--------------------------------------------------------------------------------
/static/images/recommend2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/recommend2.png
--------------------------------------------------------------------------------
/static/images/star1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/star1.png
--------------------------------------------------------------------------------
/static/images/star2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/static/images/star2.png
--------------------------------------------------------------------------------
/uni.scss:
--------------------------------------------------------------------------------
1 | @import 'uview-ui/theme.scss';
2 |
--------------------------------------------------------------------------------
/unpackage/dist/build/.automator/app-plus/.automator.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/dist/build/.automator/app-plus/.automator.json
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/__uniappsuccess.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/dist/build/app-plus/__uniappsuccess.png
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/__uniappview.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
14 | View
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/app-config-service.js:
--------------------------------------------------------------------------------
1 |
2 | var isReady=false;var onReadyCallbacks=[];
3 | var isServiceReady=false;var onServiceReadyCallbacks=[];
4 | var __uniConfig = {"pages":["pages/film/film","pages/star/star","pages/me/me","pages/detail/detail","pages/play/play"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"ZY Player","navigationBarBackgroundColor":"#FFFFFF","backgroundColor":"#FFFFFF"},"tabBar":{"color":"#909399","selectedColor":"#303133","backgroundColor":"#FFFFFF","borderStyle":"black","list":[{"pagePath":"pages/film/film","iconPath":"static/images/home1.png","selectedIconPath":"static/images/home2.png","text":"首页"},{"pagePath":"pages/star/star","iconPath":"static/images/star1.png","selectedIconPath":"static/images/star2.png","text":"收藏"},{"pagePath":"pages/me/me","iconPath":"static/images/me1.png","selectedIconPath":"static/images/me2.png","text":"我"}]},"nvueCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":false,"autoclose":true},"appname":"ZY Player","compilerVersion":"2.9.8","entryPagePath":"pages/film/film","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
5 | var __uniRoutes = [{"path":"/pages/film/film","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"首页"}},{"path":"/pages/star/star","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"收藏"}},{"path":"/pages/me/me","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/detail/detail","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/play/play","meta":{},"window":{"navigationBarTitleText":"播放"}}];
6 | __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
7 | __uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
8 | service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
9 |
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/app-config.js:
--------------------------------------------------------------------------------
1 | (function(e){function r(r){for(var n,l,i=r[0],p=r[1],a=r[2],c=0,s=[];c","","","","","",""]},"apple":{},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"nativePlugins":{"XZH-Shortcut":{"__plugin_info__":{"name":"XZH-Shortcut","description":"Android图标长按菜单","platforms":"Android","url":"","android_package_name":"","ios_bundle_id":"","isCloud":false,"bought":-1,"pid":"","parameters":{}}}},"allowsInlineMediaPlayback":true,"safearea":{"background":"#FFFFFF","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"2.9.8","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#909399","selectedColor":"#303133","backgroundColor":"#FFFFFF","borderStyle":"rgba(0,0,0,0.4)","list":[{"pagePath":"pages/film/film","iconPath":"static/images/home1.png","selectedIconPath":"static/images/home2.png","text":"首页"},{"pagePath":"pages/star/star","iconPath":"static/images/star1.png","selectedIconPath":"static/images/star2.png","text":"收藏"},{"pagePath":"pages/me/me","iconPath":"static/images/me1.png","selectedIconPath":"static/images/me2.png","text":"我"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}}
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/static/images/home1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/dist/build/app-plus/static/images/home1.png
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/static/images/home2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/dist/build/app-plus/static/images/home2.png
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/static/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/dist/build/app-plus/static/images/logo.png
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/static/images/me1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/dist/build/app-plus/static/images/me1.png
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/static/images/me2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/dist/build/app-plus/static/images/me2.png
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/static/images/star1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/dist/build/app-plus/static/images/star1.png
--------------------------------------------------------------------------------
/unpackage/dist/build/app-plus/static/images/star2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/dist/build/app-plus/static/images/star2.png
--------------------------------------------------------------------------------
/unpackage/res/icons/1024x1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/1024x1024.png
--------------------------------------------------------------------------------
/unpackage/res/icons/120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/120x120.png
--------------------------------------------------------------------------------
/unpackage/res/icons/144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/144x144.png
--------------------------------------------------------------------------------
/unpackage/res/icons/152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/152x152.png
--------------------------------------------------------------------------------
/unpackage/res/icons/167x167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/167x167.png
--------------------------------------------------------------------------------
/unpackage/res/icons/180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/180x180.png
--------------------------------------------------------------------------------
/unpackage/res/icons/192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/192x192.png
--------------------------------------------------------------------------------
/unpackage/res/icons/20x20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/20x20.png
--------------------------------------------------------------------------------
/unpackage/res/icons/29x29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/29x29.png
--------------------------------------------------------------------------------
/unpackage/res/icons/40x40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/40x40.png
--------------------------------------------------------------------------------
/unpackage/res/icons/58x58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/58x58.png
--------------------------------------------------------------------------------
/unpackage/res/icons/60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/60x60.png
--------------------------------------------------------------------------------
/unpackage/res/icons/72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/72x72.png
--------------------------------------------------------------------------------
/unpackage/res/icons/76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/76x76.png
--------------------------------------------------------------------------------
/unpackage/res/icons/80x80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/80x80.png
--------------------------------------------------------------------------------
/unpackage/res/icons/87x87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/87x87.png
--------------------------------------------------------------------------------
/unpackage/res/icons/96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cuiocean/ZY-Player-APP/c378b08a2065d01e2f1b005028fcf8250d5c08c4/unpackage/res/icons/96x96.png
--------------------------------------------------------------------------------
/utils/initSetting.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 0,
4 | "key": "config",
5 | "R18": true
6 | }
7 | ]
--------------------------------------------------------------------------------
/utils/initSite.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 1,
4 | "key": "mahuazy",
5 | "name": "麻花资源",
6 | "api": "https://www.mhapi123.com/inc/api.php",
7 | "download": "",
8 | "group": "默认",
9 | "isActive": true,
10 | "status": "可用"
11 | },
12 | {
13 | "id": 2,
14 | "key": "88zyw",
15 | "name": "88 影视资源站",
16 | "api": "http://www.88zyw.net/inc/api.php",
17 | "download": "",
18 | "group": "默认",
19 | "isActive": true,
20 | "status": "可用"
21 | },
22 | {
23 | "id": 3,
24 | "key": "apibdzy",
25 | "name": "百度云资源",
26 | "api": "https://api.apibdzy.com/api.php/provide/vod/?ac=list",
27 | "download": "",
28 | "group": "默认",
29 | "isActive": true,
30 | "status": "可用"
31 | },
32 | {
33 | "id": 4,
34 | "key": "mbo",
35 | "name": "秒播资源",
36 | "api": "http://caiji.mb77.vip/inc/api.php",
37 | "download": "",
38 | "group": "默认",
39 | "isActive": true,
40 | "status": "可用"
41 | },
42 | {
43 | "id": 5,
44 | "key": "zuidazy",
45 | "name": "最大资源网",
46 | "api": "http://www.zdziyuan.com/inc/api.php",
47 | "download": "http://www.zdziyuan.com/inc/apidown.php",
48 | "group": "默认",
49 | "isActive": true,
50 | "status": "可用"
51 | },
52 | {
53 | "id": 6,
54 | "key": "123ku",
55 | "name": "123 资源",
56 | "api": "http://cj.123ku2.com:12315/inc/api.php",
57 | "download": "",
58 | "group": "默认",
59 | "isActive": true,
60 | "status": "可用"
61 | },
62 | {
63 | "id": 7,
64 | "key": "okzy",
65 | "name": "OK 资源网",
66 | "api": "http://cj.okzy.tv/inc/api.php",
67 | "download": "http://cj.okzy.tv/inc/apidown.php",
68 | "group": "默认",
69 | "isActive": true,
70 | "status": "可用"
71 | },
72 | {
73 | "id": 8,
74 | "key": "kuyunzy",
75 | "name": "酷云资源",
76 | "api": "http://caiji.kuyun98.com/inc/ldg_api.php",
77 | "download": "http://caiji.kuyun98.com/inc/apidown.php",
78 | "group": "默认",
79 | "isActive": true,
80 | "status": "可用"
81 | },
82 | {
83 | "id": 9,
84 | "key": "kubozy",
85 | "name": "酷播资源",
86 | "api": "http://api.kbzyapi.com/inc/api.php",
87 | "download": "",
88 | "group": "默认",
89 | "isActive": true,
90 | "status": "可用"
91 | },
92 | {
93 | "id": 10,
94 | "key": "yongjiuzy",
95 | "name": "永久资源",
96 | "api": "http://cj.yongjiuzyw.com/inc/api.php",
97 | "download": "",
98 | "group": "默认",
99 | "isActive": true,
100 | "status": "可用"
101 | },
102 | {
103 | "id": 11,
104 | "key": "rrzy",
105 | "name": "人人资源",
106 | "api": "https://www.rrzyw.cc/api.php/provide/vod/from/rrm3u8/at/xml/",
107 | "download": "",
108 | "group": "默认",
109 | "isActive": true,
110 | "status": "可用"
111 | },
112 | {
113 | "id": 12,
114 | "key": "bbkdj",
115 | "name": "步步高顶尖资源网",
116 | "api": "http://api.bbkdj.com/api",
117 | "download": "",
118 | "group": "默认",
119 | "isActive": true,
120 | "status": "可用"
121 | },
122 | {
123 | "id": 13,
124 | "key": "zuixinzy",
125 | "name": "最新资源",
126 | "api": "http://api.zuixinapi.com/inc/api.php",
127 | "download": "",
128 | "group": "默认",
129 | "isActive": true,
130 | "status": "可用"
131 | },
132 | {
133 | "id": 14,
134 | "key": "subo988",
135 | "name": "速播资源站",
136 | "api": "https://www.subo988.com/inc/api.php",
137 | "download": "",
138 | "group": "默认",
139 | "isActive": true,
140 | "status": "可用"
141 | },
142 | {
143 | "id": 15,
144 | "key": "1886zy",
145 | "name": "1886 资源",
146 | "api": "http://cj.1886zy.co/inc/api.php",
147 | "download": "",
148 | "group": "默认",
149 | "isActive": true,
150 | "status": "可用"
151 | }
152 | ]
153 |
--------------------------------------------------------------------------------
/utils/request.js:
--------------------------------------------------------------------------------
1 | import ajax from 'uni-ajax'
2 | import parser from 'fast-xml-parser'
3 | import db from './database'
4 |
5 | const http = {
6 | xmlConfig: {
7 | trimValues: true,
8 | textNodeName: '_t',
9 | ignoreAttributes: false,
10 | attributeNamePrefix: '_',
11 | parseAttributeValue: true
12 | },
13 | // 获取视频源详情
14 | async getSite (key) {
15 | const site = await db.get('site', key)
16 | if (site.flag) {
17 | return site.data
18 | }
19 | return false
20 | },
21 | // 获取视频源的分类
22 | async class (key) {
23 | const site = await this.getSite(key)
24 | try {
25 | const res = await ajax.post(site.api)
26 | const json = parser.parse(res.data, this.xmlConfig)
27 | const arr = []
28 | if (json.rss.class) {
29 | for (const i of json.rss.class.ty) {
30 | const j = {
31 | tid: i._id,
32 | name: i._t
33 | }
34 | arr.push(j)
35 | }
36 | }
37 | return arr
38 | } catch (err) {
39 | return err
40 | }
41 | },
42 | // 获取视频资源
43 | async list (key, pg = 1, t) {
44 | const site = await this.getSite(key)
45 | const url = `${site.api}?ac=videolist${t ? '&t=' + t: ''}&pg=${pg}`
46 | try {
47 | const res = await ajax.post(url)
48 | const json = parser.parse(res.data, this.xmlConfig)
49 | if (json.rss.list.video) {
50 | return json.rss.list.video
51 | } else {
52 | return []
53 | }
54 | } catch (err) {
55 | return err
56 | }
57 | },
58 | // 获取总资源数, 以及页数
59 | async page (key, t) {
60 | const site = await this.getSite(key)
61 | const url = `${site.api}?ac=videolist${t ? '&t=' + t: ''}`
62 | try {
63 | const res = await ajax.post(url)
64 | const json = parser.parse(res.data, this.xmlConfig)
65 | const pg = {
66 | page: json.rss.list._page,
67 | pagecount: json.rss.list._pagecount,
68 | pagesize: json.rss.list._pagesize,
69 | recordcount: json.rss.list._recordcount
70 | }
71 | return pg
72 | } catch (err) {
73 | return err
74 | }
75 | },
76 | // 搜索资源
77 | async search (key, wd) {
78 | const site = await this.getSite(key)
79 | wd = encodeURI(wd)
80 | const url = `${site.api}?wd=${wd}`
81 | try {
82 | const res = await ajax.post(url, { timeourt: 3000 })
83 | const json = parser.parse(res.data, this.xmlConfig)
84 | if (json && json.rss && json.rss.list) {
85 | const videoList = json.rss.list.video
86 | return videoList
87 | }
88 | return null
89 | } catch (err) {
90 | return err
91 | }
92 | },
93 | // 获取资源详情
94 | async detail (key, id) {
95 | const site = await this.getSite(key)
96 | const url = `${site.api}?ac=videolist&ids=${id}`
97 | try {
98 | const res = await ajax.post(url)
99 | const json = parser.parse(res.data, this.xmlConfig)
100 | if (json && json.rss && json.rss.list) {
101 | const videoList = json.rss.list.video
102 | let m3u8List = []
103 | const dd = videoList.dl.dd
104 | const type = Object.prototype.toString.call(dd)
105 | if (type === '[object Array]') {
106 | for (const i of dd) {
107 | if (i._flag.indexOf('m3u8') >= 0) {
108 | m3u8List = i._t.split('#')
109 | }
110 | }
111 | } else {
112 | m3u8List = dd._t.split('#')
113 | }
114 | videoList.m3u8List = m3u8List
115 | return videoList
116 | }
117 | return null
118 | } catch (err) {
119 | return err
120 | }
121 | },
122 | // 通过 json url 导入视频源
123 | async site (jsonUrl) {
124 | try {
125 | const res = await ajax.get(jsonUrl)
126 | return res.data
127 | } catch (err) {
128 | return err
129 | }
130 | }
131 | }
132 |
133 | export default http
134 |
--------------------------------------------------------------------------------
/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 | fast-xml-parser@^3.17.4:
6 | version "3.17.4"
7 | resolved "https://registry.npm.taobao.org/fast-xml-parser/download/fast-xml-parser-3.17.4.tgz#d668495fb3e4bbcf7970f3c24ac0019d82e76477"
8 | integrity sha1-1mhJX7Pku895cPPCSsABnYLnZHc=
9 |
10 | uni-ajax@^2.1.8:
11 | version "2.1.8"
12 | resolved "https://registry.npm.taobao.org/uni-ajax/download/uni-ajax-2.1.8.tgz#113de6d7cc162546f890467079e13e1d5c61e821"
13 | integrity sha1-ET3m18wWJUb4kEZweeE+HVxh6CE=
14 |
15 | uview-ui@^1.8.1:
16 | version "1.8.2"
17 | resolved "https://registry.npm.taobao.org/uview-ui/download/uview-ui-1.8.2.tgz#701fa30be0704afff30cd048342db796004a7dc9"
18 | integrity sha1-cB+jC+BwSv/zDNBINC23lgBKfck=
19 |
--------------------------------------------------------------------------------