cart.js 536 Bytes
import cartModel from '../../models/cart/cart';

const app = getApp();
const router = global.router;

Page({
  data: {
  },
  onLoad() {

  },
  onShow() {
    this.getCartData();

  },
  goShopping() {
    router.go('home');
  },
  getCartData() {
    cartModel.getCartData({uid: app.getUid()})
      .then(res => {
        if (res.code === 200 && res.data) {
          this._resolveCartData(res.data);
        } else {
          return Promise.reject();
        }
      })
      .catch(() => {});
  },
  _resolveCartData() {

  }
});