zlisen 4 lat temu
rodzic
commit
78bdc22565

+ 1
- 1
config/dev.js Wyświetl plik

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

+ 17
- 0
src/pages/account/edit/index.jsx Wyświetl plik

67
   };
67
   };
68
   function formSubmit(e) {
68
   function formSubmit(e) {
69
     console.log(e.detail, "formSubmit");
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
     editShopKeeper(e.detail.value);
87
     editShopKeeper(e.detail.value);
71
   }
88
   }
72
 
89
 

+ 9
- 0
src/pages/label/edit/index.jsx Wyświetl plik

29
   const onSave = () => {
29
   const onSave = () => {
30
     console.log(333);
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
     if (id) {
41
     if (id) {
33
       Taro.showModal({
42
       Taro.showModal({
34
         title: "确定修改该标签组吗?",
43
         title: "确定修改该标签组吗?",

+ 4
- 3
src/pages/label/index.jsx Wyświetl plik

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

+ 10
- 1
src/pages/mateTag/edit/index.jsx Wyświetl plik

28
   };
28
   };
29
 
29
 
30
   const onSave = () => {
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
     if (tagId) {
42
     if (tagId) {
34
       Taro.showModal({
43
       Taro.showModal({

+ 13
- 2
src/pages/shop/index.jsx Wyświetl plik

20
 
20
 
21
   console.log(props, radioHouseState);
21
   console.log(props, radioHouseState);
22
   useEffect(() => {
22
   useEffect(() => {
23
-    getShopList({ pageNum: 1, pageSize: 10 });
23
+    
24
   }, []);
24
   }, []);
25
 
25
 
26
   useDidShow(() => {
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
           ...page,
41
           ...page,
36
           pageNum: page.current
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
       .catch(() => setLoading(false));
51
       .catch(() => setLoading(false));
41
   }
52
   }

+ 16
- 5
src/util/request.js Wyświetl plik

9
 
9
 
10
   return Taro.request(opts)
10
   return Taro.request(opts)
11
     .then((res) => {
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
       return res
19
       return res
14
     })
20
     })
15
     .catch((err) => {
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
 export function optionBuilder(options) {
34
 export function optionBuilder(options) {
24
   const {
35
   const {