Commit 83ffd2bd authored by ben.liu's avatar ben.liu

fix:适配秒杀

parent 3903cd87
registry=http://npmprivate.quantgroups.com/
\ No newline at end of file
......@@ -216,6 +216,7 @@ export default {
}
},
mounted() {
this.setIsOrder();
this.orderNo = this.$route.query.orderNo || cookies.get('orderNo')?.orderNo;
cookies.set('orderNo', { orderNo: this.orderNo });
if (this.$route?.query?.ocrflag) {
......@@ -232,6 +233,12 @@ export default {
this.getCouponList(this.orderNo);
},
methods: {
setIsOrder() {
const { hideOrder } = this.$route.query || {};
if (hideOrder) {
localStorage.set('hideOrder', hideOrder);
}
},
/* 查询支付信息 */
async queryPayInfo() {
const [data, error] = await queryPayInfo({
......
......@@ -14,19 +14,19 @@
<p v-if="freeAmount > 0" class="info__text info__free">已优惠¥{{ freeAmount }}</p>
</div>
</div>
<p class="tips">
<p v-if="isOrder" class="tips">
您可在“我的-我的订单”中查看详情
</p>
<div class="actions">
<div :class="['actions', !isOrder && 'no-order']">
<cr-button
shape="circle"
class="actions__back"
:plain="true"
type="primary"
@click="goHome(payStatus)"
>返回首页</cr-button
@click="goHome"
>{{ returnUrl ? '返回秒杀' : '返回首页' }}</cr-button
>
<cr-button shape="circle" type="primary" @click="goOrderList(payStatus)"
<cr-button v-if="isOrder" shape="circle" type="primary" @click="goOrderList(payStatus)"
>查看订单</cr-button
>
</div>
......@@ -54,6 +54,7 @@
<script>
import RecoGoods from '@/components/RecoGoods.vue';
import cookies from '@/service/cookieStorage.service';
import localStorage from '@/service/localStorage.service';
import { goUrlExtends } from './extends';
export default {
components: { RecoGoods },
......@@ -64,10 +65,13 @@ export default {
orderNo: null,
isSuccess: false,
freeAmount: 0,
payStatus: ''
payStatus: '',
returnUrl: '',
isOrder: true
};
},
created() {
this.getQuery();
const { orderNo, reason } = this.$route.query;
const { success } = this.$route.meta;
const amount = cookies.get('amount') || {};
......@@ -82,6 +86,12 @@ export default {
});
},
methods: {
getQuery() {
this.returnUrl = cookies.get('returnUrl') || '';
if (localStorage.get('hideOrder')) {
this.isOrder = false;
}
},
goPay() {
this.$track.registeredEvents('h5_RechargeResultPageClick', {
pay_status: this.payStatus,
......@@ -141,6 +151,9 @@ export default {
flex-direction: row;
margin-top: @padding-lg;
justify-content: space-between;
&.no-order {
justify-content: center;
}
&__back {
color: @cherry-color-error;
border: 1px solid @cherry-color-error;
......
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