123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- <template>
- <view class="uni-popup-dialog">
- <view class="uni-dialog-title">
- <text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{title}}</text>
- </view>
- <view class="uni-dialog-content">
- <view class="uni-dialog-content-title">频率:</view>
- <lxc-count
- @handleCount="handleCountClick"
- :index="item.index"
- :value="item.num"
- :delayed="100"
- >
- </lxc-count>
- </view>
- <view class="uni-dialog-button-group">
- <view class="uni-dialog-button" @click="close">
- <text class="uni-dialog-button-text">取消</text>
- </view>
- <view class="uni-dialog-button uni-border-left" @click="onOk(status == 0 ? 1 : 0)">
- <text class="uni-dialog-button-text uni-button-color">{{status == 0 ? '开启' : '关闭'}}</text>
- </view>
- </view>
- </view>
- </template>
- <script>
-
- export default {
- name: "uniPopupQiang",
- props: {
- item:{
- type:Object,
- default:()=>{
- return {
- index:0,
- num:2,
- }
- }
- },
- value: {
- type: [String, Number],
- default: ''
- },
- maxlength:{
- type: Number,
- default: 10
- },
- status:{
- type:String,
- default:'0'
- },
- placeholder: {
- type: [String, Number],
- default: '请输入内容'
- },
-
- type: {
- type: String,
- default: 'error'
- },
-
- mode: {
- type: String,
- default: 'base'
- },
-
- title: {
- type: String,
- default: '提示'
- },
-
- content: {
- type: String,
- default: ''
- },
-
- beforeClose: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- dialogType: 'error',
- focus: false,
- val: "",
- num:2
- }
- },
- inject: ['popup'],
- watch: {
- type(val) {
- this.dialogType = val
- },
- mode(val) {
- if (val === 'input') {
- this.dialogType = 'info'
- }
- },
- value(val) {
- this.val = val
- }
- },
- created() {
-
- this.popup.mkclick = false
- if (this.mode === 'input') {
- this.dialogType = 'info'
- this.val = this.value
- } else {
- this.dialogType = this.type
- }
- },
- mounted() {
- this.focus = true
- },
- methods: {
- handleCountClick(num){
- this.num = num;
- },
-
- onOk(status) {
- this.$emit('confirm',{num:this.num,status:status})
- },
-
- close() {
- if (this.beforeClose) {
- this.$emit('close', () => {
- this.popup.close()
- })
- return
- }
- this.popup.close()
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .uni-popup-dialog {
- width: 300px;
- border-radius: 5px;
- background-color: #fff;
- }
- .uni-dialog-title {
-
- display: flex;
-
- flex-direction: row;
- justify-content: flex-start;
- padding: 20px 0 10px 15px;
- }
- .uni-dialog-title-text {
- font-size: 16px;
- font-weight: 500;
- }
- .uni-dialog-button-group {
-
- display: flex;
-
- flex-direction: row;
- border-top-color: #bdbdbd;
- border-top-style: solid;
- border-top-width: 1px;
- margin-top:5px;
- }
- .uni-dialog-button {
-
- display: flex;
-
- flex: 1;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- height: 55px;
- }
- .uni-border-left {
- border-left-color: #bdbdbd;
- border-left-style: solid;
- border-left-width: 1px;
- }
- .uni-dialog-button-text {
- font-size: 14px;
- }
- .uni-button-color {
- }
- .uni-dialog-input {
- flex: 1;
- font-size: 14px;
- overflow: visible !important;
- line-height :1.9rem !important;
- height:1.9rem !important;
- border-radius: 10px;
- padding-left:2px;
- background-color: #eeeeee;
- }
- .uni-popup__success {
- color: $uni-color-success;
- }
- .uni-popup__warn {
- color: $uni-color-warning;
- }
- .uni-popup__error {
- color: $uni-color-error;
- }
- .uni-popup__info {
- color: #909399;
- }
- .uni-dialog-content{
- display: flex;
- padding: 40rpx;
- }
- </style>
|