Commit fb84552a authored by Xuguangxing's avatar Xuguangxing

feat: 处理支付结果页

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