thirdpayment
elf 11 months ago
parent 919b5dee02
commit 75eb8401be

@ -111,6 +111,33 @@ class AccountController extends AbstractController
return $this->success(['url' => $url]);
}
public function unbindCard(RequestInterface $request)
{
$userInfo = $this->checkUser($request);
$userId = $this->resetUserId($userInfo['userId']);
$requestLog = $this->createRequestLog(['userId' => $userId]);
$result = $this->userService->unbindCard($requestLog->getData(), $requestLog->app);
return $this->success(['result' => $result]);
}
public function setPayPassword(RequestInterface $request)
{
$userInfo = $this->checkUser($request);
$userId = $this->resetUserId($userInfo['userId']);
$requestLog = $this->createRequestLog(['userId' => $userId]);
$url = $this->userService->pwdForget($requestLog->getData(), $requestLog->app, $requestLog->request_token);
return $this->success(['url' => $url]);
}
public function resetPayPassword(RequestInterface $request)
{
$userInfo = $this->checkUser($request);
$userId = $this->resetUserId($userInfo['userId']);
$requestLog = $this->createRequestLog(['userId' => $userId]);
$url = $this->userService->pwdModify($requestLog->getData(), $requestLog->app, $requestLog->request_token);
return $this->success(['url' => $url]);
}
public function transferPay(RequestInterface $request)
{
$userInfo = $this->checkUser($request);

@ -42,6 +42,9 @@ Router::addGroup('/account',function () {
Router::post('/register', [AccountController::class, 'register']);
Router::post('/open-account', [AccountController::class, 'openAccount']);
Router::post('/bind-card', [AccountController::class, 'bindCard']);
Router::post('/unbind-card', [AccountController::class, 'unBindCard']);
Router::post('/set-pay-password', [AccountController::class, 'setPayPassword']);
Router::post('/reset-pay-password', [AccountController::class, 'resetPayPassword']);
Router::post('/transfer-pay', [AccountController::class, 'transferPay']);
Router::post('/user-info', [AccountController::class, 'getUserInfo']);
}, []);

@ -24,16 +24,16 @@
<el-descriptions-item label="用户名" v-else><el-button type="primary" @click="openAccount" size="mini" round>开户</el-button></el-descriptions-item>
<el-descriptions-item label="身份证号" v-if="userInfo != null && userInfo.realname_flag==='Y'">{{userInfo.certificate_no}}</el-descriptions-item>
<el-descriptions-item label="身份证号" v-else>--</el-descriptions-item>
<el-descriptions-item label="支付密码" v-if="userInfo != null && userInfo.set_pwd_flag==='Y'">********** <el-button type="primary" @click="openAccount" size="mini" round>修改</el-button></el-descriptions-item>
<el-descriptions-item label="支付密码" v-else><el-button type="primary" @click="openAccount" size="mini" round>设置</el-button></el-descriptions-item>
<el-descriptions-item label="支付密码" v-if="userInfo != null && userInfo.set_pwd_flag==='Y'">********** <el-button type="primary" @click="resetPayPassword" size="mini" round>修改</el-button></el-descriptions-item>
<el-descriptions-item label="支付密码" v-else><el-button type="primary" @click="setPayPassword" size="mini" round>设置</el-button></el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-descriptions title="绑卡信息">
<el-descriptions-item label="开户行" v-if="bankCard != null && bankCard.bind_card_flag==='Y'">{{bankCard.bank_name}} <el-button type="primary" @click="openAccount" size="mini" round>解绑</el-button></el-descriptions-item>
<el-descriptions-item label="开户行" v-else><el-button type="primary" @click="openAccount" size="mini" round>绑卡</el-button></el-descriptions-item>
<el-descriptions-item label="开户行" v-if="bankCard != null && bankCard.bind_card_flag==='Y'">{{bankCard.bank_name}} <el-button type="primary" @click="unbindCard" size="mini" round>解绑</el-button></el-descriptions-item>
<el-descriptions-item label="开户行" v-else><el-button type="primary" @click="bindCard" size="mini" round>绑卡</el-button></el-descriptions-item>
<el-descriptions-item label="开户姓名" v-if="bankCard != null && bankCard.bind_card_flag==='Y'">{{bankCard.card_user_name}}</el-descriptions-item>
<el-descriptions-item label="开户姓名" v-else>--</el-descriptions-item>
</el-descriptions>
@ -116,21 +116,63 @@
});
console.log('submit!');
},
resetPayPassword() {
axios.post('/account/reset-pay-password', {token: window.sessionStorage.getItem('token')})
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
window.open(result.data.url)
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
setPayPassword() {
axios.post('/account/set-pay-password', {token: window.sessionStorage.getItem('token')})
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
window.open(result.data.url)
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
bindCard() {
axios.post('/account/bind-card', this.bindConfirmForm)
axios.post('/account/bind-card', {token: window.sessionStorage.getItem('token')})
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
this.bindConfirmVisible = false;
this.$message.success('支付成功');
this.$alert('请记住您的订单号:' + result.data.bizData.outOrderNo , '支付成功', {
confirmButtonText: '确定',
callback: action => {
}
});
window.open(result.data.url)
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
unbindCard() {
axios.post('/account/unbind-card', {token: window.sessionStorage.getItem('token')})
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
window.location.href = window.location.href;
})
.catch((error) => {
this.$message.error('请求错误');

Loading…
Cancel
Save