Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
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
和慭琛
take_order
Commits
6781b973
Commit
6781b973
authored
Feb 23, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add-file
parent
79e6ea0c
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
607 additions
and
47 deletions
+607
-47
settled.js
take-order/common/api/settled.js
+15
-0
base_url.js
take-order/common/base_url.js
+17
-13
http.interceptor.js
take-order/common/http.interceptor.js
+2
-1
upload.js
take-order/components/upload/upload.js
+14
-5
pingpp.js
take-order/include/libs/pingpp.js
+2
-0
qiniuUploader.js
take-order/include/libs/qiniuUploader.js
+5
-4
pages.json
take-order/pages.json
+10
-0
file-upload.vue
take-order/pages/settle/file-upload.vue
+15
-9
pay-ensure.vue
take-order/pages/settle/pay-ensure.vue
+87
-15
sign-contract.vue
take-order/pages/settle/sign-contract.vue
+440
-0
No files found.
take-order/common/api/settled.js
View file @
6781b973
...
@@ -11,6 +11,16 @@ let settledApiFun = function(vm){
...
@@ -11,6 +11,16 @@ let settledApiFun = function(vm){
let
checkSettleIDCardFront
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/v1/h5/settled/card-front'
,
params
);
let
checkSettleIDCardFront
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/v1/h5/settled/card-front'
,
params
);
/* 校验身份证反面 */
/* 校验身份证反面 */
let
checkSettleIDCardBack
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/v1/h5/settled/card-back'
,
params
);
let
checkSettleIDCardBack
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/v1/h5/settled/card-back'
,
params
);
/* 缴纳保证金 */
// let paySettleDeposit = async (params = {}) => await vm.$u.post('/rest-xue.yunya.com/v1/settled/pay-deposit', params,{'content-type': 'application/x-www-form-urlencoded'});
let
paySettleDeposit
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'http://apidoc.banshouhui.com:3000/mock/52/v1/settled/pay-deposit'
,
params
,{
'content-type'
:
'application/x-www-form-urlencoded'
});
let
getSettleDepositResult
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'http://apidoc.banshouhui.com:3000/mock/52/v1/settled/pay-deposit'
,
params
,{
'content-type'
:
'application/x-www-form-urlencoded'
});
/* 校验银行卡 */
let
checkSettleBank
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/wxh-site-rest/rest/register/verifyBankCard'
,
params
);
/* 校验支付宝 */
let
checkSettleAlipay
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/wxh-site-rest/rest/register/verifyAlipayAccount'
,
params
);
/* 提交认证资料 */
let
checkSettleSignInfo
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/v1/settled/check-sign-info'
,
params
,{
'content-type'
:
'application/x-www-form-urlencoded'
});
const
settledApi
=
{
const
settledApi
=
{
getSettleBaseInfo
,
getSettleBaseInfo
,
...
@@ -18,6 +28,11 @@ let settledApiFun = function(vm){
...
@@ -18,6 +28,11 @@ let settledApiFun = function(vm){
submitSettleBaseInfo
,
submitSettleBaseInfo
,
checkSettleIDCardFront
,
checkSettleIDCardFront
,
checkSettleIDCardBack
,
checkSettleIDCardBack
,
paySettleDeposit
,
getSettleDepositResult
,
checkSettleBank
,
checkSettleAlipay
,
checkSettleSignInfo
}
}
return
settledApi
return
settledApi
}
}
...
...
take-order/common/base_url.js
View file @
6781b973
let
codeUrl
=
{
let
codeUrl
=
{
apiUrl
:
'https://rest-u.banshouhui.com'
,
apiUrl
:
'https://rest-u.banshouhui.com'
,
apiBaseUrl
:
'https://code.banshouhui.com'
apiBaseUrl
:
'https://code.banshouhui.com'
,
}
}
...
@@ -15,18 +15,22 @@ let ucenterUrl = {
...
@@ -15,18 +15,22 @@ let ucenterUrl = {
/* --------------------------- prod end --------------------------- */
/* --------------------------- prod end --------------------------- */
/* --------------------------- test begin --------------------------- */
/* --------------------------- test begin --------------------------- */
askUrl
=
{
// let askUrl = {
//apiUrl: 'http://fa.yunya.com',
// //apiUrl: 'http://fa.yunya.com',
apiUrl
:
'http://fa.test.ibanshou.cn'
,
// apiUrl: 'http://fa.test.ibanshou.cn',
// apiUrl:'http://rest-u.yunya.com',
// fileUrl: 'https://s-fa.banshouhui.com',
fileUrl
:
'https://s-fa.banshouhui.com'
,
// staticUrl:'https://fa.banshouhui.com/assets/addons/ask/img/uniapp',
staticUrl
:
'https://fa.banshouhui.com/assets/addons/ask/img/uniapp'
,
// }
}
// let ucenterUrl = {
ucenterUrl
=
{
// //apiBaseUrl: 'http://u.yunya.com',
//apiBaseUrl: 'http://u.yunya.com',
// apiBaseUrl: 'http://fa.test.ibanshou.cn'
apiBaseUrl
:
'http://fa.test.ibanshou.cn'
// }
}
codeUrl
=
{
apiUrl
:
'http://rest-u.yunya.com'
,
apiBaseUrl
:
'https://code.banshouhui.com'
,
}
/* --------------------------- test end --------------------------- */
/* --------------------------- test end --------------------------- */
function
getCodeUrl
(
uri
)
{
function
getCodeUrl
(
uri
)
{
...
...
take-order/common/http.interceptor.js
View file @
6781b973
...
@@ -42,7 +42,8 @@ let noLoginUrl = [
...
@@ -42,7 +42,8 @@ let noLoginUrl = [
'/v1/h5/settled/get-settled-info'
,
'/v1/h5/settled/get-settled-info'
,
'/v1/h5/settled/area'
,
'/v1/h5/settled/area'
,
'/v1/h5/settled/save-info'
'/v1/h5/settled/save-info'
,
'http://apidoc.banshouhui.com:3000/mock/52/v1/settled/pay-deposit'
];
];
//设置session_id
//设置session_id
const
getSessionId
=
function
(
vm
)
{
const
getSessionId
=
function
(
vm
)
{
...
...
take-order/components/upload/upload.js
View file @
6781b973
import
qiniuUploader
from
'@/include/libs/qiniuUploader.js'
;
import
qiniuUploader
from
'@/include/libs/qiniuUploader.js'
;
import
globalUrl
from
'@/common/base_url.js'
export
default
{
export
default
{
name
:
'upload-img'
,
name
:
'upload-img'
,
components
:
{},
components
:
{},
data
()
{
data
()
{
return
{
return
{
domain
:
'http
s://s-fa.banshouhui
.com'
,
domain
:
'http
://upload.qiniup
.com'
,
uptokenURL
:
'http://rest-u.yunya.com
/v1/tokens'
,
uptokenURL
:
globalUrl
.
codeUrl
.
apiUrl
+
'
/v1/tokens'
,
imgList
:
[],
imgList
:
[],
imgs
:[],
uploadToken
:
''
uploadToken
:
''
};
};
},
},
...
@@ -36,7 +38,7 @@ export default {
...
@@ -36,7 +38,7 @@ export default {
initQiniu
:
function
()
{
initQiniu
:
function
()
{
var
options
=
{
var
options
=
{
// bucket所在区域,这里是华北区。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
// bucket所在区域,这里是华北区。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
region
:
'
S
CN'
,
region
:
'
E
CN'
,
bucket
:
'fa-cms'
,
bucket
:
'fa-cms'
,
qiniuBucketURLPrefix
:
'uploads'
,
qiniuBucketURLPrefix
:
'uploads'
,
// 获取uptoken方法三选一即可,执行优先级为:uptoken > uptokenURL > uptokenFunc。三选一,剩下两个置空。推荐使用uptokenURL,详情请见 README.md
// 获取uptoken方法三选一即可,执行优先级为:uptoken > uptokenURL > uptokenFunc。三选一,剩下两个置空。推荐使用uptokenURL,详情请见 README.md
...
@@ -70,6 +72,7 @@ export default {
...
@@ -70,6 +72,7 @@ export default {
uni
.
chooseImage
({
uni
.
chooseImage
({
count
:
this
.
selectNum
,
//默认9 this.selectNum
count
:
this
.
selectNum
,
//默认9 this.selectNum
success
:
(
chooseImageRes
)
=>
{
success
:
(
chooseImageRes
)
=>
{
console
.
log
(
chooseImageRes
,
'chooseImageRes'
)
for
(
var
i
=
0
;
i
<
chooseImageRes
.
tempFilePaths
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
chooseImageRes
.
tempFilePaths
.
length
;
i
++
)
{
let
file
=
chooseImageRes
.
tempFilePaths
[
i
];
let
file
=
chooseImageRes
.
tempFilePaths
[
i
];
let
index
=
file
.
lastIndexOf
(
'/'
);
let
index
=
file
.
lastIndexOf
(
'/'
);
...
@@ -83,14 +86,19 @@ export default {
...
@@ -83,14 +86,19 @@ export default {
// filesize: '',
// filesize: '',
progress
:
0
progress
:
0
}
}
const
params
=
{
name
:
name
,
file
:
file
,
}
if
(
newLen
>
0
)
{
if
(
newLen
>
0
)
{
qiniuUploader
.
upload
(
file
,
(
res
)
=>
{
qiniuUploader
.
upload
(
params
,
(
res
)
=>
{
console
.
log
(
res
,
'res'
)
let
inLen
=
this
.
selectNum
-
this
.
imgList
.
length
let
inLen
=
this
.
selectNum
-
this
.
imgList
.
length
if
(
inLen
>
0
)
{
if
(
inLen
>
0
)
{
item
.
src
=
file
item
.
src
=
file
this
.
imgList
.
push
(
item
);
this
.
imgList
.
push
(
item
);
this
.
imgs
.
push
(
res
.
key
)
// this.addRecord(item,res)
// this.addRecord(item,res)
this
.
$emit
(
'image-change'
,
this
.
imgList
)
//将图片回传父页面
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'图片数量不能大于9'
title
:
'图片数量不能大于9'
...
@@ -164,6 +172,7 @@ export default {
...
@@ -164,6 +172,7 @@ export default {
// },
// },
async
removeImg
(
index
)
{
async
removeImg
(
index
)
{
this
.
imgList
.
splice
(
index
,
1
)
this
.
imgList
.
splice
(
index
,
1
)
this
.
imgs
.
splice
(
index
,
1
)
// this.$emit('image-change', this.imgList) //将图片回传父页面
// this.$emit('image-change', this.imgList) //将图片回传父页面
},
},
getUrlKey
(
file
)
{
getUrlKey
(
file
)
{
...
...
take-order/include/libs/pingpp.js
0 → 100644
View file @
6781b973
This diff is collapsed.
Click to expand it.
take-order/include/libs/qiniuUploader.js
View file @
6781b973
...
@@ -77,13 +77,13 @@
...
@@ -77,13 +77,13 @@
}
}
// 正式上传
// 正式上传
function
doUpload
(
filePath
,
success
,
fail
,
options
,
progress
,
cancelTask
)
{
function
doUpload
(
params
,
success
,
fail
,
options
,
progress
,
cancelTask
)
{
if
(
null
==
config
.
qiniuUploadToken
&&
config
.
qiniuUploadToken
.
length
>
0
)
{
if
(
null
==
config
.
qiniuUploadToken
&&
config
.
qiniuUploadToken
.
length
>
0
)
{
console
.
error
(
'qiniu UploadToken is null, please check the init config or networking'
);
console
.
error
(
'qiniu UploadToken is null, please check the init config or networking'
);
return
return
}
}
var
url
=
uploadURLFromRegionCode
(
config
.
qiniuRegion
);
var
url
=
uploadURLFromRegionCode
(
config
.
qiniuRegion
);
var
fileName
=
filePath
.
split
(
'//'
)[
1
];
var
fileName
=
params
.
file
.
split
(
'//'
)[
1
];
// 自定义上传key(即自定义上传文件名)。通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义文件名称。如果options非空,则使用options中的key作为fileName
// 自定义上传key(即自定义上传文件名)。通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义文件名称。如果options非空,则使用options中的key作为fileName
if
(
options
&&
options
.
key
)
{
if
(
options
&&
options
.
key
)
{
fileName
=
options
.
key
;
fileName
=
options
.
key
;
...
@@ -97,7 +97,7 @@
...
@@ -97,7 +97,7 @@
}
}
var
uploadTask
=
wx
.
uploadFile
({
var
uploadTask
=
wx
.
uploadFile
({
url
:
url
,
url
:
url
,
filePath
:
filePath
,
filePath
:
params
.
file
,
name
:
'file'
,
name
:
'file'
,
formData
:
formData
,
formData
:
formData
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
...
@@ -145,9 +145,10 @@
...
@@ -145,9 +145,10 @@
function
getQiniuToken
(
callback
)
{
function
getQiniuToken
(
callback
)
{
wx
.
request
({
wx
.
request
({
url
:
config
.
qiniuUploadTokenURL
,
url
:
config
.
qiniuUploadTokenURL
,
method
:
'POST'
,
//url: 'https://www.llxq.net/addons/qiniu/index/createToken',
//url: 'https://www.llxq.net/addons/qiniu/index/createToken',
success
:
function
(
res
)
{
success
:
function
(
res
)
{
var
token
=
res
.
data
.
data
.
token
;
var
token
=
res
.
data
.
token
;
if
(
token
&&
token
.
length
>
0
)
{
if
(
token
&&
token
.
length
>
0
)
{
config
.
qiniuUploadToken
=
token
;
config
.
qiniuUploadToken
=
token
;
if
(
callback
)
{
if
(
callback
)
{
...
...
take-order/pages.json
View file @
6781b973
...
@@ -55,6 +55,12 @@
...
@@ -55,6 +55,12 @@
"navigationBarTitleText"
:
"入驻提示"
"navigationBarTitleText"
:
"入驻提示"
}
}
},{
"path"
:
"pages/settle/sign-contract"
,
"style"
:
{
"navigationBarTitleText"
:
"签约页面"
}
},
},
{
{
"path"
:
"pages/index/index"
,
"path"
:
"pages/index/index"
,
...
@@ -286,6 +292,10 @@
...
@@ -286,6 +292,10 @@
"name"
:
"缴纳保证金"
,
//模式名称
"name"
:
"缴纳保证金"
,
//模式名称
"path"
:
"pages/settle/pay-ensure"
,
//启动页面,必选
"path"
:
"pages/settle/pay-ensure"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
},{
"name"
:
"签约页面"
,
//模式名称
"path"
:
"pages/settle/sign-contract"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
}]
}]
}
}
}
}
take-order/pages/settle/file-upload.vue
View file @
6781b973
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
<view
class=
"img-wrap rel"
>
<view
class=
"img-wrap rel"
>
<view
class=
"upload-box"
>
<view
class=
"upload-box"
>
<view
class=
"img-item pic"
v-for=
"(file,index) in imgList"
>
<view
class=
"img-item pic"
v-for=
"(file,index) in imgList"
>
<!--
<view
class=
"tip-sucess u-flex u-row-center"
v-if=
"file && (file.status == status.QUEUED || file.status == status.UPLOADING)"
>
<view
class=
"tip-sucess u-flex u-row-center"
v-if=
"file && (file.status == status.QUEUED || file.status == status.UPLOADING)"
>
<span>
正在上传中...
{{
file
.
percent
}}
%
</span>
<span>
正在上传中...
{{
file
.
percent
}}
%
</span>
</view>
-->
</view>
<img
:src=
"file.src"
@
click=
"perviewImg(index)"
>
<img
:src=
"file.src"
@
click=
"perviewImg(index)"
>
<view
class=
"close"
@
click=
"removeImg(index)"
>
<view
class=
"close"
@
click=
"removeImg(index)"
>
<u-icon
name=
"close"
color=
"#fff"
size=
"20"
></u-icon>
<u-icon
name=
"close"
color=
"#fff"
size=
"20"
></u-icon>
...
@@ -41,11 +41,15 @@
...
@@ -41,11 +41,15 @@
// this.initworkingAgeList();
// this.initworkingAgeList();
// this.getareaList()
// this.getareaList()
},
},
onHide
(){
this
.
setPrevPageData
()
},
methods
:
{
methods
:
{
goBack
(
type
)
{
goBack
(
type
)
{
if
(
type
)
{
// if (type) {
this
.
setPrevPageData
()
// this.setPrevPageData()
}
// }
this
.
setPrevPageData
()
uni
.
navigateBack
({
uni
.
navigateBack
({
delta
:
2
delta
:
2
});
});
...
@@ -59,12 +63,11 @@
...
@@ -59,12 +63,11 @@
return
return
}
}
let
prevVue
=
pages
[
pages
.
length
-
2
].
$vm
let
prevVue
=
pages
[
pages
.
length
-
2
].
$vm
this
.
imgList
=
[
prevVue
.
fileInfo
[
uploadType
]
]
this
.
imgList
=
prevVue
.
fileInfo
[
uploadType
]
?
[
prevVue
.
fileInfo
[
uploadType
]]
:
[
]
const
formShowList
=
prevVue
.
formShowList
const
formShowList
=
prevVue
.
formShowList
pageTitle
=
formShowList
.
map
(
item
=>
{
formShowList
.
map
(
item
=>
{
if
(
item
.
filedName
===
uploadType
){
if
(
item
.
filedName
===
uploadType
){
this
.
pageTitle
=
item
.
label
this
.
pageTitle
=
item
.
label
||
'图片上传'
}
}
})
})
uni
.
setNavigationBarTitle
({
uni
.
setNavigationBarTitle
({
...
@@ -73,13 +76,16 @@
...
@@ -73,13 +76,16 @@
},
},
setPrevPageData
()
{
setPrevPageData
()
{
let
pages
=
getCurrentPages
()
let
pages
=
getCurrentPages
()
console
.
log
(
pages
,
'pages'
)
if
(
pages
.
length
<
2
)
{
if
(
pages
.
length
<
2
)
{
return
return
}
}
let
selected
=
this
.
selected
let
selected
=
this
.
selected
let
prevVue
=
pages
[
pages
.
length
-
2
].
$vm
let
prevVue
=
pages
[
pages
.
length
-
2
].
$vm
const
selectType
=
this
.
selectType
const
selectType
=
this
.
selectType
prevVue
.
fileInfo
[
selectType
]
=
this
.
imgList
console
.
log
(
this
.
imgList
,
'this.imgList'
)
prevVue
.
fileInfo
[
selectType
]
=
this
.
imgList
.
join
(
','
)
console
.
log
(
prevVue
.
fileInfo
,
'prev.fileInfo'
)
},
},
initworkingAgeList
()
{
initworkingAgeList
()
{
let
list
=
[{
let
list
=
[{
...
...
take-order/pages/settle/pay-ensure.vue
View file @
6781b973
...
@@ -7,41 +7,113 @@
...
@@ -7,41 +7,113 @@
</view>
</view>
<view
class=
"seat"
></view>
<view
class=
"seat"
></view>
<view
class=
"btn-wrap flex-xc"
>
<view
class=
"btn-wrap flex-xc"
>
<button
class=
"btn-submit"
@
click=
"submitBaseInfo
"
>
<button
class=
"btn-submit"
:disabled=
"saving"
@
click=
"paySubmit
"
>
微信支付
{{
saving
?
'支付中……'
:
'微信支付'
}}
</button>
</button>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
pingpp
from
'@/include/libs/pingpp.js'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
baseInfo
:
{
name
:
""
,
mobile
:
""
,
service_area
:
[],
working_age
:
""
,
address
:
''
},
saving
:
false
,
saving
:
false
,
areaTxts
:
[],
paySuccess
:
false
,
workingAgeTxt
:
''
,
protocolContent
:
''
}
}
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
},
},
computed
:
{
computed
:
{},
},
components
:
{
components
:
{
},
},
methods
:
{
methods
:
{
successCallback
(){
const
timer
=
setTimeout
(()
=>
{
uni
.
navigateTo
({
url
:
'/pages/settle/prompt'
})
})
},
pending
(){
const
timer
=
setTimeout
(
async
()
=>
{
clearTimeout
(
timer
)
const
params
=
{
}
const
res
=
await
this
.
$u
.
api
.
getSettleDepositResult
(
params
);
if
(
!
res
.
status
){
return
}
const
payStatus
=
res
.
data
.
status
switch
(
parseInt
(
payStatus
))
{
case
0
:
this
.
pending
();
break
;
case
1
:
this
.
paySuccess
=
true
uni
.
showToast
({
title
:
'支付成功'
,
icon
:
'none'
})
this
.
successCallback
()
break
;
default
:
this
.
paySuccess
=
false
}
clearTimeout
(
timer
)
},
1000
)
},
async
paySubmit
()
{
this
.
saving
=
true
uni
.
showLoading
({
title
:
'支付中……'
})
// 提交支付订单
const
params
=
{
oid
:
2
,
type
:
'wx_pub'
}
const
res
=
await
this
.
$u
.
api
.
paySettleDeposit
(
params
);
if
(
!
res
.
status
)
{
uni
.
showToast
({
title
:
'支付调用失败,请稍后重试'
,
icon
:
'none'
})
return
}
const
{
charge
}
=
res
.
data
;
//Web 与微信内支付
pingpp
.
createPayment
(
charge
,
(
result
,
err
)
=>
{
if
(
result
==
"success"
)
{
// 只有微信公众账号 (wx_pub)、微信小程序 (wx_lite)、QQ 公众号 (qpay_pub)、支付宝口碑 (alipay_qr)
// 支付成功的结果会在这里返回,其他的支付结果都会跳转到 extra 中对应的 URL。
uni
.
showToast
({
title
:
'支付成功'
,
icon
:
'none'
})
}
else
if
(
result
==
"fail"
)
{
// charge 不正确或者微信公众账号/QQ 公众号/支付宝口碑支付失败时会在此处返回
console
.
log
(
err
.
msg
)
// uni.showToast({
// title: err.msg,
// icon:'none'
// })
}
else
if
(
result
==
"cancel"
)
{
// 微信公众账号、QQ 公众号、支付宝口碑支付取消支付
uni
.
showToast
({
title
:
'您已经取消了支付'
,
icon
:
'none'
})
}
});
},
},
},
}
}
</
script
>
</
script
>
...
...
take-order/pages/settle/sign-contract.vue
0 → 100644
View file @
6781b973
<
template
>
<view
class=
"content"
>
<view
class=
"title"
>
入驻基本信息
</view>
<view
class=
"base-list"
>
<view
class=
"item item-input flex-yc"
>
<label
class=
"label"
>
签约人
</label>
<view
class=
"input flex1 u-text-right"
>
{{
baseInfo
.
name
}}
</view>
</view>
<view
class=
"item item-select u-row-between"
>
<view
class=
"label"
>
结算方式:
</view>
<u-radio-group
v-model=
"baseInfo.pay_type"
>
<u-radio
v-for=
"(item, index) in radioList"
:key=
"index"
:name=
"item.value"
>
{{
item
.
name
}}
</u-radio>
</u-radio-group>
</view>
<template
v-if=
"baseInfo.pay_type==='bankcard'"
>
<view
class=
"item item-input flex u-row-between"
>
<label
class=
"label"
>
银行名称
</label>
<input
placeholder=
"请输入银行名称"
v-model=
"baseInfo.bank_name"
class=
"input flex1"
/>
</view>
<view
class=
"item item-input flex u-row-between"
>
<label
class=
"label"
>
银行卡号
</label>
<input
placeholder=
"请输入银行卡号"
v-model=
"baseInfo.bank_no"
type=
"number"
class=
"input flex1"
/>
</view>
<view
class=
"item item-input flex u-row-between"
>
<label
class=
"label"
>
支行名称
</label>
<input
placeholder=
"请输入支行名称"
v-model=
"baseInfo.bank_site"
class=
"input flex1"
/>
</view>
</
template
>
<
template
v-else
>
<view
class=
"item item-input flex u-row-between"
>
<label
class=
"label"
>
姓名
</label>
<input
placeholder=
"请输入账户名称"
v-model=
"baseInfo.bank_name"
class=
"input flex1"
/>
</view>
<view
class=
"item item-input flex u-row-between"
>
<label
class=
"label"
>
支付宝账号
</label>
<input
placeholder=
"请输入支付宝账号"
v-model=
"baseInfo.bank_no"
class=
"input flex1"
/>
</view>
</
template
>
</view>
<view
class=
"seat"
></view>
<view
class=
"btn-wrap flex-xc"
>
<button
class=
"btn-submit"
:disabled=
"!submitStatus"
@
click=
"submitBaseInfo"
>
确定
</button>
</view>
</view>
</template>
<
script
>
let
r
=
require
(
"../../libs/bmap-wx.min.js"
);
let
h
=
new
r
.
BMapWX
({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak
:
"lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
export
default
{
data
()
{
return
{
baseInfo
:
{
name
:
"张三"
,
id_card_no
:
""
,
id
:
""
,
bank_no
:
''
,
// 银行卡号
bank_site
:
''
,
// 开户行
bank_name
:
''
,
// 银行名称
pay_type
:
'bankcard'
// 结算方式:bankcard银行卡,alipay支付宝
},
radioList
:[{
name
:
'银行卡'
,
value
:
'bankcard'
},{
name
:
'支付宝'
,
value
:
'alipay'
}],
saving
:
false
,
}
},
onLoad
(
e
)
{
},
onShow
(){
console
.
log
(
'onshow'
)
},
computed
:
{
submitStatus
()
{
const
baseInfo
=
this
.
baseInfo
const
flag
=
baseInfo
.
pay_type
&&
baseInfo
.
bank_no
&&
baseInfo
.
bank_name
return
flag
&&
!
this
.
saving
;
},
},
components
:
{
},
methods
:
{
checkBaseInfo
()
{
const
baseInfo
=
this
.
baseInfo
;
let
rulesObj
=
{
pay_type
:
function
(
value
)
{
if
(
!
value
)
{
uni
.
showToast
({
title
:
'请选择支付方式'
,
icon
:
'none'
});
return
false
;
}
},
mobile
:
function
(
value
)
{
const
mobileReg
=
/^
[
1
][
3,4,5,7,8
][
0-9
]{9}
$/
;
if
(
!
value
)
{
uni
.
showToast
({
title
:
'请输入您的电话'
,
icon
:
'none'
});
return
false
;
return
false
;
}
else
if
(
!
mobileReg
.
test
(
value
))
{
uni
.
showToast
({
title
:
'请输入正确的电话'
,
icon
:
'none'
});
return
false
;
}
},
bank_site
:
function
(
value
)
{
if
(
!
value
&&
baseInfo
.
pay_type
===
'bankcard'
)
{
uni
.
showToast
({
title
:
'请输入支行名称'
,
icon
:
'none'
});
return
false
;
}
},
bank_no
:
function
(
value
)
{
const
pay_type
=
baseInfo
.
pay_type
const
txt
=
pay_type
===
'bankcard'
?
'银行卡号'
:
'支付宝账户'
const
bandReg
=
/^
([
1-9
]{1})(\d{15}
|
\d{16}
|
\d{18})
$/
if
(
!
value
)
{
uni
.
showToast
({
title
:
'请输入'
+
txt
,
icon
:
'none'
});
return
false
;
}
else
if
(
!
bandReg
.
test
(
value
)
&&
pay_type
===
'bankcard'
)
{
uni
.
showToast
({
title
:
'请输入正确的银行卡号'
,
icon
:
'none'
});
return
false
;
}
},
bank_name
:
function
(
value
)
{
const
txt
=
baseInfo
.
pay_type
===
'bankcard'
?
'银行'
:
'支付宝账户'
if
(
!
value
)
{
uni
.
showToast
({
title
:
'请输入'
+
txt
+
'名称'
,
icon
:
'none'
});
return
false
;
}
},
};
const
flagArr
=
Object
.
keys
(
baseInfo
).
some
((
key
)
=>
{
// 返回验证失败的数组
let
flag
=
true
;
if
(
rulesObj
.
hasOwnProperty
(
key
))
{
const
func
=
rulesObj
[
key
];
const
value
=
baseInfo
[
key
];
if
(
typeof
func
===
"function"
)
{
flag
=
func
(
value
)
===
false
?
false
:
true
;
}
}
return
!
flag
;
});
return
!
flagArr
||
flagArr
.
length
<
1
;
},
async
checkBank
(){
const
type
=
this
.
baseInfo
.
pay_type
const
request
=
{
bankcard
:
this
.
$u
.
api
.
checkSettleBank
,
alipay
:
this
.
$u
.
api
.
checkSettleAlipay
}
const
res
=
await
request
[
type
]()
if
(
res
.
code
!==
200
){
return
}
return
true
},
async
submitInfo
(){
// checkSettleSignInfo
const
baseInfo
=
this
.
baseInfo
;
const
params
=
{
...
baseInfo
,
}
const
res
=
this
.
$u
.
api
.
checkSettleSignInfo
(
params
)
if
(
res
.
status
!=
200
)
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
});
return
;
}
return
true
},
async
jumpSign
(){
// 跳转签约
const
baseInfo
=
this
.
baseInfo
;
const
params
=
{
...
baseInfo
,
}
const
res
=
this
.
$u
.
api
.
checkSettleSignInfo
(
params
)
if
(
res
.
status
!=
200
)
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
});
return
;
}
return
true
},
async
submitBaseInfo
()
{
const
baseInfo
=
this
.
baseInfo
;
if
(
!
this
.
checkBaseInfo
())
{
return
;
}
this
.
saving
=
true
;
uni
.
showLoading
({
title
:
'加载中'
});
const
requestArr
=
[
'checkBank'
,
'submitBaseInfo'
,
'jumpSign'
]
for
(
let
i
=
0
;
i
<
requestArr
.
length
;
i
++
){
const
result
=
await
this
[
requestArr
[
i
]]()
if
(
!
result
){
break
;
}
}
this
.
saving
=
false
;
uni
.
hideLoading
()
uni
.
showToast
({
title
:
'入驻基本信息提交成功'
,
icon
:
'success'
});
let
timer
=
setTimeout
(()
=>
{
clearTimeout
(
timer
)
uni
.
navigateTo
({
url
:
'/pages/settle/file'
})
},
2000
)
},
},
}
</
script
>
<
style
lang=
"scss"
>
.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
;
}
}
}
.title
{
padding
:
30rpx
0
40rpx
;
text-align
:
center
;
line-height
:
50rpx
;
font-size
:
36rpx
;
color
:
#333
;
font-weight
:
bold
;
}
.seat
{
padding-bottom
:
144rpx
;
}
/*提交按钮*/
.btn-wrap
{
position
:
fixed
;
// margin: px2rem(36);
left
:
0
;
right
:
0
;
bottom
:
0
;
padding
:
30rpx
0
;
background
:
#f3f3f3
;
.btn-submit
{
width
:
600rpx
;
// left: 5%;
// bottom: px2rem(36);
height
:
104rpx
;
line-height
:
104rpx
;
background
:
#2272ff
;
font-size
:
32rpx
;
color
:
#fff
;
&
:disabled
{
border
:
2rpx
solid
#999
;
background-color
:
#f3f3f3
;
color
:
#999
;
}
}
}
/* .back_view{
background-color: #FFFFFF;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
}
*/
</
style
>
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