xujing 5 年之前
父節點
當前提交
512c3f7b70
共有 5 個檔案被更改,包括 43 行新增31 行删除
  1. 4
    4
      config/dev.js
  2. 2
    1
      src/app.js
  3. 13
    6
      src/pages/person/myShare/index.js
  4. 5
    3
      src/pages/person/spread/index.js
  5. 19
    17
      src/pages/person/spread/poster.js

+ 4
- 4
config/dev.js 查看文件

5
   defineConstants: {
5
   defineConstants: {
6
     // HOST: '"http://47.101.36.130:8085"',//测试
6
     // HOST: '"http://47.101.36.130:8085"',//测试
7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
8
-    // HOST: '"https://dev.jinchengjiaye.com"',//测试
9
-    // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
8
+    HOST: '"https://dev.jinchengjiaye.com"',//测试
9
+    WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10
     // HOST: '"https://lt.pawoma.cn"',
10
     // HOST: '"https://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    HOST: '"http://192.168.2.51:8080"',
13
-    WSS_HOST: '"ws://192.168.2.51:8080"',
12
+    // HOST: '"http://192.168.2.51:8080"',
13
+    // WSS_HOST: '"ws://192.168.2.51:8080"',
14
     Version: 'V3.5.6'
14
     Version: 'V3.5.6'
15
   },
15
   },
16
   weapp: {},
16
   weapp: {},

+ 2
- 1
src/app.js 查看文件

108
     ],
108
     ],
109
     window: {
109
     window: {
110
       backgroundTextStyle: 'light',
110
       backgroundTextStyle: 'light',
111
-      navigationBarBackgroundColor: '#BB9C79',
111
+      navigationBarBackgroundColor: '#E31F05',
112
+      // navigationBarBackgroundColor: '#BB9C79',
112
       navigationBarTitleText: '橙蕉',
113
       navigationBarTitleText: '橙蕉',
113
       navigationBarTextStyle: 'white',
114
       navigationBarTextStyle: 'white',
114
 
115
 

+ 13
- 6
src/pages/person/myShare/index.js 查看文件

88
   }
88
   }
89
 
89
 
90
   handleItemClick(item) {
90
   handleItemClick(item) {
91
-    Taro.navigateTo({
92
-      url: `/pages/person/myShare/accessRecord?targetId=${item.targetId}&eventType=${item.eventType}` 
93
-    })
91
+    if (item.eventType == "project") {
92
+      Taro.navigateTo({
93
+        url: `/pages/person/myShare/accessRecord?targetId=${item.targetId}&eventType=building`
94
+      })
95
+    } else {
96
+      Taro.navigateTo({
97
+        url: `/pages/person/myShare/accessRecord?targetId=${item.targetId}&eventType=${item.eventType}`
98
+      })
99
+    }
100
+
94
   }
101
   }
95
 
102
 
