| | |
| | | // pages/cart/index.js |
| | | const app = getApp() |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | right: [ |
| | | { |
| | | text: '编辑', |
| | | className: 'btn edit-btn', |
| | | |
| | | }, |
| | | { |
| | | text: '删除', |
| | | className: 'btn delete-btn', |
| | | }, |
| | | ], |
| | | }, |
| | | onDelete() { |
| | | wx.showToast({ title: '你点击了删除', icon: 'none' }); |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | this.shoppingCartGet() |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | shoppingCartGet() { |
| | | |
| | | app.MG.store.getShoppingCartProductList({ |
| | | start: 0, |
| | | size: 999, |
| | | filterList: [], |
| | | searchList: [] |
| | | }).then(res => { |
| | | console.log(res); |
| | | }) |
| | | } |
| | | }) |