|
|
@@ -8,16 +8,18 @@
|
|
|
<view class="desc">数量</view>
|
|
|
<div class="flower-unit_box">
|
|
|
<input
|
|
|
+ ref="input"
|
|
|
disabled
|
|
|
- @tap="changeType('currentNum')"
|
|
|
- :key="selectItem.currentNum"
|
|
|
+ @tap="changeType('currentNum')"
|
|
|
+ :key="selectItem.currentNum"
|
|
|
+ @focus="focusSelect($event)"
|
|
|
type="text"
|
|
|
v-model="selectItem.currentNum">
|
|
|
<span>{{selectItem.currentUnit}}</span>
|
|
|
</div>
|
|
|
</view>
|
|
|
<image
|
|
|
- @tap="changeUnit"
|
|
|
+ @tap="changeUnit"
|
|
|
class="change-unit"
|
|
|
src="https://bpic.51yuansu.com/pic3/cover/03/80/68/5c0607c96e49d_610.jpg"
|
|
|
mode="scaleToFill"
|
|
|
@@ -62,16 +64,23 @@
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
- return {
|
|
|
- keyShow: false,
|
|
|
- enterType:'currentNum',
|
|
|
- };
|
|
|
+ return {
|
|
|
+ keyShow: false,
|
|
|
+ enterType:'currentNum',
|
|
|
+ };
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.activeKeyboard()
|
|
|
+ this.activeKeyboard()
|
|
|
+ this.focus()
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ focus() {
|
|
|
+ this.$refs.input.focus()
|
|
|
+ },
|
|
|
+ focusSelect(){
|
|
|
+ event.currentTarget.select();
|
|
|
+ },
|
|
|
changeType(type){
|
|
|
this.enterType = type
|
|
|
},
|
|
|
@@ -128,6 +137,7 @@
|
|
|
flex-direction: column;
|
|
|
box-sizing: border-box;
|
|
|
& .flower-input_box {
|
|
|
+ flex: 1;
|
|
|
& .flower-title {
|
|
|
text-align: center;
|
|
|
color: #333333;
|
|
|
@@ -155,6 +165,7 @@
|
|
|
& > input {
|
|
|
flex: 1;
|
|
|
height: 40rpx;
|
|
|
+ font-size: 14rpx;
|
|
|
border-bottom: 1px solid #eee;
|
|
|
}
|
|
|
}
|