123456789101112131415161718192021222324252627282930313233343536373839 |
- import {
- getProducts,
- } from '~/api/global'
- let polling
- Component({
- data: {
- products: [],
- },
- lifetimes: {
- attached() {
- // this.selectComponent("#popUp").showModal()
- this.getProducts()
- },
- },
- methods: {
- async getProducts() {
- let {
- productList: products,
- } = await getProducts()
- this.setData({
- products,
- })
- },
- openDonutBuy({
- currentTarget
- }) {
- let product = currentTarget.dataset.product
- this.triggerEvent('toBuy',product)
- this.close()
- },
- async open(product) {
- this.selectComponent("#popUp").showModal()
- },
- closeEvent() {},
- close() {
- this.selectComponent("#popUp").hideModal()
- }
- }
- })
|