周立森 5 лет назад
Родитель
Сommit
d8f3976469
9 измененных файлов: 75 добавлений и 30 удалений
  1. Двоичные данные
      chengjiaojinfang.zip
  2. 2
    2
      config/dev.js
  3. 16
    14
      src/pages/person/index.js
  4. 15
    5
      src/pages/project/detail/index.js
  5. 2
    0
      src/pages/project/index.js
  6. 20
    2
      src/pages/shop/detail/index.js
  7. 4
    0
      src/pages/shop/index.scss
  8. 8
    4
      src/utils/redux.js
  9. 8
    3
      src/utils/request.js

Двоичные данные
chengjiaojinfang.zip Просмотреть файл


+ 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.72:8080"',
13
-    // WSS_HOST: '"ws://192.168.0.72:8080"',
12
+    // HOST: '"http://192.168.0.172:8080"',
13
+    // WSS_HOST: '"ws://192.168.0.172:8080"',
14 14
   },
15 15
   weapp: {},
16 16
   h5: {}

+ 16
- 14
src/pages/person/index.js Просмотреть файл

@@ -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>

+ 15
- 5
src/pages/project/detail/index.js Просмотреть файл

@@ -151,8 +151,9 @@ export default class Index extends Component {
151 151
     const { buildingId } = this.state
152 152
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
153 153
     queryActivityList(payload).then(res => {
154
+      console.log(res,'Activity')
154 155
       this.setState({
155
-        activityList: res.list || []
156
+        activityList: res || []
156 157
       })
157 158
     })
158 159
   }
@@ -861,9 +862,14 @@ export default class Index extends Component {
861 862
       <Block>
862 863
         {
863 864
           activityList.length > 0 && (
864
-            <View className="activity" onClick={this.handleActivityMoreClick}>
865
+            <View className="activity" >
865 866
               {console.log(activityList, '----activityList-----')}
866
-              <View className="title">热门活动</View>
867
+              <View className="section-head">
868
+                 <Text className="section-head__title">热门活动</Text>
869
+                 <View className="section-head__more" onClick={this.handleActivityMoreClick}>
870
+                   更多活动<Text className="iconfont icon-more"></Text>
871
+                 </View>
872
+               </View>
867 873
               <View
868 874
                 style={{ position: 'relative' }}>
869 875
                 <HelpGroupBanner
@@ -878,7 +884,7 @@ export default class Index extends Component {
878 884
 
879 885
               </View>
880 886
             </View>
881
-            // <View className="house-type">
887
+            // <View classN                                                                                                                                                                                                                                                                                                                                                                                                                                                    ame="house-type">
882 888
             //   <View className="section-head">
883 889
             //     <Text className="section-head__title">热门活动</Text>
884 890
             //     <View className="section-head__more" onClick={this.handleActivityMoreClick}>
@@ -980,12 +986,16 @@ export default class Index extends Component {
980 986
           }}
981 987
           id='myVideo'
982 988
           controls={true}
989
+          initialTime='0'
990
+  
991
+          loop={false}
992
+          muted={false}
983 993
         // autoplay={false}
984 994
         // initialTime='0'
985 995
         // loop={true}
986 996
         // muted={false}
987 997
 
988
-        show-mute-btn='true'
998
+        show-mute-btn={true}
989 999
         // onPlay={this.onPlay}
990 1000
         // show-center-play-btn='false'
991 1001
         // onPause= {this.onPause}

+ 2
- 0
src/pages/project/index.js Просмотреть файл

@@ -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 Просмотреть файл

@@ -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>

+ 4
- 0
src/pages/shop/index.scss Просмотреть файл

@@ -199,6 +199,10 @@
199 199
       line-height: 60px;
200 200
       font-weight: bold;
201 201
       padding: 0 20px;
202
+      width:334px;
203
+      overflow:hidden; 
204
+      text-overflow:ellipsis; 
205
+      white-space: nowrap
202 206
     }
203 207
 
204 208
     &__des {

+ 8
- 4
src/utils/redux.js Просмотреть файл

@@ -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
 

+ 8
- 3
src/utils/request.js Просмотреть файл

@@ -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 84
     if (err.errMsg === 'request:fail timeout') {
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'