@xtdev/xt-miniprogram-ui 1.2.90 → 1.2.92
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.
|
@@ -282,7 +282,7 @@ Component({
|
|
|
282
282
|
if (!tempFiles) {
|
|
283
283
|
tempFiles = [res];
|
|
284
284
|
}
|
|
285
|
-
if (fileType == 'video' &&
|
|
285
|
+
if (fileType == 'video' && tempFiles[0].size / 1024 / 1024 > 100) {
|
|
286
286
|
// 视频上传不允许超过100M
|
|
287
287
|
wx.showToast({ title: '视频大小不可超过100M', icon: 'none' });
|
|
288
288
|
return;
|
|
@@ -42,6 +42,7 @@ Component({
|
|
|
42
42
|
|
|
43
43
|
lifetimes: {
|
|
44
44
|
attached() {
|
|
45
|
+
this.checkCamera();
|
|
45
46
|
this.initFont();
|
|
46
47
|
this.initComponent();
|
|
47
48
|
},
|
|
@@ -51,6 +52,36 @@ Component({
|
|
|
51
52
|
},
|
|
52
53
|
|
|
53
54
|
methods: {
|
|
55
|
+
checkCamera(){
|
|
56
|
+
// 检查相机权限
|
|
57
|
+
wx.getSetting({
|
|
58
|
+
success: (res) => {
|
|
59
|
+
if (!res.authSetting['scope.camera']) {
|
|
60
|
+
wx.authorize({
|
|
61
|
+
scope: 'scope.camera',
|
|
62
|
+
success: () => {
|
|
63
|
+
},
|
|
64
|
+
fail: () => {
|
|
65
|
+
this.triggerEvent('error', {
|
|
66
|
+
errMsg: '请授权摄像头权限',
|
|
67
|
+
});
|
|
68
|
+
wx.showModal({
|
|
69
|
+
title: '提示',
|
|
70
|
+
content: '请授权摄像头权限',
|
|
71
|
+
confirmText: '去授权',
|
|
72
|
+
complete: (res) => {
|
|
73
|
+
if (res.confirm) {
|
|
74
|
+
wx.openSetting({})
|
|
75
|
+
}
|
|
76
|
+
this.cancel();
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
},
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
},
|
|
54
85
|
initFont() {
|
|
55
86
|
wx.loadFontFace({
|
|
56
87
|
family: 'FengTan-Regular', // 注意:这里的名称要和下面使用时完全一致
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<view class="watermark-camera-container">
|
|
2
2
|
<!-- 相机区域 -->
|
|
3
3
|
<view class="camera-section" wx:if="{{!previewImage}}">
|
|
4
|
-
<camera device-position="{{devicePosition}}" flash="{{flashlight}}" class="camera" binderror="onCameraError" />
|
|
4
|
+
<camera device-position="{{devicePosition}}" frame-size="large" resolution="high" flash="{{flashlight}}" class="camera" binderror="onCameraError" />
|
|
5
5
|
|
|
6
6
|
<!-- 实时水印预览层 -->
|
|
7
7
|
<view class="watermark-preview-layer">
|