Commit fb84552a authored by Xuguangxing's avatar Xuguangxing

feat: 处理支付结果页

parent 7d16b7f5
......@@ -32,10 +32,18 @@
</style>
<script>
export default {
props: {
groupInfo: {
type: Object,
default: () => {
return {};
}
}
},
methods: {
showRules() {
this.$dialog({
message: '啊啊啊啊啊啊啊啊啊',
message: this.groupInfo.groupBuyDesc || '',
title: '拼团须知',
showCancelButton: false,
confirmButtonText: '我知道了'
......
......@@ -14,6 +14,7 @@ const kdspHost = 'https://kdsp-api-vcc3.liangkebang.net';
// const talosHost = 'http://192.168.25.210:8080'; // 张超
// const talosHost = 'http://192.168.28.83:80'; // 董彪
// const talosHost = 'http://192.168.25.122:8098'; // 王永杰
// const talosHost = protocol + '//192.168.28.41'; // 超人
const opapiHost = 'https://opapi-vcc3.liangkebang.net';
const VCC_CHANNEL = '';
const TERMINAL = 'H5';
......
......@@ -70,7 +70,7 @@
}"
/>
</template>
<rules />
<rules :group-info="detailInfo.groupBuyInfo || {}" />
</div>
<span v-if="detailImgList.length" id="goodDetail" class="goods-divider">宝贝详情</span>
<div class="goods-detail-imgs">
......
......@@ -204,7 +204,7 @@ export default {
cookies.set('skuID', params.skuList[0].skuNo);
if (isWxMp) {
this.nativeBridge.openNewUrl({
newUrl: `/pages/pay/index?orderNo=${data.orderNo}`
newUrl: `/pages/pay/index?orderNo=${data.orderNo}&from=groupbuy`
});
} else if (isApp) {
this.nativeBridge.openNewUrl({
......
......@@ -184,7 +184,8 @@ export default {
payContractInfo: {},
isCheckAgreement: false,
mergePayPretreatmentInfo: {},
tradeType: isWechat ? 'JSAPI' : 'MWEB'
tradeType: isWechat ? 'JSAPI' : 'MWEB',
amountInfo: {}
};
},
computed: {
......@@ -539,7 +540,10 @@ export default {
name: `pay${type}`,
query: {
reason: error,
orderNo: this.orderNo
orderNo: this.orderNo,
payType: this.payType,
finalAmt: this.amountInfo.finalAmt || '',
freeAmount: this.amountInfo.freeAmount || ''
}
});
},
......@@ -629,6 +633,7 @@ export default {
: (orderAmt - faceValue || 0).toFixed(2);
const freeAmount =
!IS_THIRD_PAY(this.payType) && this.showCoupon ? faceValue || '0.00' : '0.00';
this.amountInfo = { finalAmt, freeAmount };
cookies.set('amount', { finalAmt, freeAmount });
},
async reissueContract() {
......
......@@ -18,16 +18,9 @@
拼团成功即可退款0元拿,拼团失败立即退款
</p>
<div class="actions">
<cr-button shape="circle" type="default" @click="goOrderList(payStatus)"
>我的拼团</cr-button
>
<cr-button
shape="circle"
class="actions__back"
:plain="true"
type="primary"
@click="goPage(1)"
>查看订单</cr-button
<cr-button shape="circle" type="default" @click="goPage(1)">我的拼团</cr-button>
<cr-button shape="circle" class="actions__back" :plain="true" type="primary" @click="share"
>邀请好友</cr-button
>
</div>
</div>
......@@ -69,11 +62,11 @@
</div>
</template>
<script>
import cookies from '@/service/cookieStorage.service';
import { goUrlExtends } from './extends';
import CouponCard from './components/CouponCard.vue';
import { getCouponList } from '@/api/pay.api';
import Goods from '@/components/RecoGoods/RecoGoods.vue';
import { isApp, isWxMp } from '@/service/validation.service';
export default {
components: {
Goods,
......@@ -90,52 +83,28 @@ export default {
couponList: [],
payStatusName: '',
payMethodName: '',
payTrackInfo: {},
skuID: ''
payType: ''
};
},
created() {
const { orderNo, reason } = this.$route.query;
const { orderNo, reason, finalAmt, freeAmount, payType } = this.$route.query;
const { success } = this.$route.meta;
const amount = cookies.get('amount') || {};
this.payTrackInfo = cookies.get('payTrackInfo') || {};
this.skuID = String(cookies.get('skuID')) || '';
this.money = amount.finalAmt;
this.payType = payType || '';
this.money = finalAmt || '';
this.orderNo = orderNo;
this.reason = reason || '';
this.isSuccess = success || false;
this.freeAmount = amount.freeAmount;
this.freeAmount = freeAmount || '';
this.payStatus = success ? '订单支付成功' : '订单支付失败';
this.payStatusName = success ? '支付成功' : '支付失败';
this.$track?.registeredEvents('h5_RechargeResultPageExposure', {
pay_status: this.payStatus
});
this.$track?.registeredEvents('H5_2BPaymentPageExposure', {
order_no: orderNo,
pay_result: this.payStatus,
vcc_state: this.payTrackInfo.vcc_state,
pay_method: this.payTrackInfo.pay_method,
pay_amount: amount.finalAmt
});
this.getCouponList();
this.payMethod();
},
methods: {
payMethod() {
const name = this.payTrackInfo.pay_method;
switch (name) {
case 1:
this.payMethodName = '享花卡';
break;
case 2:
this.payMethodName = '微信';
break;
case 3:
this.payMethodName = '支付宝';
break;
default:
'';
}
share() {
// 分享
},
// goPay() {
// this.$track?.registeredEvents('h5_RechargeResultPageClick', {
......@@ -148,18 +117,26 @@ export default {
// this.$router.replace({ name: 'pay', query: { orderNo: this.orderNo } });
// },
goPage(type) {
const name = type ? '查看订单' : '重新支付';
this.$track?.registeredEvents('H5_2B_PaymentResultPageBtnClick', {
commodity_id: this.skuID,
order_number: this.orderNo,
pay_method: this.payMethodName,
pay_status: this.payStatusName,
buttons_name: name
});
if (type == 1) {
this.$router.replace({ name: 'orderList', params: { state: 0 } });
this.$router.replace({ path: '/orderList/0' });
} else {
this.$router.replace({ name: 'pay', query: { orderNo: this.orderNo } });
if (isWxMp) {
this.nativeBridge.openNewUrl({
newUrl: `/pages/pay/index?orderNo=${this.orderNo}&from=groupbuy`
});
} else if (isApp) {
this.nativeBridge.openNewUrl({
newUrl: `/pay?orderNo=${this.orderNo}`
});
} else {
return; // todo 处理纯h5情况
// this.$dialog({
// message: '请在App或小程序中参与活动~',
// title: '',
// showCancelButton: false,
// confirmButtonText: '我知道了'
// });
}
}
},
async getCouponList() {
......
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