stellar-ui-v2 1.40.16 → 1.40.17
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/README.md +8 -8
- package/components/ste-app-share/README.md +90 -0
- package/components/ste-app-share/config.json +5 -0
- package/components/ste-app-share/draw.js +73 -0
- package/components/ste-app-share/share.js +40 -0
- package/components/ste-app-share/ste-app-share.vue +272 -0
- package/components/ste-app-update/README.md +4 -3
- package/components/ste-index-list/README.md +6 -6
- package/components/ste-message-box/ste-message-box.js +72 -72
- package/components/ste-message-box/ste-message-box.vue +364 -364
- package/components/ste-popup/README.md +16 -16
- package/components/ste-popup/ste-popup.vue +392 -392
- package/components/ste-price/ste-price.vue +256 -256
- package/components/ste-rate/README.md +13 -13
- package/components/ste-search/ste-search.vue +590 -590
- package/components/ste-select/datetime.vue +106 -106
- package/components/ste-table-column/checkbox-icon.vue +65 -65
- package/components/ste-table-column/radio-icon.vue +110 -110
- package/components/ste-table-column/sub-table.vue +116 -116
- package/components/ste-tabs/props.js +212 -212
- package/components/ste-toast/ste-toast.js +69 -69
- package/components/ste-video/ste-video.vue +754 -632
- package/package.json +18 -18
- package/static/haibao.png +0 -0
- package/static/lianjie.png +0 -0
- package/static/qq.png +0 -0
- package/static/qqkj.png +0 -0
- package/static/shoucang.png +0 -0
- package/static/weixin.png +0 -0
- package/static/wxpyq.png +0 -0
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
## ✨ 特性
|
|
12
12
|
|
|
13
|
-
- 🎯 多平台覆盖,支持 微信小程序、支付宝小程序、H5.
|
|
14
|
-
- 🚀 40+ 个高质量组件,覆盖移动端主流场景.
|
|
15
|
-
- 📖 提供丰富的文档和组件示例.
|
|
13
|
+
- 🎯 多平台覆盖,支持 微信小程序、支付宝小程序、H5.
|
|
14
|
+
- 🚀 40+ 个高质量组件,覆盖移动端主流场景.
|
|
15
|
+
- 📖 提供丰富的文档和组件示例.
|
|
16
16
|
- 🎨 支持修改 CSS 变量实现主题定制.
|
|
17
17
|
|
|
18
18
|
## 📱 预览
|
|
@@ -75,11 +75,11 @@ npm i stellar-ui-v2 -S
|
|
|
75
75
|
|
|
76
76
|
## 周边生态
|
|
77
77
|
|
|
78
|
-
| 项目 | 描述 |
|
|
79
|
-
| --- | --- |
|
|
80
|
-
|[StellarUI-Plus](https://github.com/wuhanshuzhiyun/stellar-ui-plus) | 一个基于vue3构建,打造的uni-app组件库 |
|
|
81
|
-
|[ste-vue-inset-loader](https://github.com/wuhanshuzhiyun/ste-vue-inset-loader) |常用于小程序需要全局引入组件的场景的包 |
|
|
82
|
-
|[ste-helper](https://github.com/wuhanshuzhiyun/stellar-ui-plus/tree/main/plugins/ste-helper) |旨在帮助开发者更加有效率的使用 StellarUI-Plus来开发项目的vscode插件 |
|
|
78
|
+
| 项目 | 描述 |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
|[StellarUI-Plus](https://github.com/wuhanshuzhiyun/stellar-ui-plus) | 一个基于vue3构建,打造的uni-app组件库 |
|
|
81
|
+
|[ste-vue-inset-loader](https://github.com/wuhanshuzhiyun/ste-vue-inset-loader) |常用于小程序需要全局引入组件的场景的包 |
|
|
82
|
+
|[ste-helper](https://github.com/wuhanshuzhiyun/stellar-ui-plus/tree/main/plugins/ste-helper) |旨在帮助开发者更加有效率的使用 StellarUI-Plus来开发项目的vscode插件 |
|
|
83
83
|
|[ste-cli](https://github.com/wuhanshuzhiyun/ste-cli) |stellar配套的脚手架 |
|
|
84
84
|
|
|
85
85
|
## 核心团队
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# AppShare 分享
|
|
2
|
+
- APP分享组件
|
|
3
|
+
- 仅支持APP端
|
|
4
|
+
|
|
5
|
+
---$
|
|
6
|
+
|
|
7
|
+
### 代码演示
|
|
8
|
+
#### 基础用法
|
|
9
|
+
```html
|
|
10
|
+
<template>
|
|
11
|
+
<ste-app-share :open="open" @close="open = false" :data="data" :poster="poster" :miniProgram="miniProgram"></ste-app-share>
|
|
12
|
+
</template>
|
|
13
|
+
<script>
|
|
14
|
+
let num = 0;
|
|
15
|
+
export default {
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
open: false,
|
|
19
|
+
poster: {
|
|
20
|
+
qrcode: 'https://image.whzb.com/chain/StellarUI/头像/邻里购.png',
|
|
21
|
+
background: '#ffffff',
|
|
22
|
+
title: '推荐一个宝贝给你,快来看看吧~',
|
|
23
|
+
message: '请及时购买,价格具有时效性',
|
|
24
|
+
},
|
|
25
|
+
data: {
|
|
26
|
+
price: '100.00',
|
|
27
|
+
image: 'https://image.whzb.com/chain/image/1c/1cd2/1cd27514a2516b146e317fa3b538f4f4/6976279890175-1.jpg',
|
|
28
|
+
name: '中百福嘉白干子 200g/份',
|
|
29
|
+
desc: '豆香浓郁|家常百搭',
|
|
30
|
+
},
|
|
31
|
+
miniProgram: {
|
|
32
|
+
id: 'gh_c9b7b9786694',
|
|
33
|
+
path: 'pages/tabbar/tabbar',
|
|
34
|
+
type: 0,
|
|
35
|
+
webUrl: 'https://image.whzb.com/chain/StellarUI/头像/邻里购.png',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
headOpen() {
|
|
41
|
+
if (num % 2 === 0) {
|
|
42
|
+
this.data.image = 'https://image.whzb.com/chain/image/1c/1cd2/1cd27514a2516b146e317fa3b538f4f4/6976279890175-1.jpg';
|
|
43
|
+
} else {
|
|
44
|
+
this.data.image = 'https://image.whzb.com/chain/StellarUI/image/test.jpg';
|
|
45
|
+
}
|
|
46
|
+
num++;
|
|
47
|
+
this.open = true;
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
</script>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---$
|
|
55
|
+
### API
|
|
56
|
+
|
|
57
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
58
|
+
| ----- | ----- | --- | ------- | ------| --------|
|
|
59
|
+
| `open` | 打开分享 | `boolean` | `false` | - | - |
|
|
60
|
+
| `viewPoster` | 是否显示海报 | `boolean` | `true` | - | - |
|
|
61
|
+
| `poster` | 海报参数 | `Poster` | `{ background: '#ffffff', title: '推荐一个宝贝给你,快来看看吧~', message: '请及时购买,价格具有时效性', qrcode: '' }` | - | - |
|
|
62
|
+
| `miniProgram` | 小程序参数 | `MiniProgram` | `{ id: '', path: '', type: 0, webUrl: '' }` | - | - |
|
|
63
|
+
| `data` | 分享数据 | `Data` | `{ price: '', image: '', name: '', desc: '' }` | - | - |
|
|
64
|
+
|
|
65
|
+
#### Poster 海报参数
|
|
66
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
67
|
+
| ----- | ----- | --- | ------- | ------| --------|
|
|
68
|
+
| `background`| 背景色 | `string`| `#ffffff` | - | - |
|
|
69
|
+
| `title` | 顶部标题 | `string`| `推荐一个宝贝给你,快来看看吧~` | - | - |
|
|
70
|
+
| `message` | 底部提示 | `string`| `请及时购买,价格具有时效性` | - | - |
|
|
71
|
+
| `qrcode` | 二维码 | `string`| - | - | - |
|
|
72
|
+
|
|
73
|
+
#### MiniProgram 小程序参数
|
|
74
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
75
|
+
| ----- | ----- | --- | ------- | ------| --------|
|
|
76
|
+
| `id` | 微信小程序原始id | `string`| - | - | - |
|
|
77
|
+
| `path` | 点击链接进入的页面 | `string`| - | - | - |
|
|
78
|
+
| `type` | 微信小程序版本类型,可取值: 0-正式版; 1-测试版; 2-体验版。 默认值为0 | `string`| `0` | - | - |
|
|
79
|
+
| `webUrl`| 兼容低版本的网页链接 | `string`| - | - | - |
|
|
80
|
+
|
|
81
|
+
#### Data 分享数据
|
|
82
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
83
|
+
| ----- | ----- | --- | ------- | ------| --------|
|
|
84
|
+
| `price` | 价格 | `string`| - | - | - |
|
|
85
|
+
| `image` | 图片链接 | `string`| - | - | - |
|
|
86
|
+
| `name` | 商品名称 | `string`| - | - | - |
|
|
87
|
+
| `desc` | 商品描述 | `string`| - | - | - |
|
|
88
|
+
|
|
89
|
+
---$
|
|
90
|
+
{{xuyajun}}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {UniApp.CanvasContext} ctx
|
|
3
|
+
* @param {{background:string;title:string;message:string;qrcode:string}} poster
|
|
4
|
+
* @param {{page: string;image: string;name: string;desc: string;price:string}} data
|
|
5
|
+
*/
|
|
6
|
+
export function drawPoster(ctx, poster, data) {
|
|
7
|
+
return new Promise(async (resolve, reject) => {
|
|
8
|
+
const { width, height } = ctx;
|
|
9
|
+
// 清空
|
|
10
|
+
ctx.clearRect(0, 0, width, height);
|
|
11
|
+
// 绘制白色背景
|
|
12
|
+
ctx.setFillStyle(poster.background || '#ffffff');
|
|
13
|
+
ctx.fillRect(0, 0, width, height);
|
|
14
|
+
// 居中绘制标题
|
|
15
|
+
if (poster.title) {
|
|
16
|
+
ctx.setFontSize(14);
|
|
17
|
+
ctx.setFillStyle('#333333');
|
|
18
|
+
ctx.setTextAlign('center');
|
|
19
|
+
ctx.fillText(poster.title, width / 2, 30);
|
|
20
|
+
}
|
|
21
|
+
// 绘制宽高一致的图片
|
|
22
|
+
if (data.image) {
|
|
23
|
+
try {
|
|
24
|
+
const image = await uni.getImageInfo({ src: data.image });
|
|
25
|
+
ctx.drawImage(image.path, 0, 40, width, width);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.error(e);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// 绘制加粗文本name
|
|
31
|
+
if (data.name) {
|
|
32
|
+
ctx.setFontSize(16);
|
|
33
|
+
ctx.setFillStyle('#333333');
|
|
34
|
+
ctx.setTextAlign('left');
|
|
35
|
+
ctx.fillText(data.name, 10, width + 80);
|
|
36
|
+
}
|
|
37
|
+
// 绘制message
|
|
38
|
+
if (data.desc) {
|
|
39
|
+
ctx.setFontSize(14);
|
|
40
|
+
ctx.setFillStyle('#666666');
|
|
41
|
+
ctx.setTextAlign('left');
|
|
42
|
+
ctx.fillText(data.desc, 10, width + 100);
|
|
43
|
+
}
|
|
44
|
+
// 绘制价格
|
|
45
|
+
if (data.price) {
|
|
46
|
+
ctx.setFontSize(20);
|
|
47
|
+
ctx.setFillStyle('#ff0000');
|
|
48
|
+
ctx.setTextAlign('left');
|
|
49
|
+
ctx.fillText(`¥${data.price}`, 10, width + 125);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 绘制文字
|
|
53
|
+
if (poster.message) {
|
|
54
|
+
ctx.setFontSize(12);
|
|
55
|
+
ctx.setFillStyle('#666666');
|
|
56
|
+
ctx.setTextAlign('left');
|
|
57
|
+
ctx.fillText(poster.message, 10, height - 20);
|
|
58
|
+
}
|
|
59
|
+
// 绘制qrcode
|
|
60
|
+
if (poster.qrcode) {
|
|
61
|
+
try {
|
|
62
|
+
const qrcode = await uni.getImageInfo({ src: poster.qrcode });
|
|
63
|
+
ctx.drawImage(qrcode.path, width - 80, width + 80, 70, 70);
|
|
64
|
+
} catch (e) {
|
|
65
|
+
console.error(e);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// 绘制完成
|
|
69
|
+
ctx.draw(false, () => {
|
|
70
|
+
resolve();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {'WXSceneSession' | 'WXSceneTimeline' | 'WXSceneFavorite'} scene
|
|
3
|
+
* @param {{id: string;path: string;type: number;webUrl: string}} miniProgram
|
|
4
|
+
* @param {{page: string;image: string;name: string;desc: string;price:string}} data
|
|
5
|
+
*/
|
|
6
|
+
export const share = (scene, miniProgram, data) => {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
uni.downloadFile({
|
|
9
|
+
url: data.image,
|
|
10
|
+
success: (res) => {
|
|
11
|
+
console.log('imageUrl===', res.tempFilePath);
|
|
12
|
+
const options = {
|
|
13
|
+
provider: 'weixin',
|
|
14
|
+
scene,
|
|
15
|
+
type: 5,
|
|
16
|
+
miniProgram: Object.assign({ type: 0, webUrl: res.tempFilePath }, miniProgram),
|
|
17
|
+
imageUrl: res.tempFilePath,
|
|
18
|
+
title: data.name,
|
|
19
|
+
summary: `${data.name} #${data.desc}`,
|
|
20
|
+
};
|
|
21
|
+
console.log('options====', options);
|
|
22
|
+
uni.share({
|
|
23
|
+
...options,
|
|
24
|
+
success: (res) => {
|
|
25
|
+
console.log('分享成功', res);
|
|
26
|
+
resolve(res);
|
|
27
|
+
},
|
|
28
|
+
fail: (err) => {
|
|
29
|
+
console.log('分享失败', err);
|
|
30
|
+
reject(err);
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
fail: (err) => {
|
|
35
|
+
console.log('下载失败', err);
|
|
36
|
+
reject(err);
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
};
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 分享弹窗 -->
|
|
3
|
+
<view class="ste-share-root" :class="{ open: dataOpen }">
|
|
4
|
+
<view class="content-box" :style="{ opacity: viewPoster ? 1 : 0 }">
|
|
5
|
+
<view class="loading" v-if="loading"></view>
|
|
6
|
+
<canvas id="content-poster" canvas-id="content-poster" />
|
|
7
|
+
</view>
|
|
8
|
+
<view class="footer-box">
|
|
9
|
+
<view class="footer-head">
|
|
10
|
+
<view class="footer-head-item"></view>
|
|
11
|
+
<view>分享到</view>
|
|
12
|
+
<view class="footer-head-item" @click="close">×</view>
|
|
13
|
+
</view>
|
|
14
|
+
<scroll-view class="footer-scroll-view" scroll-x="true">
|
|
15
|
+
<view class="footer-share-list">
|
|
16
|
+
<view class="footer-item" @click="handShare('WXSceneSession')">
|
|
17
|
+
<image class="footer-icon" src="../../static/weixin.png" mode="widthFix"></image>
|
|
18
|
+
<text>微信好友</text>
|
|
19
|
+
</view>
|
|
20
|
+
<view class="footer-item" @click="handShare('WXSceneTimeline')">
|
|
21
|
+
<image class="footer-icon" src="../../static/wxpyq.png" mode="widthFix"></image>
|
|
22
|
+
<text>朋友圈</text>
|
|
23
|
+
</view>
|
|
24
|
+
<view class="footer-item" @click="handShare('WXSceneFavorite')">
|
|
25
|
+
<image class="footer-icon" src="../../static/shoucang.png" mode="widthFix"></image>
|
|
26
|
+
<text>微信收藏</text>
|
|
27
|
+
</view>
|
|
28
|
+
</view>
|
|
29
|
+
</scroll-view>
|
|
30
|
+
<view class="footer-share-list">
|
|
31
|
+
<view class="footer-item" @click="downloadPoster" v-if="viewPoster">
|
|
32
|
+
<image class="footer-icon" src="../../static/haibao.png" mode="widthFix"></image>
|
|
33
|
+
<text>生成海报</text>
|
|
34
|
+
</view>
|
|
35
|
+
</view>
|
|
36
|
+
</view>
|
|
37
|
+
</view>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import { copyFileToPublicDir, drawPoster } from './draw';
|
|
42
|
+
import { share } from './share';
|
|
43
|
+
|
|
44
|
+
export default {
|
|
45
|
+
name: 'ste-app-share',
|
|
46
|
+
group: '业务组件',
|
|
47
|
+
title: 'AppShare 分享',
|
|
48
|
+
props: {
|
|
49
|
+
open: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
53
|
+
/** 显示海报 */
|
|
54
|
+
viewPoster: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: true,
|
|
57
|
+
},
|
|
58
|
+
/** 海报参数 */
|
|
59
|
+
poster: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: () => ({ background: '#ffffff', title: '推荐一个宝贝给你,快来看看吧~', message: '请及时购买,价格具有时效性', qrcode: '' }),
|
|
62
|
+
},
|
|
63
|
+
/** 小程序参数 */
|
|
64
|
+
miniProgram: {
|
|
65
|
+
type: Object,
|
|
66
|
+
default: () => ({ id: '', path: '', type: 0, webUrl: '' }),
|
|
67
|
+
},
|
|
68
|
+
/** 分享数据 */
|
|
69
|
+
data: {
|
|
70
|
+
type: Object,
|
|
71
|
+
default: () => ({ price: '', image: '', name: '', desc: '' }),
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
data() {
|
|
75
|
+
return {
|
|
76
|
+
dataOpen: false,
|
|
77
|
+
loading: false,
|
|
78
|
+
ctx: null,
|
|
79
|
+
canvas: null,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
watch: {
|
|
83
|
+
open: {
|
|
84
|
+
handler(val) {
|
|
85
|
+
this.dataOpen = val;
|
|
86
|
+
if (val) {
|
|
87
|
+
this.draw();
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
immediate: true,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
mounted() {},
|
|
94
|
+
methods: {
|
|
95
|
+
close() {
|
|
96
|
+
this.dataOpen = false;
|
|
97
|
+
this.$emit('close', false);
|
|
98
|
+
},
|
|
99
|
+
handShare(scene) {
|
|
100
|
+
// #ifndef APP
|
|
101
|
+
uni.showToast({ title: '暂不支持', icon: 'none', duration: 2000 });
|
|
102
|
+
// #endif
|
|
103
|
+
// #ifdef APP
|
|
104
|
+
share(scene, this.miniProgram, this.data);
|
|
105
|
+
// #endif
|
|
106
|
+
},
|
|
107
|
+
draw() {
|
|
108
|
+
if (!this.viewPoster) return;
|
|
109
|
+
this.loading = true;
|
|
110
|
+
if (!this.ctx) {
|
|
111
|
+
this.ctx = uni.createCanvasContext('content-poster', this);
|
|
112
|
+
const query = uni.createSelectorQuery().in(this);
|
|
113
|
+
this.canvas = query
|
|
114
|
+
.select('#content-poster')
|
|
115
|
+
.boundingClientRect((canvas) => {
|
|
116
|
+
this.ctx.width = canvas.width;
|
|
117
|
+
this.ctx.height = canvas.height;
|
|
118
|
+
|
|
119
|
+
drawPoster(this.ctx, this.poster, this.data).then(() => {
|
|
120
|
+
this.loading = false;
|
|
121
|
+
});
|
|
122
|
+
})
|
|
123
|
+
.exec();
|
|
124
|
+
} else {
|
|
125
|
+
drawPoster(this.ctx, this.poster, this.data).then(() => {
|
|
126
|
+
this.loading = false;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
downloadPoster() {
|
|
131
|
+
uni.canvasToTempFilePath({
|
|
132
|
+
canvasId: 'content-poster',
|
|
133
|
+
success: ({ tempFilePath }) => {
|
|
134
|
+
uni.saveImageToPhotosAlbum({
|
|
135
|
+
filePath: tempFilePath,
|
|
136
|
+
success: () => {
|
|
137
|
+
uni.showToast({ title: '保存成功', icon: 'success', duration: 2000 });
|
|
138
|
+
},
|
|
139
|
+
fail: (err) => {
|
|
140
|
+
uni.showToast({ title: '保存失败', icon: 'none', duration: 2000 });
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
</script>
|
|
149
|
+
|
|
150
|
+
<style lang="scss">
|
|
151
|
+
.ste-share-root {
|
|
152
|
+
position: fixed;
|
|
153
|
+
top: 0;
|
|
154
|
+
left: 0;
|
|
155
|
+
width: 100%;
|
|
156
|
+
height: 100%;
|
|
157
|
+
z-index: 9999;
|
|
158
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
159
|
+
opacity: 0;
|
|
160
|
+
pointer-events: none;
|
|
161
|
+
transition: all 0.3s;
|
|
162
|
+
&.open {
|
|
163
|
+
opacity: 1;
|
|
164
|
+
pointer-events: auto;
|
|
165
|
+
}
|
|
166
|
+
.content-box {
|
|
167
|
+
position: absolute;
|
|
168
|
+
width: 660rpx;
|
|
169
|
+
height: 1020rpx;
|
|
170
|
+
top: 120rpx;
|
|
171
|
+
left: 50%;
|
|
172
|
+
transform: translateX(-50%);
|
|
173
|
+
z-index: 9;
|
|
174
|
+
border-radius: 12px;
|
|
175
|
+
overflow: hidden;
|
|
176
|
+
#content-poster {
|
|
177
|
+
width: 100%;
|
|
178
|
+
height: 100%;
|
|
179
|
+
}
|
|
180
|
+
.loading {
|
|
181
|
+
position: absolute;
|
|
182
|
+
width: 100%;
|
|
183
|
+
height: 100%;
|
|
184
|
+
z-index: 10;
|
|
185
|
+
background-color: #fff;
|
|
186
|
+
&::after {
|
|
187
|
+
content: '加载中...';
|
|
188
|
+
position: absolute;
|
|
189
|
+
width: 100%;
|
|
190
|
+
top: calc(50% + 20px);
|
|
191
|
+
font-size: 12px;
|
|
192
|
+
color: #999;
|
|
193
|
+
text-align: center;
|
|
194
|
+
line-height: 40px;
|
|
195
|
+
}
|
|
196
|
+
&::before {
|
|
197
|
+
content: '';
|
|
198
|
+
position: absolute;
|
|
199
|
+
width: 40px;
|
|
200
|
+
height: 40px;
|
|
201
|
+
top: calc(50%);
|
|
202
|
+
left: calc(50%);
|
|
203
|
+
border-radius: 50%;
|
|
204
|
+
border: 4px solid #f3f3f3;
|
|
205
|
+
border-top-color: #999;
|
|
206
|
+
animation: loading 1s infinite linear;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
.footer-box {
|
|
211
|
+
width: 100%;
|
|
212
|
+
background-color: #fff;
|
|
213
|
+
position: absolute;
|
|
214
|
+
bottom: 0;
|
|
215
|
+
z-index: 10;
|
|
216
|
+
border-radius: 15px 15px 0 0;
|
|
217
|
+
overflow: hidden;
|
|
218
|
+
.footer-head {
|
|
219
|
+
width: 100%;
|
|
220
|
+
height: 44px;
|
|
221
|
+
display: flex;
|
|
222
|
+
justify-content: space-between;
|
|
223
|
+
align-items: center;
|
|
224
|
+
.footer-head-item {
|
|
225
|
+
font-size: 20px;
|
|
226
|
+
width: 44px;
|
|
227
|
+
height: 100%;
|
|
228
|
+
display: flex;
|
|
229
|
+
align-items: center;
|
|
230
|
+
justify-content: center;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
.footer-scroll-view {
|
|
234
|
+
width: 100%;
|
|
235
|
+
height: 75px;
|
|
236
|
+
}
|
|
237
|
+
.footer-share-list {
|
|
238
|
+
white-space: nowrap;
|
|
239
|
+
padding: 0 15px 15px 15px;
|
|
240
|
+
display: flex;
|
|
241
|
+
align-items: flex-start;
|
|
242
|
+
|
|
243
|
+
.footer-item {
|
|
244
|
+
width: 60px;
|
|
245
|
+
height: 60px;
|
|
246
|
+
display: inline-flex;
|
|
247
|
+
flex-direction: column;
|
|
248
|
+
align-items: center;
|
|
249
|
+
justify-content: center;
|
|
250
|
+
font-size: 12px;
|
|
251
|
+
line-height: 30px;
|
|
252
|
+
& + .footer-item {
|
|
253
|
+
margin-left: 10px;
|
|
254
|
+
}
|
|
255
|
+
.footer-icon {
|
|
256
|
+
width: 30px;
|
|
257
|
+
height: 30px;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@keyframes loading {
|
|
265
|
+
0% {
|
|
266
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
267
|
+
}
|
|
268
|
+
100% {
|
|
269
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
</style>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# AppUpdate App更新
|
|
2
2
|
|
|
3
|
-
此组件用于APP更新功能
|
|
3
|
+
- 此组件用于APP更新功能
|
|
4
|
+
- 仅支持APP端
|
|
4
5
|
|
|
5
6
|
---$
|
|
6
7
|
|
|
@@ -9,8 +10,8 @@
|
|
|
9
10
|
- 属性`clientId`用于设置APP的应用编码
|
|
10
11
|
- 属性`clientSecret`用于设置APP的应用密钥
|
|
11
12
|
- 函数`start`用于开始检查更新
|
|
12
|
-
-
|
|
13
|
-
-
|
|
13
|
+
- 回调事件`cancel`取消更新
|
|
14
|
+
- 回调事件`complete`取消,成功更新都会执行
|
|
14
15
|
|
|
15
16
|
```html
|
|
16
17
|
<script>
|
|
@@ -111,12 +111,12 @@ methods: {
|
|
|
111
111
|
|
|
112
112
|
#### IndexList Props
|
|
113
113
|
|
|
114
|
-
| 属性名 | 说明 |类型 |默认值 |可选值 | 支持版本 |
|
|
115
|
-
| --- |--- | --- | --- | --- | --- |
|
|
116
|
-
| `active` | 当前激活的索引下标,支持sync双向绑定,默认值0 | `Number` | `0` | - | - |
|
|
117
|
-
| `height` | 高度,默认值100% | `String`/`Number` | `"100%"` | - | - |
|
|
118
|
-
| `sticky` | `title`是否粘性布局,自定义`title`插槽时不生效 | `Boolean` | `true` | - | - |
|
|
119
|
-
| `inactiveColor` | 右边锚点状态非激活时的颜色 | `String` | `#666666` | - | - |
|
|
114
|
+
| 属性名 | 说明 |类型 |默认值 |可选值 | 支持版本 |
|
|
115
|
+
| --- |--- | --- | --- | --- | --- |
|
|
116
|
+
| `active` | 当前激活的索引下标,支持sync双向绑定,默认值0 | `Number` | `0` | - | - |
|
|
117
|
+
| `height` | 高度,默认值100% | `String`/`Number` | `"100%"` | - | - |
|
|
118
|
+
| `sticky` | `title`是否粘性布局,自定义`title`插槽时不生效 | `Boolean` | `true` | - | - |
|
|
119
|
+
| `inactiveColor` | 右边锚点状态非激活时的颜色 | `String` | `#666666` | - | - |
|
|
120
120
|
| `activeColor` | 右边锚点状态激活时的颜色 | `String` | `#0090FF` | - | - |
|
|
121
121
|
|
|
122
122
|
#### IndexList Events
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import Vue from 'vue';
|
|
2
|
-
import Vuex from 'vuex';
|
|
3
|
-
|
|
4
|
-
Vue.use(Vuex);
|
|
5
|
-
const DEFAULT_KEY = '$steMsgBoxKey';
|
|
6
|
-
const DEFAULT_CONFIG = {
|
|
7
|
-
title: '',
|
|
8
|
-
content: '',
|
|
9
|
-
showCancel: true,
|
|
10
|
-
icon: '',
|
|
11
|
-
cancelText: '取消',
|
|
12
|
-
cancelColor: '#333333',
|
|
13
|
-
confirmText: '确认',
|
|
14
|
-
confirmColor: '',
|
|
15
|
-
editable: false,
|
|
16
|
-
placeholderText: '',
|
|
17
|
-
success: null,
|
|
18
|
-
fail: null,
|
|
19
|
-
complete: null,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const store = new Vuex.Store({
|
|
23
|
-
state: {},
|
|
24
|
-
mutations: {
|
|
25
|
-
initializeState(state, key) {
|
|
26
|
-
if (!state[key]) {
|
|
27
|
-
Vue.set(state, key, {
|
|
28
|
-
selector: key,
|
|
29
|
-
openBegin: false,
|
|
30
|
-
...DEFAULT_CONFIG,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
setState(state, { key, params }) {
|
|
35
|
-
Object.assign(state[key], params);
|
|
36
|
-
},
|
|
37
|
-
resetState(state, key) {
|
|
38
|
-
Object.assign(state[key], {
|
|
39
|
-
openBegin: false,
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
function useSteMsgBox(key) {
|
|
46
|
-
key = key ?? DEFAULT_KEY;
|
|
47
|
-
store.commit('initializeState', key);
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
showMsgBox(params) {
|
|
51
|
-
store.commit('setState', {
|
|
52
|
-
key,
|
|
53
|
-
params: {
|
|
54
|
-
...DEFAULT_CONFIG,
|
|
55
|
-
...params,
|
|
56
|
-
confirm: params.confirm ?? function () {},
|
|
57
|
-
cancel: params.cancel ?? function () {},
|
|
58
|
-
complete: params.complete ?? function () {},
|
|
59
|
-
openBegin: true,
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
hideMsgBox() {
|
|
64
|
-
store.commit('resetState', key);
|
|
65
|
-
},
|
|
66
|
-
$state: store.state[key],
|
|
67
|
-
$store: store,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export default useSteMsgBox;
|
|
72
|
-
export { DEFAULT_KEY };
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import Vuex from 'vuex';
|
|
3
|
+
|
|
4
|
+
Vue.use(Vuex);
|
|
5
|
+
const DEFAULT_KEY = '$steMsgBoxKey';
|
|
6
|
+
const DEFAULT_CONFIG = {
|
|
7
|
+
title: '',
|
|
8
|
+
content: '',
|
|
9
|
+
showCancel: true,
|
|
10
|
+
icon: '',
|
|
11
|
+
cancelText: '取消',
|
|
12
|
+
cancelColor: '#333333',
|
|
13
|
+
confirmText: '确认',
|
|
14
|
+
confirmColor: '',
|
|
15
|
+
editable: false,
|
|
16
|
+
placeholderText: '',
|
|
17
|
+
success: null,
|
|
18
|
+
fail: null,
|
|
19
|
+
complete: null,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const store = new Vuex.Store({
|
|
23
|
+
state: {},
|
|
24
|
+
mutations: {
|
|
25
|
+
initializeState(state, key) {
|
|
26
|
+
if (!state[key]) {
|
|
27
|
+
Vue.set(state, key, {
|
|
28
|
+
selector: key,
|
|
29
|
+
openBegin: false,
|
|
30
|
+
...DEFAULT_CONFIG,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
setState(state, { key, params }) {
|
|
35
|
+
Object.assign(state[key], params);
|
|
36
|
+
},
|
|
37
|
+
resetState(state, key) {
|
|
38
|
+
Object.assign(state[key], {
|
|
39
|
+
openBegin: false,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
function useSteMsgBox(key) {
|
|
46
|
+
key = key ?? DEFAULT_KEY;
|
|
47
|
+
store.commit('initializeState', key);
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
showMsgBox(params) {
|
|
51
|
+
store.commit('setState', {
|
|
52
|
+
key,
|
|
53
|
+
params: {
|
|
54
|
+
...DEFAULT_CONFIG,
|
|
55
|
+
...params,
|
|
56
|
+
confirm: params.confirm ?? function () {},
|
|
57
|
+
cancel: params.cancel ?? function () {},
|
|
58
|
+
complete: params.complete ?? function () {},
|
|
59
|
+
openBegin: true,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
hideMsgBox() {
|
|
64
|
+
store.commit('resetState', key);
|
|
65
|
+
},
|
|
66
|
+
$state: store.state[key],
|
|
67
|
+
$store: store,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default useSteMsgBox;
|
|
72
|
+
export { DEFAULT_KEY };
|