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