Ver código fonte

fix:修改空壁纸的toast提示

zeng.chen 4 meses atrás
pai
commit
0a0290e645
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7 0
      pages/piano/cropper/cropper.js

+ 7 - 0
pages/piano/cropper/cropper.js

@@ -232,6 +232,13 @@ Page({
     //   return;
     // }
     let _imgTopPic = _this.data._imgTopPic ?? ""
+    if (_imgTopPic.length == 0) {
+      wx.showToast({
+        title: '壁纸不能为空',
+        icon: "none"
+      })
+      return
+    }
     if (_imgTopPic.startsWith("http")) {
       // 服务器的走下载图片
       console.log("服务器的走下载图片", _this.data._imgTopPic)