增加按钮状态不可点击

This commit is contained in:
魏啾
2024-12-26 17:48:45 +08:00
parent 374c561803
commit 6188622e7c
3 changed files with 24 additions and 8 deletions

View File

@@ -192,4 +192,7 @@ export default {
getrulelist(data) { //菜单列表 getrulelist(data) { //菜单列表
return uni.api.post("store/getrulelist", data, false); return uni.api.post("store/getrulelist", data, false);
}, },
checkqrcodestatus(data) { //检查二维码状态
return uni.api.post("user/checkqrcodestatus", data);
},
} }

View File

@@ -9,7 +9,7 @@ uni.pro.interceptor('request', {
return options return options
}, },
success(res) { success(res) {
if (res.code >= 400) { if (res.data.code == 1) {
return res.data return res.data
} else { } else {
return res.data return res.data

View File

@@ -94,7 +94,8 @@
<u-icon name="weixin-fill" color="#04be02" size="28"></u-icon> <u-icon name="weixin-fill" color="#04be02" size="28"></u-icon>
微信抬头一键导入 微信抬头一键导入
</view> </view>
<view class="content_bottom" @click="saveMerchantBaseInfo">确定</view> <view class="content_bottom" :style="disabled?'':'background:rgb(219 214 214);color: #666666;'"
@click="saveMerchantBaseInfo">确定</view>
</view> </view>
</template> </template>
@@ -110,6 +111,7 @@
data() { data() {
return { return {
showtext: 0, showtext: 0,
disabled: false,
subCategoryList: [], subCategoryList: [],
form: { form: {
user_type: 2, user_type: 2,
@@ -163,6 +165,14 @@
this.showtitle = true this.showtitle = true
this.form.open_id = uni.cache.get('open_id') this.form.open_id = uni.cache.get('open_id')
// #endif // #endif
let RES = await this.api.checkqrcodestatus({
id: this.form.id
})
if (RES.code == 1) {
this.disabled = true
} else {
this.disabled = false
}
// 开票失败的回显 // 开票失败的回显
if (e.view_type == 'fail') { if (e.view_type == 'fail') {
this.form.view_type = e.view_type; this.form.view_type = e.view_type;
@@ -335,6 +345,9 @@
}); });
}, },
async saveMerchantBaseInfo() { async saveMerchantBaseInfo() {
if (!this.disabled) {
return false;
}
if (this.form.user_name == null || this.form.user_name == '') { if (this.form.user_name == null || this.form.user_name == '') {
uni.showToast({ uni.showToast({
title: '请输入名称', title: '请输入名称',