소스 검색

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

周立森 5 년 전
부모
커밋
0db43df0a0
6개의 변경된 파일41개의 추가작업 그리고 11개의 파일을 삭제
  1. 4
    4
      config/dev.js
  2. 1
    1
      project.config.json
  3. 3
    1
      src/pages/project/detail/index.js
  4. 31
    3
      src/pages/project/index.js
  5. 1
    1
      src/utils/request.js
  6. 1
    1
      src/utils/tools.js

+ 4
- 4
config/dev.js 파일 보기

@@ -5,12 +5,12 @@ module.exports = {
5 5
   defineConstants: {
6 6
     // HOST: '"http://47.101.36.130:8085"',//测试
7 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 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://192.168.0.84:8080"',
13
+    WSS_HOST: '"ws://192.168.0.84:8080"',
14 14
   },
15 15
   weapp: {},
16 16
   h5: {}

+ 1
- 1
project.config.json 파일 보기

@@ -2,7 +2,7 @@
2 2
 	"miniprogramRoot": "dist/",
3 3
 	"projectname": "mini-chengjiao",
4 4
 	"description": "知与行联调",
5
-	"appid": "wxda1f84b79b3edeb3",
5
+	"appid": "wxd9ee3a9480a4e544",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": false,

+ 3
- 1
src/pages/project/detail/index.js 파일 보기

@@ -65,8 +65,10 @@ export default class Index extends Component {
65 65
     ready.queue(() => {
66 66
       // 分享场景需要先授权手机, 再授权头像
67 67
       const options = wx.getLaunchOptionsSync()
68
+      console.log('-------options----->', options)
68 69
       if (sceneInShare(options.scene)) {
69 70
         const { person = {} } = this.props.userInfo || {}
71
+        console.log('-------person----->', person)
70 72
         if ((person.tel || person.phone) && (person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
71 73
           Taro.reLaunch({ url: '/pages/auth/index' })
72 74
           return
@@ -79,13 +81,13 @@ export default class Index extends Component {
79 81
 
80 82
       this.initPageData()
81 83
     })
82
-    console.log('---------------after componentWillMount---------------')
83 84
   }
84 85
 
85 86
   componentWillUnmount() {
86 87
     const { recordId } = this.state
87 88
     recordId && updatePoint(recordId)
88 89
   }
90
+
89 91
   initPageData() {
90 92
     const router = Taro.getStorageSync('router')
91 93
     const id = this.$router.params.id || router.query.id

+ 31
- 3
src/pages/project/index.js 파일 보기

@@ -103,7 +103,7 @@ export default class Index extends Component {
103 103
       const payload = { location: `${location.longitude},${location.latitude}` }
104 104
 
105 105
       getLocationCity(payload).then(res => {
106
-
106
+        console.log(res,"!!!!!!!!!!!!!!!!!11res=========")
107 107
         let curCity = cityList.filter(item => {
108 108
           return item.name == res.name || ''
109 109
         })
@@ -134,9 +134,37 @@ export default class Index extends Component {
134 134
       this.updateCity(defaultCity)
135 135
     })
136 136
   }
137
+  updateCity(payload) {
138
+    const NanJing = {
139
+      citycode: "025",
140
+      id: 320100,
141
+      initial: "N",
142
+      lat: "32.041544",
143
+      leveltype: 2,
144
+      lng: "118.767413",
145
+      name: "南京市",
146
+      parentid: 320000,
147
+      pinyin: "Nanjing",
148
+      shortname: "南京",
149
+      status: 1,
150
+      zipcode: "320100"
151
+    }
152
+
153
+    const appId = accountInfo.miniProgram.appId;
154
+    let params;
155
+
156
+    switch (appId) {
157
+      // 知与行联调
158
+      case 'wxd9ee3a9480a4e544':
159
+        params = NanJing;
160
+        break;
161
+
162
+      default:
163
+        params = payload;
164
+        break;
165
+    }
137 166
 
138
-  updateCity (payload) {
139
-    this.props.dispatchCitySelected(payload).then(res => {
167
+    this.props.dispatchCitySelected(params).then(res => {
140 168
       this.loadData()
141 169
     })
142 170
   }

+ 1
- 1
src/utils/request.js 파일 보기

@@ -94,7 +94,7 @@ export const fetch = async (options) => {
94 94
       icon: 'none'
95 95
     })
96 96
 
97
-    throw new Error(err)
97
+    throw new Error(errMessage)
98 98
   })
99 99
 }
100 100
 

+ 1
- 1
src/utils/tools.js 파일 보기

@@ -5,7 +5,7 @@ import Taro from '@tarojs/taro';
5 5
  * @param {*} scene 
6 6
  */
7 7
 export function sceneInShare(scene) {
8
-  return [1011, 1012, 1013, 1031, 1032, 1036, 1047, 1048].indexOf(scene) > -1
8
+  return [1007, 1008, 1011, 1012, 1013, 1031, 1032, 1036, 1047, 1048, 1049].indexOf(scene) > -1
9 9
 }
10 10
 
11 11
 /**