|
|
|
@ -3,6 +3,7 @@ const product = require('../../utils/product.js') |
|
|
|
|
|
|
|
|
|
Page({ |
|
|
|
|
data: { |
|
|
|
|
toastAddProduct: true, |
|
|
|
|
title: '', |
|
|
|
|
id: 0, |
|
|
|
|
address: '', |
|
|
|
@ -41,6 +42,7 @@ Page({ |
|
|
|
|
product.setAttribute('quantity', this.data.quantity) |
|
|
|
|
cartItems.data.push(product) |
|
|
|
|
} |
|
|
|
|
this.setData({ toastAddProduct:false }); |
|
|
|
|
|
|
|
|
|
wx.setStorage({ |
|
|
|
|
key: 'cartItems', |
|
|
|
@ -52,6 +54,10 @@ Page({ |
|
|
|
|
this.setData({'quantity': e.detail.value}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
toastChange: function(){ |
|
|
|
|
this.setData({ toastAddProduct:true }); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 立即购买
|
|
|
|
|
formSubmit: function(e) { |
|
|
|
|
e.detail.value['sku'] = e.target.dataset['sku'] |
|
|
|
|