From 946dae0a8885b529e7755788ba7872503d9f9d9d Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期二, 20 八月 2024 18:09:31 +0800 Subject: [PATCH] 按钮点击操作成功再有效 --- pages/modal/5600.vue | 45 +++++++++++++++++++++++++++++++++------------ 1 files changed, 33 insertions(+), 12 deletions(-) diff --git a/pages/modal/5600.vue b/pages/modal/5600.vue index 34a9ef2..d589191 100644 --- a/pages/modal/5600.vue +++ b/pages/modal/5600.vue @@ -94,7 +94,8 @@ <view class="view-bottom" v-if="param.Sub_Page[0].OK_Button==true"> <button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button> - <button type="primary" @tap="ok" class="btn_add">{{translateSys('ok')}}</button> + <button type="primary" @tap="ok" class="btn_add" :class="okLoading?'btn_disabled':''" + :disabled="okLoading">{{translateSys('ok')}}</button> </view> </view> </swiper-item> @@ -143,7 +144,8 @@ <view class="view-bottom" v-if="param.Sub_Page[1].OK_Button==true"> <!-- --> <button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button> - <button type="primary" @tap="ok2" class="btn_add">{{translateSys('ok')}}</button> + <button type="primary" @tap="ok2" class="btn_add" :class="ok2Loading?'btn_disabled':''" + :disabled="ok2Loading">{{translateSys('ok')}}</button> </view> </view> </swiper-item> @@ -206,6 +208,8 @@ active_id: '', activelist: [], selectAttrObj: {}, + okLoading: false, + ok2Loading: false, }; }, onLoad(options) { @@ -571,7 +575,7 @@ // .exec(); // } //console.log(item); - if (item.oldvalue != item.value&& item.value.trim() != "") { + if (item.oldvalue != item.value && item.value.trim() != "") { item.oldvalue = item.value; var attr = item.fieldId; this.head_styledef.form.model[attr] = item.value; @@ -653,7 +657,7 @@ }, onEnterChange(item) { //鍥炶溅锛岀偣鍑绘寜閽紝鍙栨秷鑺傜偣浜嬩欢 // console.log(item); - if (item.oldvalue != item.value&& item.value.trim() != "") { + if (item.oldvalue != item.value && item.value.trim() != "") { item.oldvalue = item.value; var attr = item.fieldId; this.head_styledef.form.model[attr] = item.value; @@ -843,7 +847,7 @@ this.translateSys( "quotation_mark_left") + value .page_name + this.translateSys( - "sys.quotation_mark_right") + + "quotation_mark_right") + this.translate( "are_you_sure_clear_last"), success: function(res) { @@ -1552,17 +1556,18 @@ uni.showModal({ title: this.translateSys("tip"), content: this.translate( - "page.tip_no_data_first") + + "tip_no_data_first") + this.translateSys( "quotation_mark_left") + this.param.Sub_Page[0].Name + this.translateSys( - "sys.quotation_mark_right") + + "quotation_mark_right") + this.translate( - "page.tip_no_data_last"), + "tip_no_data_last"), showCancel: false, confirmText: this.translateSys("cancel") }); return false; } + this.okLoading = true //鑾峰彇琛ㄥご灞炴� var head_attr = {}; this.$data.head_styledef.form.items.forEach(item => { @@ -1629,6 +1634,7 @@ }); const list = [] if (jsonlist.length == 0) { + //this.okLoading = false uni.showModal({ title: this.translateSys("tip"), content: this.translate("tip_no_select_data"), @@ -1665,17 +1671,18 @@ uni.showModal({ title: this.translateSys("tip"), content: this.translate( - "page.tip_no_data_first") + + "tip_no_data_first") + this.translateSys( "quotation_mark_left") + this.param.Sub_Page[1].Name + this.translateSys( - "sys.quotation_mark_right") + + "quotation_mark_right") + this.translate( - "page.tip_no_data_last"), + "tip_no_data_last"), showCancel: false, confirmText: this.translateSys("cancel") }); return false; } + this.ok2Loading = true //鑾峰彇琛ㄥご灞炴� var head_attr = {}; this.$data.head_styledef.form.items.forEach(item => { @@ -1741,6 +1748,7 @@ }); }); if (jsonlist.length == 0) { + this.ok2Loading = false uni.showModal({ title: this.translateSys("tip"), content: this.translate("tip_no_select_data"), @@ -1965,8 +1973,16 @@ confirmText: this.translateSys("cancel") }); } + if (type == "1") + this.okLoading = false + else if (type == "2") + this.ok2Loading = false }).catch(ex => { var tip = typeof ex == "string" ? ex : ex.errMsg; + if (type == "1") + this.okLoading = false + else if (type == "2") + this.ok2Loading = false uni.showModal({ title: this.translateSys("error") + "8.1", content: this.translate("execute_after_ok_event_failed") + this.translateSys( @@ -2209,16 +2225,21 @@ button.btn_add { width: 49.5%; - padding: 20rpx; line-height: 1.5; border: none; font-size: 38rpx; font-weight: bold; float: right; + color: #fff; display: inline-block; } + button.btn_disabled { + background-color: #ddd; + color: #888; + } + .logo { height: 100rpx; width: 460rpx; -- Gitblit v1.9.1