张延森 3 years ago
parent
commit
b650d6a551
4 changed files with 21 additions and 3 deletions
  1. 1
    0
      config/dev.js
  2. 1
    0
      config/prod.js
  3. 3
    3
      src/pages/index/tabs/Recommend.jsx
  4. 16
    0
      src/utils/index.js

+ 1
- 0
config/dev.js View File

5
   defineConstants: {
5
   defineConstants: {
6
     // HOST: '"http://192.168.89.147:8080"',
6
     // HOST: '"http://192.168.89.147:8080"',
7
     HOST: '"https://sgl-v2.njyunzhi.com"',
7
     HOST: '"https://sgl-v2.njyunzhi.com"',
8
+    OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
8
   },
9
   },
9
   mini: {},
10
   mini: {},
10
   h5: {}
11
   h5: {}

+ 1
- 0
config/prod.js View File

4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
     HOST: '"https://sgl-v2.njyunzhi.com"',
6
     HOST: '"https://sgl-v2.njyunzhi.com"',
7
+    OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
7
   },
8
   },
8
   mini: {},
9
   mini: {},
9
   h5: {
10
   h5: {

+ 3
- 3
src/pages/index/tabs/Recommend.jsx View File

74
 
74
 
75
   // }
75
   // }
76
 
76
 
77
-  // useDidShow(() => {
78
-  //   likeLook()
79
-  // })
77
+  useDidShow(() => {
78
+    setQueryParams({ ... queryParams})
79
+  })
80
 
80
 
81
   return (
81
   return (
82
     // <view style={{ height: '100%', overflow: 'hidden',display:'flex',flexDirection:'column' }}>
82
     // <view style={{ height: '100%', overflow: 'hidden',display:'flex',flexDirection:'column' }}>

+ 16
- 0
src/utils/index.js View File

44
 
44
 
45
   return arr.filter(Boolean).join('&')
45
   return arr.filter(Boolean).join('&')
46
 }
46
 }
47
+
48
+/**
49
+ * 压缩图片
50
+ * @param {*} url 
51
+ * @returns 
52
+ */
53
+export function compressImage(url) {
54
+  if (!url) return url;
55
+
56
+  // eslint-disable-next-line no-undef
57
+  if (url.indexOf(OSS) > -1) {
58
+    return `${url}?x-oss-process=style/cmp80`
59
+  }
60
+
61
+  return url;
62
+}