进度条颜色
This commit is contained in:
@ -71,7 +71,7 @@
|
|||||||
<view @touchmove.prevent>
|
<view @touchmove.prevent>
|
||||||
<slider :value="sliderValue" min="10" max="100" activeColor="rgb(187, 230, 0)"
|
<slider :value="sliderValue" min="10" max="100" activeColor="rgb(187, 230, 0)"
|
||||||
backgroundColor="rgb(26, 26, 26)" :show-value="false" @changing="onSliderChanging"
|
backgroundColor="rgb(26, 26, 26)" :show-value="false" @changing="onSliderChanging"
|
||||||
@change="onSliderChangeEnd" block-color="#BBE600" block-size="20" />
|
@change="onSliderChangeEnd" block-color="#fff" block-size="20" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -372,15 +372,11 @@
|
|||||||
const touchX = e.touches[0].clientX;
|
const touchX = e.touches[0].clientX;
|
||||||
const cardLeft = this.cardRect.left;
|
const cardLeft = this.cardRect.left;
|
||||||
const cardWidth = this.cardRect.width;
|
const cardWidth = this.cardRect.width;
|
||||||
|
|
||||||
let relativeX = touchX - cardLeft;
|
let relativeX = touchX - cardLeft;
|
||||||
|
|
||||||
// 边界处理
|
// 边界处理
|
||||||
if (relativeX < 0) relativeX = 0;
|
if (relativeX < 0) relativeX = 0;
|
||||||
if (relativeX > cardWidth) relativeX = cardWidth;
|
if (relativeX > cardWidth) relativeX = cardWidth;
|
||||||
|
|
||||||
const newValue = Math.round((relativeX / cardWidth) * 100);
|
const newValue = Math.round((relativeX / cardWidth) * 100);
|
||||||
|
|
||||||
// 调用已有的节流函数来更新值和发送命令
|
// 调用已有的节流函数来更新值和发送命令
|
||||||
this.onSliderChanging({
|
this.onSliderChanging({
|
||||||
detail: {
|
detail: {
|
||||||
|
Reference in New Issue
Block a user