修改上传图片显示
parent
b7bc45a539
commit
e51a4e65d3
|
|
@ -2,7 +2,7 @@
|
||||||
<!-- 视频 -->
|
<!-- 视频 -->
|
||||||
<view>
|
<view>
|
||||||
<template v-if="file.length > 0">
|
<template v-if="file.length > 0">
|
||||||
<!-- <view class="flex-row gap-20 align-c">
|
<view class="flex-row gap-20 align-c">
|
||||||
<view class="file-title text-line-1" :style="propStyle + 'width:auto;height:100%'">
|
<view class="file-title text-line-1" :style="propStyle + 'width:auto;height:100%'">
|
||||||
{{ file[0].original || '' }}
|
{{ file[0].original || '' }}
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
<iconfont name="icon-download-btn" size="20rpx" />
|
<iconfont name="icon-download-btn" size="20rpx" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="file-title" :style="propStyle + 'width:100%;height:100%'">暂无文件</view>
|
<view class="file-title" :style="propStyle + 'width:100%;height:100%'">暂无文件</view>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<!-- 左右模式 -->
|
<!-- 左右模式 -->
|
||||||
<!-- <template v-if="flex_direction == 'row'"> -->
|
<!-- <template v-if="flex_direction == 'row'"> -->
|
||||||
<view :class="'wh-auto ht-auto ' + (flex_direction == 'row' ? 'flex-row align-b gap-10' : 'flex-col gap-10')">
|
<view :class="'wh-auto ht-auto ' + (flex_direction == 'row' ? 'flex-row align-b gap-10' : 'flex-col gap-10')">
|
||||||
<view v-if="!['rich-text', 'auxiliary-line'].includes(item.key)" class="field-label flex-row align-c gap-10" :style="field_label_style">
|
<view v-if="!['rich-text', 'auxiliary-line', 'upload-attachments'].includes(item.key)" class="field-label flex-row align-c gap-10" :style="field_label_style">
|
||||||
<view class="flex-row align-c" :style="title_style">{{ item.com_data.title }}<view v-if="item.com_data.is_required == '1'" class="required">*</view></view>
|
<view class="flex-row align-c" :style="title_style">{{ item.com_data.title }}<view v-if="item.com_data.is_required == '1'" class="required">*</view></view>
|
||||||
<view v-if="item.com_data.common_config.help_is_show == '1' && !isEmpty(item.com_data.common_config.help_explain)" :data-value="item.com_data.common_config.help_explain" @tap="help_icon_event">
|
<view v-if="item.com_data.common_config.help_is_show == '1' && !isEmpty(item.com_data.common_config.help_explain)" :data-value="item.com_data.common_config.help_explain" @tap="help_icon_event">
|
||||||
<iconfont name="icon-miaosha-hdgz" :size="help_icon_style" color="#999"></iconfont>
|
<iconfont name="icon-miaosha-hdgz" :size="help_icon_style" color="#999"></iconfont>
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,10 @@
|
||||||
type: [Number, String, Array, Object],
|
type: [Number, String, Array, Object],
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
propKey: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -128,7 +132,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
propKey(val) {
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
created: function () {},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
// 将80%的宽度分成16份
|
// 将80%的宽度分成16份
|
||||||
const block = (sys_width * 0.8) / 16;
|
const block = (sys_width * 0.8) / 16;
|
||||||
this.setData({
|
this.setData({
|
||||||
|
|
@ -137,9 +152,6 @@
|
||||||
form_images_list: this.propData,
|
form_images_list: this.propData,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
created: function () {},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
// 采用递归的方式上传多张
|
// 采用递归的方式上传多张
|
||||||
upload_one_by_one(img_paths, success, fail, count, length, action) {
|
upload_one_by_one(img_paths, success, fail, count, length, action) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
@ -190,9 +202,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
message(e) {
|
|
||||||
console.log(e);
|
|
||||||
},
|
|
||||||
// 文件上传
|
// 文件上传
|
||||||
file_upload_event(e) {
|
file_upload_event(e) {
|
||||||
if (this.propType == 'img') {
|
if (this.propType == 'img') {
|
||||||
|
|
@ -253,6 +262,8 @@
|
||||||
|
|
||||||
// 图片删除
|
// 图片删除
|
||||||
upload_delete_event(e) {
|
upload_delete_event(e) {
|
||||||
|
console.log('删除');
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: this.$t('common.warm_tips'),
|
title: this.$t('common.warm_tips'),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<uploads :propType="propType" :propData="form_value" :propMaxNum="max_num" :propPathType="pathType" :propBorderStyle="border_style" @call-back="call_back"></uploads>
|
<uploads :propKey="propKey" :propType="propType" :propData="form_value" :propMaxNum="max_num" :propPathType="pathType" :propBorderStyle="border_style" @call-back="call_back"></uploads>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
propKey(val) {
|
propKey(val) {
|
||||||
// 初始化
|
// 初始化
|
||||||
this.init();
|
this.init();
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
|
|
|
||||||
|
|
@ -56,15 +56,15 @@
|
||||||
this.setData({
|
this.setData({
|
||||||
params: app.globalData.launch_params_handle(params),
|
params: app.globalData.launch_params_handle(params),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 加载数据
|
||||||
|
this.get_data();
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
// 调用公共事件方法
|
// 调用公共事件方法
|
||||||
app.globalData.page_event_onshow_handle();
|
app.globalData.page_event_onshow_handle();
|
||||||
|
|
||||||
// 加载数据
|
|
||||||
this.get_data();
|
|
||||||
|
|
||||||
// 公共onshow事件
|
// 公共onshow事件
|
||||||
this.init_common();
|
this.init_common();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue