|
@@ -271,13 +271,17 @@
|
|
|
})
|
|
|
},
|
|
|
goBuy(){
|
|
|
- if(this.goodsnum>this.info.dayCount){
|
|
|
- uni.showToast({
|
|
|
- title:'超过兑换限制',
|
|
|
- icon:'none',
|
|
|
- })
|
|
|
- return false;
|
|
|
+
|
|
|
+ if(this.info.dayCount&&this.info.dayCount!='null'){
|
|
|
+ if(this.goodsnum>this.info.dayCount){
|
|
|
+ uni.showToast({
|
|
|
+ title:'超过兑换限制',
|
|
|
+ icon:'none',
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if(!this.shopInfo.qty){
|
|
|
uni.showToast({
|
|
|
title: '库存不足',
|
|
@@ -315,29 +319,36 @@
|
|
|
});
|
|
|
|
|
|
},
|
|
|
- calculation(type){
|
|
|
+ calculation(type){
|
|
|
+
|
|
|
if(type==1){
|
|
|
if(this.goodsnum>1){
|
|
|
this.goodsnum--
|
|
|
}
|
|
|
}else{
|
|
|
//console.log("+++")
|
|
|
- if(this.goodsnum<this.info.dayCount){
|
|
|
- if(this.goodsnum<this.shopInfo.qty){
|
|
|
- this.goodsnum++
|
|
|
+ if(this.info.dayCount&&this.info.dayCount!='null'){
|
|
|
+ console.log(this.info.dayCount)
|
|
|
+ if(this.goodsnum<this.info.dayCount){
|
|
|
+ if(this.goodsnum<this.shopInfo.qty){
|
|
|
+ this.goodsnum++
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title:'剩余个数不足',
|
|
|
+ icon:'none',
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}else{
|
|
|
uni.showToast({
|
|
|
- title:'剩余个数不足',
|
|
|
+ title:'超过兑换限制',
|
|
|
icon:'none',
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
}else{
|
|
|
- uni.showToast({
|
|
|
- title:'超过兑换限制',
|
|
|
- icon:'none',
|
|
|
- })
|
|
|
- }
|
|
|
+ this.goodsnum++
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
this.totalIntegral=this.goodsnum*this.info.integral
|
|
@@ -1069,3 +1080,6 @@ button{
|
|
|
margin-left:71rpx;
|
|
|
}
|
|
|
</style>
|
|
|
+<!--
|
|
|
+
|
|
|
+ -->
|