info
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uni_modules/uni-media-library/components/media-info/index"],{1095:function(e,n,t){"use strict";t.r(n);var r=t(1096),i=t(1098);for(var o in i)["default"].indexOf(o)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(o);t(1101);var u,c=t(46),a=Object(c["default"])(i["default"],r["render"],r["staticRenderFns"],!1,null,null,null,!1,r["components"],u);a.options.__file="uni_modules/uni-media-library/components/media-info/index.vue",n["default"]=a.exports},1096:function(e,n,t){"use strict";t.r(n);var r=t(1097);t.d(n,"render",(function(){return r["render"]})),t.d(n,"staticRenderFns",(function(){return r["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return r["recyclableRender"]})),t.d(n,"components",(function(){return r["components"]}))},1097:function(e,n,t){"use strict";var r;t.r(n),t.d(n,"render",(function(){return i})),t.d(n,"staticRenderFns",(function(){return u})),t.d(n,"recyclableRender",(function(){return o})),t.d(n,"components",(function(){return r}));try{r={uniIcons:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(t.bind(null,437))},uniEasyinput:function(){return t.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(t.bind(null,459))}}}catch(c){if(-1===c.message.indexOf("Cannot find module")||-1===c.message.indexOf(".vue"))throw c;console.error(c.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var i=function(){var e=this,n=e.$createElement,t=(e._self._c,e.showMediaInfoPanel?/^cloud:\/\//.test(e.currentMedia._src):null);e.$mp.data=Object.assign({},{$root:{g0:t}})},o=!1,u=[];i._withStripped=!0},1098:function(e,n,t){"use strict";t.r(n);var r=t(1099),i=t.n(r);for(var o in r)["default"].indexOf(o)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(o);n["default"]=i.a},1099:function(e,n,t){"use strict";(function(e,r){var i=t(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=i(t(11)),u=t(1100),c={name:"media-info",props:{currentMedia:{type:Object,default:function(){}}},data:function(){return{mediaInfo:{height:200}}},computed:{showMediaInfoPanel:function(){return this.currentMedia&&this.currentMedia._id},fileSize:function(){var e=this.currentMedia.size;return e?e<1024?e+" B":e<1048576?(e/1024).toFixed(2)+" KB":e<1073741824?(e/1024/1024).toFixed(2)+" MB":(e/1024/1024/1024).toFixed(2)+" GB":"0.00 MB"},fileType:function(){return this.currentMedia.fileType?this.currentMedia.fileType.toUpperCase():"-"},resolution:function(){var e={width:0,height:0};return this.currentMedia.resolution&&(e.width=this.currentMedia.resolution.width||0,e.height=this.currentMedia.resolution.height||0),e},mediaDuration:function(){if(this.currentMedia.duration){var e=this.currentMedia.duration,n=Math.floor(e/3600),t=Math.floor((e-3600*n)/60),r=Math.floor(e-3600*n-60*t);return"".concat(n,":").concat(t,":").concat(r)}return"-"},createDate:function(){if(!this.currentMedia.createDate)return"-";var e=new Date(this.currentMedia.createDate),n=e.getFullYear(),t=e.getMonth()+1,r=e.getDate(),i=e.getHours(),o=e.getMinutes(),u=e.getSeconds();return"".concat(n,"年").concat(t,"月").concat(r,"日 ").concat(i,":").concat(o,":").concat(u)},coverImage:function(){var e;return(0,u.generateCoverURL)(this.currentMedia.cover,null===(e=this.currentMedia.thumbRules)||void 0===e?void 0:e.detailCover)}},methods:{previewImage:function(){e.previewImage({current:this.currentMedia.src,urls:[this.currentMedia.src]})},onFiledChange:function(n){var t=r.database();t.collection("uni-media-library").doc(this.currentMedia._id).update((0,o.default)({},n,this.currentMedia[n]||"")).catch((function(n){console.log(n),e.showToast({title:"更新失败",icon:"none"})}))}}};n.default=c}).call(this,t(2)["default"],t(27)["uniCloud"])},1101:function(e,n,t){"use strict";t.r(n);var r=t(1102),i=t.n(r);for(var o in r)["default"].indexOf(o)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(o);n["default"]=i.a},1102:function(e,n,t){}}]);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-media-library/components/media-info/index.js.map
|
||||
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
||||
'uni_modules/uni-media-library/components/media-info/index-create-component',
|
||||
{
|
||||
'uni_modules/uni-media-library/components/media-info/index-create-component':(function(module, exports, __webpack_require__){
|
||||
__webpack_require__('2')['createComponent'](__webpack_require__(1095))
|
||||
})
|
||||
},
|
||||
[['uni_modules/uni-media-library/components/media-info/index-create-component']]
|
||||
]);
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"uni-icons": "/uni_modules/uni-icons/components/uni-icons/uni-icons",
|
||||
"uni-easyinput": "/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput"
|
||||
},
|
||||
"component": true
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
<view class="media-info-wrap"><block wx:if="{{showMediaInfoPanel}}"><block wx:if="{{currentMedia.src}}"><view class="preview"><block wx:if="{{currentMedia.type==='image'}}"><view class="image"><image class="img" src="{{coverImage}}" mode="aspectFill"></image></view></block><block wx:else><block wx:if="{{currentMedia.type==='video'}}"><view class="video"><video style="width:100%;height:100%;" src="{{currentMedia.src}}" poster="{{coverImage}}"></video></view></block></block><block wx:if="{{currentMedia.type==='image'}}"><view class="ops"><view data-event-opts="{{[['tap',[['previewImage',['$event']]]]]}}" class="op" bindtap="__e"><uni-icons vue-id="0a809c82-1" type="eye" size="16" color="#333" bind:__l="__l"></uni-icons></view></view></block></view></block><view class="info-item"><view class="label">URL</view><block wx:if="{{$root.g0}}"><view class="content">{{currentMedia._src}}</view></block><block wx:else><view class="content">{{currentMedia.src}}</view></block></view><view class="info-item"><view class="label">描述</view><view class="content"><uni-easyinput vue-id="0a809c82-2" placeholder="描述; 用于媒体资源搜索" value="{{currentMedia.description}}" data-event-opts="{{[['^blur',[['onFiledChange',['description']]]],['^clear',[['onFiledChange',['description']]]],['^input',[['__set_model',['$0','description','$event',[]],['currentMedia']]]]]}}" bind:blur="__e" bind:clear="__e" bind:input="__e" bind:__l="__l"></uni-easyinput></view></view><view class="info-item"><view class="label">替代文字</view><view class="content"><uni-easyinput vue-id="0a809c82-3" placeholder="替代文字,资源加载失败时展示" value="{{currentMedia.alt}}" data-event-opts="{{[['^blur',[['onFiledChange',['alt']]]],['^clear',[['onFiledChange',['alt']]]],['^input',[['__set_model',['$0','alt','$event',[]],['currentMedia']]]]]}}" bind:blur="__e" bind:clear="__e" bind:input="__e" bind:__l="__l"></uni-easyinput></view></view><view class="title">基本信息</view><view class="media-base-info"><view class="info-item"><view class="label">原始文件名</view><view class="content">{{currentMedia.originalName||'-'}}</view></view><view class="info-item"><view class="label">文件类型</view><view class="content">{{fileType}}</view></view><view class="info-item"><view class="label">文件大小</view><view class="content">{{fileSize||'-'}}</view></view><view class="info-item"><view class="label">分辨率</view><view class="content">{{resolution.width+"*"+resolution.height}}</view></view><block wx:if="{{currentMedia.type==='video'}}"><view class="info-item"><view class="label">时长</view><view class="content">{{mediaDuration}}</view></view></block><view class="info-item"><view class="label">上传者</view><view class="content">{{currentMedia.uploadUser&¤tMedia.uploadUser[0]&¤tMedia.uploadUser[0].nickname||'-'}}</view></view><view class="info-item" style="width:100%;"><view class="label">上传时间</view><view class="content">{{createDate}}</view></view></view></block></view>
|
||||
Vendored
+122
@@ -0,0 +1,122 @@
|
||||
@charset "UTF-8";
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.title {
|
||||
margin-top: 30px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.media-info-wrap {
|
||||
width: 320px;
|
||||
background-color: #fafafa;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
border-left: #f1f1f1 solid 1px;
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
}
|
||||
.preview {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.preview:hover .ops {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
.preview .ops {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
left: 0;
|
||||
right: 10px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity .3s;
|
||||
}
|
||||
.preview .ops .op {
|
||||
cursor: pointer;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 6px rgba(0, 0, 0, 0.06);
|
||||
transition: background-color .3s;
|
||||
}
|
||||
.preview .ops .op:hover {
|
||||
background: #eee;
|
||||
}
|
||||
.preview .img {
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.preview .video {
|
||||
height: 180px;
|
||||
}
|
||||
.preview .video uni-video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.info-item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.info-item .label {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
color: #999;
|
||||
}
|
||||
.info-item .content {
|
||||
margin-top: 10px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.media-base-info {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.media-base-info .info-item {
|
||||
width: 50%;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.media-base-info .info-item .content {
|
||||
margin-top: 5px;
|
||||
}
|
||||
@media screen and (max-width: 1360px) {
|
||||
.media-info-wrap {
|
||||
width: 280px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user