Skip to content

Commit db53637

Browse files
committed
fix: merge
2 parents 3f05a96 + 2043a54 commit db53637

File tree

18 files changed

+524
-485
lines changed

18 files changed

+524
-485
lines changed

demos/react-demo/src/Inspection.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React from "react";
2+
import EZUIKit from "ezuikit-js";
3+
4+
class App extends React.Component {
5+
constructor(props) {
6+
super(props);
7+
this.player = null;
8+
this.state = {
9+
deviceList: [
10+
{
11+
width: 600,
12+
height: 400,
13+
accessToken: 'at.79xun36c3txmf3j452p1vc8ubaaf9r0q-361vhe7edi-1cekmll-f541jowsm',
14+
url: 'ezopen://open.ys7.com/C69625501/1.live',
15+
template: 'pcLive'
16+
},
17+
{
18+
width: 600,
19+
height: 400,
20+
accessToken: 'at.79xun36c3txmf3j452p1vc8ubaaf9r0q-361vhe7edi-1cekmll-f541jowsm',
21+
url: 'ezopen://open.ys7.com/BC7799091/1.live',
22+
template: 'pcLive'
23+
}
24+
]
25+
}
26+
}
27+
componentDidMount() {
28+
this.init();
29+
}
30+
31+
init = () => {
32+
console.log(document.getElementById('player'), this.state.deviceList);
33+
const inspection = new EZUIKit.EZUIKitInspectionUI(this.playerRef.current, { list: this.state.deviceList, pageSize: 2 })
34+
};
35+
36+
render() {
37+
return (
38+
<div className="demo">
39+
<h2>视频模式使用示例:</h2>
40+
<div>
41+
<div id="player"></div>
42+
</div>
43+
<div>
44+
<button onClick={this.init}>init</button>
45+
</div>
46+
</div>
47+
);
48+
}
49+
}
50+
51+
export default App;
Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
1-
const webpack = require('webpack')
2-
const plugins = []
3-
4-
if (process.env.UNI_OPT_TREESHAKINGNG) {
5-
plugins.push(require('@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js'))
6-
}
7-
8-
if (
9-
(
10-
process.env.UNI_PLATFORM === 'app-plus' &&
11-
process.env.UNI_USING_V8
12-
) ||
13-
(
14-
process.env.UNI_PLATFORM === 'h5' &&
15-
process.env.UNI_H5_BROWSER === 'builtin'
16-
)
17-
) {
18-
const path = require('path')
19-
20-
const isWin = /^win/.test(process.platform)
21-
22-
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
23-
24-
const input = normalizePath(process.env.UNI_INPUT_DIR)
25-
try {
26-
plugins.push([
27-
require('@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console'),
28-
{
29-
file (file) {
30-
file = normalizePath(file)
31-
if (file.indexOf(input) === 0) {
32-
return path.relative(input, file)
33-
}
34-
return false
35-
}
36-
}
37-
])
38-
} catch (e) { }
39-
}
40-
41-
process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']
42-
process.UNI_LIBRARIES.forEach(libraryName => {
43-
plugins.push([
44-
'import',
45-
{
46-
'libraryName': libraryName,
47-
'customName': (name) => {
48-
return `${libraryName}/lib/${name}/${name}`
49-
}
50-
}
51-
])
52-
})
53-
54-
if (process.env.UNI_PLATFORM !== 'h5') {
55-
plugins.push('@babel/plugin-transform-runtime')
56-
}
57-
58-
const config = {
59-
presets: [
60-
[
61-
'@vue/app',
62-
{
63-
modules: webpack.version[0] > 4 ? 'auto' : 'commonjs',
64-
useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry'
65-
}
66-
]
67-
],
68-
plugins
69-
}
70-
71-
const UNI_H5_TEST = '**/@dcloudio/uni-h5/dist/index.umd.min.js'
72-
if (process.env.NODE_ENV === 'production') {
73-
config.overrides = [{
74-
test: UNI_H5_TEST,
75-
compact: true,
76-
}]
77-
} else {
78-
config.ignore = [UNI_H5_TEST]
79-
}
80-
81-
module.exports = config
1+
const webpack = require('webpack')
2+
const plugins = []
3+
4+
if (process.env.UNI_OPT_TREESHAKINGNG) {
5+
plugins.push(require('@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js'))
6+
}
7+
8+
if (
9+
(
10+
process.env.UNI_PLATFORM === 'app-plus' &&
11+
process.env.UNI_USING_V8
12+
) ||
13+
(
14+
process.env.UNI_PLATFORM === 'h5' &&
15+
process.env.UNI_H5_BROWSER === 'builtin'
16+
)
17+
) {
18+
const path = require('path')
19+
20+
const isWin = /^win/.test(process.platform)
21+
22+
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
23+
24+
const input = normalizePath(process.env.UNI_INPUT_DIR)
25+
try {
26+
plugins.push([
27+
require('@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console'),
28+
{
29+
file (file) {
30+
file = normalizePath(file)
31+
if (file.indexOf(input) === 0) {
32+
return path.relative(input, file)
33+
}
34+
return false
35+
}
36+
}
37+
])
38+
} catch (e) { }
39+
}
40+
41+
process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']
42+
process.UNI_LIBRARIES.forEach(libraryName => {
43+
plugins.push([
44+
'import',
45+
{
46+
'libraryName': libraryName,
47+
'customName': (name) => {
48+
return `${libraryName}/lib/${name}/${name}`
49+
}
50+
}
51+
])
52+
})
53+
54+
if (process.env.UNI_PLATFORM !== 'h5') {
55+
plugins.push('@babel/plugin-transform-runtime')
56+
}
57+
58+
const config = {
59+
presets: [
60+
[
61+
'@vue/app',
62+
{
63+
modules: webpack.version[0] > 4 ? 'auto' : 'commonjs',
64+
useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry'
65+
}
66+
]
67+
],
68+
plugins
69+
}
70+
71+
const UNI_H5_TEST = '**/@dcloudio/uni-h5/dist/index.umd.min.js'
72+
if (process.env.NODE_ENV === 'production') {
73+
config.overrides = [{
74+
test: UNI_H5_TEST,
75+
compact: true,
76+
}]
77+
} else {
78+
config.ignore = [UNI_H5_TEST]
79+
}
80+
81+
module.exports = config
Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
const path = require('path')
2-
const webpack = require('webpack')
3-
const config = {
4-
parser: require('postcss-comment'),
5-
plugins: [
6-
require('postcss-import')({
7-
resolve (id, basedir, importOptions) {
8-
if (id.startsWith('~@/')) {
9-
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3))
10-
} else if (id.startsWith('@/')) {
11-
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2))
12-
} else if (id.startsWith('/') && !id.startsWith('//')) {
13-
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1))
14-
}
15-
return id
16-
}
17-
}),
18-
require('autoprefixer')({
19-
remove: process.env.UNI_PLATFORM !== 'h5'
20-
}),
21-
require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
22-
]
23-
}
24-
if (webpack.version[0] > 4) {
25-
delete config.parser
26-
}
27-
module.exports = config
1+
const path = require('path')
2+
const webpack = require('webpack')
3+
const config = {
4+
parser: require('postcss-comment'),
5+
plugins: [
6+
require('postcss-import')({
7+
resolve (id, basedir, importOptions) {
8+
if (id.startsWith('~@/')) {
9+
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3))
10+
} else if (id.startsWith('@/')) {
11+
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2))
12+
} else if (id.startsWith('/') && !id.startsWith('//')) {
13+
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1))
14+
}
15+
return id
16+
}
17+
}),
18+
require('autoprefixer')({
19+
remove: process.env.UNI_PLATFORM !== 'h5'
20+
}),
21+
require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
22+
]
23+
}
24+
if (webpack.version[0] > 4) {
25+
delete config.parser
26+
}
27+
module.exports = config
28+
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
<!DOCTYPE html>
2-
<html lang="zh-CN">
3-
4-
<head>
5-
<meta charset="utf-8">
6-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7-
<title>
8-
<%= htmlWebpackPlugin.options.title %>
9-
</title>
10-
<script>
11-
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
12-
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
13-
</script>
14-
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
15-
</head>
16-
17-
<body>
18-
<noscript>
19-
<strong>Please enable JavaScript to continue.</strong>
20-
</noscript>
21-
<div id="app"></div>
22-
<!-- built files will be auto injected -->
23-
</body>
24-
1+
2+
<!DOCTYPE html>
3+
<html lang="zh-CN">
4+
5+
<head>
6+
<meta charset="utf-8">
7+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
8+
<title>
9+
<%= htmlWebpackPlugin.options.title %>
10+
</title>
11+
<script>
12+
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
13+
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
14+
</script>
15+
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
16+
</head>
17+
18+
<body>
19+
<noscript>
20+
<strong>Please enable JavaScript to continue.</strong>
21+
</noscript>
22+
<div id="app"></div>
23+
<!-- built files will be auto injected -->
24+
</body>
2525
</html>

