Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
李俊赕
self-support
Commits
2c8aba78
Commit
2c8aba78
authored
Apr 19, 2021
by
Facius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.banshouhui.com/lijundan/self-support
parents
26039978
dcbabe22
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
740 additions
and
597 deletions
+740
-597
App.vue
src/App.vue
+4
-3
classify.data.js
src/common/classify.data.js
+3
-1
XhFiles.vue
src/components/createCom/XhFiles.vue
+102
-0
XhRadio - 副本.vue
src/components/createCom/XhRadio - 副本.vue
+0
-45
index.js
src/components/upload/index.js
+17
-4
complete.vue
src/pages/order/complete.vue
+6
-1
file.vue
src/pages/settle/file.vue
+605
-540
index.js
src/plugins/uploader/index.js
+2
-2
upload.js
src/plugins/uploader/request/upload/upload.js
+1
-1
No files found.
src/App.vue
View file @
2c8aba78
...
@@ -36,6 +36,9 @@
...
@@ -36,6 +36,9 @@
// 授权用户信息
// 授权用户信息
authUserInfo
:
''
,
authUserInfo
:
''
,
// 用户入驻信息
settledInfo
:
{},
},
},
onLaunch
:
function
()
{
onLaunch
:
function
()
{
// 应用初始化(全局只触发一次)
// 应用初始化(全局只触发一次)
...
@@ -46,9 +49,7 @@
...
@@ -46,9 +49,7 @@
},
},
onShow
:
function
()
{
onShow
:
function
()
{
// 应用启动,或从后台进入前台显示
// 应用启动,或从后台进入前台显示
if
(
!
this
.
globalData
.
token
)
{
this
.
autoLogin
()
this
.
autoLogin
()
}
},
},
onHide
:
function
()
{
onHide
:
function
()
{
// 应用从前台进入后台
// 应用从前台进入后台
...
...
src/common/classify.data.js
View file @
2c8aba78
...
@@ -38,7 +38,9 @@ export default [{
...
@@ -38,7 +38,9 @@ export default [{
"cat"
:
10
"cat"
:
10
},
},
{
{
"fieldsTitle"
:
"短裙"
,
"fieldsTitle"
:
"文件选择"
,
"fieldsName"
:
"file"
,
"fieldsType"
:
"file"
,
"key"
:
"短裙"
,
"key"
:
"短裙"
,
"icon"
:
"https://cdn.uviewui.com/uview/common/classify/1/5.jpg"
,
"icon"
:
"https://cdn.uviewui.com/uview/common/classify/1/5.jpg"
,
"cat"
:
10
"cat"
:
10
...
...
src/components/createCom/XhFiles.vue
0 → 100644
View file @
2c8aba78
<
template
>
<view
class=
"file-box"
>
<view
class=
"u-flex"
@
click=
"selectUpload"
>
<view
class=
"txt u-flex-1"
>
{{
item
.
fieldsTitle
}}
</view>
<u-icon
name=
"arrow-right"
color=
"#666"
size=
"28"
></u-icon>
</view>
<view
class=
"pics u-flex u-flex-wrap"
>
<u-image
class=
"pic"
v-for=
"(item,index) in imgList"
width=
"170rpx"
height=
"170"
:src=
"item.path"
></u-image>
<!--
<u-image
class=
"pic"
v-for=
"item in 6"
width=
"170rpx"
height=
"170"
src=
"'https://cdn.uviewui.com/uview/example/fade.jpg"
></u-image>
-->
</view>
<u-popup
v-model=
"maskShow"
mode=
"center"
width=
"500"
>
<view
class=
"upload-box u-p-30"
>
<view
class=
"title"
>
请选择图片
</view>
<view
class=
"u-flex u-row-between"
>
<view
class=
"upload-item u-text-center"
@
click=
"uploadFile('photo')"
>
<u-image
class=
"pic"
width=
"170rpx"
height=
"170"
src=
"'https://cdn.uviewui.com/uview/example/fade.jpg"
></u-image>
相册
</view>
<view
class=
"upload-item u-text-center"
@
click=
"uploadFile"
>
<u-image
class=
"pic"
width=
"170rpx"
height=
"170"
src=
"'https://cdn.uviewui.com/uview/example/fade.jpg"
></u-image>
拍摄
</view>
</view>
</view>
</u-popup>
</view>
</
template
>
<
script
>
import
objMixin
from
'./objMixin'
import
baseFile
from
'@/components/upload/index'
;
export
default
{
name
:
'XhFiles'
,
components
:
{},
mixins
:
[
objMixin
,
baseFile
],
props
:
{},
filters
:{},
data
()
{
return
{
maskShow
:
false
}
},
computed
:
{
settings
()
{
return
this
.
item
.
settings
||
[]
}
},
watch
:
{},
mounted
()
{},
methods
:
{
selectUpload
(){
// 弹窗展示
this
.
maskShow
=
true
},
async
uploadFile
(
type
){
const
self
=
this
if
(
type
&&
type
===
'photo'
){
// 直接打开相册
let
config
=
{
options
:{
consourceType
:[
'album'
],
//['album', 'camera']
}
}
await
this
.
chooseImage
(
'qiniu'
,
config
)
self
.
setValue
()
return
}
// 使用拍照工具拍摄
},
setValue
()
{
const
dataValue
=
[]
this
.
imgList
.
map
(
item
=>
{
dataValue
.
push
(
item
.
key
)
})
this
.
valueChange
(
dataValue
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.pic
{
margin-right
:
15rpx
;
margin-bottom
:
15rpx
;
&
:nth-child
(
3n
)
{
margin-right
:
0
;
}
}
// .list {
// display: flex;
// .txt {
// color: #666;
// padding: 10rpx;
// &.active {
// background-color: red;
// color: #fff;
// }
// }
// }
</
style
>
src/components/createCom/XhRadio - 副本.vue
deleted
100644 → 0
View file @
26039978
<
template
>
<view
class=
"list"
>
<view
v-for=
"(item,index) in settings"
:key=
"index"
:class=
"
{'txt':true,'active':item===dataValue}"
@click="setValue(item)">
{{
item
}}
</view>
</view>
</
template
>
<
script
>
import
stringMixin
from
'./stringMixin'
export
default
{
name
:
'XhRadio'
,
components
:
{},
mixins
:
[
stringMixin
],
props
:
{},
data
()
{
return
{}
},
computed
:
{
settings
(){
return
this
.
item
.
settings
||
[]
}
},
watch
:
{},
mounted
()
{},
methods
:
{
setValue
(
txt
){
this
.
dataValue
=
txt
this
.
valueChange
(
txt
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.list
{
display
:
flex
;
.txt
{
color
:
#666
;
padding
:
10rpx
;
&
.active
{
background-color
:
red
;
color
:
#fff
;
}
}
}
</
style
>
src/components/upload/index.js
View file @
2c8aba78
...
@@ -5,7 +5,9 @@ export default {
...
@@ -5,7 +5,9 @@ export default {
components
:
{},
components
:
{},
data
()
{
data
()
{
return
{
return
{
imgList
:[]
imgList
:[],
// 上传文件种类:0--头像、1--证件、2--身份证
categories
:
[
'avatar'
,
'cert'
,
'id'
],
};
};
},
},
created
()
{
created
()
{
...
@@ -26,10 +28,19 @@ export default {
...
@@ -26,10 +28,19 @@ export default {
}
}
let
res
=
await
uploader
.
urlFileUpload
(
options
)
let
res
=
await
uploader
.
urlFileUpload
(
options
)
},
},
async
chooseImage
(
type
){
/**
* 上传图片公用组件
* @param {Object} type 文件上传方式
* @param {Object} attr 文件属性:图片种类[category](身份证、证件、头像);
* 图片上传其他配置[options】(如,选择图片或拍摄options.consourceType,['album', 'camera'];)其他
*/
async
chooseImage
(
type
,
attr
=
{}){
const
self
=
this
const
self
=
this
let
imgList
=
[]
let
imgList
=
[]
if
(
type
===
'qiniu'
){
if
(
type
===
'qiniu'
){
// 图片种类
let
category
=
attr
&&
attr
.
category
||
self
.
categories
[
0
]
let
config
=
attr
&&
attr
.
options
||
{}
// 图片上传参数配置
// 七牛上传
// 七牛上传
let
options
=
{
let
options
=
{
onProgressUpdate
(
res
){
onProgressUpdate
(
res
){
...
@@ -57,13 +68,15 @@ export default {
...
@@ -57,13 +68,15 @@ export default {
}
}
self
.
imgList
=
imgList
self
.
imgList
=
imgList
console
.
log
(
res
,
'res---onEachUpdate'
)
console
.
log
(
res
,
'res---onEachUpdate'
)
}
},
cardType
:
category
,
...
config
}
}
// 不需要进度条等可直接获取
// 不需要进度条等可直接获取
let
res
=
await
uploader
.
qnImgUpload
(
options
)
let
res
=
await
uploader
.
qnImgUpload
(
options
)
console
.
log
(
self
.
imgList
,
'self.imgList'
)
console
.
log
(
self
.
imgList
,
'self.imgList'
)
//
console.log(uploader,uploader.qiniuTokenObj,'qiniuTokenObj')
console
.
log
(
uploader
,
uploader
.
qiniuTokenObj
,
'qiniuTokenObj'
)
// let imgList = res.map(item=>{
// let imgList = res.map(item=>{
// return {
// return {
// key:item,
// key:item,
...
...
src/pages/order/complete.vue
View file @
2c8aba78
...
@@ -41,6 +41,9 @@
...
@@ -41,6 +41,9 @@
<xh-select
v-if=
"item.fieldsType==='select'"
:groupIndex=
"groupIndex"
<xh-select
v-if=
"item.fieldsType==='select'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-select>
</xh-select>
<xh-files
v-if=
"item.fieldsType==='file'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-files>
</
template
>
</
template
>
</u-form-item>
</u-form-item>
</view>
</view>
...
@@ -58,6 +61,7 @@
...
@@ -58,6 +61,7 @@
import
XhRadio
from
'@/components/createCom/XhRadio.vue'
import
XhRadio
from
'@/components/createCom/XhRadio.vue'
import
XhCheckbox
from
'@/components/createCom/XhCheckbox.vue'
import
XhCheckbox
from
'@/components/createCom/XhCheckbox.vue'
import
XhSelect
from
'@/components/createCom/XhSelect.vue'
import
XhSelect
from
'@/components/createCom/XhSelect.vue'
import
XhFiles
from
'@/components/createCom/XhFiles.vue'
// import XhRadio from '@/components/createCom/XhRadio.vue'
// import XhRadio from '@/components/createCom/XhRadio.vue'
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -109,7 +113,8 @@
...
@@ -109,7 +113,8 @@
XhInput
,
XhInput
,
XhRadio
,
XhRadio
,
XhCheckbox
,
XhCheckbox
,
XhSelect
XhSelect
,
XhFiles
// formCom
// formCom
},
},
created
()
{
created
()
{
...
...
src/pages/settle/file.vue
View file @
2c8aba78
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<view
class=
"tip-text"
>
<view
class=
"tip-text"
>
<image
class=
"tip-image"
mode=
"widthFix"
src=
"../../static/settle/anquan@3x.png"
></image>
<image
class=
"tip-image"
mode=
"widthFix"
src=
"../../static/settle/anquan@3x.png"
></image>
<text>
身份证照片、电工证照片、行驶证/驾驶证照片及车辆照片仅用于申请入驻。
</text>
<text>
身份证照片、电工证照片、行驶证/驾驶证照片及车辆照片仅用于申请入驻。
</text>
</view>
</view>
<view
class=
"info-view"
>
<view
class=
"info-view"
>
<view
v-for=
"(fileItem, index) in formShowList"
class=
"title-view"
:key=
"index"
>
<view
v-for=
"(fileItem, index) in formShowList"
class=
"title-view"
:key=
"index"
>
<view>
<view>
...
@@ -13,23 +13,31 @@
...
@@ -13,23 +13,31 @@
</view>
</view>
<view
class=
"info-tip-text"
>
{{
fileItem
.
tips
}}
</view>
<view
class=
"info-tip-text"
>
{{
fileItem
.
tips
}}
</view>
<view
class=
"image-view"
>
<view
class=
"image-view"
>
<image
class=
"info-image"
mode=
"aspectFill"
v-for=
"(src, key) in fileItem.placeholderImages"
<image
:src=
"fileItem.imgs.length > key ? fileItem.imgs[key] : src"
:key=
"src + key"
class=
"info-image"
@
click=
"handleClick(fileItem, index, key)"
></image>
mode=
"aspectFill"
v-for=
"(src, key) in fileItem.placeholderImages"
:src=
"fileItem.imgs.length > key ? fileItem.imgs[key] : src"
:key=
"src + key"
@
click=
"handleClick(fileItem, index, key)"
></image>
</view>
</view>
<view
v-if=
"index == 0"
class=
"bottom-tip-view"
>
<view
v-if=
"index == 0"
class=
"bottom-tip-view"
>
<image
class=
"bottom-tip-image"
mode=
"widthFix"
src=
"../../static/settle/tishi@3x.png"
></image>
<image
class=
"bottom-tip-image"
mode=
"widthFix"
src=
"../../static/settle/tishi@3x.png"
></image>
<text>
所上传的身份证信息必须与银行卡开户绑定身份证信息一致,否则将导致订单报酬无法交付
</text>
<text>
所上传的身份证信息必须与银行卡开户绑定身份证信息一致,否则将导致订单报酬无法交付
</text>
</view>
</view>
<view
class=
"card-info-view"
v-if=
"index == 0 && (fileInfo.id_card_name || fileInfo.id_card_number || fileInfo.id_card_date)"
>
<view
class=
"card-info-view"
v-if=
"index == 0
<view
class=
"card-list-view"
v-for=
"(value, cardkey) in cardTitle"
:key=
"cardkey"
>
&& ((fileInfo.id_card_name || fileInfo.id_card_number || fileInfo.id_card_date) || frontErrorMsg || backErrorMsg)"
>
<view
class=
"card-list-item"
>
<view
class=
"card-list-view"
v-for=
"(value, cardkey) in cardTitle"
:key=
"cardkey"
>
<text>
{{
value
}}
</text>
<view
class=
"card-list-item"
>
<text
class=
"card-item-text"
>
{{
fileInfo
[
cardkey
]
}}
</text>
<text>
{{
value
}}
</text>
</view>
<text
class=
"card-item-text"
>
{{
fileInfo
[
cardkey
]
}}
</text>
<view
class=
"line-view"
></view>
</view>
<view
class=
"card-item-error"
v-if=
"fileInfo[cardkey] && (cardkey == 'id_card_date' ? fileInfo.id_card_back : fileInfo.id_card_front)"
>
识别失败,请重新上传
</view>
<view
class=
"line-view"
></view>
</view>
<view
class=
"card-item-error"
v-if=
"fileInfo[cardkey]
&& ((cardkey == 'id_card_name' || cardkey == 'id_card_number') && frontErrorMsg)"
>
{{
frontErrorMsg
}}
</view>
<view
class=
"card-item-error"
v-if=
"(cardkey == 'id_card_date' && backErrorMsg)"
>
{{
backErrorMsg
}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -37,48 +45,34 @@
...
@@ -37,48 +45,34 @@
<template
v-slot:bottom
>
<template
v-slot:bottom
>
<view
class=
"btn-wrap flex-xc"
>
<view
class=
"btn-wrap flex-xc"
>
<button
class=
"btn-submit"
:disabled=
"!submitBtnStatus"
@
click=
"$u.debounce(submitFileInfo, 500)"
>
<button
class=
"btn-submit"
:disabled=
"!submitBtnStatus"
@
click=
"$u.debounce(submitFileInfo, 500)"
>
{{
!
submitBtnStatus
?
"完成必填项,可提交资料"
:
"提交"
}}
{{
!
submitBtnStatus
?
'完成必填项,可提交资料'
:
'提交'
}}
</button>
</button>
</view>
</view>
</
template
>
</
template
>
<!-- <view class="base-list">
<view
class=
"base-list"
>
<template v-for="(fileItem, index) in formShowList">
<template v-for="(fileItem, index) in formShowList">
<view class="item item-select flex flex-yc" :key="index" @click="toUploadImg(fileItem, index)">
<view class="item item-select flex flex-yc" :key="index" @click="toUploadImg(fileItem, index)">
<view class="label txt">{{ fileItem.label }}</view>
<view class="label txt">{{ fileItem.label }}</view>
<p class="flex1 u-text-right txt" v-show="fileInfo[fileItem.filedName] !== ''">
<p class="flex1 u-text-right txt" v-show="fileInfo[fileItem.filedName] !== ''">
{{
{{ imgObj[fileItem.filedName] && imgObj[fileItem.filedName].length + '张' }}
imgObj
[
fileItem
.
filedName
]
&&
imgObj
[
fileItem
.
filedName
].
length
+
"张"
}}
</p>
</p>
<u-icon name="arrow-right" color="#999" size="28"></u-icon>
<u-icon name="arrow-right" color="#999" size="28"></u-icon>
</view>
</view>
<view
class=
"tips"
:key=
"index + 't'"
>
<view class="tips" :key="index + 't'">{{ fileItem.tips }}</view>
{{
fileItem
.
tips
}}
<view class="tips id-identity-box" :key="index + 'identity'" v-if="fileItem.filedName === 'id_card_front'">
</view>
<view
class=
"tips id-identity-box"
:key=
"index + 'identity'"
v-if=
"fileItem.filedName === 'id_card_front'"
>
<view class="txt">请核实识别结果</view>
<view class="txt">请核实识别结果</view>
<view class="txt">
<view class="txt">
身份证姓名:
{{
fileInfo
.
id_card_name
}}
<span
class=
"red"
v-show=
"
身份证姓名:{{ fileInfo.id_card_name }}
!fileInfo.id_card_name &&
<span class="red" v-show="!fileInfo.id_card_name && fileInfo.id_card_front">识别失败,请重新上传</span>
fileInfo.id_card_front
"
>
识别失败,请重新上传
</span>
</view>
</view>
<view class="txt">
<view class="txt">
身份证号码:
{{
fileInfo
.
id_card_number
身份证号码:{{ fileInfo.id_card_number }}
}}
<span
class=
"red"
v-show=
"
<span class="red" v-show="!fileInfo.id_card_name && fileInfo.id_card_front">识别失败,请重新上传</span>
!fileInfo.id_card_name &&
fileInfo.id_card_front
"
>
识别失败,请重新上传
</span>
</view>
</view>
</view>
</view>
</template>
</template>
</view>
</view>
-->
<!-- <view class="seat"></view>
<!-- <view class="seat"></view>
<view class="btn-wrap fixed flex flex-xc">
<view class="btn-wrap fixed flex flex-xc">
<button class="btn-submit" :disabled="!submitBtnStatus" @click="$u.debounce(submitFileInfo, 500)">
<button class="btn-submit" :disabled="!submitBtnStatus" @click="$u.debounce(submitFileInfo, 500)">
...
@@ -92,504 +86,575 @@
...
@@ -92,504 +86,575 @@
</template>
</template>
<
script
>
<
script
>
import
Settle
from
'@/components/settle/index.vue'
import
Settle
from
'@/components/settle/index.vue'
export
default
{
import
base
from
'@/components/upload/index'
;
components
:
{
const
app
=
getApp
()
Settle
export
default
{
},
mixins
:[
base
],
data
()
{
components
:
{
return
{
Settle
fileInfo
:
{
},
id
:
""
,
data
()
{
id_card_name
:
""
,
return
{
id_card_number
:
""
,
imgList
:[],
id_card_date
:
''
,
frontErrorMsg
:
''
,
id_card_front
:
""
,
backErrorMsg
:
''
,
id_card_back
:
""
,
uploadType
:
''
,
electrician_certificate
:
""
,
settledInfo
:
''
,
vehicle_photos
:
""
,
fileInfo
:
{
other_certificates
:
""
,
id
:
""
,
id_card_back_check
:
false
,
id_card_name
:
""
,
},
id_card_number
:
""
,
imgObj
:
{
id_card_date
:
''
,
id_card_front
:
[],
id_card_front
:
""
,
id_card_back
:
[],
id_card_back
:
""
,
electrician_certificate
:
[],
electrician_certificate
:
""
,
vehicle_photos
:
[],
/**
other_certificates
:
[]
* 其他证件照片信息,json串储存
},
* driver_license:驾驶证
formShowList
:
[{
* driving_license:行驶证
filedName
:
"id_card_front"
,
* vehicle:车辆照
required
:
true
,
**/
maxImgs
:
2
,
other_photos
:
{
label
:
"实名认证"
,
"driver_license"
:
{
tips
:
"上传二代身份证照片,图片大小不大于3M"
,
"url"
:
""
,
imgs
:
[],
placeholderImages
:
[
'../../static/settle/renxiang@3x.png'
,
'../../static/settle/guohui@3x.png'
]
},
// {
// filedName: "id_card_back",
// required: true,
// label: "身份证国徽面",
// maxImgs: 1,
// tips: "上传二代身份证照片,图片大小不大于3M",
// imgs: [],
// },
{
filedName
:
"electrician_certificate"
,
label
:
"电工证照"
,
required
:
true
,
maxImgs
:
1
,
tips
:
"上传电工证证照片,图片大小不大于3M"
,
imgs
:
[],
placeholderImages
:
[
'../../static/settle/diangong@3x.png'
]
},
},
{
"driving_license"
:
{
filedName
:
"other_certificates"
,
"url"
:
""
,
label
:
"驾驶证/行驶证照片"
,
imgs
:
[],
maxImgs
:
999
,
tips
:
"两证单张照片需包含两页内容,图片大小不大于3M"
,
placeholderImages
:
[
'../../static/settle/jiashi@3x.png'
,
'../../static/settle/jiashi@3x.png'
]
},
},
{
"vehicle"
:{
filedName
:
"vehicle_photos"
,
"url"
:
""
,
label
:
"车辆照"
,
maxImgs
:
1
,
tips
:
"两证单张照片需包含两页内容,图片大小不大于3M"
,
imgs
:
[],
placeholderImages
:
[
'../../static/settle/zhengmian@3x.png'
,
'../../static/settle/cemian@3x.png'
]
},
},
},
id_card_back_check
:
false
,
},
imgObj
:
{
id_card_front
:
[],
id_card_back
:
[],
electrician_certificate
:
[],
driver_license
:
[],
driving_license
:
[],
vehicle
:
[],
},
formShowList
:
[{
filedName
:
"id_card_front"
,
required
:
true
,
maxImgs
:
2
,
label
:
"实名认证"
,
tips
:
"上传二代身份证照片,图片大小不大于3M"
,
imgs
:
[],
placeholderImages
:
[
'../../static/settle/renxiang@3x.png'
,
'../../static/settle/guohui@3x.png'
]
},
// {
// filedName: "id_card_back",
// required: true,
// label: "身份证国徽面",
// maxImgs: 1,
// tips: "上传二代身份证照片,图片大小不大于3M",
// imgs: [],
// },
{
filedName
:
"electrician_certificate"
,
label
:
"电工证照"
,
required
:
true
,
maxImgs
:
1
,
tips
:
"上传电工证证照片,图片大小不大于3M"
,
imgs
:
[],
placeholderImages
:
[
'../../static/settle/diangong@3x.png'
]
},
{
filedName
:
"driver_license"
,
label
:
"驾驶证/行驶证照片"
,
imgs
:
[],
maxImgs
:
999
,
tips
:
"两证单张照片需包含两页内容,图片大小不大于3M"
,
placeholderImages
:
[
'../../static/settle/jiashi@3x.png'
,
'../../static/settle/jiashi@3x.png'
]
},
{
filedName
:
"vehicle"
,
label
:
"车辆照"
,
maxImgs
:
1
,
tips
:
"两证单张照片需包含两页内容,图片大小不大于3M"
,
imgs
:
[],
placeholderImages
:
[
'../../static/settle/zhengmian@3x.png'
,
'../../static/settle/cemian@3x.png'
]
},
],
],
submitSuccess
:
false
,
submitSuccess
:
false
,
saving
:
false
,
saving
:
false
,
}
},
onLoad
(
e
)
{
this
.
initSettledInfo
()
},
updated
()
{
// 该方法性能消耗大目前不使用
// this.updateImgs()
},
watch
:
{
"fileInfo.id_card_front"
()
{
if
(
this
.
fileInfo
.
id_card_front
)
{
this
.
checkIdCard
(
"front"
);
}
else
{
this
.
fileInfo
.
id_card_name
=
""
;
this
.
fileInfo
.
id_card_number
=
""
;
}
}
},
},
onLoad
(
e
)
{},
"fileInfo.id_card_back"
()
{
updated
()
{
if
(
this
.
fileInfo
.
id_card_back
)
{
this
.
updateImgs
()
this
.
checkIdCard
(
"back"
);
}
else
{
this
.
fileInfo
.
id_card_back_check
=
true
;
}
},
},
watch
:
{
},
"fileInfo.id_card_front"
()
{
computed
:
{
if
(
this
.
fileInfo
.
id_card_front
)
{
submitBtnStatus
()
{
this
.
checkIdCard
(
"front"
);
// const baseInfo = this.baseInfo
}
else
{
const
fileInfo
=
this
.
fileInfo
this
.
fileInfo
.
id_card_name
=
""
;
const
flag
=
fileInfo
.
id_card_front
&&
fileInfo
.
id_card_back
&&
fileInfo
.
electrician_certificate
this
.
fileInfo
.
id_card_number
=
""
;
return
flag
&&
!
this
.
saving
;
}
},
"fileInfo.id_card_back"
()
{
if
(
this
.
fileInfo
.
id_card_front
)
{
this
.
checkIdCard
(
"back"
);
}
else
{
this
.
fileInfo
.
id_card_back_check
=
true
;
}
},
},
},
computed
:
{
cardTitle
()
{
submitBtnStatus
()
{
return
{
// const baseInfo = this.baseInfo
'id_card_name'
:
'姓名'
,
const
fileInfo
=
this
.
fileInfo
'id_card_number'
:
'身份证号'
,
const
flag
=
fileInfo
.
id_card_front
&&
fileInfo
.
id_card_back
&&
fileInfo
.
electrician_certificate
'id_card_date'
:
'有效期'
return
flag
&&
!
this
.
saving
;
}
},
}
cardTitle
()
{
},
return
{
components
:
{
'id_card_name'
:
'姓名'
,
'id_card_number'
:
'身份证号'
,
},
'id_card_date'
:
'有效期'
methods
:
{
}
// 初始化入驻信息
async
initSettledInfo
()
{
let
self
=
this
let
settledInfo
=
app
.
globalData
.
settledInfo
if
(
settledInfo
&&
settledInfo
.
length
)
{
self
.
fileInfo
.
id
=
settledInfo
.
id
}
else
{
const
app
=
getApp
()
const
callBack
=
(
vm
,
result
)
=>
{
vm
.
settledInfo
=
result
.
record
vm
.
fileInfo
.
id
=
result
.
record
.
id
}
settledInfo
=
await
app
.
getBaseInfo
(
this
,
callBack
)
uni
.
hideLoading
()
}
}
},
},
components
:
{
// item: formShowList的元素
// index、key: 选中的是formShowList的第index里面的第key个图片选择器
async
handleClick
(
item
,
index
,
key
)
{
let
self
=
this
self
.
imgList
=
[]
self
.
uploadType
=
item
.
filedName
||
''
// 默认上传证件类型图片
let
attr
=
{
category
:
self
.
categories
[
1
]}
switch
(
index
)
{
case
0
:
// 身份证
// 上传图片
// 成功之后更新 fileInfo、 item里的imgs
attr
=
{
category
:
self
.
categories
[
2
]}
if
(
key
==
0
)
{
// 身份证正面照片
self
.
uploadType
=
"id_card_front"
}
else
{
// 身份证反面照片
self
.
uploadType
=
"id_card_back"
}
break
;
default
:
//其他
// 上传图片
// 成功之后更新 item里的imgs
break
;
}
await
self
.
chooseImage
(
"qiniu"
,
attr
)
if
(
self
.
uploadType
&&
self
.
imgList
&&
self
.
imgList
.
length
>
0
)
{
// 设置图片对象
self
.
imgObj
[
self
.
uploadType
]
=
self
.
imgList
self
.
formShowList
[
index
].
imgs
[
key
]
=
self
.
imgList
[
0
].
src
this
.
updateImgs
()
}
},
},
methods
:
{
// item: formShowList的元素
updateImgs
()
{
// index、key: 选中的是formShowList的第index里面的第key个图片选择器
const
uploadType
=
this
.
uploadType
handleClick
(
item
,
index
,
key
)
{
const
uploadImgs
=
this
.
imgObj
[
uploadType
]
switch
(
index
)
{
if
(
uploadImgs
&&
uploadImgs
.
length
<
1
)
{
case
0
:
return
// 身份证
}
// 上传图片
if
(
uploadType
===
'driver_license'
||
uploadType
===
'driving_license'
||
uploadType
===
'vehicle'
)
{
// 成功之后更新 fileInfo、 item里的imgs
const
otherImgs
=
this
.
imgObj
[
uploadType
]
break
;
let
imgs
=
[]
default
:
otherImgs
.
map
(
item
=>
{
//其他
const
img
=
item
.
key
||
item
.
src
||
''
// 上传图片
imgs
.
push
(
img
)
// 成功之后更新 item里的imgs
break
;
}
},
updateImgs
()
{
const
uploadType
=
this
.
uploadType
const
uploadImgs
=
this
.
imgObj
[
uploadType
]
if
(
uploadImgs
.
length
<
1
)
{
return
}
if
(
uploadType
===
'other_certificates'
)
{
const
otherImgs
=
this
.
imgObj
[
'other_certificates'
]
let
imgs
=
[]
otherImgs
.
map
(
item
=>
{
const
img
=
item
.
key
||
item
.
src
||
''
imgs
.
push
(
img
)
})
this
.
fileInfo
[
uploadType
]
=
imgs
.
join
(
','
)
return
}
this
.
fileInfo
[
uploadType
]
=
uploadImgs
[
0
].
key
||
uploadImgs
[
0
].
src
||
''
},
toUploadImg
(
item
,
index
)
{
this
.
uploadType
=
item
.
filedName
uni
.
navigateTo
({
url
:
'/pages/settle/file-upload?uploadType='
+
item
.
filedName
})
// this.fileUploadIndex = index;
},
gopage
(
url
)
{
uni
.
navigateTo
({
url
,
});
},
async
checkIdCard
(
type
)
{
uni
.
showLoading
({
title
:
'加载中'
})
})
let
request
=
{
this
.
fileInfo
[
uploadType
]
=
imgs
.
join
(
','
)
front
:
this
.
$u
.
api
.
checkSettleIDCardFront
,
back
:
this
.
$u
.
api
.
checkSettleIDCardBack
,
return
};
}
let
url
=
{
this
.
fileInfo
[
uploadType
]
=
uploadImgs
[
0
].
key
||
uploadImgs
[
0
].
src
||
''
front
:
this
.
fileInfo
.
id_card_front
,
},
back
:
this
.
fileInfo
.
id_card_back
,
toUploadImg
(
item
,
index
)
{
};
this
.
uploadType
=
item
.
filedName
uni
.
navigateTo
({
const
params
=
{
url
:
'/pages/settle/file-upload?uploadType='
+
item
.
filedName
[
"id_card_"
+
type
]:
url
[
type
],
})
id
:
this
.
fileInfo
.
id
||
0
,
// this.fileUploadIndex = index;
}
},
gopage
(
url
)
{
uni
.
navigateTo
({
url
,
});
},
async
checkIdCard
(
type
)
{
uni
.
showLoading
({
title
:
'加载中'
})
let
request
=
{
front
:
this
.
$u
.
api
.
checkSettleIDCardFront
,
back
:
this
.
$u
.
api
.
checkSettleIDCardBack
,
};
let
url
=
{
front
:
this
.
fileInfo
.
id_card_front
,
back
:
this
.
fileInfo
.
id_card_back
,
};
const
params
=
{
[
"id_card_"
+
type
]:
url
[
type
],
id
:
this
.
fileInfo
.
id
||
0
,
}
const
res
=
await
request
[
type
](
params
);
const
res
=
await
request
[
type
](
params
);
if
(
res
.
code
!==
200
)
{
if
(
res
.
code
!==
200
)
{
if
(
type
===
"front"
)
{
this
.
fileInfo
.
id_card_name
=
""
;
this
.
fileInfo
.
id_card_number
=
""
;
}
else
{
this
.
fileInfo
.
id_card_back_check
=
false
;
}
return
}
uni
.
hideLoading
()
if
(
type
===
"front"
)
{
if
(
type
===
"front"
)
{
this
.
fileInfo
.
id_card_name
=
this
.
fileInfo
.
id_card_name
=
""
;
res
.
data
.
id_card_name
||
""
;
this
.
fileInfo
.
id_card_number
=
""
;
this
.
fileInfo
.
id_card_number
=
this
.
frontErrorMsg
=
res
.
message
||
"识别失败,请重新上传"
res
.
data
.
id_card_number
||
""
;
}
else
{
}
else
{
this
.
fileInfo
.
id_card_back_check
=
true
;
this
.
fileInfo
.
id_card_back_check
=
false
;
}
this
.
backErrorMsg
=
res
.
message
||
"识别失败,请重新上传"
},
checkFileInfo
()
{
let
formFlag
=
true
;
const
fileInfo
=
this
.
fileInfo
;
let
checkFunc
=
function
(
item
)
{
const
value
=
fileInfo
[
item
.
filedName
];
const
tips
=
"请上传您的"
+
item
.
label
;
if
(
!
value
)
{
uni
.
showToast
({
title
:
tips
,
icon
:
'none'
})
return
false
;
}
return
true
;
};
const
flagArr
=
this
.
formShowList
.
some
((
item
)
=>
{
// 返回验证失败的数组
let
flag
=
true
;
if
(
item
.
required
)
{
flag
=
checkFunc
(
item
);
}
return
!
flag
;
});
formFlag
=
!
flagArr
||
flagArr
.
length
>
1
;
if
(
formFlag
)
{
if
(
!
fileInfo
.
id_card_name
)
{
uni
.
showToast
({
title
:
'身份证识别不通过,请重新上传'
,
icon
:
'none'
})
formFlag
=
false
;
return
formFlag
;
}
if
(
!
fileInfo
.
id_card_back_check
)
{
uni
.
showToast
({
title
:
'身份证国徽面识别不通过,请重新上传'
,
icon
:
'none'
})
formFlag
=
false
;
}
}
}
return
return
formFlag
;
}
},
uni
.
hideLoading
()
async
submitFileInfo
()
{
if
(
type
===
"front"
)
{
if
(
!
this
.
checkFileInfo
())
{
this
.
fileInfo
.
id_card_name
=
return
;
res
.
data
.
id_card_name
||
""
;
this
.
fileInfo
.
id_card_number
=
res
.
data
.
id_card_number
||
""
;
this
.
frontErrorMsg
=
(
!
this
.
fileInfo
.
id_card_name
||
!
this
.
fileInfo
.
id_card_number
)
?
"识别失败,请重新上传"
:
''
}
else
{
this
.
fileInfo
.
id_card_date
=
res
.
data
.
id_card_date
||
""
;
this
.
fileInfo
.
id_card_back_check
=
true
;
this
.
backErrorMsg
=
!
this
.
fileInfo
.
id_card_date
?
"识别失败,请重新上传"
:
''
}
},
checkFileInfo
()
{
let
formFlag
=
true
;
const
fileInfo
=
this
.
fileInfo
;
let
checkFunc
=
function
(
item
)
{
const
value
=
fileInfo
[
item
.
filedName
];
const
tips
=
"请上传您的"
+
item
.
label
;
if
(
!
value
)
{
uni
.
showToast
({
title
:
tips
,
icon
:
'none'
})
return
false
;
}
}
const
fileInfo
=
this
.
fileInfo
;
return
true
;
let
submitInfoData
=
{
};
...
fileInfo
,
const
flagArr
=
this
.
formShowList
.
some
((
item
)
=>
{
recommender
:
getApp
().
globalData
.
settleRecommend
// 返回验证失败的数组
let
flag
=
true
;
if
(
item
.
required
)
{
flag
=
checkFunc
(
item
);
}
}
uni
.
showLoading
({
return
!
flag
;
title
:
'加载中……'
});
})
formFlag
=
!
flagArr
||
flagArr
.
length
>
1
;
const
res
=
await
this
.
$u
.
api
.
submitSettleFileInfo
(
submitInfoData
)
if
(
formFlag
)
{
uni
.
hideLoading
()
if
(
!
fileInfo
.
id_card_name
)
{
if
(
res
.
code
!==
200
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
message
,
title
:
'身份证识别不通过,请重新上传'
,
icon
:
'none'
icon
:
'none'
})
})
return
formFlag
=
false
;
return
formFlag
;
}
}
uni
.
showToast
({
if
(
!
fileInfo
.
id_card_back_check
)
{
title
:
'资料提交成功'
,
uni
.
showToast
({
})
title
:
'身份证国徽面识别不通过,请重新上传'
,
let
timer
=
setTimeout
(()
=>
{
icon
:
'none'
clearTimeout
(
timer
)
uni
.
navigateTo
({
url
:
'/pages/settle/prompt'
})
})
},
2000
)
formFlag
=
false
;
this
.
submitSuccess
=
true
;
// this.$u.api.post("@u/v1/h5/settled/submit-info", submitInfoData)
// .then((res) => {
// uni.hideLoading()
// if (res.status != 200) {
// return;
// }
// if (res.data) {
// uni.showToast({
// title:'工作人员2个工作日内审核回复',
// icon:'none'
// })
// this.submitSuccess = true;
// }
// })
// .catch(() => {
// //Indicator.close();
// });
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.page-content
{
background-color
:
#F4F5F7
;
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
}
.base-list
{
.item
{
display
:
flex
;
margin-bottom
:
58rpx
;
padding
:
28rpx
30rpx
;
width
:
100%
;
height
:
100rpx
;
font-size
:
32rpx
;
background-color
:
#fff
;
.label
{
color
:
#333
;
font-size
:
32rpx
;
}
.txt
{
line-height
:
44rpx
;
color
:
#333
;
font-size
:
32rpx
;
}
.required
{
margin
:
0
6rpx
;
color
:
red
;
font-size
:
32rpx
;
}
.iconfont
{
color
:
#999
;
}
}
.tips
{
margin-top
:
20rpx
;
padding
:
0
30rpx
;
line-height
:
40rpx
;
font-size
:
28rpx
;
color
:
#666
;
&
+
.id-identity-box
{
margin-top
:
-38rpx
;
margin-bottom
:
40rpx
;
}
}
.id-identity-box
{
.txt
{
padding-top
:
8rpx
;
line-height
:
40rpx
;
font-size
:
28rpx
;
color
:
#666
;
&
:first-child
{
margin-top
:
-58rpx
;
padding-top
:
12rpx
;
}
.red
{
color
:
red
;
}
}
}
}
// &.tips{
return
formFlag
;
// margin-bottom:0!important;
},
// }
async
submitFileInfo
()
{
if
(
!
this
.
checkFileInfo
())
{
}
return
;
.item
+
.tips
{
margin-top
:
-38rpx
;
margin-bottom
:
58rpx
;
}
/*选择内容*/
.item-select
{
font-size
:
30rpx
;
color
:
#333
;
font-weight
:
500
;
justify-content
:
space-between
;
border-bottom
:
1rpx
solid
#f5f5f5
;
}
.flex1
{
flex
:
1
!
important
;
&
.txt
{
white-space
:
nowrap
;
// max-width: 450rpx;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
}
.item-input
{
overflow
:
hidden
;
input
{
text-align
:
right
;
line-height
:
44rpx
;
width
:
100%
;
font-size
:
30rpx
;
color
:
#333
;
font-weight
:
400
;
}
.input-readonly
{
font-size
:
30rpx
;
color
:
#999
;
font-weight
:
400
;
}
}
const
fileInfo
=
this
.
fileInfo
;
input
:
:-
webkit-input-placeholder
{
let
submitInfoData
=
{
font-size
:
30rpx
;
...
fileInfo
,
color
:
#999
;
recommender
:
getApp
().
globalData
.
settleRecommend
font-weight
:
400
;
}
}
uni
.
showLoading
({
input
:
-
moz-placeholder
{
title
:
'加载中……'
font-size
:
30rpx
;
})
color
:
#999
;
const
res
=
await
this
.
$u
.
api
.
submitSettleFileInfo
(
submitInfoData
)
font-weight
:
400
;
uni
.
hideLoading
()
}
if
(
res
.
code
!==
200
)
{
uni
.
showToast
({
input
:
-
ms-input-placeholder
{
title
:
res
.
message
,
font-size
:
30rpx
;
icon
:
'none'
color
:
#999
;
})
font-weight
:
400
;
return
}
}
}
uni
.
showToast
({
}
title
:
'资料提交成功'
,
})
.tip-text
{
let
timer
=
setTimeout
(()
=>
{
background-color
:
#FFFFFF
;
clearTimeout
(
timer
)
border-radius
:
12rpx
;
uni
.
navigateTo
({
padding
:
38rpx
30rpx
30rpx
30rpx
;
url
:
'/pages/settle/prompt'
height
:
140rpx
;
})
margin-bottom
:
20rpx
;
},
2000
)
font-size
:
24rpx
;
color
:
#000000
;
this
.
submitSuccess
=
true
;
display
:
flex
;
// this.$u.api.post("@u/v1/h5/settled/submit-info", submitInfoData)
align-items
:
flex-start
;
// .then((res) => {
}
// uni.hideLoading()
.tip-image
{
// if (res.status != 200) {
width
:
34rpx
;
// return;
margin-right
:
8rpx
;
// }
margin-top
:
2rpx
;
// if (res.data) {
}
// uni.showToast({
// title:'工作人员2个工作日内审核回复',
// icon:'none'
// })
// this.submitSuccess = true;
// }
// })
// .catch(() => {
// //Indicator.close();
// });
},
},
}
</
script
>
.bottom-tip-view
{
<
style
lang=
"scss"
scoped
>
color
:
#999999
;
.page-content
{
font-size
:
20rpx
;
background-color
:
#F4F5F7
;
display
:
flex
;
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
}
.base-list
{
.item
{
display
:
flex
;
margin-bottom
:
58rpx
;
padding
:
28rpx
30rpx
;
width
:
100%
;
height
:
100rpx
;
font-size
:
32rpx
;
background-color
:
#fff
;
.label
{
color
:
#333
;
font-size
:
32rpx
;
}
.txt
{
line-height
:
44rpx
;
color
:
#333
;
font-size
:
32rpx
;
}
.required
{
margin
:
0
6rpx
;
color
:
red
;
font-size
:
32rpx
;
}
.iconfont
{
color
:
#999
;
}
}
.tips
{
margin-top
:
20rpx
;
padding
:
0
30rpx
;
line-height
:
40rpx
;
font-size
:
28rpx
;
color
:
#666
;
&
+
.id-identity-box
{
margin-top
:
-38rpx
;
margin-bottom
:
40rpx
;
}
}
.id-identity-box
{
.txt
{
padding-top
:
8rpx
;
line-height
:
40rpx
;
font-size
:
28rpx
;
color
:
#666
;
&
:first-child
{
margin-top
:
-58rpx
;
padding-top
:
12rpx
;
}
.red
{
color
:
red
;
}
}
// &.tips{
// margin-bottom:0!important;
// }
}
.item
+
.tips
{
margin-top
:
-38rpx
;
margin-bottom
:
58rpx
;
}
/*选择内容*/
.item-select
{
font-size
:
30rpx
;
color
:
#333
;
font-weight
:
500
;
justify-content
:
space-between
;
border-bottom
:
1rpx
solid
#f5f5f5
;
}
.flex1
{
flex
:
1
!
important
;
&
.txt
{
white-space
:
nowrap
;
// max-width: 450rpx;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
}
.item-input
{
overflow
:
hidden
;
input
{
text-align
:
right
;
line-height
:
44rpx
;
width
:
100%
;
font-size
:
30rpx
;
color
:
#333
;
font-weight
:
400
;
}
.input-readonly
{
font-size
:
30rpx
;
color
:
#999
;
font-weight
:
400
;
}
input
:
:-
webkit-input-placeholder
{
font-size
:
30rpx
;
color
:
#999
;
font-weight
:
400
;
}
input
:
-
moz-placeholder
{
font-size
:
30rpx
;
color
:
#999
;
font-weight
:
400
;
}
input
:
-
ms-input-placeholder
{
font-size
:
30rpx
;
color
:
#999
;
font-weight
:
400
;
}
}
}
.tip-text
{
background-color
:
#FFFFFF
;
border-radius
:
12rpx
;
padding
:
38rpx
30rpx
30rpx
30rpx
;
height
:
140rpx
;
margin-bottom
:
20rpx
;
font-size
:
24rpx
;
color
:
#000000
;
display
:
flex
;
align-items
:
flex-start
;
align-items
:
flex-start
;
margin-top
:
30rpx
;
}
}
.tip-image
{
.bottom-tip-image
{
width
:
34rpx
;
width
:
24rpx
;
margin-right
:
8rpx
;
height
:
24rpx
;
margin-top
:
2rpx
;
margin-right
:
8rpx
;
}
margin-top
:
4rpx
;
}
.bottom-tip-view
{
color
:
#999999
;
.seat
{
font-size
:
20rpx
;
padding-bottom
:
144rpx
;
display
:
flex
;
}
align-items
:
flex-start
;
margin-top
:
30rpx
;
/*提交按钮*/
}
.btn-wrap
{
width
:
100%
;
.bottom-tip-image
{
width
:
24rpx
;
.btn-submit
{
height
:
24rpx
;
width
:
600rpx
;
margin-right
:
8rpx
;
height
:
104rpx
;
margin-top
:
4rpx
;
line-height
:
104rpx
;
}
border-radius
:
52rpx
;
background
:
#2272FF
;
.seat
{
font-size
:
32rpx
;
padding-bottom
:
144rpx
;
color
:
#fff
;
}
&
[
disabled
]
{
/*提交按钮*/
background-color
:
#D1D4D4
;
.btn-wrap
{
color
:
#FFFFFF
;
width
:
100%
;
}
}
.btn-submit
{
width
:
600rpx
;
height
:
104rpx
;
line-height
:
104rpx
;
border-radius
:
52rpx
;
background
:
#2272FF
;
font-size
:
32rpx
;
color
:
#fff
;
&
[
disabled
]
{
background-color
:
#D1D4D4
;
color
:
#FFFFFF
;
}
}
}
}
.card-info-view
{
.card-info-view
{
margin-top
:
30rpx
;
margin-top
:
30rpx
;
...
@@ -617,40 +682,40 @@
...
@@ -617,40 +682,40 @@
}
}
}
}
}
}
.info-view
{
.info-view
{
margin-bottom
:
188rpx
;
margin-bottom
:
188rpx
;
.title-view
{
.title-view
{
background-color
:
#FFFFFF
;
background-color
:
#FFFFFF
;
border-radius
:
12rpx
;
border-radius
:
12rpx
;
padding
:
38rpx
30rpx
30rpx
30rpx
;
padding
:
38rpx
30rpx
30rpx
30rpx
;
margin-bottom
:
20rpx
;
margin-bottom
:
20rpx
;
font-size
:
32rpx
;
font-size
:
32rpx
;
color
:
#333333
;
color
:
#333333
;
.title-image
{
.title-image
{
width
:
24rpx
;
width
:
24rpx
;
height
:
24rpx
;
height
:
24rpx
;
margin-right
:
10rpx
;
margin-right
:
10rpx
;
}
}
}
}
.info-tip-text
{
.info-tip-text
{
font-size
:
24rpx
;
font-size
:
24rpx
;
color
:
#666666
;
color
:
#666666
;
margin-top
:
10rpx
;
margin-top
:
10rpx
;
}
}
.image-view
{
.image-view
{
margin-top
:
30rpx
;
margin-top
:
30rpx
;
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
.info-image
{
.info-image
{
width
:
300rpx
;
width
:
300rpx
;
height
:
226rpx
;
height
:
226rpx
;
}
}
}
}
}
}
</
style
>
</
style
>
src/plugins/uploader/index.js
View file @
2c8aba78
...
@@ -26,11 +26,11 @@ let baseOptions = {
...
@@ -26,11 +26,11 @@ let baseOptions = {
let
uploader
=
new
request
(
baseOptions
);
let
uploader
=
new
request
(
baseOptions
);
// 添加获取七牛云token的方法
// 添加获取七牛云token的方法
uploader
.
getQnToken
=
function
(
data
)
{
uploader
.
getQnToken
=
function
(
params
)
{
//该地址需要开发者自行配置(每个后台的接口风格都不一样)
//该地址需要开发者自行配置(每个后台的接口风格都不一样)
// console.log(uploader.get,'uploader.get')
// console.log(uploader.get,'uploader.get')
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
uploader
.
post
(
baseOptions
.
qiniuUploadUrl
,
data
).
then
(
data
=>
{
uploader
.
post
(
baseOptions
.
qiniuUploadUrl
,
params
).
then
(
data
=>
{
/*
/*
*接口返回参数:
*接口返回参数:
*visitPrefix:访问文件的域名
*visitPrefix:访问文件的域名
...
...
src/plugins/uploader/request/upload/upload.js
View file @
2c8aba78
...
@@ -83,7 +83,7 @@ export default class fileUpload extends request {
...
@@ -83,7 +83,7 @@ export default class fileUpload extends request {
}
}
let
qnRes
=
this
.
qiniuTokenObj
let
qnRes
=
this
.
qiniuTokenObj
if
(
!
qnRes
||
qnRes
.
cardType
!==
requestInfo
.
cardType
){
if
(
!
qnRes
||
qnRes
.
cardType
!==
requestInfo
.
cardType
){
let
params
=
{
type
:
requestInfo
.
cardType
||
''
}
let
params
=
{
type
:
requestInfo
.
cardType
||
'
avatar
'
}
qnRes
=
await
this
.
getQnToken
(
params
)
qnRes
=
await
this
.
getQnToken
(
params
)
this
.
qiniuTokenObj
=
{
this
.
qiniuTokenObj
=
{
cardType
:
''
,
cardType
:
''
,
...
...
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