新增上传文件处理
parent
0960667c08
commit
3f1508c237
|
|
@ -1420,4 +1420,8 @@ button[disabled].bg-grey {
|
|||
}
|
||||
.indicator_about_location .dot-item {
|
||||
margin: 0 6rpx;
|
||||
}
|
||||
|
||||
.popup-bottom .vue-ref {
|
||||
background: #fff !important;
|
||||
}
|
||||
18
package.json
18
package.json
|
|
@ -1,15 +1,5 @@
|
|||
{
|
||||
"id": "my-datetime",
|
||||
"name": "日期-时间选择器",
|
||||
"version": "1.0.1",
|
||||
"description": "日期选择器、时间选择器、年月选择器、日期时间选择器",
|
||||
"keywords": [
|
||||
"日期选择器、年月选择器、时间选择器、日期时间选择器"
|
||||
],
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"前端组件",
|
||||
"通用组件"
|
||||
]
|
||||
}
|
||||
}
|
||||
"dependencies": {
|
||||
"jweixin-module": "^1.6.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
10
pages.json
10
pages.json
|
|
@ -1945,5 +1945,15 @@
|
|||
"pagePath": "pages/user/user"
|
||||
}
|
||||
]
|
||||
},
|
||||
"condition" : { //模式配置,仅开发期间生效
|
||||
"current": 0, //当前激活的模式(list 的索引项)
|
||||
"list": [
|
||||
{
|
||||
"name": "", //模式名称
|
||||
"path": "", //启动页面,必选
|
||||
"query": "" //启动参数,在页面的onLoad函数里面得到
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -2,21 +2,23 @@
|
|||
<!-- 视频 -->
|
||||
<view>
|
||||
<template v-if="file.length > 0">
|
||||
<view class="flex-row gap-20 align-c">
|
||||
<span class="file-title text-line-1" :style="propStyle + 'width:auto;height:100%'">{{ file[0].original || '' }}</span>
|
||||
<!-- <view class="flex-row gap-20 align-c">
|
||||
<view class="file-title text-line-1" :style="propStyle + 'width:auto;height:100%'">
|
||||
{{ file[0].original || '' }}
|
||||
</view>
|
||||
<view class="oprate cr-blue">
|
||||
<view class="icon" :data-url="file[0].url" @tap="copy">
|
||||
<iconfont name="icon-copy" size="20rpx" />
|
||||
</view>
|
||||
<span class="divider"></span>
|
||||
<view class="divider"></view>
|
||||
<view class="icon" :data-name="file[0].original" :data-url="file[0].url" @tap="download">
|
||||
<iconfont name="icon-download-btn" size="20rpx" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="file-title" :style="propStyle + 'width:100%;height:100%'">暂无文件</span>
|
||||
<view class="file-title" :style="propStyle + 'width:100%;height:100%'">暂无文件</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -74,7 +76,7 @@
|
|||
},
|
||||
// 复制到剪切板
|
||||
copy(e) {
|
||||
const { url, name } = e.currentTarget.dataset;
|
||||
const url = e.currentTarget.dataset.url;
|
||||
/* 创建一个临时的textarea元素 */
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = url;
|
||||
|
|
@ -100,7 +102,7 @@
|
|||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
@ -123,12 +125,12 @@
|
|||
border-radius: 30rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 2rpx 8rpx 0px rgba(0,0,0,0.1);
|
||||
.icon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
padding: 12rpx 24rpx;
|
||||
}
|
||||
}
|
||||
.oprate .icon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
padding: 12rpx 24rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,15 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- 上传文件仅支持H5、微信小程序、QQ小程序 -->
|
||||
<!-- #ifdef H5 || MP-WEIXIN || MP-QQ -->
|
||||
<view v-if="item.key == 'upload-attachments'" 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 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>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="flex-1 wh-auto flex-col gap-5">
|
||||
<view v-if="['single-text', 'radio-btns', 'select'].includes(item.key) && item.com_data.type == 'single-text'" :style="item.com_data.common_style">
|
||||
<component-input :propValue="item.com_data" :propKey="propKey" :propDataIndex="index" :propStyle="component_style" @dataCheck="data_check" @dataChange="data_change"></component-input>
|
||||
|
|
@ -82,6 +91,14 @@
|
|||
<view v-else-if="item.key == 'auxiliary-line'">
|
||||
<component-auxiliary-line :propValue="item.com_data" :propKey="propKey" :propDataIndex="index" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction"></component-auxiliary-line>
|
||||
</view>
|
||||
<view v-else-if="['upload-img', 'upload-video'].includes(item.key)">
|
||||
<component-upload :propValue="item.com_data" :propType="item.key == 'upload-img' ? 'img' : ( item.key == 'upload-video' ? 'video' : 'file')" :propKey="propKey" :propDataId="propDataId" :propDataIndex="index" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataChange="data_change"></component-upload>
|
||||
</view>
|
||||
<!-- #ifdef H5 || MP-WEIXIN || MP-QQ -->
|
||||
<view v-else-if="item.key == 'upload-attachments'">
|
||||
<component-upload :propValue="item.com_data" :propType="item.key == 'upload-img' ? 'img' : ( item.key == 'upload-video' ? 'video' : 'file')" :propKey="propKey" :propDataId="propDataId" :propDataIndex="index" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataChange="data_change"></component-upload>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS || H5 || MP-WEIXIN || MP-BAIDU -->
|
||||
<view v-else-if="item.key == 'rich-text'" :style="item.com_data.common_style + 'padding:0;'">
|
||||
<component-rich-text :propValue="item.com_data" :propKey="propKey" :propDataIndex="index" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataChange="data_change"></component-rich-text>
|
||||
|
|
@ -135,6 +152,7 @@ import componentText from '@/pages/form-input/components/form-input/text.vue';
|
|||
import componentAttachments from '@/pages/form-input/components/form-input/attachments.vue';
|
||||
import componentAuxiliaryLine from '@/pages/form-input/components/form-input/auxiliary-line.vue';
|
||||
import componentRichText from '@/pages/form-input/components/form-input/rich-text.vue';
|
||||
import componentUpload from '@/pages/form-input/components/form-input/upload.vue';
|
||||
import componentRegionPicker from '@/pages/common/components/region-picker/region-picker';
|
||||
export default {
|
||||
name: 'formInput',
|
||||
|
|
@ -158,7 +176,8 @@ export default {
|
|||
componentText,
|
||||
componentAttachments,
|
||||
componentAuxiliaryLine,
|
||||
componentRichText
|
||||
componentRichText,
|
||||
componentUpload
|
||||
},
|
||||
props: {
|
||||
propValue: {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="flex-row align-c wh-auto gap-10" :style="propStyle">
|
||||
<iconfont :name="'icon-' + com_data.icon_name" size="24rpx" color="#666" propContainerDisplay="flex" ></iconfont>
|
||||
<input :value="form_value" class="uni-input flex-1" :style="propStyle" :password="is_show" :type="is_show ? '' : 'text'" :placeholder="placeholder" @focus="focus_input" @blur="data_check" @input="input_value_event" />
|
||||
<input :value="form_value" class="uni-input flex-1" :style="propStyle" :password="is_show" :type="is_show ? '' : 'text'" :placeholder="placeholder" @blur="data_check" @input="input_value_event" />
|
||||
<view @tap="eye_change">
|
||||
<iconfont :name="'icon-' + (is_show ? 'eye' : 'eye-close')" size="24rpx" color="#666" propContainerDisplay="flex"></iconfont>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</template>
|
||||
<template v-else>
|
||||
<template v-if="index + 1 == new_selected">
|
||||
<span class="rate-divide-name nowrap" :data-index="index + 1" :style="`color:${ com_data.select_color };`" @tap="icon_click">{{ index + 1 }}分</span>
|
||||
<span class="rate-divide-name nowrap" :data-index="index + 1" :style="'color:' + com_data.select_color" @tap="icon_click">{{ index + 1 }}分</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="rate-divide-name nowrap" :data-index="index + 1" @tap="icon_click">{{ index + 1 }}分</span>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</template>
|
||||
</view>
|
||||
<!-- 弹窗 -->
|
||||
<uni-popup ref="selectPopup" type="bottom" @onclose="quick_close_event">
|
||||
<uni-popup ref="selectPopup" type="bottom" class="popup-bottom" @onclose="quick_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white popup-content flex-col">
|
||||
<!-- 头部的样式 -->
|
||||
<view class="flex-row jc-sb margin-bottom">
|
||||
|
|
@ -298,6 +298,9 @@
|
|||
::v-deep .uni-radio-input {
|
||||
transform: scale(0.7);
|
||||
}
|
||||
::v-deep .vue-ref {
|
||||
background: #fff !important;
|
||||
}
|
||||
.add-option {
|
||||
height: 80rpx;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</template>
|
||||
</view>
|
||||
<!-- 弹窗 -->
|
||||
<uni-popup ref="selectPopup" type="bottom" @onclose="quick_close_event">
|
||||
<uni-popup ref="selectPopup" type="bottom" class="popup-bottom" @onclose="quick_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white popup-content flex-col gap-10">
|
||||
<!-- 头部的样式 -->
|
||||
<view class="flex-row jc-sb">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<video :src="video" class="wh-auto ht-auto" :poster="video_img" objectFit="cover" style="object-fit: cover"></video>
|
||||
<!-- #endif-->
|
||||
<!-- #ifdef APP -->
|
||||
<video-player ref="domVideoPlayer" :poster="video_img" :src="video" objectFit="cover" controls />
|
||||
<video-player :poster="video_img" :src="video" objectFit="cover" controls />
|
||||
<!-- #endif-->
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue