Commit 44db59dc authored by FE-安焕焕's avatar FE-安焕焕 👣

接口联调

parent 6aa1b0ca
......@@ -52,6 +52,11 @@ const getGoodsList = function(data) {
});
};
// KA流程节点
const kaGetNextUrl = function() {
return request.get(`${talosHost}/api/kdsp/ka/process/get-next-url`);
};
export {
pay,
prepay,
......@@ -62,5 +67,6 @@ export {
ocrFaceId,
queryPayInfo,
getGoodsList,
kaGetNextUrl,
queryPayStatus
};
......@@ -14,6 +14,6 @@ let protocol = window.location.protocol;
let payHost = protocol + '//mapi-qa.liangkebang.net/pay';
let shenceHost = 'https://bn.xyqb.com/sa?project=default'; // 测试地址
let talosHost = 'http://yapi.quantgroups.com/mock/351'; // 电商分期测试环境服务地址
let talosHost = 'http://talos-vcc2.liangkebang.net'; // 电商分期测试环境服务地址
let operatorHost = 'https://operator.liangkebang.com';
export default { talosHost, operatorHost, payHost, shenceHost, test: true };
......@@ -38,11 +38,10 @@ export default {
},
watch: {
userPhoneInfo: function(val) {
this.phoneNoHome = val?.phoneNoHome;
this.changeTelFormat(val?.phoneNo);
this.phoneNoHome = val.phoneNoHome;
}
},
created() {},
methods: {
changeTelFormat(phone) {
this.phoneNoHome = '';
......
......@@ -45,6 +45,7 @@ const IS_CREDIT_PAY = method =>
const PAYMENT_CODE_PAY = 1; // 支付密码
const SMS_VERIFICATION_CODE_PAY = 2; //短信验证码
const FACE_VERIFICATION_CODE_PAY = 4; //短信验证码
const PAY_SUCCESS = 3; // 支付成功
const PAY_PAYING = 2; //支付中
......@@ -83,6 +84,7 @@ function isDetentionFn() {
if (this.creditPayList.payList[key].isRecommend) {
const type = this.creditPayList.payList[key].payType;
this.changePayType(type, this.creditPayList.payList[key].mergePayPretreatmentInfo);
this.isCheckAgreement = true;
this.pay();
return;
}
......@@ -104,6 +106,7 @@ function isDetentionFn() {
onConfirm: () => {
// 切换享花卡支付
this.changePayType(CREDIT_PAY);
this.isCheckAgreement = true;
this.pay();
}
});
......@@ -145,5 +148,6 @@ export {
ACCOUNT_APPLY_SUCCESS,
ACCOUNT_APPLY_AUDITING,
ACCOUNT_APPLY_AUDIT_FAIL,
SMS_VERIFICATION_CODE_PAY
SMS_VERIFICATION_CODE_PAY,
FACE_VERIFICATION_CODE_PAY
};
......@@ -23,11 +23,12 @@
export default {
name: 'Contract',
props: {
contractList: Array
contractList: Array,
value: Boolean
},
data() {
return {
isCheck: false
isCheck: this.value
};
},
methods: {
......@@ -35,7 +36,7 @@ export default {
window.location.href = url;
},
change(e) {
this.$emit('change', e);
this.$emit('input', e);
}
}
};
......
......@@ -6,15 +6,22 @@
<cr-image :src="value.icon" class="icon" mode="aspectFit" width="39" height="39" />
<div class="content-info-con">
<div class="content-info-tit">
<div class="content-info-tit-wrap">
<p class="content-info-tit">{{ value.name }}</p>
<p v-if="value.tagName" class="content-info-tit_tag">{{ value.tagName }}</p>
</div>
<p>{{ value.accountStatusDesc }}</p>
</div>
<p v-if="isGroupPay && value.mergePayPretreatmentInfo" class="content-info-amount">
{{ value.mergePayPretreatmentInfo && value.mergePayPretreatmentInfo.creditPayAmt }}
{{
value.mergePayPretreatmentInfo && value.mergePayPretreatmentInfo.creditPayAmt
}}.00
</p>
</div>
<p>{{ value.accountStatusDesc }}</p>
</div>
<!-- <p v-if="isGroupPay && value.mergePayPretreatmentInfo" class="content-info-amount">
{{ value.mergePayPretreatmentInfo && value.mergePayPretreatmentInfo.creditPayAmt }}.00
</p> -->
</div>
<div
v-if="showCoupon && value.payType === 1"
class="couponDes"
......@@ -110,7 +117,6 @@ export default {
}
.type-item {
width: 100%;
// height: 134rpx;
padding: 12px 8px 12px 12px;
box-sizing: border-box;
display: flex;
......@@ -123,7 +129,6 @@ export default {
&-content-info {
width: 100%;
display: flex;
// width: 308px;
align-items: center;
}
&-checkbox {
......@@ -141,6 +146,10 @@ export default {
margin-bottom: 2px;
display: flex;
align-items: center;
justify-content: space-between;
&-wrap {
display: flex;
}
&_tag {
display: inline-flex;
align-items: center;
......@@ -161,6 +170,9 @@ export default {
color: @font-color-light;
}
.content-info-amount {
width: 100px;
text-align: left;
word-break: break-all;
&::before {
content: '¥';
}
......
......@@ -8,7 +8,9 @@
:show-coupon="showCoupon"
:risk-limit="riskLimit"
/>
<p class="dashed">
</div>
<div class="dashed">
<p class="dashed-line" />
<cr-checkbox
v-model="thirdPayInfo.isCheck"
shape="round"
......@@ -17,7 +19,9 @@
class="dashed-checkbox"
@click.native="changePayType(thirdPayInfo)"
/>
</p>
</div>
<!-- <PayCardItem :is-group-pay="true" :value="thirdPayInfo" /> -->
<div class="groupCard">
<PayCardItem :is-group-pay="true" :value="thirdPayInfo" />
</div>
<p class="group-more b-t" @click="openMore">更多支付组合<cr-icon type="arrow" size="15px" /></p>
......@@ -97,7 +101,7 @@ export default {
</script>
<style lang="less">
.groupCard {
width: 320px;
width: 100%;
}
.group-more {
.text-13;
......@@ -114,28 +118,21 @@ export default {
z-index: 2;
}
.dashed {
width: 309px;
margin: auto;
position: relative;
width: 100%;
padding: 0 12px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
&-line {
width: 310px;
border-bottom: 1px dashed #dcdcdc;
}
&-checkbox {
width: 18px;
position: absolute;
right: -22px;
top: -8px;
}
&::after {
content: '';
width: 24px;
height: 28px;
position: absolute;
margin-top: -12px;
left: 50%;
margin-left: -12px;
background: url('../../../assets/images/addicon.png') no-repeat;
background-size: 100%;
}
}
.more-title {
.text-16;
display: flex;
......
<template>
<cr-overlay :show="value" @click="closeModal">
<cr-overlay :show="value">
<div class="sms-modal">
<div class="sms">
<p class="sms-icon"><cr-icon type="cross" color="#999999" @click="closeModal" /></p>
<p class="sms-title">请输入短信验证码</p>
<p class="sms-des">为保证您账户安全,此笔交易需要短信验证</p>
<p class="phone">已发送至 {{ getPhone() }}17611682272</p>
<p class="phone">已发送至 {{ getPhone() }}</p>
<cr-authcode-field
span-size="20px"
type="number"
......@@ -87,7 +87,7 @@ export default {
},
getPhone() {
const phone = localStorage.get('phoneNo');
const phoneS = phone.replace(/(\d{3})\d*(\d{4})/, '+86 $1 **** $2');
const phoneS = `${phone}`.replace(/(\d{3})\d*(\d{4})/, '+86 $1 **** $2');
return phoneS;
},
sendSa() {
......
......@@ -41,8 +41,8 @@
<cr-contract
v-if="isShowProtocol"
ref="agreement"
v-model="isCheckAgreement"
:contract-list="payContractInfo.contractInfos"
@change="$event => (isCheckAgreement = $event)"
/>
<cr-button
type="primary"
......@@ -81,7 +81,7 @@
no-render-disable-tab
:show-coupon="couponPopup"
:enable-list="payCouponList"
:value="selectedCoupon.pickupId"
:value="selectedCoupon.id"
@click="selectCouponItem"
@change="handleSelectCoupon"
/>
......@@ -119,9 +119,18 @@ import {
creditPayStatusType,
ACCOUNT_APPLY_SUCCESS,
ACCOUNT_APPLY_AUDIT_FAIL,
SMS_VERIFICATION_CODE_PAY //短信验证码
SMS_VERIFICATION_CODE_PAY, //短信验证码
FACE_VERIFICATION_CODE_PAY
} from './STATIC_DATA';
import { pay, prepay, getCoupon, h5AppyUrl, ocrFaceId, queryPayInfo } from '@/api/pay.api.js';
import {
pay,
prepay,
getCoupon,
h5AppyUrl,
ocrFaceId,
queryPayInfo,
kaGetNextUrl
} from '@/api/pay.api.js';
const VCC_CHANNEL = localStorage.get('vccChannel');
export default {
components: {
......@@ -401,7 +410,8 @@ export default {
},
orderNo: this.orderNo,
payMethod: this.payType,
payCouponId: this.selectedCoupon.pickupId || ''
payCouponId: this.selectedCoupon.id || '',
mergePayPretreatmentId: this.mergePayPretreatmentInfo?.mergePayPretreatmentId
};
const [data, error] = params ? await pay(paramsData) : await prepay(paramsData);
/* 支付失败 */
......@@ -427,11 +437,12 @@ export default {
payByWay('ALIWEB', aliPayInfo);
return;
}
if (creditPayStatus === PAY_PAYING) {
/* 支付中 */
this.payResult('Waiting');
return;
}
// if (creditPayStatus === PAY_PAYING) {
// /* 支付中? */
// this.payResult('Waiting');
// return;
// }
console.log(creditPayStatus);
if (creditPayStatus === PAY_SUCCESS) {
/* 支付成功 */
this.payResult('Success');
......@@ -441,6 +452,11 @@ export default {
/* 密码或者短信鉴权 */
this.close();
this[`${creditPayStatusType[creditPayStatus]}Modal`] = true;
return;
}
/* 人脸鉴权 */
if (creditPayStatus === FACE_VERIFICATION_CODE_PAY) {
this.goOcr();
}
},
payResult(type, error) {
......@@ -510,10 +526,19 @@ export default {
},
/* 进入h5授信流程 */
async goApply() {
if (this.$route.query.ka) {
this.getKaGetNextUrl();
return;
}
const [{ url }] = await h5AppyUrl();
if (url) return;
window.location.href = url;
},
async getKaGetNextUrl() {
const [{ nextUrl }] = await kaGetNextUrl();
if (!nextUrl) return;
window.location.href = nextUrl;
},
/* 走h5活体流程 */
async goOcr() {
const [{ url }] = await ocrFaceId({
......@@ -543,8 +568,10 @@ export default {
},
goHome() {
// 商城地址
this.$router.push({ name: 'home' });
},
goOrderDetail() {
this.$router.push({ name: 'orderList' });
// 订单详情地址
}
}
......
......@@ -70,12 +70,14 @@ export default {
methods: {
goHome() {
// 去页面
this.$router.push({ name: 'home' });
},
goOrderDetail() {
registeredEvents('PD_YXMMAEC_UserClickCashierCheckOrderBtn', {
order_id: this.orderNo
});
// 去订单详情页面
this.$router.push({ name: 'orderList' });
},
goPay() {
registeredEvents('PD_YXMMAEC_UserClickCashierPaymentAgainBtn', {
......
......@@ -115,7 +115,7 @@ export default {
async getSkuList() {
this.skuList = [];
const { spuNo: spuNos, type } = this.spuInfo;
const [res] = await rechargeApi.getSkuList({ spuNos, type });
const [res] = await rechargeApi.getSkuList(spuNos, type);
if (res) {
this.skuList = res.rechargeList;
this.handleSkuSelected(res.rechargeList[0], 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment