提交 a77ae9e8 编写于 作者: 杜庆泉's avatar 杜庆泉

action sheet 颜色示例修改

上级 b509a35a
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<view class="uni-list"> <view class="uni-list">
<view class="uni-list-cell uni-list-cell-pd"> <view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">自定义itemColor</view> <view class="uni-list-cell-db">自定义itemColor</view>
<switch :checked="itemColorCustom" /> <switch :checked="itemColorCustom" @change="itemColorChange"/>
</view> </view>
</view> </view>
<view class="uni-padding-wrap"> <view class="uni-padding-wrap">
...@@ -70,12 +70,17 @@ ...@@ -70,12 +70,17 @@
} }
} }
}, },
itemColorChange: function (e : SwitchChangeEvent) {
this.itemColorCustom = e.detail.value
},
actionSheetTap() { actionSheetTap() {
console.log("itemColorCustom === " + this.itemColorCustom)
const that = this const that = this
if(this.itemColorCustom){
uni.showActionSheet({ uni.showActionSheet({
title: this.items[this.current].value, title: this.items[this.current].value,
itemList: ['item1', 'item2', 'item3', 'item4'], itemList: ['item1', 'item2', 'item3', 'item4'],
itemColor:"#ff00ff",
// #ifdef H5 // #ifdef H5
popover: { popover: {
// 104: navbar + topwindow 高度,暂时 fix createSelectorQuery 在 pc 上获取 top 不准确的 bug // 104: navbar + topwindow 高度,暂时 fix createSelectorQuery 在 pc 上获取 top 不准确的 bug
...@@ -91,6 +96,28 @@ ...@@ -91,6 +96,28 @@
}) })
} }
}) })
}else{
uni.showActionSheet({
title: this.items[this.current].value,
itemList: ['item1', 'item2', 'item3', 'item4'],
// #ifdef H5
popover: {
// 104: navbar + topwindow 高度,暂时 fix createSelectorQuery 在 pc 上获取 top 不准确的 bug
top: that.buttonRect.top + 104 + that.buttonRect.height,
left: that.buttonRect.left + that.buttonRect.width / 2
},
// #endif
success: (e) => {
console.log(e.tapIndex);
uni.showToast({
title: "点击了第" + e.tapIndex + "个选项",
icon: "none"
})
}
})
}
}, },
// #ifdef H5 // #ifdef H5
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
this.altitudeSelect = e.detail.value this.altitudeSelect = e.detail.value
}, },
geocodeChange: function (e : SwitchChangeEvent) { geocodeChange: function (e : SwitchChangeEvent) {
this.geocodeChange = e.detail.value this.geocodeSelect = e.detail.value
}, },
highAccuracySelectChange: function (e : SwitchChangeEvent) { highAccuracySelectChange: function (e : SwitchChangeEvent) {
this.isHighAccuracySelect = e.detail.value this.isHighAccuracySelect = e.detail.value
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
type: this.items[this.current].value, type: this.items[this.current].value,
altitude:this.altitudeSelect, altitude:this.altitudeSelect,
isHighAccuracy:this.isHighAccuracySelect, isHighAccuracy:this.isHighAccuracySelect,
geocode:this.geocodeSelect,
success: function (res:any) { success: function (res:any) {
uni.hideLoading() uni.hideLoading()
console.log(res); console.log(res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册