// components/commodity_card/commodity_card.js const { getClassifyGoods, getAllGoods } = require('../../API/appraise') Component({ lifetimes: { created: function() { } }, /** * 组件的属性列表 * 是属性名到属性设置的映射表 */ properties: { comList: { type: [] } }, /** * 组件的初始数据 */ data: { imgUrl: "", price: 0, page: 1, pageSize: 6, id: 0 }, /** * 组件的方法列表 */ methods: { detailTo(e) { const id = e.currentTarget.dataset.id; const title = e.currentTarget.dataset.title; const price = e.currentTarget.dataset.price; const comImg = e.currentTarget.dataset.pic; wx.navigateTo({ url: '/pages/details/details?id=' + id + '&title=' + title + '&price=' + price + '&img=' + comImg, }) }, } })