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,4 +3,5 @@ dist/
3 3
 .rn_temp/
4 4
 node_modules/
5 5
 .DS_Store
6
-*.rar
6
+*.rar
7
+*.zip

BIN
chengjiaojinfang.zip View File


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

@@ -25,6 +25,7 @@ export default class Person extends Component {
25 25
     tourist: false,//普通用户,
26 26
     menus: [],
27 27
     roleName: '普通用户',
28
+
28 29
   }
29 30
 
30 31
   componentDidShow () {
@@ -34,9 +35,10 @@ export default class Person extends Component {
34 35
   }
35 36
 
36 37
   loadUserInfo () {
38
+  
37 39
     queryUserInfo().then(user => {
38 40
       const [roleSetting, roleName] = this.getRoleName(user.personType)
39
-
41
+     
40 42
       this.setState({
41 43
         user,
42 44
         phone: user.phone,
@@ -54,7 +56,7 @@ export default class Person extends Component {
54 56
     }
55 57
 
56 58
     doUserSignin({ id }).then(res => {
57
-      Taro.Toast({
59
+      Taro.showToast({
58 60
         title: '签到成功'
59 61
       })
60 62
       // this.setState({
@@ -93,21 +95,21 @@ export default class Person extends Component {
93 95
 
94 96
 
95 97
       putRegisterConsultant().then(res => {
96
-        console.log("res", res)
98
+    
97 99
 
98
-        if (res) {
100
+        // if (res) {
99 101
           Taro.showToast({
100 102
             title: "匹配成功,请退出小程序重新登录即可",
101 103
             icon: "none",
102 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 113
       }).catch(err => {
112 114
         console.error(err)
113 115
         Taro.showToast({
@@ -200,12 +202,12 @@ export default class Person extends Component {
200 202
           </View>
201 203
           <View className='qiandao-con'>
202 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 207
               user.havaSigned ?
206 208
                 (<View className='reday-qiandao-btn' onClick={this.doSign}> 已签到</View>) :
207 209
                 (<View className='qiandao-btn' onClick={this.doSign}>签到</View>)
208
-            }
210
+            } */}
209 211
             {/* <Text className='integral-cont_btn' onClick={this.goShop}>去兑换</Text> */}
210 212
 
211 213
           </View>

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

@@ -24,7 +24,7 @@ export default class Profile extends Component {
24 24
 
25 25
   }
26 26
 
27
-  componentDidShow() {
27
+  componentWillMount() {
28 28
     this.getProfile()
29 29
   }
30 30
 

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

@@ -49,7 +49,7 @@
49 49
     font-size: 32px;
50 50
     color: #666;
51 51
     line-height: 44px;
52
-    
52
+    text-align: center;
53 53
 
54 54
     &.active {
55 55
       color: #BB9C79;
@@ -57,6 +57,8 @@
57 57
     }
58 58
 &-text {
59 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,6 +57,8 @@ export default class Pannel extends Component {
57 57
       currentMarkerPos = 0
58 58
     }
59 59
 
60
+    // console.log('-------markerList---------', markerList)
61
+
60 62
     this.setState({ currentMarkerPos, markerList })
61 63
   }
62 64
 

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

@@ -167,8 +167,9 @@ export default class Index extends Component {
167 167
     const { buildingId } = this.state
168 168
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
169 169
     queryActivityList(payload).then(res => {
170
+      console.log(res,'Activity')
170 171
       this.setState({
171
-        activityList: res.list || []
172
+        activityList: res || []
172 173
       })
173 174
     })
174 175
   }
@@ -824,7 +825,6 @@ export default class Index extends Component {
824 825
                       {
825 826
                         item && (
826 827
                           <View className='house__img-info'>
827
-                            {console.log(list, '-------')}
828 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 829
                             <View className='house-type__state' style={`background-color: ${statusBgColors[item.marketStatus - 1]}`}>{statusOpts[item.marketStatus - 1]}</View>
830 830
                           </View>
@@ -877,9 +877,14 @@ export default class Index extends Component {
877 877
       <Block>
878 878
         {
879 879
           activityList.length > 0 && (
880
-            <View className="activity" onClick={this.handleActivityMoreClick}>
880
+            <View className="activity" >
881 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 888
               <View
884 889
                 style={{ position: 'relative' }}>
885 890
                 <HelpGroupBanner
@@ -894,7 +899,7 @@ export default class Index extends Component {
894 899
 
895 900
               </View>
896 901
             </View>
897
-            // <View className="house-type">
902
+            // <View classN                                                                                                                                                                                                                                                                                                                                                                                                                                                    ame="house-type">
898 903
             //   <View className="section-head">
899 904
             //     <Text className="section-head__title">热门活动</Text>
900 905
             //     <View className="section-head__more" onClick={this.handleActivityMoreClick}>

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

@@ -256,7 +256,9 @@ export default class Index extends Component {
256 256
           title: '当前城市暂无楼盘',
257 257
           icon: 'none'
258 258
         })
259
+     
259 260
       }
261
+    
260 262
       Taro.hideLoading()
261 263
       this.setState({
262 264
         loaded: true

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

@@ -17,6 +17,8 @@ export default class Index extends Component {
17 17
   state = {
18 18
     goodsId: null,
19 19
     visibleExcBtn: true,
20
+    datas: {},
21
+    inventory: null
20 22
   }
21 23
 
22 24
   componentWillMount () {
@@ -49,18 +51,34 @@ export default class Index extends Component {
49 51
 
50 52
     this.props.dispatchGoodsExchange(goodsId).then(res => {
51 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 68
       // App.zhuge.track('兑换商品', {
54 69
       //   '商品id': goodsId,
55 70
       //   '商品名称': goodsName
56 71
       // })
72
+      // this.loadDetail()
57 73
     }).catch(err => {
74
+      console.log(err.message, 'err-----')
58 75
       hasClick = true
59 76
     })
60 77
   }
61 78
 
62 79
   render () {
63 80
     const { goodsDetail } = this.props
81
+    const { inventory } = this.state
64 82
     return (
65 83
       <View className="page">
66 84
         <ScrollView
@@ -87,7 +105,7 @@ export default class Index extends Component {
87 105
               <Text className="num">{goodsDetail.pointPrice}积分</Text>
88 106
               <Text className="detail__title-surplus">
89 107
                 <Text>剩余数量</Text>
90
-                <Text className="num">{goodsDetail.inventory}</Text>
108
+                <Text className="num">{inventory || goodsDetail.inventory}</Text>
91 109
               </Text>
92 110
             </View>
93 111
           </View>

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

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

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

@@ -7,10 +7,14 @@ import { fetch } from './request'
7 7
 export function createAction(options) {
8 8
   const { url, payload, method, fetchOptions, cb, type } = options
9 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,20 +70,25 @@ export const fetch = async (options) => {
70 70
           })
71 71
         }
72 72
       }
73
-      console.error(res.data)
73
+
74 74
       Taro.showToast({
75 75
         title: message,
76 76
         icon: 'none'
77 77
       })
78
+
79
+      throw res.data
78 80
     }
79 81
   }).catch((err) => {
80
-    console.error(err, "444")
81
-
82
+    
82 83
     let errMessage = `请求失败: ${err.errMsg}`
83
-    if (err.errMsg === 'request:fail timeout') {
84
+    if (err.errMsg) {
84 85
       errMessage = '请检查网络'
85 86
     }
86 87
 
88
+    if (err.message) {
89
+      errMessage = err.message
90
+    }
91
+
87 92
     Taro.showToast({
88 93
       title: errMessage,
89 94
       icon: 'none'