3 changed files with 169 additions and 14 deletions
@ -0,0 +1,105 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-popup ref="popup"> |
||||
|
<view class="popup_box"> |
||||
|
<view class="pop_title"> |
||||
|
数量 |
||||
|
<text class="fr" @click="closeScanPopup()">关闭</text> |
||||
|
</view> |
||||
|
<view class="pop_tab"> |
||||
|
|
||||
|
<view class="tab_info"> |
||||
|
<view class="conbox"> |
||||
|
<textarea v-model="content" trim="all" style="margin-left: 5px;" :focus="true" type="number"></textarea> |
||||
|
<!-- <uni-easyinput v-model="content" type="number" ></uni-easyinput> --> |
||||
|
</view> |
||||
|
<view class="uni-flex"> |
||||
|
<button class="clean_scan_btn" @click="clear()">清空</button> |
||||
|
<button class="scan_btn" @click="confirm()">确定</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
showErrorMsg, |
||||
|
} from '@/common/basic.js'; |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
content: '', |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
openPopup(content) { |
||||
|
this.content = content; |
||||
|
this.$refs['popup'].open("bottom"); |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup(content) { |
||||
|
this.$refs.popup.close(); |
||||
|
}, |
||||
|
|
||||
|
cancel() { |
||||
|
this.$refs['popup'].close(); |
||||
|
}, |
||||
|
|
||||
|
confirm() { |
||||
|
if(!/^[0-9]+.?[0-9]*$/.test(this.content)){ |
||||
|
uni.showToast({ |
||||
|
title:"请输入数字" |
||||
|
}) |
||||
|
this.content="" |
||||
|
return |
||||
|
} |
||||
|
this.$emit("confirm", this.content); |
||||
|
this.$refs['popup'].close(); |
||||
|
}, |
||||
|
|
||||
|
clear() { |
||||
|
this.content = ''; |
||||
|
}, |
||||
|
|
||||
|
maskClick() { |
||||
|
this.$emit("confirm", true); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<!-- background-color: #fff; --> |
||||
|
<style scoped lang="scss"> |
||||
|
.center { |
||||
|
flex: auto; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
// align-items: center; |
||||
|
} |
||||
|
|
||||
|
.flex-item { |
||||
|
width: 50%; |
||||
|
text-align: center; |
||||
|
} |
||||
|
|
||||
|
.messageButton { |
||||
|
border-color: #F8F8F8; |
||||
|
} |
||||
|
|
||||
|
.messagePopup { |
||||
|
background-color: #fff; |
||||
|
border-radius: 5px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .uni-input-input { |
||||
|
font-size: 20px; |
||||
|
height: 46px; |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue