zlpt_app/pages/offLoan/offLoan.vue

152 lines
3.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<view
class="single-loans"
>
<view class="upper-infos">
<view class="info-lef">
<image src="/static/bg2.jpg" mode=""></image>
</view>
<view class="info-rig">
<view class="rig-top">522单杠震动压路机</view>
<view class="rig-others">订单编号22334455</view>
<view class="rig-others">订单创建日期2023.12.13 09:35:03</view>
</view>
</view>
<view class="lower-cash">
<h5>实付款5566</h5>
<h5>供应商安徽博诺思信息科技有限公司</h5>
</view>
</view>
<view class="loan-material">
<h4 style="margin-bottom: 20rpx;">退租材料</h4>
<uni-forms ref="offLoanForm" :rules="rules" :modelValue="offLoanData" label-position="top">
<uni-forms-item required name="devicePic" label="上传设备图片" label-width="150">
<uni-file-picker limit="1" v-model="offLoanData.devicePic" @select="uploadPhoto"></uni-file-picker>
</uni-forms-item>
<uni-forms-item required name="deviceVideo" label="上传设备运行视频" label-width="150">
<uni-file-picker limit="1" file-mediatype="video" v-model="offLoanData.deviceVideo" @select="uploadVideo"></uni-file-picker>
</uni-forms-item>
<button @click="subForm">提交</button>
</uni-forms>
</view>
</view>
</template>
<script>
export default {
data() {
return {
offLoanData: {
devicePic: [],
deviceVideo: []
},
rules: {
devicePic: {
rules: [
{
required: true,
errorMessage: '请上传设备图片!'
}
]
},
deviceVideo: {
rules: [
{
required: true,
errorMessage: '请上传设备运行视频!'
}
]
}
}
}
},
methods: {
subForm () {
console.log(this.offLoanData);
this.$refs.offLoanForm.validate().then(formData => {
console.log(formData);
})
},
uploadPhoto (e) {
console.log(e);
this.offLoanData.devicePic = e.tempFilePaths
},
uploadVideo (e) {
console.log(e);
this.offLoanData.deviceVideo = e.tempFilePaths
}
},
onLoad(params) {
console.log(params);
}
}
</script>
<style lang="scss">
body{
background-color: #F9F9F9;
}
.single-loans, .loan-material{
width: 90%;
margin: 20rpx auto;
background-color: #fff;
box-sizing: border-box;
padding: 30rpx;
border-radius: 15rpx;
}
.single-loans{
display: flex;
flex-direction: column;
.upper-infos{
width: 100%;
box-sizing: border-box;
padding: 0 0 20rpx 0;
display: flex;
border-bottom: 1px solid #F1F1F1;
.info-lef{
width: 25%;
height: 10.5vh;
border-radius: 15rpx;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
}
.info-rig{
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
box-sizing: border-box;
padding: 15rpx;
view{
width: 100%
}
.rig-top{
font-size: 18px;
font-weight: bold;
margin-bottom: 15rpx;
}
.rig-others{
font-size: 12px;
color: #7A7A7A;
}
}
}
.lower-cash{
width: 100%;
display: flex;
flex-direction: column;
box-sizing: border-box;
padding: 20rpx 0 0 0;
h5{
font-weight: normal;
margin-bottom: 8rpx;
}
}
}
</style>