|
@@ -1788,16 +1788,21 @@ export default {
|
|
|
|
|
|
this.toPayment(this.goodsDetail);
|
|
|
},
|
|
|
- toPayment(goodsDetail) {
|
|
|
- // let selectGoodsList = JSON.parse(JSON.stringify([this.goodsDetail]));
|
|
|
- let selectGoodsList = JSON.parse(JSON.stringify([goodsDetail]));
|
|
|
- localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
|
|
|
+ toPayment(data) {
|
|
|
+ if (!Array.isArray(data)) {
|
|
|
+ data = [data]
|
|
|
+ }
|
|
|
+ let selectGoodsList = JSON.parse(JSON.stringify(data));
|
|
|
+ localStorage.setItem(
|
|
|
+ "checkGoodsList",
|
|
|
+ JSON.stringify(selectGoodsList)
|
|
|
+ );
|
|
|
this.$router.push({
|
|
|
path: "/payment",
|
|
|
});
|
|
|
},
|
|
|
- togoBuy(skuItem) {
|
|
|
- this.toPayment(skuItem);
|
|
|
+ togoBuy(goodList) {
|
|
|
+ this.toPayment(goodList);
|
|
|
},
|
|
|
addCart() {
|
|
|
if (!this.$tools.isLogin()) {
|