小程序商城购物车规格



  规格:
  
    
      {{item.name}}
    
  
  颜色:
  
    
      {{item.name}}
    
  

{{guige[gindex].name}}:{{color[cindex].name}}
Page({
 
  /**
   * 页面的初始数据
   */
  data: {
    guige:[
      {id:1,name:'M'},
      {id:2,name:'L'},
      {id:3,name:'X'},
      {id:4,name:'S'}
    ],
    color:[
      {id:5,name:'红'},
      { id: 6, name: '橙'},
      { id: 7, name: '黄'},
      { id: 8, name: '绿'}
    ]
  },
  guige:function(e){
    this.setData({
      gid: e.currentTarget.dataset.index,
      gindex: e.currentTarget.dataset.current,
    })
  },
  color:function(e){
    this.setData({
      cid: e.currentTarget.dataset.index,
      cindex: e.currentTarget.dataset.current,
    })
  }

.color{
  color: red
}
.dis{display: flex;justify-content: space-around}

你可能感兴趣的:(小程序商城购物车规格)