wangfukang 3 years ago
parent
commit
109ed8b1f8
  1. 17
      uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue

17
uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue

@ -1,11 +1,11 @@
<template> <template>
<view class="uni-numbox"> <view class="uni-numbox">
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}"> <view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" style="background: #f5f5f5;">
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }" :style="{color}">-</text> <text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }" :style="{color}">-</text>
</view> </view>
<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number" <input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number"
v-model="inputValue" :style="{background, color}" /> v-model="inputValue" :style="{background, color}" />
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}"> <view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" style="background: #f5f5f5;">
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }" :style="{color}">+</text> <text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }" :style="{color}">+</text>
</view> </view>
</view> </view>
@ -53,7 +53,7 @@
}, },
background: { background: {
type: String, type: String,
default: '#f5f5f5' default: '#fff'
}, },
color: { color: {
type: String, type: String,
@ -155,12 +155,13 @@
}; };
</script> </script>
<style lang="scss" > <style lang="scss" >
$box-height: 26px; $box-height: 60rpx;
$bg: #f5f5f5; $bg: #fff;
$br: 2px; $br: 2px;
$color: #333; $color: #333;
.uni-numbox { .uni-numbox {
height: 60rpx;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
/* #endif */ /* #endif */
@ -187,7 +188,7 @@
width: 40px; width: 40px;
height: $box-height; height: $box-height;
text-align: center; text-align: center;
font-size: 14px; font-size: 20px;
border-left-width: 0; border-left-width: 0;
border-right-width: 0; border-right-width: 0;
color: $color; color: $color;
@ -207,7 +208,7 @@
// fix nvue // fix nvue
line-height: 20px; line-height: 20px;
font-size: 20px; font-size: 32px;
font-weight: 300; font-weight: 300;
color: $color; color: $color;
} }

Loading…
Cancel
Save