| | |
| | | // pages/digitalCourses/index.js |
| | | import { |
| | | loginInfo |
| | | } from '../../assets/js/login'; |
| | | const app = getApp() |
| | | import { |
| | | setSessionGuid, |
| | |
| | | }); |
| | | } |
| | | this.getCourseTypeListList() |
| | | this.getShoppingCartList() |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (token) this.getShoppingCartList() |
| | | }, |
| | | |
| | | /** |
| | |
| | | }) |
| | | }, |
| | | addCart(e) { |
| | | const addFun = () => { |
| | | const { |
| | | item |
| | | } = e.currentTarget.dataset; |
| | |
| | | console.error('出错了:', error) |
| | | } |
| | | } |
| | | |
| | | } |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (token) { |
| | | addFun() |
| | | } else { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getShoppingCartList() |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | }) |