Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
e90742db
Commit
e90742db
authored
Mar 24, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
fd8ae213
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
1 deletions
+110
-1
xgg-saas-merchant/app/base/wxapplet/impl/merchantApplet.js
+109
-0
xgg-saas-merchant/app/config/environment.js
+1
-1
No files found.
xgg-saas-merchant/app/base/wxapplet/impl/merchantApplet.js
View file @
e90742db
...
...
@@ -70,6 +70,115 @@ class MerchantApplet extends AppletBase {
let
user
=
await
this
.
getLoginUser
(
pobj
.
merchant_id
,
pobj
.
openid
);
return
this
.
returnSuccess
(
user
);
}
// 保存订单信息
async
saveOrder
(
gobj
,
pobj
,
req
,
loginUser
)
{
try
{
let
merchant
=
await
this
.
getMerchant
(
merchant_id
);
let
rs
=
await
this
.
buildOrder
(
pobj
,
merchant
);
if
(
rs
.
code
===
0
)
{
return
rs
;
}
var
info
=
await
this
.
bmorderSve
.
saveOrderBiz
(
rs
.
data
);
var
result
=
{
code
:
1
};
return
result
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
);
//日志记录
logCtl
.
error
({
optitle
:
"查询商户信息错误, params [id = "
+
pobj
.
id
+
" ]"
,
op
:
"wxapplet/impl/xggApplet/merchantInfo"
,
content
:
e
.
stack
,
clientIp
:
req
.
clientIp
});
if
(
e
.
name
==
'SequelizeUniqueConstraintError'
)
{
return
{
code
:
2
,
msg
:
"您的信息已经提交成功,请到我的订单中查看"
};
}
return
{
code
:
-
200
,
msg
:
"error"
,
data
:
{},
stack
:
e
.
stack
};
}
}
async
buildOrder
(
obj
)
{
if
(
!
obj
.
idcard_front
)
{
return
this
.
returnFail
(
"请上传身份证人像面"
);
}
if
(
!
obj
.
idcard_back
)
{
return
this
.
returnFail
(
"请上传身份证国徽图"
);
}
if
(
!
obj
.
legal_name
)
{
return
this
.
returnFail
(
"请填写法人姓名"
);
}
if
(
!
obj
.
legal_mobile
)
{
return
this
.
returnFail
(
"请填写联系手机"
);
}
if
(
!
/^1
\d{10}
$/
.
test
(
obj
.
legal_mobile
))
{
return
this
.
returnFail
(
"联系手机格式错误"
);
}
if
(
!
obj
.
legal_idno
)
{
return
this
.
returnFail
(
"请填写身份证号码"
);
}
if
(
!
await
this
.
idcardClient
.
checkIDCard
(
obj
.
legal_idno
))
{
return
this
.
returnFail
(
"身份证号码错误,请检查后重新输入"
);
}
if
(
!
obj
.
company_names
)
{
return
this
.
returnFail
(
"请填写公司名称"
);
}
if
(
!
obj
.
bank_front
)
{
return
this
.
returnFail
(
"请上传银行卡正面"
);
}
if
(
!
obj
.
bank_back
)
{
return
this
.
returnFail
(
"请上传银行卡反面"
);
}
if
(
!
obj
.
bank_mobile
)
{
return
this
.
returnFail
(
"请填写银行预留手机号"
);
}
var
order
=
{
merchantId
:
obj
.
merchantId
||
this
.
merchantId
,
companyId
:
obj
.
companyId
,
orderNo
:
orderNo
,
userId
:
loginUser
.
id
,
ownerId
:
0
,
status
:
0
,
auditStatus
:
0
};
var
userbiz
=
{
merchantId
:
obj
.
merchantId
||
this
.
merchantId
,
companyId
:
obj
.
companyId
,
orderNo
:
orderNo
,
user_id
:
loginUser
.
id
,
idcard_front
:
obj
.
idcard_front
,
idcard_back
:
obj
.
idcard_back
,
idcard
:
obj
.
idcard
,
legal_name
:
obj
.
legal_name
,
legal_mobile
:
obj
.
legal_mobile
,
person_img
:
obj
.
person_img
||
""
,
companyNames
:
obj
.
companyNames
,
bank_front
:
obj
.
bank_front
,
bank_back
:
obj
.
bank_back
,
bank
:
obj
.
bank
,
bankno
:
obj
.
bankno
,
bankMobile
:
obj
.
bankMobile
||
""
,
};
rs
.
code
=
1
;
rs
.
data
=
{
order
:
order
,
userbiz
:
userbiz
,
};
return
rs
;
}
//
// async commonInfo(gobj, pobj, req, loginUser) {
// var user = await this.bmuserSve.findById(loginUser.id);
...
...
xgg-saas-merchant/app/config/environment.js
View file @
e90742db
...
...
@@ -27,7 +27,7 @@ module.exports = function (app) {
app
.
all
(
'*'
,
function
(
req
,
res
,
next
)
{
req
.
objs
=
system
;
res
.
header
(
'Access-Control-Allow-Origin'
,
'*'
);
res
.
header
(
'Access-Control-Allow-Headers'
,
'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, xggsaa
splatform
sid'
);
res
.
header
(
'Access-Control-Allow-Headers'
,
'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, xggsaa
merchant
sid'
);
res
.
header
(
'Access-Control-Allow-Methods'
,
'PUT, POST, GET, DELETE, OPTIONS'
);
// res.header('Access-Control-Allow-Credentials', 'true');
if
(
req
.
method
==
'OPTIONS'
)
{
...
...
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