患者1.2
This commit is contained in:
@@ -47,13 +47,16 @@ var validator_1 = require("../common/validator");
|
||||
}, previewFullImage: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
}, videoFit: {
|
||||
type: String,
|
||||
value: 'contain',
|
||||
}, imageFit: {
|
||||
type: String,
|
||||
value: 'scaleToFill',
|
||||
}, uploadIcon: {
|
||||
type: String,
|
||||
value: 'photograph',
|
||||
} }, shared_1.chooseImageProps), shared_1.chooseVideoProps), shared_1.chooseMediaProps), shared_1.chooseMessageFileProps),
|
||||
} }, shared_1.imageProps), shared_1.videoProps), shared_1.mediaProps), shared_1.messageFileProps),
|
||||
data: {
|
||||
lists: [],
|
||||
isInCount: true,
|
||||
@@ -129,11 +132,12 @@ var validator_1 = require("../common/validator");
|
||||
if (!this.data.previewFullImage)
|
||||
return;
|
||||
var index = event.currentTarget.dataset.index;
|
||||
var lists = this.data.lists;
|
||||
var _a = this.data, lists = _a.lists, showmenu = _a.showmenu;
|
||||
var item = lists[index];
|
||||
wx.previewImage({
|
||||
urls: lists.filter(function (item) { return (0, utils_1.isImageFile)(item); }).map(function (item) { return item.url; }),
|
||||
current: item.url,
|
||||
showmenu: showmenu,
|
||||
fail: function () {
|
||||
wx.showToast({ title: '预览图片失败', icon: 'none' });
|
||||
},
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
title="{{ item.name || ('视频' + index) }}"
|
||||
poster="{{ item.thumb }}"
|
||||
autoplay="{{ item.autoplay }}"
|
||||
object-fit="{{videoFit}}"
|
||||
class="van-uploader__preview-image"
|
||||
style="{{ computed.sizeStyle({ previewSize }) }}"
|
||||
data-index="{{ index }}"
|
||||
|
||||
+8
-4
@@ -1,4 +1,4 @@
|
||||
export declare const chooseImageProps: {
|
||||
export declare const imageProps: {
|
||||
sizeType: {
|
||||
type: ArrayConstructor;
|
||||
value: string[];
|
||||
@@ -7,8 +7,12 @@ export declare const chooseImageProps: {
|
||||
type: ArrayConstructor;
|
||||
value: string[];
|
||||
};
|
||||
showmenu: {
|
||||
type: BooleanConstructor;
|
||||
value: boolean;
|
||||
};
|
||||
};
|
||||
export declare const chooseVideoProps: {
|
||||
export declare const videoProps: {
|
||||
capture: {
|
||||
type: ArrayConstructor;
|
||||
value: string[];
|
||||
@@ -26,7 +30,7 @@ export declare const chooseVideoProps: {
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
export declare const chooseMediaProps: {
|
||||
export declare const mediaProps: {
|
||||
capture: {
|
||||
type: ArrayConstructor;
|
||||
value: string[];
|
||||
@@ -44,6 +48,6 @@ export declare const chooseMediaProps: {
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
export declare const chooseMessageFileProps: {
|
||||
export declare const messageFileProps: {
|
||||
extension: null;
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.chooseMessageFileProps = exports.chooseMediaProps = exports.chooseVideoProps = exports.chooseImageProps = void 0;
|
||||
// props for choose image
|
||||
exports.chooseImageProps = {
|
||||
exports.messageFileProps = exports.mediaProps = exports.videoProps = exports.imageProps = void 0;
|
||||
// props for image
|
||||
exports.imageProps = {
|
||||
sizeType: {
|
||||
type: Array,
|
||||
value: ['original', 'compressed'],
|
||||
@@ -11,9 +11,13 @@ exports.chooseImageProps = {
|
||||
type: Array,
|
||||
value: ['album', 'camera'],
|
||||
},
|
||||
showmenu: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
};
|
||||
// props for choose video
|
||||
exports.chooseVideoProps = {
|
||||
// props for video
|
||||
exports.videoProps = {
|
||||
capture: {
|
||||
type: Array,
|
||||
value: ['album', 'camera'],
|
||||
@@ -31,8 +35,8 @@ exports.chooseVideoProps = {
|
||||
value: 'back',
|
||||
},
|
||||
};
|
||||
// props for choose media
|
||||
exports.chooseMediaProps = {
|
||||
// props for media
|
||||
exports.mediaProps = {
|
||||
capture: {
|
||||
type: Array,
|
||||
value: ['album', 'camera'],
|
||||
@@ -50,7 +54,7 @@ exports.chooseMediaProps = {
|
||||
value: 'back',
|
||||
},
|
||||
};
|
||||
// props for choose file
|
||||
exports.chooseMessageFileProps = {
|
||||
// props for file
|
||||
exports.messageFileProps = {
|
||||
extension: null,
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ function isVideoFile(item) {
|
||||
}
|
||||
exports.isVideoFile = isVideoFile;
|
||||
function formatImage(res) {
|
||||
return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { type: 'image', url: item.path, thumb: item.path })); });
|
||||
return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { type: 'image', url: item.tempFilePath || item.path, thumb: item.tempFilePath || item.path })); });
|
||||
}
|
||||
function formatVideo(res) {
|
||||
return [
|
||||
@@ -59,13 +59,27 @@ function chooseFile(_a) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
switch (accept) {
|
||||
case 'image':
|
||||
wx.chooseImage({
|
||||
count: multiple ? Math.min(maxCount, 9) : 1,
|
||||
sourceType: capture,
|
||||
sizeType: sizeType,
|
||||
success: function (res) { return resolve(formatImage(res)); },
|
||||
fail: reject,
|
||||
});
|
||||
if (utils_1.isPC) {
|
||||
wx.chooseImage({
|
||||
count: multiple ? Math.min(maxCount, 9) : 1,
|
||||
sourceType: capture,
|
||||
sizeType: sizeType,
|
||||
success: function (res) { return resolve(formatImage(res)); },
|
||||
fail: reject,
|
||||
});
|
||||
}
|
||||
else {
|
||||
wx.chooseMedia({
|
||||
count: multiple ? Math.min(maxCount, 9) : 1,
|
||||
mediaType: ['image'],
|
||||
sourceType: capture,
|
||||
maxDuration: maxDuration,
|
||||
sizeType: sizeType,
|
||||
camera: camera,
|
||||
success: function (res) { return resolve(formatImage(res)); },
|
||||
fail: reject,
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'media':
|
||||
wx.chooseMedia({
|
||||
|
||||
Reference in New Issue
Block a user