||
width:130px;}
height: 40px;
/*给主容器设一个边框*/
border: 1rpx solid #818284;
border-radius: 3px;
margin:20px auto;
background: white;
width: 40px;}
line-height: 40px;
text-align: center;
float: left;
width: 48px;}
height: 40px;
float: left;
margin: 0 auto;
text-align: center;
font-size: 16px;
color: #000000;
/*给中间的input设置左右边框即可*/
border-left: 1rpx solid #818284;
border-right: 1rpx solid #818284;
color: black;}
color: #ccc;}
num:1
console.log("刚刚您点击了加1");var num = this.data.num;// 总数量-1if (num < 1000) {
this.data.num++;
}// 将数值与状态写回this.setData({
num: this.data.num
});
console.log("刚刚您点击了减1");
var num = this.data.num;
// 商品总数量-1
if (num > 1) {
this.data.num--;
}
// 将数值与状态写回
this.setData({
num: this.data.num
});