this.reasonList=['多拍了','不想要了','其他原因']
actionTap() {
uni.showActionSheet({
title: '退货原因',
itemList: this.reasonList,
itemColor: "#999999",
success: res => {
// res.tapIndex获取到选择的数组的位置
//list[res.tapIndex])获取选择的对应的值;
console.log("选择的值=" + this.reasonList[res.tapIndex]);
this.title=this.reasonList[res.tapIndex]
// switch (i) {
// case 0:
// this.title = '多拍了'
// break;
// case 1:
// this.title = '不想要了'
// break;
// case 2:
// this.title = '其他原因'
// break;
// default:
// break;
// };
},
fail: function(res) {
console.log(res.errMsg);
}
})
},
微信小程序获取uni.showActionSheet中选择的值
最新推荐文章于 2024-05-07 17:28:27 发布
关键词由CSDN通过智能技术生成