96
   render() {
103
   render() {
109
           {
116
           {
110
             recordList.map(item => (
117
             recordList.map(item => (
111
               <View className="share-item" key={item.targetId + 'share'} onClick={this.handleItemClick.bind(this, item)}>
118
               <View className="share-item" key={item.targetId + 'share'} onClick={this.handleItemClick.bind(this, item)}>
112
-                <Image className="img" mode="aspectFill"  src={transferImage(item.activityImg || emptyImg)}></Image>
119
+                <Image className="img" mode="aspectFill" src={transferImage(item.activityImg || emptyImg)}></Image>
113
                 <View className={item.eventType == 'project' ? 'building' : 'name'}>{item.activityName || ''}</View>
120
                 <View className={item.eventType == 'project' ? 'building' : 'name'}>{item.activityName || ''}</View>
114
                 {item.eventType == 'project' && <View className="price"> {item.price ? '均价' + item.price + '元/m²' : '暂无均价'} </View>}
121
                 {item.eventType == 'project' && <View className="price"> {item.price ? '均价' + item.price + '元/m²' : '暂无均价'} </View>}
115
 
122
 
116
                 {item.eventType == 'h5' && <View className="num"> {item.drainageShareNum || '0'}人查看了分享 </View>}
123
                 {item.eventType == 'h5' && <View className="num"> {item.drainageShareNum || '0'}人查看了分享 </View>}
117
-                {item.eventType == 'project' && <View className="num"> {item.projectNum || '0'}人查看了分享 </View>}
124
+                {item.eventType == 'project' && <View className="num"> {item.buildingNum || '0'}人查看了分享 </View>}
118
                 {item.eventType == 'group' && <View className="num"> {item.groupActivityShareNum || '0'}人查看了分享 </View>}
125
                 {item.eventType == 'group' && <View className="num"> {item.groupActivityShareNum || '0'}人查看了分享 </View>}
119
                 {item.eventType == 'help' && <View className="num"> {item.helpActivityShareNum || '0'}人查看了分享 </View>}
126
                 {item.eventType == 'help' && <View className="num"> {item.helpActivityShareNum || '0'}人查看了分享 </View>}
120
                 {item.eventType == 'activity' && <View className="num"> {item.activityShareNum || '0'}人查看了分享 </View>}
127
                 {item.eventType == 'activity' && <View className="num"> {item.activityShareNum || '0'}人查看了分享 </View>}
121
                 {item.eventType == 'news' && <View className="num"> {item.newsNum || '0'}人查看了分享 </View>}
128
                 {item.eventType == 'news' && <View className="num"> {item.newsNum || '0'}人查看了分享 </View>}
122
 
129
 
123
-                {item.eventType == 'building' && <View className="address"> {item.address || ''} </View>}
130
+                {item.eventType == 'project' && <View className="address"> {item.address || ''} </View>}
124
               </View>
131
               </View>
125
             ))
132
             ))
126
           }
133
           }

+ 5
- 3
src/pages/person/spread/index.js 查看文件

5
 import { getMiniQrcode } from '@/services/common'
5
 import { getMiniQrcode } from '@/services/common'
6
 import Poster from './poster'
6
 import Poster from './poster'
7
 import { ROLE_CODE } from '@/constants/user'
7
 import { ROLE_CODE } from '@/constants/user'
8
+import rtLog from '@/utils/rtLog'
8
 @connect(
9
 @connect(
9
   ({ user }) => ({ ...user })
10
   ({ user }) => ({ ...user })
10
 )
11
 )
36
       }
37
       }
37
 
38
 
