Browse Source

新增地址增加空格校验

Eratosici 3 năm trước cách đây
mục cha
commit
ffe43acba5
1 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 5 3
      mall4uni/pages/editAddress/editAddress.vue

+ 5 - 3
mall4uni/pages/editAddress/editAddress.vue

@@ -355,7 +355,8 @@ export default {
       var mobile = ths.mobile;
       var addr = ths.addr;
 
-      if (!receiver) {
+      if (!receiver.trim()) {
+        this.receiver = ''
         uni.showToast({
           title: '请输入收货人姓名',
           icon: "none"
@@ -379,7 +380,8 @@ export default {
         return;
       }
 
-      if (!addr) {
+      if (!addr.trim()) {
+        this.addr = ''
         uni.showToast({
           title: '请输入详细地址',
           icon: "none"
@@ -473,4 +475,4 @@ export default {
 </script>
 <style>
 @import "./editAddress.css";
-</style>
+</style>