getQueryString()
This commit is contained in:
parent
f2666346c8
commit
1dd800b854
|
|
@ -427,7 +427,14 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getQueryString(url, name) { //解码
|
||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||
var r = url.substr(1).match(reg)
|
||||
if (r != null) {
|
||||
return r[2]
|
||||
}
|
||||
return null;
|
||||
},
|
||||
/**
|
||||
* socket初始化
|
||||
*/
|
||||
|
|
@ -507,19 +514,19 @@
|
|||
* @param {Object} b
|
||||
*/
|
||||
shopAdd(item, index, index1, a, b) {
|
||||
if ( a == "+" ){
|
||||
|
||||
if ( this.skuNumber < this.skuSuit && this.amountcartNumber < this.skuSuit) {
|
||||
this.amountcartNumber = this.amountcartNumber + (this.skuSuit==0?1:this.skuSuit);
|
||||
}else {
|
||||
if (a == "+") {
|
||||
|
||||
if (this.skuNumber < this.skuSuit && this.amountcartNumber < this.skuSuit) {
|
||||
this.amountcartNumber = this.amountcartNumber + (this.skuSuit == 0 ? 1 : this.skuSuit);
|
||||
} else {
|
||||
this.amountcartNumber++;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (this.amountcartNumber > 0) {
|
||||
console.log(item)
|
||||
if ( this.skuNumber < this.skuSuit && this.amountcartNumber <= this.skuSuit) {
|
||||
this.amountcartNumber = this.amountcartNumber - (this.skuSuit==0?1:this.skuSuit);
|
||||
if (this.skuNumber < this.skuSuit && this.amountcartNumber <= this.skuSuit) {
|
||||
this.amountcartNumber = this.amountcartNumber - (this.skuSuit == 0 ? 1 : this.skuSuit);
|
||||
} else {
|
||||
this.amountcartNumber = this.amountcartNumber - 1;
|
||||
}
|
||||
|
|
@ -723,7 +730,7 @@
|
|||
this.addCart(params);
|
||||
} else {
|
||||
this.skuId = res.data.id;
|
||||
this.skuNumber = res.data.number||0;
|
||||
this.skuNumber = res.data.number || 0;
|
||||
this.skuSuit = res.data.suit;
|
||||
this.showShopsku = true //打开弹框
|
||||
}
|
||||
|
|
@ -870,11 +877,11 @@
|
|||
const currentElement = this.topArr[this.leftIndex];
|
||||
const diff = lastElement - currentElement;
|
||||
console.log(diff)
|
||||
if (diff > this.scrollHeight) {
|
||||
this.leftIndex = (index < 0 ? 0 : index);
|
||||
} else {
|
||||
this.leftIndex = this.leftIndex
|
||||
}
|
||||
// if (diff > this.scrollHeight) {
|
||||
this.leftIndex = (index < 0 ? 0 : index);
|
||||
// } else {
|
||||
// this.leftIndex = this.leftIndex
|
||||
// }
|
||||
}
|
||||
},
|
||||
/* 左侧导航点击 */
|
||||
|
|
@ -883,7 +890,9 @@
|
|||
scrollTop: this.topArr[index] - this.HeighT,
|
||||
duration: 0
|
||||
});
|
||||
this.leftIndex = index
|
||||
setTimeout(() => {
|
||||
this.leftIndex = index
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue