Преглед на файлове

Merge branch 'v4' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into v4

# Conflicts:
#	config/dev.js
傅行帆 преди 5 години
родител
ревизия
b242c9a754
променени са 8 файла, в които са добавени 28 реда и са изтрити 10 реда
  1. 2
    2
      config/dev.js
  2. 4
    4
      config/prod.js
  3. 1
    1
      src/pages/activity/detail/assemble.js
  4. 2
    1
      src/pages/activity/item/index.js
  5. 1
    1
      src/pages/news/detail/index.js
  6. 1
    0
      src/pages/news/index.js
  7. 2
    1
      src/pages/news/item.js
  8. 15
    0
      src/utils/tools.js

+ 2
- 2
config/dev.js Целия файл

@@ -9,8 +9,8 @@ module.exports = {
9 9
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    HOST: '"http://192.168.0.84:8080"',
13
-    WSS_HOST: '"ws://192.168.0.84:8080"',
12
+    HOST: '"http://127.0.0.1:8080"',
13
+    WSS_HOST: '"ws://127.0.0.1:8080"',
14 14
   },
15 15
   weapp: {},
16 16
   h5: {}

+ 4
- 4
config/prod.js Целия файл

@@ -3,10 +3,10 @@ module.exports = {
3 3
     NODE_ENV: '"production"'
4 4
   },
5 5
   defineConstants: {
6
-    HOST: '"https://dev.jinchengjiaye.com"',
7
-    WSS_HOST: '"wss://dev.jinchengjiaye.com"',
8
-    // HOST: '"https://lt.pawoma.cn"',
9
-    // WSS_HOST: '"wss://lt.pawoma.cn"',
6
+    // HOST: '"https://dev.jinchengjiaye.com"',
7
+    // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
8
+    HOST: '"https://lt.pawoma.cn"',
9
+    WSS_HOST: '"wss://lt.pawoma.cn"',
10 10
   },
11 11
   weapp: {},
12 12
   h5: {}

+ 1
- 1
src/pages/activity/detail/assemble.js Целия файл

@@ -630,7 +630,7 @@ export default class Detail extends Component {
630 630
                   {
631 631
                     !isStarter && actState === ActInProcess && groupState === GroupInProcess &&
632 632
 
633
-                    <View className="btn-box">
633
+                    <View className="btn-box" style="margin: auto; padding: 0;">
634 634
                       {
635 635
                         (groupState === GroupInProcess && !isJoin) &&
636 636
                         (<Button className="assistance-btn" onClick={this.joinGroup}>立即参团</Button>)

+ 2
- 1
src/pages/activity/item/index.js Целия файл

@@ -1,6 +1,7 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import './index.scss'
3 3
 import dayjs from 'dayjs'
4
+import { getThumbnail } from '@utils/tools'
4 5
 
5 6
 export default class Item extends Component {
6 7
   static defaultProps = {
@@ -15,7 +16,7 @@ export default class Item extends Component {
15 16
     const { data, style } = this.props
16 17
     return (
17 18
       <View className="item" style={style} onClick={this.handleClick.bind(this, data)}>
18
-        <Image className="pic" mode="aspectFill" src={data.mainImg || data.imgUrl}></Image>
19
+        <Image className="pic" mode="aspectFill" src={getThumbnail(data.mainImg || data.imgUrl)}></Image>
19 20
         <View className="box">
20 21
           <View className="title">{data.title}</View>
21 22
           {

+ 1
- 1
src/pages/news/detail/index.js Целия файл

@@ -7,7 +7,7 @@ import WxParse from '@components/wxParse/wxParse'
7 7
 import BackHomeBtn from '@components/BackHomeBtn'
8 8
 import Notice from '@components/Notice'
9 9
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
10
-import { getDownloadURL } from '@utils/tools'
10
+import { getDownloadURL, getThumbnail } from '@utils/tools'
11 11
 import {
12 12
   addNewsUv,
13 13
   favorNews,

+ 1
- 0
src/pages/news/index.js Целия файл

@@ -5,6 +5,7 @@ import './index.scss'
5 5
 import { savePoint, updatePoint } from '@services/common'
6 6
 import { queryNewsList } from '@services/news'
7 7
 import { connect } from '@tarojs/redux'
8
+
8 9
 let pageIndex = 1
9 10
 
10 11
 @connect(state => state.city)

+ 2
- 1
src/pages/news/item.js Целия файл

@@ -1,6 +1,7 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import dayjs from 'dayjs'
3 3
 import './item.scss'
4
+import { getThumbnail } from '@utils/tools'
4 5
 
5 6
 export default class NewsItem extends Component {
6 7
   static defaultProps = {
@@ -13,7 +14,7 @@ export default class NewsItem extends Component {
13 14
     const { data } = this.props
14 15
     return (
15 16
       <View className="item" key={data.newsId} onClick={this.handleClick}>
16
-        <Image className="item-img" mode="aspectFill" src={data.newsImg}></Image>
17
+        <Image className="item-img" mode="aspectFill" src={getThumbnail(data.newsImg)}></Image>
17 18
         <View className="item-con">
18 19
           <View className="item-con__title">{data.newsName}</View>
19 20
           <View className="item-con__date">{dayjs(data.createDate).format('YYYY-MM-DD')}</View>

+ 15
- 0
src/utils/tools.js Целия файл

@@ -4,6 +4,21 @@ export function times(n) {
4 4
   return n > 0 ? '*'.repeat(n - 1).split('*') : []
5 5
 }
6 6
 
7
+/**
8
+ * 
9
+ * @param {*} img 
10
+ * @param {*} quality  仅支持 70,50,30,5
11
+ */
12
+export function getThumbnail(img, quality) {
13
+  if (!img) return img
14
+
15
+  if (img.indexOf('https://estateagents.oss-cn-shanghai.aliyuncs.com') === 0) {
16
+    return `${img}?x-oss-process=style/compress${quality || 30}`
17
+  }
18
+
19
+  return img
20
+}
21
+
7 22
 /**
8 23
  * 解析 queryString   a=b&c=d  ==> { a:b, c:d }
9 24
  * @param {*} queryString