Kaynağa Gözat

show toast if add icon failed

Zhengxiaowei 5 yıl önce
ebeveyn
işleme
89e7074281
2 değiştirilmiş dosya ile 7 ekleme ve 3 silme
  1. 2 1
      src/components/short/index.ux
  2. 5 2
      src/views/Index/index.ux

+ 2 - 1
src/components/short/index.ux

@@ -28,7 +28,8 @@ export default {
 							this.$emit("addshort", { installed: true });
 						},
 						fail: (code) => {
-							this.$emit("addshort", { installed: false });
+							console.log(code);
+							this.$emit("addshort", { installed: false, msg: code });
 						}
 					})
 				}

+ 5 - 2
src/views/Index/index.ux

@@ -99,6 +99,9 @@ export default {
     })
   },
   shortEnd(value) {
+    if (value.detail.msg) {
+      prompt.showToast({ message: "用户禁止创建" });
+    }
     this.showShortPop = !value.detail.installed;
   },
   onBackPress() {
@@ -116,8 +119,8 @@ export default {
   onMenuPress() {
     this.$app.$def.showMenu();
   },
-  changeShortCut(){
-    this.showShortPop=false;
+  changeShortCut() {
+    this.showShortPop = false;
   },
   async getCoustom() {
     let res = await getCustomQrcode();