38
       getMiniQrcode(payload).then(qrcode => {
39
       getMiniQrcode(payload).then(qrcode => {
40
+        rtLog.error(qrcode, "qrcodeqrcodeqrcodeqrcodeqrcodeqrcode")
39
         let data = {
41
         let data = {
40
           qrcode,//小程序二维码
42
           qrcode,//小程序二维码
41
           nickname,//访问者名字
43
           nickname,//访问者名字
53
   // 开始生成海报
55
   // 开始生成海报
54
   toggleVisiblePoster = (flag) => {
56
   toggleVisiblePoster = (flag) => {
55
     if (flag) {
57
     if (flag) {
56
-      console.log(flag,"flagflagflagflag,true")
58
+      rtLog.error(flag, "flagflagflagflag,true")
57
       this.getPosterData().then(posterData => {
59
       this.getPosterData().then(posterData => {
58
-        console.log(posterData,"posterDataposterDataposterDataposterDataposterData")
60
+        rtLog.error(posterData,"posterDataposterDataposterDataposterDataposterData")
59
         this.setState({
61
         this.setState({
60
           makePosterStatus: !!flag,
62
           makePosterStatus: !!flag,
61
           posterData,
63
           posterData,
63
         })
65
         })
64
       })
66
       })
65
     } else {
67
     } else {
66
-      console.log(flag,"flagflagflagflag,false")
68
+      rtLog.error(flag,"flagflagflagflag,false")
67
       this.setState({
69
       this.setState({
68
         makePosterStatus: !!flag
70
         makePosterStatus: !!flag
69
       })
71
       })

+ 19
- 17
src/pages/person/spread/poster.js 查看文件

1
 import Taro, { Component } from '@tarojs/taro';
1
 import Taro, { Component } from '@tarojs/taro';
2
 import { TaroCanvasDrawer } from '@/components/taro-plugin-canvas';
2
 import { TaroCanvasDrawer } from '@/components/taro-plugin-canvas';
3
 import dayjs from 'dayjs'
3
 import dayjs from 'dayjs'
4
+import rtLog from '@/utils/rtLog'
4
 /**
5
 /**
5
  * 文档参考
6
  * 文档参考
6
  * http://taro-ext.jd.com/plugin/view/5d23051670a0f46a87c9785b
7
  * http://taro-ext.jd.com/plugin/view/5d23051670a0f46a87c9785b
34
     const texts = [
35
     const texts = [
35
 
36
 
36
       {
37
       {
37
-        x:120,
38
+        x: 120,
38
         y: 90,
39
         y: 90,
39
         text: data.nickname,
40
         text: data.nickname,
40
-        fontSize:28,
41
+        fontSize: 28,
41
         color: '#000',
42
         color: '#000',
42
         baseLine: 'middle',
43
         baseLine: 'middle',
43
         lineHeight: 48,
44
         lineHeight: 48,
44
         width: 200,
45
         width: 200,
45
       },
46
       },
46
       {
47
       {
47
-        x:250,
48
+        x: 250,
48
         y: 580,
49
         y: 580,
49
         text: data.tip,
50
         text: data.tip,
50
-        fontSize:20,
51
+        fontSize: 20,
51
         color: '#999999',
52
         color: '#999999',
52
         baseLine: 'middle',
53
         baseLine: 'middle',
53
         lineHeight: 48,
54
         lineHeight: 48,
54
         width: 500,
55
         width: 500,
55
-        textAlign:'center'
56
+        textAlign: 'center'
56
       },
57
       },
57
-     
58
+
58
     ]
59
     ]
59
     const images = [
60
     const images = [
60
-      
61
+
61
       {
62
       {
62
         url: data.avatarurl || require('@/assets/default-avatar.png'),
63
         url: data.avatarurl || require('@/assets/default-avatar.png'),
63
         width: 90,
64
         width: 90,
64
         height: 90,
65
         height: 90,
65
         y: 30,
66
         y: 30,
66
         x: 20,
67
         x: 20,
67
-        borderWidth:1,
68
-        borderRadius:20,
68
+        borderWidth: 1,
69
+        borderRadius: 20,
69
       },
70
       },
70
       {
71
       {
71
         url: data.qrcode,
72
         url: data.qrcode,
77
     ]
78
     ]
78
     const blocks = [
79
     const blocks = [
79
       {
80
       {
80
-        x:300,
81
+        x: 300,
81
         y: 100,
82
         y: 100,
82
         color: '#fff',
83
         color: '#fff',
83
         baseLine: 'middle',
84
         baseLine: 'middle',
84
         lineHeight: 48,
85
         lineHeight: 48,
85
         width: 500,
86
         width: 500,
86
-        height:530
87
+        height: 530
87
       },
88
       },
88
     ]
89
     ]
89
-    const config = Object.assign(basicConfig, {images, texts,blocks })
90
+    const config = Object.assign(basicConfig, { images, texts, blocks })
90
     this.setState({
91
     this.setState({
91
       config,
92
       config,
92
       canvasStatus: true
93
       canvasStatus: true
94
   }
95
   }
95
 
96
 
96
   onCreateSuccess = (result) => {
97
   onCreateSuccess = (result) => {
97
-    console.log(result,"生成图片resultresultresultresult")
98
+    rtLog.error(result, "==================================")
99
+    console.log(result, "生成图片resultresultresultresult")
98
     const { tempFilePath, errMsg } = result;
100
     const { tempFilePath, errMsg } = result;
99
     Taro.hideLoading();
101
     Taro.hideLoading();
100
     if (errMsg === 'canvasToTempFilePath:ok') {
102
     if (errMsg === 'canvasToTempFilePath:ok') {
101
-      
103
+
102
       this.setState({
104
       this.setState({
103
         shareImage: tempFilePath,
105
         shareImage: tempFilePath,
104
         // 重置 TaroCanvasDrawer 状态,方便下一次调用
106
         // 重置 TaroCanvasDrawer 状态,方便下一次调用
107
       })
109
       })
108
       Taro.saveImageToPhotosAlbum({
110
       Taro.saveImageToPhotosAlbum({
109
         filePath: tempFilePath,
111
         filePath: tempFilePath,
110
-        success:function(res){
112
+        success: function (res) {
111
           Taro.showToast({
113
           Taro.showToast({
112
             title: '已保存到相册',
114
             title: '已保存到相册',
113
             icon: 'success',
115
             icon: 'success',
114
             duration: 2000,
116
             duration: 2000,
115
           });
117
           });
116
-        },fail:function(){
118
+        }, fail: function () {
117
           Taro.showToast({
119
           Taro.showToast({
118
             title: '保存失败,请打开相册权限',
120
             title: '保存失败,请打开相册权限',
119
             icon: 'none',
121
             icon: 'none',
131
       Taro.showToast({ icon: 'none', title: errMsg || '出现错误' });
133
       Taro.showToast({ icon: 'none', title: errMsg || '出现错误' });
132
       console.log(errMsg);
134
       console.log(errMsg);
133
     }
135
     }
134
-    
136
+
135
 
137
 
136
     // 预览
138
     // 预览
137
     // Taro.previewImage({
139
     // Taro.previewImage({