Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxh-order-h5
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李俊赕
wxh-order-h5
Commits
f048a79b
Commit
f048a79b
authored
Mar 09, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完工配置页面
parent
e1a2a29d
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
353 additions
and
337 deletions
+353
-337
service.js
web/src/api/renbao/order/service.js
+19
-0
XhFiles.vue
web/src/views/h5/renbao/order/components/XhFiles.vue
+163
-0
index.js
web/src/views/h5/renbao/order/components/index.js
+3
-0
service.vue
web/src/views/h5/renbao/order/service.vue
+168
-0
service.vue
web/src/views/pc/renbao/order/service.vue
+0
-337
No files found.
web/src/api/renbao/order/service.js
0 → 100644
View file @
f048a79b
import
{
request
}
from
'@/utils/request'
// import { getToken } from '@/utils/auth'
// 提交文件信息
export
function
submitInfo
(
query
)
{
return
request
({
url
:
'/wxh-cloud-rest/rest/thirdparty/haier/getAppreciationService'
,
method
:
'get'
,
headers
:
{
'Content-Type'
:
'application/form-data'
},
data
:
query
})
}
// export function getVap(query) {
// return request({
// url: '/wxh-cloud-rest/rest/thirdparty/haier/getVap',
// method: 'get',
// params: query
// })
// }
web/src/views/h5/renbao/order/components/XhFiles.vue
0 → 100644
View file @
f048a79b
<
template
>
<div
class=
"input-item"
>
<div
class=
"label"
>
{{
item
.
label
}}
<span
class=
"required"
>
*
</span></div>
<!--
<div
class=
"required"
>
*
</div>
-->
<div
class=
"input-box img-box"
>
<div
:key=
"index"
class=
"img-item"
v-for=
"(item, index) in imgList"
>
<img
:src=
"item.src"
/>
<div
class=
"close"
@
click=
"deleteImg(index)"
>
x
</div>
</div>
<img-uploader
:empty-img-src=
"require('@/assets/img/icon-img-empty.png')"
:icon-src=
"require('@/assets/img/add.png')"
@
update=
"addFile"
></img-uploader>
</div>
</div>
</
template
>
<
script
>
import
ImgUploader
from
'@/components/uploader/img-uploader'
// import {
// uploadFile
// } from '@/api/shzhida/order/service'
import
{
Toast
}
from
'mint-ui'
export
default
{
name
:
'XhFiles'
,
components
:
{
'img-uploader'
:
ImgUploader
},
data
()
{
return
{
imgList
:
[]
}
},
props
:
{
item
:
{
type
:
Object
,
default
()
{
return
[
{}
]
}
}
},
computed
:
{
},
watch
:
{
// 'item.value': function() {
// this.item.value.map(item => {
// this.imgList.push({ src: item })
// })
// }
},
mounted
()
{},
methods
:
{
// async uploadFile(item) {
// console.log(item)
// const fromData = new FormData()
// fromData.append('file', item.file)
// const result = await uploadFile(this.orderId, fromData)
// if (result.data.code === 200) {
// if (this.item.value) {
// this.item.value.push(result.data.data)
// } else {
// this.item.value = [result.data.data]
// }
// } else {
// if (result.data.message) {
// Toast({
// message: result.data.message,
// duration: 3000
// })
// }
// }
// },
checkSize
(
file
)
{
const
size
=
1
if
(
file
.
size
>
size
*
1024
*
1024
)
{
Toast
({
message
:
'图片大小不能超过'
+
size
+
'M'
,
icon
:
'none'
})
return
false
}
return
true
},
addFile
(
item
)
{
console
.
log
(
item
,
'item'
)
if
(
!
this
.
checkSize
(
item
.
file
))
{
return
}
this
.
imgList
.
push
(
item
)
this
.
item
.
value
=
this
.
imgList
// this.uploadFile(item)
},
deleteImg
(
index
)
{
this
.
imgList
.
splice
(
index
,
1
)
this
.
item
.
value
=
this
.
imgList
}
}
}
</
script
>
<
style
lang=
"less"
scoped
>
@import '~@/assets/css/func.less';
.input-item{
display: flex;
// display: block!important;
}
.label{
min-width:px2rem(160);
text-align: left;
}
.input-box{
// margin-left:px2rem(20);
flex:1;
// width:100%;
// padding:px2rem(20) 0 0 px2rem(20);
// min-height: px2rem(212);
// background: #f3f3f3;
display: flex;
}
.img-box{
flex-wrap: wrap;
.img-item{
position: relative;
margin-right:px2rem(20);
margin-bottom:px2rem(20);
width:px2rem(160);
height:px2rem(160);
img{
display: block;
width:100%;height:100%;
}
}
}
.close{
position: absolute;
right:0;
top:0;
width:px2rem(40);
height:px2rem(40);
padding:0 px2rem(10);
background: rgba(0,0,0,0.5);
line-height: px2rem(40);
font-size: px2rem(28);
color:#fff;
text-align: center;
img{
display: block;
width:100%;
height:100%;
}
}
.upload-box{
position: relative;
}
</
style
>
web/src/views/h5/renbao/order/components/index.js
0 → 100644
View file @
f048a79b
export
{
default
as
XhFiles
}
from
'./XhFiles'
web/src/views/h5/renbao/order/service.vue
0 → 100644
View file @
f048a79b
<
template
>
<div
class=
"about"
>
<div
class=
"form-item"
v-for=
"(item,index) in formList"
:key=
"index"
>
<XhFiles
:item=
"item"
v-if=
"item.inputType==='file'"
/>
</div>
<div
class=
"btn-group"
>
<mt-button
type=
"primary"
@
click=
"submitInfo"
>
提交信息
</mt-button>
</div>
</div>
</
template
>
<
script
>
import
{
submitInfo
}
from
'@/api/renbao/order/service.js'
import
{
XhFiles
}
from
'./components/index.js'
import
{
Toast
,
Indicator
}
from
'mint-ui'
export
default
{
name
:
'RenbaoOrderService'
,
components
:
{
XhFiles
},
data
()
{
return
{
formList
:
[{
fieldName
:
'chargerPointType0'
,
label
:
'完工前照片'
,
value
:
[],
inputType
:
'file'
,
required
:
true
},
{
fieldName
:
'chargerPointType1'
,
label
:
'完工过程照片'
,
value
:
[],
inputType
:
'file'
,
required
:
true
},
{
fieldName
:
'chargerPointType2'
,
label
:
'完成照片'
,
value
:
[],
inputType
:
'file'
,
required
:
true
},
{
fieldName
:
'chargerPointType3'
,
label
:
'验收照片'
,
value
:
[],
inputType
:
'file'
,
required
:
true
}],
form
:
{},
loading
:
true
}
},
watch
:
{},
computed
:
{
},
created
()
{
this
.
scrollY
=
0
// if (this.$route.query.orderId) {
// this.getOrderId(this.$route.query.orderId)
// }
},
mounted
()
{
},
methods
:
{
checkInfo
()
{
const
data
=
{}
const
formList
=
this
.
formList
let
flag
=
true
let
txt
=
''
for
(
let
i
=
0
;
i
<
formList
.
length
;
i
++
)
{
const
item
=
formList
[
i
]
if
(
item
.
required
&&
item
.
value
.
length
<
1
)
{
flag
=
false
txt
=
'请上传'
+
item
.
label
break
}
}
Toast
({
message
:
txt
,
icon
:
'none'
,
duration
:
3000
})
return
flag
},
submitInfo
()
{
const
data
=
{}
this
.
formList
.
map
(
item
=>
{
data
[
item
.
fieldName
]
=
item
.
value
})
if
(
!
this
.
checkInfo
())
{
return
}
Indicator
.
open
(
'Loading...'
)
submitInfo
(
data
).
then
((
result
)
=>
{
Indicator
.
close
()
if
(
result
.
data
.
code
!==
200
)
{
Toast
({
message
:
result
.
data
.
message
||
'请求错误'
,
icon
:
'none'
,
duration
:
3000
})
return
false
}
}).
catch
((
error
)
=>
{
console
.
log
(
error
)
Toast
({
message
:
'服务异常'
,
icon
:
'none'
,
duration
:
3000
})
})
console
.
log
(
data
,
'data'
)
},
handleAvatarSuccess
(
res
,
file
)
{
this
.
imageUrl
=
URL
.
createObjectURL
(
file
.
raw
)
},
beforeAvatarUpload
(
file
)
{
const
isJPG
=
file
.
type
===
'image/jpeg'
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
if
(
!
isJPG
)
{
this
.
$message
.
error
(
'上传头像图片只能是 JPG 格式!'
)
}
if
(
!
isLt2M
)
{
this
.
$message
.
error
(
'上传头像图片大小不能超过 2MB!'
)
}
return
isJPG
&&
isLt2M
}
}
}
</
script
>
<
style
lang=
"less"
scoped
>
@import '~@/assets/css/func.less';
.form-box{
padding:px2rem(20) 0;
}
.form-item{
padding:px2rem(20) px2rem(20);
}
/deep/ .input-item {
.required{
padding:0 px2rem(5);
line-height:px2rem(40);
font-size: px2rem(20);
color:red;
}
}
.btn-group{
position: fixed;
left:0;
right:0;
bottom:0;
display: flex;
padding:px2rem(30) px2rem(30);
box-shadow: 0 px2rem(-1) px2rem(5) rgba(0,0,0,0.05);
background: #fff;
.mint-button{
flex:1;
margin-right:px2rem(20);
font-size:px2rem(28);
&:last-child{margin-right: 0;}
}
}
</
style
>
web/src/views/pc/renbao/order/service.vue
deleted
100644 → 0
View file @
e1a2a29d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment