zlisen 4 år sedan
förälder
incheckning
78bdc22565

+ 1
- 1
config/dev.js Visa fil

@@ -24,7 +24,7 @@ module.exports = {
24 24
       proxy: {
25 25
         '/api': {
26 26
           // target: 'https://sgl.ycjcjy.com',
27
-          target: 'http://192.168.211.105:7080',
27
+          target: 'http://192.168.31.211:7080',
28 28
           changeOrigin: true
29 29
         }
30 30
       }

+ 17
- 0
src/pages/account/edit/index.jsx Visa fil

@@ -67,6 +67,23 @@ const index = props => {
67 67
   };
68 68
   function formSubmit(e) {
69 69
     console.log(e.detail, "formSubmit");
70
+
71
+    if (!e.detail.value.name) {
72
+      Taro.showToast({
73
+        title: "请输入名称",
74
+        icon: "none",
75
+        duration: 2000
76
+      });
77
+      return;
78
+    }
79
+    if (!e.detail.value.phone) {
80
+      Taro.showToast({
81
+        title: "请输入号码",
82
+        icon: "none",
83
+        duration: 2000
84
+      });
85
+      return;
86
+    }
70 87
     editShopKeeper(e.detail.value);
71 88
   }
72 89
 

+ 9
- 0
src/pages/label/edit/index.jsx Visa fil

@@ -29,6 +29,15 @@ const index = props => {
29 29
   const onSave = () => {
30 30
     console.log(333);
31 31
 
32
+    if(!name){
33
+      Taro.showToast({
34
+        title: "请输入名称",
35
+        icon: "none",
36
+        duration: 2000
37
+      });
38
+      return;
39
+    }
40
+
32 41
     if (id) {
33 42
       Taro.showModal({
34 43
         title: "确定修改该标签组吗?",

+ 4
- 3
src/pages/label/index.jsx Visa fil

@@ -81,7 +81,8 @@ const house = props => {
81 81
                     <View>标签组名称:{x.name}</View>
82 82
                   </View>
83 83
                   <View className="bottom">
84
-                    <Text
84
+                    <View
85
+                    style={{height:'100%',width:'50%'}}
85 86
                       onClick={() => {
86 87
                         Taro.navigateTo({
87 88
                           url: `/pages/label/edit/index?id=${x.groupId}`
@@ -89,8 +90,8 @@ const house = props => {
89 90
                       }}
90 91
                     >
91 92
                       编辑
92
-                    </Text>
93
-                    <Text onClick={() => onDelete(x)}>删除</Text>
93
+                    </View>
94
+                    <View onClick={() => onDelete(x)}>删除</View>
94 95
                   </View>
95 96
                 </ContainerLayout>
96 97
               </View>

+ 10
- 1
src/pages/mateTag/edit/index.jsx Visa fil

@@ -28,7 +28,16 @@ const index = props => {
28 28
   };
29 29
 
30 30
   const onSave = () => {
31
-    console.log(333);
31
+  
32
+    if(!name){
33
+      Taro.showToast({
34
+        title: "请输入名称",
35
+        icon: "none",
36
+        duration: 2000
37
+      });
38
+      return;
39
+    }
40
+
32 41
 
33 42
     if (tagId) {
34 43
       Taro.showModal({

+ 13
- 2
src/pages/shop/index.jsx Visa fil

@@ -20,10 +20,16 @@ const account = props => {
20 20
 
21 21
   console.log(props, radioHouseState);
22 22
   useEffect(() => {
23
-    getShopList({ pageNum: 1, pageSize: 10 });
23
+    
24 24
   }, []);
25 25
 
26 26
   useDidShow(() => {
27
+    getShopList({ pageNum: 1, pageSize: 10 });
28
+    // if(page.pageNum==1){
29
+
30
+    // }else{
31
+    //   getShopList({ pageNum: 1, pageSize: 10 });
32
+    // }
27 33
     
28 34
   });
29 35
 
@@ -35,7 +41,12 @@ const account = props => {
35 41
           ...page,
36 42
           pageNum: page.current
37 43
         });
38
-        setList(list.concat(records || []));
44
+        if(page.current===1){
45
+          setList(records || []);
46
+        }else {
47
+          setList(list.concat(records || []));
48
+        }
49
+        
39 50
       })
40 51
       .catch(() => setLoading(false));
41 52
   }

+ 16
- 5
src/util/request.js Visa fil

@@ -9,16 +9,27 @@ export default async (options) => {
9 9
 
10 10
   return Taro.request(opts)
11 11
     .then((res) => {
12
-      console.log('3322');
12
+      console.log(res, '----------');
13
+      const { code } = typeof res.data === 'string' ? JSON.parse(res.data) : res.data
14
+      if (code == '1000') {
15
+        return res
16
+      } else {
17
+        throw res
18
+      }
13 19
       return res
14 20
     })
15 21
     .catch((err) => {
16
-      console.log(err, '333221');
17
-      return err
22
+      console.log(err, '111111111111');
23
+      if(err.status=== 504){
24
+        Taro.showToast({
25
+          title: "请检查网络",
26
+          icon: 'none'
27
+        })
28
+        throw err
29
+      }
30
+      throw err
18 31
     })
19 32
 }
20
-// import useUser from './store/user'
21
-// const {user} = useUser()
22 33
 
23 34
 export function optionBuilder(options) {
24 35
   const {