父组件里面引入子组件
<van-popup show="{
{ popup }}" position="bottom" round custom-style="height:77%;width:100%" bind:close="onClose">
<tickpage detalsindex="{
{detals}}" detalsmax="{
{datamax}}" ></tickpage>
</van-popup>
父组件中使用js方法
buy(event) {
const param = {
product_id: event.currentTarget.dataset.id
}
Apis.gettickdetals(param).then(res => {
console.log(res);
this.setData({
datamax: res
})
})
const id = event.currentTarget.dataset.id
Apis.getindexlist(id).then(res => {
this.setData({
popup: true,
detals: res
})
})
},
子组件里面
Component({
properties:{
detalsindex:{
type:Array,
value:[]
},
detalsmax:{
type:Object,
value:{}
}
},
dat