1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
epp/weixin-miniprogram/pages/shop/components/good-list-card.js

44 lines
882 B
JavaScript
Raw Normal View History

// pages/shop/components/good-list-card.js
Component({
// refer: https://developers.weixin.qq.com/miniprogram/dev/reference/api/Component.html
/**
* 组件的属性列表
*/
properties: {
goodinfo: {
type: Object,
}
},
/**
* 组件的初始数据
*/
data: {
// displayGoodsInfo: "",
},
// observers: {
// 'goodinfo': function (goodinfo) {
// console.log("observers -> goodinfo", goodinfo)
// this.setData({
// displayGoodsInfo: JSON.stringify(this.properties.goodinfo)
// })
// }
// },
/**
* 组件的方法列表
*/
methods: {
cardOntap(event) {
let dataset = event.currentTarget.dataset
console.log("cardOntap dataset", dataset)
let goodInfo = dataset.goodinfo
wx.navigateTo({
url: '/pages/shop/goodDetail?id=' + goodInfo.id,
})
}
}
})