Commit 98ad91ff by cen

fix: 样式

1 parent 4489c0ab
...@@ -7,9 +7,12 @@ ...@@ -7,9 +7,12 @@
{{ title }} {{ title }}
</view> </view>
<web-view v-if="fileUrltype === 'html'" :src="url"></web-view> <web-view v-if="fileUrltype === 'html'" :src="url"></web-view>
<view v-else> <view v-else-if="fileUrltype !== 'pdf'">
<lk-preview-office :url="url" :fileType="fileType"></lk-preview-office> <lk-preview-office :url="url" :fileType="fileType"></lk-preview-office>
</view> </view>
<view v-else>
<lk-preview-office :url="url" fileType="pdf"></lk-preview-office>
</view>
</view> </view>
</template> </template>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<image :src="media.url + videoProcess" mode="aspectFill" @click.stop="previewMedia(media, 1)"></image> <image :src="media.url + videoProcess" mode="aspectFill" @click.stop="previewMedia(media, 1)"></image>
<view class="video-play-icon"> <view class="video-play-icon">
<view class="sprites-icon icon-play"></view> <view class="sprite-icon icon-play"></view>
</view> </view>
</view> </view>
<view class="delete-icon" @click.stop="deleteMedia(field.key, index)"> <view class="delete-icon" @click.stop="deleteMedia(field.key, index)">
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
uni.hideLoading() uni.hideLoading()
const fileExtension = res.tempFiles[0]?.name ? res.tempFiles[0]?.name.split('.').pop().toLowerCase() : res.tempFiles[0]?.path.split('.').pop().toLowerCase() const fileExtension = res.tempFiles[0]?.name ? res.tempFiles[0]?.name.split('.').pop().toLowerCase() : res.tempFiles[0]?.path.split('.').pop().toLowerCase()
this.addMedia(field, { url, fileFormat: fileExtension, type: 'image', name: field.label }) this.addMedia(field, { url, fileFormat: fileExtension || 'png', type: 'image', name: field.label })
} }
} catch (error) { } catch (error) {
console.log('上传图片失败', error) console.log('上传图片失败', error)
...@@ -158,7 +158,7 @@ export default { ...@@ -158,7 +158,7 @@ export default {
console.log('上传图片成功', url) console.log('上传图片成功', url)
uni.hideLoading() uni.hideLoading()
const fileExtension = res.tempFiles[0]?.name ? res.tempFiles[0]?.name.split('.').pop().toLowerCase() : res.tempFiles[0]?.path.split('.').pop().toLowerCase() const fileExtension = res.tempFiles[0]?.name ? res.tempFiles[0]?.name.split('.').pop().toLowerCase() : res.tempFiles[0]?.path.split('.').pop().toLowerCase()
this.addMedia(field, { url, fileFormat: fileExtension, type: 'image', fileFormat: fileExtension, name: field.label }) this.addMedia(field, { url, fileFormat: fileExtension, type: 'image', fileFormat: fileExtension || 'png', name: field.label })
} }
} catch (error) { } catch (error) {
console.log('上传图片失败', error) console.log('上传图片失败', error)
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
this.addMedia(field, { this.addMedia(field, {
url, url,
type: 'video', type: 'video',
fileFormat: fileExtension, fileFormat: fileExtension || 'mp4',
name: field.label, name: field.label,
duration: res.duration, duration: res.duration,
size: res.size size: res.size
...@@ -231,7 +231,7 @@ export default { ...@@ -231,7 +231,7 @@ export default {
name: field.label, name: field.label,
duration: res.duration, duration: res.duration,
size: res.size, size: res.size,
fileFormat: fileExtension fileFormat: fileExtension || 'mp4'
}) })
uni.hideLoading() uni.hideLoading()
} catch (error) { } catch (error) {
...@@ -252,6 +252,7 @@ export default { ...@@ -252,6 +252,7 @@ export default {
// 获取指定字段的媒体数组 // 获取指定字段的媒体数组
getMedia(field) { getMedia(field) {
console.log(this.mediaData[field.key])
// 确保返回的是数组 // 确保返回的是数组
return Array.isArray(this.mediaData[field.key]) ? this.mediaData[field.key] : [] return Array.isArray(this.mediaData[field.key]) ? this.mediaData[field.key] : []
}, },
...@@ -475,5 +476,6 @@ export default { ...@@ -475,5 +476,6 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 2;
} }
</style> </style>
...@@ -478,7 +478,7 @@ export default { ...@@ -478,7 +478,7 @@ export default {
}, },
// 预览PDF // 预览PDF
previewPdf(field) { previewPdf(field) {
const url = `/pages/evaluationForm/components/pdfPreView?fileUrl=${this.pdfUrl}&title=pdf` const url = `/pages/evaluationForm/components/pdfPreView?fileUrl=${this.pdfUrl}&title=pdf&fileUrltype=pdf`
uni.navigateTo({ uni.navigateTo({
url: `${url}` url: `${url}`
}) })
......
...@@ -415,7 +415,7 @@ export default { ...@@ -415,7 +415,7 @@ export default {
carLicenseItems: [ carLicenseItems: [
{ label: '钥匙数', key: 'carLicense.keyCount' }, { label: '钥匙数', key: 'carLicense.keyCount' },
{ label: '过户次数', key: 'carLicense.transferCount' }, { label: '过户次数', key: 'carLicense.transferCount' },
{ label: '交强险到期', key: 'carLicense.forceExpirationDate' }, { label: '交强险到期', key: 'carLicense.compulsoryInsuranceExpiry' },
{ label: '年审到期', key: 'carLicense.annualInspectionExpiry' }, { label: '年审到期', key: 'carLicense.annualInspectionExpiry' },
{ label: '商业险到期', key: 'carLicense.commercialInsuranceExpiry' }, { label: '商业险到期', key: 'carLicense.commercialInsuranceExpiry' },
{ label: '原车主名称', key: 'carLicense.previousOwnerName' }, { label: '原车主名称', key: 'carLicense.previousOwnerName' },
......
...@@ -136,7 +136,8 @@ ...@@ -136,7 +136,8 @@
<checkbox class="sign-checkbox" style="transform: scale(0.7)" activeBackgroundColor="#4673FF" iconColor="#fff" :value="item.value" :checked="item.checked" :disabled="item.disabled" /> <checkbox class="sign-checkbox" style="transform: scale(0.7)" activeBackgroundColor="#4673FF" iconColor="#fff" :value="item.value" :checked="item.checked" :disabled="item.disabled" />
</view> </view>
<view class="checkbox-name">{{ item.name }}</view> <view class="checkbox-name">{{ item.name }}</view>
<input class="checkbox-input" v-if="item.isShowInput" v-model="formData[item.inputValue]" placeholder="请输入" type="number" maxlength="1" /> <input class="checkbox-input" v-if="item.isShowInput && item.key != 'other'" v-model="formData[item.inputValue]" placeholder="请输入" type="number" maxlength="1" />
<input class="checkbox-input" v-if="item.isShowInput && item.key == 'other'" v-model="formData[item.inputValue]" placeholder="请输入" />
</label> </label>
</checkbox-group> </checkbox-group>
</template> </template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!