@tencentcloud/ai-desk-customer-vue 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CustomerServiceChat/index-web.vue +7 -14
- package/components/CustomerServiceChat/message-input/index-web.vue +17 -16
- package/components/CustomerServiceChat/message-input/message-input-editor-web.vue +3 -6
- package/components/CustomerServiceChat/message-input/message-input-quote/index.vue +3 -14
- package/components/CustomerServiceChat/message-input-toolbar/emoji-dialog-mobile/emoji-dialog-mobile.vue +2 -5
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/emoji-picker-dialog.vue +8 -15
- package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.vue +3 -7
- package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.vue +6 -44
- package/components/CustomerServiceChat/message-input-toolbar/index-web.vue +1 -14
- package/components/CustomerServiceChat/message-input-toolbar/style/uni.scss +0 -56
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/index.vue +4 -7
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/index.scss +0 -1
- package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.vue +7 -50
- package/components/CustomerServiceChat/message-list/index-web.vue +3 -7
- package/components/CustomerServiceChat/message-list/message-elements/{plugins/plugin-components → message-desk}/index.ts +1 -1
- package/components/{customer-icon.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/customer-icon.vue} +0 -9
- package/components/CustomerServiceChat/message-list/message-elements/{plugins/plugin-components/message-customer → message-desk/message-desk-elements}/index.ts +1 -1
- package/components/{message-branch.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-branch.vue} +4 -4
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-desk.vue +126 -0
- package/components/{message-multi-branch → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch}/branch-pc.vue +1 -1
- package/components/{message-multi-branch → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch}/index.vue +2 -3
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-mobile/form-popup.vue +2 -3
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-mobile/input-mobile.vue +1 -1
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-mobile/radios-mobile.vue +7 -7
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-pc/input-pc.vue +1 -1
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-pc/radio-pc.vue +4 -5
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/form-mobile.vue +8 -7
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/form-pc.vue +5 -5
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/index.vue +3 -3
- package/components/{message-product-card.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-product-card.vue} +2 -2
- package/components/{message-rating → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating}/index.vue +4 -4
- package/components/{message-rating → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating}/message-rating-number.vue +3 -3
- package/components/{message-rating → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating}/message-rating-star.vue +5 -5
- package/components/{message-rich-text.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rich-text.vue} +5 -17
- package/components/{message-robot-welcome.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-robot-welcome.vue} +7 -7
- package/components/{message-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-single-form}/form-input.vue +5 -5
- package/components/{message-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-single-form}/index.vue +1 -1
- package/components/{message-stream.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-stream.vue} +2 -2
- package/{styles → components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/styles}/common.scss +1 -1
- package/components/CustomerServiceChat/message-list/message-elements/{plugins/plugin-components → message-desk}/message-plugin-layout-web.vue +2 -9
- package/components/CustomerServiceChat/message-list/message-elements/{plugins/plugin-components → message-desk}/message-plugin-web.vue +5 -5
- package/components/CustomerServiceChat/message-list/message-elements/message-quote/index-web.vue +2 -4
- package/components/CustomerServiceChat/message-list/message-elements/message-record/index.vue +3 -6
- package/components/CustomerServiceChat/message-list/message-elements/simple-message-list/index.vue +3 -29
- package/components/CustomerServiceChat/style/h5.scss +2 -1
- package/components/CustomerServiceChat/style/index.scss +0 -2
- package/components/common/Avatar/index.vue +2 -23
- package/components/common/BottomPopup/index.vue +2 -3
- package/components/common/Dialog/index.vue +2 -2
- package/components/common/ImagePreviewer/index-web.vue +2 -84
- package/components/common/ProgressMessage/index.vue +0 -8
- package/index.ts +4 -13
- package/index.vue +1 -60
- package/package.json +4 -5
- package/server.ts +3 -32
- package/utils/chatStorage.ts +2 -11
- package/utils/index.ts +2 -1
- package/assets/audio-before-delete.svg +0 -4
- package/assets/audio-blue.png +0 -0
- package/assets/audio-bubble-blue.svg +0 -3
- package/assets/audio-bubble-red.svg +0 -3
- package/assets/audio-delete.svg +0 -10
- package/assets/audio.svg +0 -6
- package/assets/camera-uni.png +0 -0
- package/assets/face-uni.png +0 -0
- package/assets/more-uni.png +0 -0
- package/assets/translate.svg +0 -12
- package/assets/video-uni.png +0 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/uni.scss +0 -36
- package/components/CustomerServiceChat/message-list/link/index.ts +0 -23
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/message-customer/message-customer-service.vue +0 -22
- package/components/CustomerServiceChat/style/uni.scss +0 -12
- package/components/CustomerServiceChat/style/wx.scss +0 -5
- package/components/common/RichText/LICENSE +0 -21
- package/components/common/RichText/README.md +0 -244
- package/components/common/RichText/dist/mp-alipay/index.acss +0 -1
- package/components/common/RichText/dist/mp-alipay/index.axml +0 -1
- package/components/common/RichText/dist/mp-alipay/index.js +0 -8
- package/components/common/RichText/dist/mp-alipay/index.json +0 -1
- package/components/common/RichText/dist/mp-alipay/node/node.acss +0 -1
- package/components/common/RichText/dist/mp-alipay/node/node.axml +0 -1
- package/components/common/RichText/dist/mp-alipay/node/node.js +0 -1
- package/components/common/RichText/dist/mp-alipay/node/node.json +0 -1
- package/components/common/RichText/dist/mp-alipay/parser.js +0 -1
- package/components/common/RichText/dist/mp-baidu/index.css +0 -1
- package/components/common/RichText/dist/mp-baidu/index.js +0 -8
- package/components/common/RichText/dist/mp-baidu/index.json +0 -1
- package/components/common/RichText/dist/mp-baidu/index.swan +0 -1
- package/components/common/RichText/dist/mp-baidu/node/node.css +0 -1
- package/components/common/RichText/dist/mp-baidu/node/node.js +0 -1
- package/components/common/RichText/dist/mp-baidu/node/node.json +0 -1
- package/components/common/RichText/dist/mp-baidu/node/node.swan +0 -1
- package/components/common/RichText/dist/mp-baidu/parser.js +0 -1
- package/components/common/RichText/dist/mp-qq/index.js +0 -8
- package/components/common/RichText/dist/mp-qq/index.json +0 -1
- package/components/common/RichText/dist/mp-qq/index.qml +0 -1
- package/components/common/RichText/dist/mp-qq/index.qss +0 -1
- package/components/common/RichText/dist/mp-qq/node/node.js +0 -1
- package/components/common/RichText/dist/mp-qq/node/node.json +0 -1
- package/components/common/RichText/dist/mp-qq/node/node.qml +0 -1
- package/components/common/RichText/dist/mp-qq/node/node.qss +0 -1
- package/components/common/RichText/dist/mp-qq/parser.js +0 -1
- package/components/common/RichText/dist/mp-toutiao/index.js +0 -8
- package/components/common/RichText/dist/mp-toutiao/index.json +0 -1
- package/components/common/RichText/dist/mp-toutiao/index.ttml +0 -1
- package/components/common/RichText/dist/mp-toutiao/index.ttss +0 -1
- package/components/common/RichText/dist/mp-toutiao/node/node.js +0 -1
- package/components/common/RichText/dist/mp-toutiao/node/node.json +0 -1
- package/components/common/RichText/dist/mp-toutiao/node/node.ttml +0 -1
- package/components/common/RichText/dist/mp-toutiao/node/node.ttss +0 -1
- package/components/common/RichText/dist/mp-toutiao/parser.js +0 -1
- package/components/common/RichText/dist/mp-weixin/index.js +0 -8
- package/components/common/RichText/dist/mp-weixin/index.json +0 -1
- package/components/common/RichText/dist/mp-weixin/index.wxml +0 -1
- package/components/common/RichText/dist/mp-weixin/index.wxss +0 -1
- package/components/common/RichText/dist/mp-weixin/node/node.js +0 -1
- package/components/common/RichText/dist/mp-weixin/node/node.json +0 -1
- package/components/common/RichText/dist/mp-weixin/node/node.wxml +0 -1
- package/components/common/RichText/dist/mp-weixin/node/node.wxss +0 -1
- package/components/common/RichText/dist/mp-weixin/parser.js +0 -1
- package/components/common/RichText/dist/uni-app/components/mp-html/mp-html.vue +0 -498
- package/components/common/RichText/dist/uni-app/components/mp-html/node/node.vue +0 -587
- package/components/common/RichText/dist/uni-app/components/mp-html/parser.js +0 -1393
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/js/handler.js +0 -1
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/js/uni.webview.min.js +0 -1
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/local.html +0 -1
- package/components/common/RichText/docs/.nojekyll +0 -0
- package/components/common/RichText/docs/index.html +0 -50
- package/components/common/RichText/docs/lib/docsify.min.js +0 -1
- package/components/common/RichText/docs/lib/prism-bash.min.js +0 -1
- package/components/common/RichText/docs/lib/search.min.js +0 -1
- package/components/common/RichText/docs/lib/vue.css +0 -858
- package/components/common/RichText/gulpfile.js +0 -113
- package/components/common/RichText/lint.js +0 -63
- package/components/common/RichText/package.json +0 -74
- package/components/common/RichText/plugins/README.md +0 -2
- package/components/common/RichText/plugins/audio/README.md +0 -25
- package/components/common/RichText/plugins/audio/build.js +0 -11
- package/components/common/RichText/plugins/audio/context.js +0 -7
- package/components/common/RichText/plugins/audio/index.js +0 -34
- package/components/common/RichText/plugins/audio/miniprogram/audio.js +0 -189
- package/components/common/RichText/plugins/audio/miniprogram/audio.json +0 -3
- package/components/common/RichText/plugins/audio/miniprogram/audio.wxml +0 -17
- package/components/common/RichText/plugins/audio/miniprogram/audio.wxss +0 -127
- package/components/common/RichText/plugins/audio/miniprogram/build.js +0 -3
- package/components/common/RichText/plugins/audio/uni-app/audio.vue +0 -269
- package/components/common/RichText/plugins/audio/uni-app/build.js +0 -3
- package/components/common/RichText/plugins/card/README.md +0 -30
- package/components/common/RichText/plugins/card/build.js +0 -14
- package/components/common/RichText/plugins/card/index.js +0 -7
- package/components/common/RichText/plugins/card/miniprogram/build.js +0 -3
- package/components/common/RichText/plugins/card/miniprogram/card.js +0 -26
- package/components/common/RichText/plugins/card/miniprogram/card.json +0 -3
- package/components/common/RichText/plugins/card/miniprogram/card.wxml +0 -9
- package/components/common/RichText/plugins/card/miniprogram/card.wxss +0 -55
- package/components/common/RichText/plugins/card/uni-app/build.js +0 -3
- package/components/common/RichText/plugins/card/uni-app/card.vue +0 -122
- package/components/common/RichText/plugins/editable/README.md +0 -137
- package/components/common/RichText/plugins/editable/config.js +0 -15
- package/components/common/RichText/plugins/editable/miniprogram/build.js +0 -813
- package/components/common/RichText/plugins/editable/miniprogram/index.js +0 -551
- package/components/common/RichText/plugins/editable/uni-app/build.js +0 -744
- package/components/common/RichText/plugins/editable/uni-app/index.js +0 -553
- package/components/common/RichText/plugins/emoji/README.md +0 -15
- package/components/common/RichText/plugins/emoji/index.js +0 -203
- package/components/common/RichText/plugins/highlight/README.md +0 -26
- package/components/common/RichText/plugins/highlight/config.js +0 -5
- package/components/common/RichText/plugins/highlight/index.js +0 -96
- package/components/common/RichText/plugins/highlight/miniprogram/build.js +0 -88
- package/components/common/RichText/plugins/highlight/prism.css +0 -125
- package/components/common/RichText/plugins/highlight/prism.min.js +0 -7
- package/components/common/RichText/plugins/highlight/uni-app/build.js +0 -88
- package/components/common/RichText/plugins/img-cache/README.md +0 -24
- package/components/common/RichText/plugins/img-cache/build.js +0 -16
- package/components/common/RichText/plugins/img-cache/index.js +0 -138
- package/components/common/RichText/plugins/latex/README.md +0 -16
- package/components/common/RichText/plugins/latex/build.js +0 -14
- package/components/common/RichText/plugins/latex/index.js +0 -77
- package/components/common/RichText/plugins/latex/katex.css +0 -1070
- package/components/common/RichText/plugins/latex/katex.min.js +0 -1
- package/components/common/RichText/plugins/markdown/README.md +0 -17
- package/components/common/RichText/plugins/markdown/index.js +0 -34
- package/components/common/RichText/plugins/markdown/marked.min.js +0 -6
- package/components/common/RichText/plugins/markdown/miniprogram/build.js +0 -70
- package/components/common/RichText/plugins/markdown/uni-app/build.js +0 -68
- package/components/common/RichText/plugins/search/README.md +0 -46
- package/components/common/RichText/plugins/search/miniprogram/index.js +0 -137
- package/components/common/RichText/plugins/search/uni-app/index.js +0 -132
- package/components/common/RichText/plugins/style/README.md +0 -30
- package/components/common/RichText/plugins/style/index.js +0 -129
- package/components/common/RichText/plugins/style/parser.js +0 -175
- package/components/common/RichText/plugins/template/README.md +0 -2
- package/components/common/RichText/plugins/template/build.js +0 -65
- package/components/common/RichText/plugins/template/index.js +0 -67
- package/components/common/RichText/plugins/txv-video/README.md +0 -18
- package/components/common/RichText/plugins/txv-video/build.js +0 -3
- package/components/common/RichText/plugins/txv-video/index.js +0 -46
- package/components/common/RichText/plugins/txv-video/miniprogram/build.js +0 -6
- package/components/common/RichText/plugins/txv-video/uni-app/build.js +0 -3
- package/components/common/RichText/src/miniprogram/index.js +0 -396
- package/components/common/RichText/src/miniprogram/index.json +0 -6
- package/components/common/RichText/src/miniprogram/index.wxml +0 -7
- package/components/common/RichText/src/miniprogram/index.wxss +0 -13
- package/components/common/RichText/src/miniprogram/node/node.js +0 -247
- package/components/common/RichText/src/miniprogram/node/node.json +0 -6
- package/components/common/RichText/src/miniprogram/node/node.wxml +0 -112
- package/components/common/RichText/src/miniprogram/node/node.wxss +0 -164
- package/components/common/RichText/src/miniprogram/parser.js +0 -1269
- package/components/common/RichText/src/uni-app/components/mp-html/mp-html.vue +0 -498
- package/components/common/RichText/src/uni-app/components/mp-html/node/node.vue +0 -585
- package/components/common/RichText/src/uni-app/components/mp-html/parser.js +0 -1393
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/js/handler.js +0 -254
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/js/uni.webview.min.js +0 -1
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/local.html +0 -33
- package/components/common/RichText/tools/config.js +0 -82
- package/components/common/RichText/tools/converter.js +0 -205
- package/components/common/RichText/tools/ifdef.js +0 -115
- package/components/common/RichText/tools/minifier.js +0 -40
- package/components/common/RichText/tools/plugin.js +0 -248
- package/components/message-customer-service.vue +0 -114
- package/script/fileCopy.js +0 -60
- package/script/syncVersion.js +0 -35
- /package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-mobile/label-mobile.vue +0 -0
- /package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-pc/label-pc.vue +0 -0
- /package/components/{message-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-single-form}/form-branch.vue +0 -0
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview 自动构建程序
|
|
3
|
-
* @author Jin Yufeng
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// 载入 gulp 插件
|
|
7
|
-
const gulp = require('gulp')
|
|
8
|
-
const htmlmin = require('gulp-htmlmin')
|
|
9
|
-
const babel = require('gulp-babel')
|
|
10
|
-
const uglify = require('gulp-uglify')
|
|
11
|
-
const cleanCss = require('gulp-clean-css')
|
|
12
|
-
const clean = require('gulp-clean')
|
|
13
|
-
const gulpif = require('gulp-if')
|
|
14
|
-
const plumber = require('gulp-plumber')
|
|
15
|
-
const size = require('gulp-size')
|
|
16
|
-
|
|
17
|
-
// 载入构建工具
|
|
18
|
-
const config = require('./tools/config')
|
|
19
|
-
const converter = require('./tools/converter')
|
|
20
|
-
const ifdef = require('./tools/ifdef')
|
|
21
|
-
const minifier = require('./tools/minifier')
|
|
22
|
-
const plugin = require('./tools/plugin')
|
|
23
|
-
|
|
24
|
-
// 载入环境信息
|
|
25
|
-
const isDev = process.argv.includes('--dev')
|
|
26
|
-
let platform = process.argv[3]
|
|
27
|
-
if (!platform) {
|
|
28
|
-
throw Error('缺少平台信息')
|
|
29
|
-
}
|
|
30
|
-
platform = platform.substr(2)
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @description 清理文件夹
|
|
34
|
-
*/
|
|
35
|
-
gulp.task('clean', () => {
|
|
36
|
-
return gulp.src(`${isDev ? 'dev' : 'dist'}/${platform === 'all' ? '' : platform + '/'}*`, {
|
|
37
|
-
read: false,
|
|
38
|
-
allowEmpty: true
|
|
39
|
-
})
|
|
40
|
-
.pipe(clean())
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @description 生成原生组件包(含插件)
|
|
45
|
-
* @returns {NodeJS.ReadWriteStream}
|
|
46
|
-
*/
|
|
47
|
-
function packComp () {
|
|
48
|
-
return gulp.src(['plugins/**/*', 'src/**/*'], {
|
|
49
|
-
nodir: true
|
|
50
|
-
})
|
|
51
|
-
// 公共处理
|
|
52
|
-
.pipe(plumber()) // 错误处理
|
|
53
|
-
.pipe(plugin.build(platform)) // 构建插件
|
|
54
|
-
.pipe(ifdef(platform)) // 条件编译
|
|
55
|
-
// wxml 处理
|
|
56
|
-
.pipe(gulpif(file => file.extname === '.wxml', minifier.wxs())) // 压缩内联 wxs
|
|
57
|
-
.pipe(gulpif(file => file.extname === '.wxml', htmlmin(config.htmlmin))) // 压缩 wxml
|
|
58
|
-
.pipe(gulpif(file => file.extname === '.html', htmlmin(Object.assign({}, config.htmlmin, { // 压缩 html
|
|
59
|
-
minifyCSS: true
|
|
60
|
-
}))))
|
|
61
|
-
// js 处理
|
|
62
|
-
.pipe(gulpif(file => file.extname === '.js' && !file.stem.includes('.min') && (platform !== 'uni-app' || file.relative.includes('static')), babel(config.babel))) // es6 转 es5
|
|
63
|
-
.pipe(gulpif(file => file.extname === '.js' && !file.stem.includes('.min') && !isDev && (platform !== 'uni-app' || file.relative.includes('static')), uglify(config.uglify))) // 压缩 js
|
|
64
|
-
// wxss(css)处理
|
|
65
|
-
.pipe(gulpif(file => file.extname.includes('ss'), cleanCss(config.cleanCss))) // 压缩 wxss
|
|
66
|
-
.pipe(plugin.importCss()) // 引入插件中的 css 文件
|
|
67
|
-
// json 处理
|
|
68
|
-
.pipe(gulpif(file => file.extname === '.json', minifier.json())) // 压缩 json
|
|
69
|
-
// 公共处理
|
|
70
|
-
.pipe(converter(platform)) // 将微信端的代码转换到各个平台
|
|
71
|
-
.pipe(gulpif(!isDev, size({
|
|
72
|
-
title: `${platform} 包生成完毕`
|
|
73
|
-
})))
|
|
74
|
-
.pipe(gulp.dest(file => {
|
|
75
|
-
return `${isDev ? 'dev' : 'dist'}/${platform}/${(platform === 'uni-app' && !file.relative.includes('components') && !file.relative.includes('static')) || (platform !== 'uni-app' && isDev) ? 'components/mp-html/' : ''}`
|
|
76
|
-
}))
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
gulp.task('build', gulp.series('clean', packComp))
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @description 生成原生示例项目
|
|
83
|
-
* @returns {NodeJS.ReadWriteStream}
|
|
84
|
-
*/
|
|
85
|
-
function packDemo () {
|
|
86
|
-
return gulp.src(['tools/demo/**/*', 'test/content.js'], {
|
|
87
|
-
nodir: true
|
|
88
|
-
})
|
|
89
|
-
.pipe(ifdef(platform))
|
|
90
|
-
.pipe(gulpif(platform !== 'uni-app', converter(platform)))
|
|
91
|
-
.pipe(gulp.dest(`dev/${platform}/`))
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
gulp.task('dev', gulp.series('clean', gulp.parallel(packComp, packDemo)))
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* @description 监听文件变化
|
|
98
|
-
*/
|
|
99
|
-
gulp.task('watch-demo', () => {
|
|
100
|
-
gulp.watch(['tools/demo/**/*', 'test/content.js']).on('all', (type, file) => {
|
|
101
|
-
console.log(type + ':' + file)
|
|
102
|
-
packDemo()
|
|
103
|
-
})
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
gulp.task('watch-comp', () => {
|
|
107
|
-
gulp.watch(['src/**/*', 'src/common/**/*', 'plugins/**/*']).on('all', (type, file) => {
|
|
108
|
-
console.log(type + ':' + file)
|
|
109
|
-
packComp()
|
|
110
|
-
})
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
gulp.task('watch', gulp.parallel('watch-demo', 'watch-comp'))
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const glob = require('glob')
|
|
3
|
-
const standard = require('standard')
|
|
4
|
-
|
|
5
|
-
// 解析参数
|
|
6
|
-
let fix = false
|
|
7
|
-
let mode = '**/*.@(js|vue)'
|
|
8
|
-
for (let i = 2; i < process.argv.length; i++) {
|
|
9
|
-
if (process.argv[i] === '--fix') {
|
|
10
|
-
fix = true
|
|
11
|
-
} else {
|
|
12
|
-
mode = process.argv[i]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// 检查 js 文件
|
|
17
|
-
function lintJs (filePath, content) {
|
|
18
|
-
const res = standard.lintTextSync(content, {
|
|
19
|
-
global: ['App', 'Page', 'Component', 'wx', 'requirePlugin', 'uni', 'test', 'expect', 'plus', 'Image'],
|
|
20
|
-
fix
|
|
21
|
-
}).results
|
|
22
|
-
// 写回修复的内容
|
|
23
|
-
if (fix && res[0].output) {
|
|
24
|
-
fs.writeFileSync(filePath, res[0].output)
|
|
25
|
-
}
|
|
26
|
-
// 打印错误信息
|
|
27
|
-
for (let i = 0; i < res[0].messages.length; i++) {
|
|
28
|
-
const item = res[0].messages[i]
|
|
29
|
-
console.log(filePath + ':' + item.line + ':' + item.column + ': ' + item.message)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// 检查 vue 文件
|
|
34
|
-
function lintVue (filePath, content) {
|
|
35
|
-
// 提取 script 部分
|
|
36
|
-
const script = content.match(/<script>([\s\S]+?)<\/script>/)
|
|
37
|
-
const line = content.substr(0, script.index).split('\n').length - 1
|
|
38
|
-
const res = standard.lintTextSync(script[1], {
|
|
39
|
-
global: ['uni', 'plus', 'weex'],
|
|
40
|
-
fix
|
|
41
|
-
}).results
|
|
42
|
-
// 写回修复的内容
|
|
43
|
-
if (fix && res[0].output) {
|
|
44
|
-
fs.writeFileSync(filePath, content.replace(/<script>[\s\S]+?<\/script>/, '<script>' + res[0].output + '</script>'))
|
|
45
|
-
}
|
|
46
|
-
// 打印错误信息
|
|
47
|
-
for (let i = 0; i < res[0].messages.length; i++) {
|
|
48
|
-
const item = res[0].messages[i]
|
|
49
|
-
console.log(filePath + ':' + (line + item.line) + ':' + item.column + ': ' + item.message)
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
glob(mode, {
|
|
54
|
-
ignore: ['node_modules/**', 'coverage/**', 'dist/**', 'dev/**', '**/*.min.js']
|
|
55
|
-
}, (_, files) => {
|
|
56
|
-
for (let i = 0; i < files.length; i++) {
|
|
57
|
-
if (files[i].includes('.js')) {
|
|
58
|
-
lintJs(files[i], fs.readFileSync(files[i], 'utf-8'))
|
|
59
|
-
} else if (files[i].includes('.vue')) {
|
|
60
|
-
lintVue(files[i], fs.readFileSync(files[i], 'utf-8'))
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
})
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mp-html",
|
|
3
|
-
"version": "2.5.0",
|
|
4
|
-
"description": "小程序富文本组件",
|
|
5
|
-
"miniprogram": "dist/mp-weixin",
|
|
6
|
-
"repository": "https://github.com/jin-yufeng/mp-html",
|
|
7
|
-
"author": "Jin Yufeng",
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"keywords": [
|
|
10
|
-
"miniprogram",
|
|
11
|
-
"rich-text",
|
|
12
|
-
"html"
|
|
13
|
-
],
|
|
14
|
-
"standard": {
|
|
15
|
-
"globals": ["App", "Page", "Component", "wx", "requirePlugin", "uni", "plus", "weex"],
|
|
16
|
-
"envs": ["jest", "browser"]
|
|
17
|
-
},
|
|
18
|
-
"jest": {
|
|
19
|
-
"testEnvironment": "jsdom",
|
|
20
|
-
"collectCoverageFrom": [
|
|
21
|
-
"dev/mp-weixin/components/mp-html/**/*.js"
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"lint": "node lint.js",
|
|
26
|
-
"lintcss": "npx stylelint src/**/*.wxss",
|
|
27
|
-
"build:weixin": "gulp build --mp-weixin",
|
|
28
|
-
"build:qq": "gulp build --mp-qq",
|
|
29
|
-
"build:baidu": "gulp build --mp-baidu",
|
|
30
|
-
"build:alipay": "gulp build --mp-alipay",
|
|
31
|
-
"build:toutiao": "gulp build --mp-toutiao",
|
|
32
|
-
"build:uni-app": "gulp build --uni-app",
|
|
33
|
-
"build": "gulp build --mp-weixin & gulp build --mp-qq & gulp build --mp-baidu & gulp build --mp-alipay & gulp build --mp-toutiao & gulp build --uni-app",
|
|
34
|
-
"watch:weixin": "gulp watch --mp-weixin --dev",
|
|
35
|
-
"watch:qq": "gulp watch --mp-qq --dev",
|
|
36
|
-
"watch:baidu": "gulp watch --mp-baidu --dev",
|
|
37
|
-
"watch:alipay": "gulp watch --mp-alipay --dev",
|
|
38
|
-
"watch:toutiao": "gulp watch --mp-toutiao --dev",
|
|
39
|
-
"watch:uni-app": "gulp watch --uni-app --dev",
|
|
40
|
-
"dev:weixin": "gulp dev --mp-weixin --dev",
|
|
41
|
-
"dev:qq": "gulp dev --mp-qq --dev",
|
|
42
|
-
"dev:baidu": "gulp dev --mp-baidu --dev",
|
|
43
|
-
"dev:alipay": "gulp dev --mp-alipay --dev",
|
|
44
|
-
"dev:toutiao": "gulp dev --mp-toutiao --dev",
|
|
45
|
-
"dev:uni-app": "gulp dev --uni-app --dev",
|
|
46
|
-
"test": "gulp dev --mp-weixin --dev && npx jest",
|
|
47
|
-
"coverage": "gulp dev --mp-weixin --dev && npx jest --coverage",
|
|
48
|
-
"coveralls": "npx coveralls < coverage/lcov.info",
|
|
49
|
-
"clean": "gulp clean --all",
|
|
50
|
-
"clean:dev": "gulp clean --all --dev"
|
|
51
|
-
},
|
|
52
|
-
"devDependencies": {
|
|
53
|
-
"@babel/preset-env": "^7.12.1",
|
|
54
|
-
"coveralls": "^3.1.0",
|
|
55
|
-
"gulp": "^4.0.0",
|
|
56
|
-
"gulp-babel": "^8.0.0",
|
|
57
|
-
"gulp-clean": "^0.4.0",
|
|
58
|
-
"gulp-clean-css": "^4.3.0",
|
|
59
|
-
"gulp-htmlmin": "^5.0.1",
|
|
60
|
-
"gulp-if": "^3.0.0",
|
|
61
|
-
"gulp-plumber": "^1.2.1",
|
|
62
|
-
"gulp-size": "^3.0.0",
|
|
63
|
-
"gulp-uglify": "^2.1.2",
|
|
64
|
-
"jest": "^26.6.1",
|
|
65
|
-
"miniprogram-simulate": "^1.2.7",
|
|
66
|
-
"standard": "^16.0.3",
|
|
67
|
-
"stylelint": "^13.7.2",
|
|
68
|
-
"stylelint-config-recess-order": "^2.3.0",
|
|
69
|
-
"stylelint-config-standard": "^20.0.0",
|
|
70
|
-
"through2": "^4.0.2",
|
|
71
|
-
"uglify-js": "^2.8.29"
|
|
72
|
-
},
|
|
73
|
-
"dependencies": {}
|
|
74
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# audio
|
|
2
|
-
功能:音乐播放器
|
|
3
|
-
大小:*≈4KB*
|
|
4
|
-
支持平台:
|
|
5
|
-
|
|
6
|
-
| 微信小程序 | QQ 小程序 | 百度小程序 | 支付宝小程序 | 头条小程序 | uni-app |
|
|
7
|
-
|:---:|:---:|:---:|:---:|:---:|:---:|
|
|
8
|
-
| √ | √ | √ | √ | √ | √(nvue 不支持) |
|
|
9
|
-
|
|
10
|
-
百度小程序原生包在此 [问题](https://smartprogram.baidu.com/forum/topic/show/125787) 未解决前无法使用
|
|
11
|
-
|
|
12
|
-
说明:
|
|
13
|
-
在大多数小程序平台,*audio* 标签已被废弃或无法使用,本插件可以代替 *audio* 标签播放音乐,并实现以下优化:
|
|
14
|
-
1. *pause-video* 属性也可以应用于音频,即播放一个音视频时可以自动暂停其他正在播放的音视频
|
|
15
|
-
2. 增加了一个可以拖动的进度条
|
|
16
|
-
3. 组件大小可以根据页面宽度自动调整
|
|
17
|
-
4. 支持 *autoplay* 属性
|
|
18
|
-
5. 播放被后台打断时,页面显示后自动继续播放
|
|
19
|
-
|
|
20
|
-
基础库要求:
|
|
21
|
-
支付宝 *1.23.4+* ,其余平台满足最低要求即可
|
|
22
|
-
第 *5* 条仅微信 *2.2.3+* 、*QQ*、百度支持
|
|
23
|
-
|
|
24
|
-
?> 如果希望页面上使用本组件,组件的路径为 *path/to/mp-html/audio/audio*
|
|
25
|
-
属性和事件基本同 *audio* 组件,组件实例上提供了 *setSrc*、*play*、*seek*、*pause*、*stop* 方法可供控制播放状态
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
usingComponents: {
|
|
3
|
-
'my-audio': '../audio/audio'
|
|
4
|
-
},
|
|
5
|
-
handler (file) {
|
|
6
|
-
// 删去原来的 audio 标签
|
|
7
|
-
if (file.basename === 'node.wxml' || file.basename === 'node.vue') {
|
|
8
|
-
file.contents = Buffer.from(file.contents.toString().replace(/<audio[\s\S]+?>/, ''))
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview audio 插件
|
|
3
|
-
*/
|
|
4
|
-
const context = require('./context')
|
|
5
|
-
let index = 0
|
|
6
|
-
|
|
7
|
-
function Audio (vm) {
|
|
8
|
-
this.vm = vm
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
Audio.prototype.onUpdate = function () {
|
|
12
|
-
this.audios = []
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
Audio.prototype.onParse = function (node) {
|
|
16
|
-
if (node.name === 'audio') {
|
|
17
|
-
if (!node.attrs.id) {
|
|
18
|
-
node.attrs.id = 'a' + index++
|
|
19
|
-
}
|
|
20
|
-
this.audios.push(node.attrs.id)
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
Audio.prototype.onLoad = function () {
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
for (let i = 0; i < this.audios.length; i++) {
|
|
27
|
-
const ctx = context.get(this.audios[i])
|
|
28
|
-
ctx.id = this.audios[i]
|
|
29
|
-
this.vm._videos.push(ctx)
|
|
30
|
-
}
|
|
31
|
-
}, 500)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
module.exports = Audio
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview audio 组件
|
|
3
|
-
*/
|
|
4
|
-
const context = require('./context')
|
|
5
|
-
|
|
6
|
-
Component({
|
|
7
|
-
data: {
|
|
8
|
-
time: '00:00'
|
|
9
|
-
},
|
|
10
|
-
properties: {
|
|
11
|
-
name: String, // 音乐名
|
|
12
|
-
author: String, // 作者
|
|
13
|
-
poster: String, // 海报图片地址
|
|
14
|
-
autoplay: Boolean, // 是否自动播放
|
|
15
|
-
controls: Boolean, // 是否显示控件
|
|
16
|
-
loop: Boolean, // 是否循环播放
|
|
17
|
-
src: { // 源地址
|
|
18
|
-
type: String,
|
|
19
|
-
observer (src) {
|
|
20
|
-
this.setSrc(src)
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
created () {
|
|
25
|
-
// 创建内部 context
|
|
26
|
-
this._ctx = wx.createInnerAudioContext()
|
|
27
|
-
this._ctx.onError(err => {
|
|
28
|
-
this.setData({
|
|
29
|
-
error: true
|
|
30
|
-
})
|
|
31
|
-
this.triggerEvent('error', err)
|
|
32
|
-
})
|
|
33
|
-
this._ctx.onTimeUpdate(() => {
|
|
34
|
-
const time = this._ctx.currentTime
|
|
35
|
-
const min = parseInt(time / 60)
|
|
36
|
-
const sec = Math.ceil(time % 60)
|
|
37
|
-
const data = {}
|
|
38
|
-
data.time = (min > 9 ? min : '0' + min) + ':' + (sec > 9 ? sec : '0' + sec)
|
|
39
|
-
// 不在拖动状态下需要更新进度条
|
|
40
|
-
if (!this.lastTime) {
|
|
41
|
-
data.value = time / this._ctx.duration * 100
|
|
42
|
-
}
|
|
43
|
-
this.setData(data)
|
|
44
|
-
})
|
|
45
|
-
this._ctx.onEnded(() => {
|
|
46
|
-
if (!this.properties.loop) {
|
|
47
|
-
this.setData({
|
|
48
|
-
playing: false
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
// #ifndef ALIPAY
|
|
53
|
-
},
|
|
54
|
-
attached () {
|
|
55
|
-
context.set(this.id, this)
|
|
56
|
-
// #endif
|
|
57
|
-
// #ifdef MP-ALIPAY
|
|
58
|
-
context.set(this.properties.id, this)
|
|
59
|
-
this.setSrc(this.properties.src)
|
|
60
|
-
// #endif
|
|
61
|
-
},
|
|
62
|
-
// #ifdef MP-ALIPAY
|
|
63
|
-
didUpdate (e) {
|
|
64
|
-
if (e.src !== this.properties.src) {
|
|
65
|
-
this.setSrc(this.properties.src)
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
// #endif
|
|
69
|
-
detached () {
|
|
70
|
-
this._ctx.destroy()
|
|
71
|
-
// #ifndef MP-ALIPAY
|
|
72
|
-
context.remove(this.id)
|
|
73
|
-
// #endif
|
|
74
|
-
// #ifdef MP_ALIPAY
|
|
75
|
-
context.remove(this.properties.id)
|
|
76
|
-
// #endif
|
|
77
|
-
},
|
|
78
|
-
// #ifndef ALIPAY | TOUTIAO
|
|
79
|
-
pageLifetimes: {
|
|
80
|
-
show () {
|
|
81
|
-
// 播放被后台打断时,页面显示后自动继续播放
|
|
82
|
-
if (this.data.playing && this._ctx.paused) {
|
|
83
|
-
this._ctx.play()
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
// #endif
|
|
88
|
-
methods: {
|
|
89
|
-
/**
|
|
90
|
-
* @description 设置源
|
|
91
|
-
* @param {string} src 源地址
|
|
92
|
-
*/
|
|
93
|
-
setSrc (src) {
|
|
94
|
-
this._ctx.autoplay = this.properties.autoplay
|
|
95
|
-
this._ctx.loop = this.properties.loop
|
|
96
|
-
this._ctx.src = src
|
|
97
|
-
if (this.properties.autoplay && !this.data.playing) {
|
|
98
|
-
this.setData({
|
|
99
|
-
playing: true
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @description 播放音乐
|
|
106
|
-
*/
|
|
107
|
-
play () {
|
|
108
|
-
this._ctx.play()
|
|
109
|
-
this.setData({
|
|
110
|
-
playing: true
|
|
111
|
-
})
|
|
112
|
-
this.triggerEvent('play'
|
|
113
|
-
// #ifdef MP-ALIPAY
|
|
114
|
-
, {
|
|
115
|
-
target: {
|
|
116
|
-
id: this.props.id
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
// #endif
|
|
120
|
-
)
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* @description 暂停音乐
|
|
125
|
-
*/
|
|
126
|
-
pause () {
|
|
127
|
-
this._ctx.pause()
|
|
128
|
-
this.setData({
|
|
129
|
-
playing: false
|
|
130
|
-
})
|
|
131
|
-
this.triggerEvent('pause')
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* @description 设置播放速率
|
|
136
|
-
* @param {Number} rate 播放速率
|
|
137
|
-
*/
|
|
138
|
-
playbackRate (rate) {
|
|
139
|
-
this._ctx.playbackRate = rate
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* @description 停止音乐
|
|
144
|
-
*/
|
|
145
|
-
stop () {
|
|
146
|
-
this._ctx.stop()
|
|
147
|
-
this.setData({
|
|
148
|
-
playing: false,
|
|
149
|
-
time: '00:00'
|
|
150
|
-
})
|
|
151
|
-
this.triggerEvent('stop')
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* @description 控制进度
|
|
156
|
-
* @param {number} sec 秒数
|
|
157
|
-
*/
|
|
158
|
-
seek (sec) {
|
|
159
|
-
this._ctx.seek(sec)
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* @description 移动进度条
|
|
164
|
-
* @param {event} e
|
|
165
|
-
* @private
|
|
166
|
-
*/
|
|
167
|
-
_seeking (e) {
|
|
168
|
-
// 避免过于频繁 setData
|
|
169
|
-
if (e.timeStamp - this.lastTime < 200) return
|
|
170
|
-
const time = Math.round(e.detail.value / 100 * this._ctx.duration)
|
|
171
|
-
const min = parseInt(time / 60)
|
|
172
|
-
const sec = time % 60
|
|
173
|
-
this.setData({
|
|
174
|
-
time: (min > 9 ? min : '0' + min) + ':' + (sec > 9 ? sec : '0' + sec)
|
|
175
|
-
})
|
|
176
|
-
this.lastTime = e.timeStamp
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* @description 进度条移动完毕
|
|
181
|
-
* @param {event} e
|
|
182
|
-
* @private
|
|
183
|
-
*/
|
|
184
|
-
_seeked (e) {
|
|
185
|
-
this._ctx.seek(e.detail.value / 100 * this._ctx.duration)
|
|
186
|
-
this.lastTime = undefined
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
})
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<view wx:if="{{controls}}" class="_contain">
|
|
2
|
-
<!-- 海报和按钮 -->
|
|
3
|
-
<view class="_poster" style="background-image:url('{{poster}}')">
|
|
4
|
-
<view class="_button" bindtap="{{playing?'pause':'play'}}">
|
|
5
|
-
<view class="{{playing?'_pause':'_play'}}" />
|
|
6
|
-
</view>
|
|
7
|
-
</view>
|
|
8
|
-
<!-- 曲名和作者 -->
|
|
9
|
-
<view class="_title">
|
|
10
|
-
<view class="_name">{{name||'未知音频'}}</view>
|
|
11
|
-
<view class="_author">{{author||'未知作者'}}</view>
|
|
12
|
-
</view>
|
|
13
|
-
<!-- 进度条 -->
|
|
14
|
-
<slider class="_slider" activeColor="#585959" block-size="12" disabled="{{error}}" value="{{value}}" bindchanging="_seeking" bindchange="_seeked" />
|
|
15
|
-
<!--播放时间-->
|
|
16
|
-
<view class="_time">{{time}}</view>
|
|
17
|
-
</view>
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/* 顶层容器 */
|
|
2
|
-
._contain {
|
|
3
|
-
position: relative;
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
width: 290px;
|
|
6
|
-
background-color: #fcfcfc;
|
|
7
|
-
border: 1px solid #e0e0e0;
|
|
8
|
-
border-radius: 2px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/* 播放、暂停按钮 */
|
|
12
|
-
._button {
|
|
13
|
-
display: flex;
|
|
14
|
-
align-items: center;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
width: 20px;
|
|
17
|
-
height: 20px;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
background-color: rgb(0, 0, 0, 0.2);
|
|
20
|
-
border: 1px solid white;
|
|
21
|
-
border-radius: 50%;
|
|
22
|
-
opacity: 0.9;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
._play {
|
|
26
|
-
margin-left: 2px;
|
|
27
|
-
border-top: 4px solid transparent;
|
|
28
|
-
border-bottom: 4px solid transparent;
|
|
29
|
-
border-left: 8px solid white;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
._pause {
|
|
33
|
-
width: 8px;
|
|
34
|
-
height: 8px;
|
|
35
|
-
background-color: white;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/* 海报 */
|
|
39
|
-
._poster {
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
width: 70px;
|
|
44
|
-
height: 70px;
|
|
45
|
-
background-color: #e6e6e6;
|
|
46
|
-
background-size: contain;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* 标题栏 */
|
|
50
|
-
._title {
|
|
51
|
-
flex: 1;
|
|
52
|
-
margin: 4px 0 0 14px;
|
|
53
|
-
text-align: left;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
._author {
|
|
57
|
-
width: 45px;
|
|
58
|
-
font-size: 12px;
|
|
59
|
-
color: #888;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
._name {
|
|
63
|
-
width: 140px;
|
|
64
|
-
font-size: 15px;
|
|
65
|
-
line-height: 39px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
._author,
|
|
69
|
-
._name {
|
|
70
|
-
overflow: hidden;
|
|
71
|
-
text-overflow: ellipsis;
|
|
72
|
-
white-space: nowrap;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/* 进度条 */
|
|
76
|
-
._slider {
|
|
77
|
-
position: absolute;
|
|
78
|
-
right: 16px;
|
|
79
|
-
bottom: 8px;
|
|
80
|
-
width: 140px;
|
|
81
|
-
margin: 0;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* 播放时间 */
|
|
85
|
-
._time {
|
|
86
|
-
margin: 7px 14px 0 0;
|
|
87
|
-
font-size: 12px;
|
|
88
|
-
color: #888;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/* 响应式布局,大屏幕用更大的尺寸 */
|
|
92
|
-
@media (min-width: 400px) {
|
|
93
|
-
._contain {
|
|
94
|
-
width: 380px;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
._button {
|
|
98
|
-
width: 26px;
|
|
99
|
-
height: 26px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
._poster {
|
|
103
|
-
width: 90px;
|
|
104
|
-
height: 90px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
._author {
|
|
108
|
-
width: 60px;
|
|
109
|
-
font-size: 15px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
._name {
|
|
113
|
-
width: 180px;
|
|
114
|
-
font-size: 19px;
|
|
115
|
-
line-height: 55px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
._slider {
|
|
119
|
-
right: 20px;
|
|
120
|
-
bottom: 10px;
|
|
121
|
-
width: 180px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
._time {
|
|
125
|
-
font-size: 15px;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
template: '<my-audio wx:if="{{n.name==\'audio\'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" author="{{n.attrs.author}}" controls="{{n.attrs.controls}}" autoplay="{{n.attrs.autoplay}}" loop="{{n.attrs.loop}}" name="{{n.attrs.name}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" data-source="audio" bindplay="play" binderror="mediaError" />'
|
|
3
|
-
}
|