123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import {
- getProducts
- } from '~/api/global'
- const app = getApp()
- Component({
- properties: {
- },
- data: {
- show: false,
- products: [],
- // 是否购买过vip
- isIos: app.globalData.isIOS,
- isPreferential: false
- },
- methods: {
- open() {
- this.getProducts()
- this.setData({
- show: true,
- })
- },
- closeModal() {
- this.setData({
- show: false
- })
- },
- async getProducts() {
- let {
- isPreferential,
- productList: products,
- } = await getProducts()
- this.setData({
- products,
- isPreferential
- })
- },
- toBuy({
- currentTarget
- }) {
- this.triggerEvent('toBuy', currentTarget.dataset.goods)
- }
- }
- })
|