|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <button class="btn btn-primary btn-buy-now" :disabled="disabledFlag" @click="buyNow(true)"><span class="watch">立即购买</span></button>
|
|
|
- <button class="btn btn-add-cart" :disabled="disabledFlag" @click="buyNow(false)"><span class="watch">加入购物车</span></button>
|
|
|
+ <button style="z-index: 1000;" class="btn btn-primary btn-buy-now" :class="{'disabled': disabledFlag}" @click="buyNow(true, $event)"><span class="watch">立即购买</span></button>
|
|
|
+ <button style="z-index: 1000;" class="btn btn-add-cart" :class="{'disabled': disabledFlag}" @click="buyNow(false, $event)"><span class="watch">加入购物车</span></button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -9,7 +9,8 @@
|
|
|
export default {
|
|
|
props: ['item', 'disabledFlag'],
|
|
|
methods: {
|
|
|
- buyNow: function (isBuy) {
|
|
|
+ buyNow: function (isBuy, event) {
|
|
|
+ event.stopPropagation()
|
|
|
if (!this.$store.state.option.user.logged) {
|
|
|
this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
|
|
|
if (response.data) {
|
|
|
@@ -17,7 +18,7 @@
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- if (this.item) {
|
|
|
+ if (this.item && !this.disabledFlag) {
|
|
|
if (isBuy) {
|
|
|
this.$http.post('trade/order/buyNow', [{
|
|
|
uuid: this.item.uuid,
|
|
|
@@ -93,7 +94,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // window.location.href = 'user#/order/pay/' + this.enidfilter(this.buy_info.orderid)
|
|
|
+// window.location.href = 'user#/order/pay/' + this.enidfilter(this.buy_info.orderid)
|
|
|
},
|
|
|
enidfilter: function (str) {
|
|
|
if (str) {
|
|
|
@@ -193,9 +194,14 @@
|
|
|
background-color: #5078CB;
|
|
|
color: #fff;
|
|
|
}
|
|
|
- .btn-buy-now[disabled], .btn-add-cart[disabled] {
|
|
|
+ .btn-buy-now.disabled,
|
|
|
+ .btn-buy-now.disabled:focus,
|
|
|
+ .btn-add-cart.disabled,
|
|
|
+ .btn-add-cart.disabled:focus{
|
|
|
background-color: #d1d2d3!important;
|
|
|
- border-color: #d1d2d3!important;
|
|
|
+ border: none!important;
|
|
|
+ outline: none;
|
|
|
color: #fff!important;
|
|
|
+ cursor: not-allowed;
|
|
|
}
|
|
|
</style>
|