Browse Source

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

# Conflicts:
#	config/dev.js
许静 5 years ago
parent
commit
0f60ff096c

+ 2
- 1
.gitignore View File

3
 .rn_temp/
3
 .rn_temp/
4
 node_modules/
4
 node_modules/
5
 .DS_Store
5
 .DS_Store
6
-*.rar
6
+*.rar
7
+*.zip

BIN
chengjiaojinfang.zip View File


+ 16
- 14
src/pages/person/index.js View File

25
     tourist: false,//普通用户,
25
     tourist: false,//普通用户,
26
     menus: [],
26
     menus: [],
27
     roleName: '普通用户',
27
     roleName: '普通用户',
28
+
28
   }
29
   }
29
 
30
 
30
   componentDidShow () {
31
   componentDidShow () {
34
   }
35
   }
35
 
36
 
36
   loadUserInfo () {
37
   loadUserInfo () {
38
+  
37
     queryUserInfo().then(user => {
39
     queryUserInfo().then(user => {
38
       const [roleSetting, roleName] = this.getRoleName(user.personType)
40
       const [roleSetting, roleName] = this.getRoleName(user.personType)
39
-
41
+     
40
       this.setState({
42
       this.setState({
41
         user,
43
         user,
42
         phone: user.phone,
44
         phone: user.phone,
54
     }
56
     }
55
 
57
 
56
     doUserSignin({ id }).then(res => {
58
     doUserSignin({ id }).then(res => {
57
-      Taro.Toast({
59
+      Taro.showToast({
58
         title: '签到成功'
60
         title: '签到成功'
59
       })
61
       })
60
       // this.setState({
62
       // this.setState({
93
 
95
 
94
 
96
 
95
       putRegisterConsultant().then(res => {
97
       putRegisterConsultant().then(res => {
96
-        console.log("res", res)
98
+    
97
 
99
 
98
-        if (res) {
100
+        // if (res) {
99
           Taro.showToast({
101
           Taro.showToast({
100
             title: "匹配成功,请退出小程序重新登录即可",
102
             title: "匹配成功,请退出小程序重新登录即可",
101
             icon: "none",
103
             icon: "none",
102
             duration: 3000
104
             duration: 3000
103
           })
105
           })
104
-        } else {
105
-          Taro.showToast({
106
-            title: "匹配失败,请联系相关管理人员",
107
-            icon: "none",
108
-            duration: 3000
109
-          })
110
-        }
106
+        // } else {
107
+        //   Taro.showToast({
108
+        //     title: "匹配失败,请联系相关管理人员",
109
+        //     icon: "none",
110
+        //     duration: 3000
111
+        //   })
112
+        // }
111
       }).catch(err => {
113
       }).catch(err => {
112
         console.error(err)
114
         console.error(err)
113
         Taro.showToast({
115
         Taro.showToast({
200
           </View>
202
           </View>
201
           <View className='qiandao-con'>
203
           <View className='qiandao-con'>
202
             <Text className='qiandao-text'>签到得积分,积分兑好礼,马上去签到吧!</Text>
204
             <Text className='qiandao-text'>签到得积分,积分兑好礼,马上去签到吧!</Text>
203
-            {/* <View className={user.havaSigned ? 'reday-qiandao-btn' : 'qiandao-btn'} onClick={this.doSign}>{user.havaSigned ? '已签到' : '签到'}</View> */}
204
-            {
205
+            <View className={user.havaSigned ? 'reday-qiandao-btn' : 'qiandao-btn'} onClick={this.doSign}>{user.havaSigned ? '已签到' : '签到'}</View>
206
+            {/* {
205
               user.havaSigned ?
207
               user.havaSigned ?
206
                 (<View className='reday-qiandao-btn' onClick={this.doSign}> 已签到</View>) :
208
                 (<View className='reday-qiandao-btn' onClick={this.doSign}> 已签到</View>) :
207
                 (<View className='qiandao-btn' onClick={this.doSign}>签到</View>)
209
                 (<View className='qiandao-btn' onClick={this.doSign}>签到</View>)
208
-            }
210
+            } */}
209
             {/* <Text className='integral-cont_btn' onClick={this.goShop}>去兑换</Text> */}
211
             {/* <Text className='integral-cont_btn' onClick={this.goShop}>去兑换</Text> */}
210
 
212
 
211
           </View>
213
           </View>

+ 1
- 1
src/pages/person/profile/index.js View File

24
 
24
 
25
   }
25
   }
26
 
26
 
27
-  componentDidShow() {
27
+  componentWillMount() {
28
     this.getProfile()
28
     this.getProfile()
29
   }
29
   }
30
 
30
 

+ 3
- 1
src/pages/project/album/index.scss View File

49
     font-size: 32px;
49
     font-size: 32px;
50
     color: #666;
50
     color: #666;
51
     line-height: 44px;
51
     line-height: 44px;
52
-    
52
+    text-align: center;
53
 
53
 
54
     &.active {
54
     &.active {
55
       color: #BB9C79;
55
       color: #BB9C79;
57
     }
57
     }
58
 &-text {
58
 &-text {
59
   padding: 4px 0;
59
   padding: 4px 0;
60
+  text-align: center;
61
+  
60
 }
62
 }
61
 
63
 
62
     &+& {
64
     &+& {

+ 2
- 0
src/pages/project/detail/Around/Pannel.js View File

57
       currentMarkerPos = 0
57
       currentMarkerPos = 0
58
     }
58
     }
59
 
59
 
60
+    // console.log('-------markerList---------', markerList)
61
+
60
     this.setState({ currentMarkerPos, markerList })
62
     this.setState({ currentMarkerPos, markerList })
61
   }
63
   }
62
 
64
 

+ 10
- 5
src/pages/project/detail/index.js View File

167
     const { buildingId } = this.state
167
     const { buildingId } = this.state
168
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
168
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
169
     queryActivityList(payload).then(res => {
169
     queryActivityList(payload).then(res => {
170
+      console.log(res,'Activity')
170
       this.setState({
171
       this.setState({
171
-        activityList: res.list || []
172
+        activityList: res || []
172
       })
173
       })
173
     })
174
     })
174
   }
175
   }
824
                       {
825
                       {
825
                         item && (
826
                         item && (
826
                           <View className='house__img-info'>
827
                           <View className='house__img-info'>
827
-                            {console.log(list, '-------')}
828
                             <Image className='house__img' src={getThumbnail(item.buildingImgList[0].url)} mode="widthFix" onClick={this.handlePreviewHxImage.bind(this, item.buildingImgList[0].url, imgUrls)}></Image>
828
                             <Image className='house__img' src={getThumbnail(item.buildingImgList[0].url)} mode="widthFix" onClick={this.handlePreviewHxImage.bind(this, item.buildingImgList[0].url, imgUrls)}></Image>
829
                             <View className='house-type__state' style={`background-color: ${statusBgColors[item.marketStatus - 1]}`}>{statusOpts[item.marketStatus - 1]}</View>
829
                             <View className='house-type__state' style={`background-color: ${statusBgColors[item.marketStatus - 1]}`}>{statusOpts[item.marketStatus - 1]}</View>
830
                           </View>
830
                           </View>
877
       <Block>
877
       <Block>
878
         {
878
         {
879
           activityList.length > 0 && (
879
           activityList.length > 0 && (
880
-            <View className="activity" onClick={this.handleActivityMoreClick}>
880
+            <View className="activity" >
881
               {console.log(activityList, '----activityList-----')}
881
               {console.log(activityList, '----activityList-----')}
882
-              <View className="title">热门活动</View>
882
+              <View className="section-head">
883
+                 <Text className="section-head__title">热门活动</Text>
884
+                 <View className="section-head__more" onClick={this.handleActivityMoreClick}>
885
+                   更多活动<Text className="iconfont icon-more"></Text>
886
+                 </View>
887
+               </View>
883
               <View
888
               <View
884
                 style={{ position: 'relative' }}>
889
                 style={{ position: 'relative' }}>
885
                 <HelpGroupBanner
890
                 <HelpGroupBanner
894
 
899
 
895
               </View>
900
               </View>
896
             </View>
901
             </View>
897
-            // <View className="house-type">
902
+            // <View classN                                                                                                                                                                                                                                                                                                                                                                                                                                                    ame="house-type">
898
             //   <View className="section-head">
903
             //   <View className="section-head">
899
             //     <Text className="section-head__title">热门活动</Text>
904
             //     <Text className="section-head__title">热门活动</Text>
900
             //     <View className="section-head__more" onClick={this.handleActivityMoreClick}>
905
             //     <View className="section-head__more" onClick={this.handleActivityMoreClick}>

+ 2
- 0
src/pages/project/index.js View File

256
           title: '当前城市暂无楼盘',
256
           title: '当前城市暂无楼盘',
257
           icon: 'none'
257
           icon: 'none'
258
         })
258
         })
259
+     
259
       }
260
       }
261
+    
260
       Taro.hideLoading()
262
       Taro.hideLoading()
261
       this.setState({
263
       this.setState({
262
         loaded: true
264
         loaded: true

+ 20
- 2
src/pages/shop/detail/index.js View File

17
   state = {
17
   state = {
18
     goodsId: null,
18
     goodsId: null,
19
     visibleExcBtn: true,
19
     visibleExcBtn: true,
20
+    datas: {},
21
+    inventory: null
20
   }
22
   }
21
 
23
 
22
   componentWillMount () {
24
   componentWillMount () {
49
 
51
 
50
     this.props.dispatchGoodsExchange(goodsId).then(res => {
52
     this.props.dispatchGoodsExchange(goodsId).then(res => {
51
       hasClick = true
53
       hasClick = true
52
-      Taro.showToast({ title: '兑换成功' })
54
+
55
+      Taro.showModal({
56
+        title: '兑换成功',
57
+        showCancel: false
58
+      })
59
+      this.setState({
60
+        inventory: res.inventory
61
+      })
62
+
63
+
64
+      // else{
65
+      //   Taro.showToast({ title: '积分不足,请先获取积分' })
66
+      // }
67
+      // Taro.showToast({ title: '兑换成功' })
53
       // App.zhuge.track('兑换商品', {
68
       // App.zhuge.track('兑换商品', {
54
       //   '商品id': goodsId,
69
       //   '商品id': goodsId,
55
       //   '商品名称': goodsName
70
       //   '商品名称': goodsName
56
       // })
71
       // })
72
+      // this.loadDetail()
57
     }).catch(err => {
73
     }).catch(err => {
74
+      console.log(err.message, 'err-----')
58
       hasClick = true
75
       hasClick = true
59
     })
76
     })
60
   }
77
   }
61
 
78
 
62
   render () {
79
   render () {
63
     const { goodsDetail } = this.props
80
     const { goodsDetail } = this.props
81
+    const { inventory } = this.state
64
     return (
82
     return (
65
       <View className="page">
83
       <View className="page">
66
         <ScrollView
84
         <ScrollView
87
               <Text className="num">{goodsDetail.pointPrice}积分</Text>
105
               <Text className="num">{goodsDetail.pointPrice}积分</Text>
88
               <Text className="detail__title-surplus">
106
               <Text className="detail__title-surplus">
89
                 <Text>剩余数量</Text>
107
                 <Text>剩余数量</Text>
90
-                <Text className="num">{goodsDetail.inventory}</Text>
108
+                <Text className="num">{inventory || goodsDetail.inventory}</Text>
91
               </Text>
109
               </Text>
92
             </View>
110
             </View>
93
           </View>
111
           </View>

+ 1
- 0
src/pages/shop/index.js View File

288
         {
288
         {
289
           goodsBuilding && goodsBuilding.length >= 2 &&
289
           goodsBuilding && goodsBuilding.length >= 2 &&
290
           <View className="list__wrap">
290
           <View className="list__wrap">
291
+            <View className="hot_title" style={{marginBottom:'0'}}>热门商品</View>
291
             <AtTabs scroll tabDirection='horizontal' current={current} tabList={goodsBuilding} onClick={this.handleClick.bind(this)}>
292
             <AtTabs scroll tabDirection='horizontal' current={current} tabList={goodsBuilding} onClick={this.handleClick.bind(this)}>
292
 
293
 
293
               {goodsBuilding.map((l_item, index) => (
294
               {goodsBuilding.map((l_item, index) => (

+ 8
- 4
src/utils/redux.js View File

7
 export function createAction(options) {
7
 export function createAction(options) {
8
   const { url, payload, method, fetchOptions, cb, type } = options
8
   const { url, payload, method, fetchOptions, cb, type } = options
9
   return (dispatch) => {
9
   return (dispatch) => {
10
-    return fetch({ url, payload, method, ...fetchOptions }).then((res) => {
11
-      dispatch({ type, payload: cb ? cb(res) : res })
12
-      return res
13
-    })
10
+    try {
11
+      return fetch({ url, payload, method, ...fetchOptions }).then((res) => {
12
+        dispatch({ type, payload: cb ? cb(res) : res })
13
+        return res
14
+      })
15
+    } catch (e) {
16
+      throw e
17
+    }
14
   }
18
   }
15
 }
19
 }
16
 
20
 

+ 9
- 4
src/utils/request.js View File

70
           })
70
           })
71
         }
71
         }
72
       }
72
       }
73
-      console.error(res.data)
73
+
74
       Taro.showToast({
74
       Taro.showToast({
75
         title: message,
75
         title: message,
76
         icon: 'none'
76
         icon: 'none'
77
       })
77
       })
78
+
79
+      throw res.data
78
     }
80
     }
79
   }).catch((err) => {
81
   }).catch((err) => {
80
-    console.error(err, "444")
81
-
82
+    
82
     let errMessage = `请求失败: ${err.errMsg}`
83
     let errMessage = `请求失败: ${err.errMsg}`
83
-    if (err.errMsg === 'request:fail timeout') {
84
+    if (err.errMsg) {
84
       errMessage = '请检查网络'
85
       errMessage = '请检查网络'
85
     }
86
     }
86
 
87
 
88
+    if (err.message) {
89
+      errMessage = err.message
90
+    }
91
+
87
     Taro.showToast({
92
     Taro.showToast({
88
       title: errMessage,
93
       title: errMessage,
89
       icon: 'none'
94
       icon: 'none'