demos/with-uniapp-vue2/src/App.vue

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
<script lang="ts">
2-
import Vue from 'vue';
3-
export default Vue.extend({
4-
mpType: 'app',
5-
onLaunch() {
6-
console.log('App Launch')
7-
},
8-
onShow() {
9-
console.log('App Show')
10-
},
11-
onHide() {
12-
console.log('App Hide')
13-
}
14-
});
15-
</script>
16-
17-
<style>
18-
/*每个页面公共css */
1+
<script lang="ts">
2+
import Vue from 'vue';
3+
export default Vue.extend({
4+
mpType: 'app',
5+
onLaunch() {
6+
console.log('App Launch')
7+
},
8+
onShow() {
9+
console.log('App Show')
10+
},
11+
onHide() {
12+
console.log('App Hide')
13+
}
14+
});
15+
</script>
16+
17+
<style>
18+
/*每个页面公共css */
1919
</style>

demos/with-uniapp-vue2/src/main.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import Vue from 'vue'
2-
import App from './App.vue'
3-
import './uni.promisify.adaptor'
4-
5-
Vue.config.productionTip = false
6-
7-
const app = new (typeof App === 'function' ? App : Vue.extend(Object.assign({ mpType: 'app' }, App)))
8-
app.$mount();
1+
import Vue from 'vue'
2+
import App from './App.vue'
3+
import './uni.promisify.adaptor'
4+
5+
Vue.config.productionTip = false
6+
7+
const app = new (typeof App === 'function' ? App : Vue.extend(Object.assign({ mpType: 'app' }, App)))
8+
app.$mount();

0 commit comments

Comments
 (0)