// components/slider-component/index.js
Component({
	properties: {
		slider_min: {
			//最小值
			type: Number,
			value: 0,
		},
		slider_max: {
			//最大值
			type: Number,
			value: 100,
		},
		slider_value: {
			//当前值
			type: Number,
			value: 10,
		},
		show_value: {
			//当前值
			type: Number,
			value: 10,
		},
		// age: {
		// 	//当前值
		// 	type: Number,
		// 	value: true,
		// },
	},
	ready() {
		console.log(this.properties.slider_min);
		console.log(this.properties.slider_max);
		console.log(this.properties.slider_value);
	},
	methods: {
		sliderChanging(e) {
			// console.log(this.properties);
			const value = e.detail.value;
			if (value >= 16) {
				this.properties.show_value = value;
			}
     
			// wx.vibrateShort({
			// 	type: "heavy",
			// 	success: function (e) {},
			// });
			// console.log(this.properties.slider_value);
			// this.triggerEvent("sliderchange", value);
			this.triggerEvent("showchange", this.properties.show_value);
		},
    sliderChange(e){
			const value = e.detail.value;
			if (value >= 16) {
				this.properties.show_value = value;
			}
      
			// console.log(this.properties.slider_value);
			this.triggerEvent("sliderchange", value);
			// this.triggerEvent("showchange", this.properties.show_value);
    }
	},
});
