Browse Source

picker webview

xujing 5 years ago
parent
commit
57c7dc1e10

+ 4
- 4
config/dev.js View File

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

+ 1
- 1
src/pages/activity/detail/index.js View File

413
                   <Text className="page-section__title">报名信息</Text>
413
                   <Text className="page-section__title">报名信息</Text>
414
                   <View className='page-content'>
414
                   <View className='page-content'>
415
                     <Input className='inputName' onInput={this.onInputText.bind(this)} type='text' placeholder='请输入姓名' />
415
                     <Input className='inputName' onInput={this.onInputText.bind(this)} type='text' placeholder='请输入姓名' />
416
-                    <Picker mode='aspectFill' range={this.state.selector} onChange={this.onChange}>
416
+                    <Picker mode='selector' range={this.state.selector} onChange={this.onChange}>
417
                       <View className='picker'>
417
                       <View className='picker'>
418
                         <Text>参加人数</Text>
418
                         <Text>参加人数</Text>
419
                         <Text className='content'>{this.state.selectorChecked}</Text>
419
                         <Text className='content'>{this.state.selectorChecked}</Text>

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

427
 .houses {
427
 .houses {
428
   box-shadow:0px 2px 12px 2px rgba(29,29,29,0.09);
428
   box-shadow:0px 2px 12px 2px rgba(29,29,29,0.09);
429
   background: white;
429
   background: white;
430
-  padding: 30px 30px 20px 30px;
430
+  padding: 30px 30px 0 30px;
431
   // .section-content{
431
   // .section-content{
432
   //   .item:last-of-type{
432
   //   .item:last-of-type{
433
   //     border:none;
433
   //     border:none;

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

3
 
3
 
4
 .item {
4
 .item {
5
   position: relative;
5
   position: relative;
6
-  padding: 30px 0;
6
+  padding: 40px 0;
7
   border-bottom: 1px solid $border-color-light;
7
   border-bottom: 1px solid $border-color-light;
8
 
8
 
9
 //&:last-child {
9
 //&:last-child {

+ 24
- 20
src/pages/project/middlePage.js View File

14
   state = {
14
   state = {
15
     avatarVisible: true,
15
     avatarVisible: true,
16
     phoneVisible: false,
16
     phoneVisible: false,
17
-    pageInfo:{}
17
+    webViewVisible: false,
18
+    pageInfo: {}
18
   }
19
   }
19
   componentWillMount() {
20
   componentWillMount() {
20
- 
21
+
21
 
22
 
22
     ready.queue(() => {
23
     ready.queue(() => {
23
-      getHFiveDetail(this.$router.params.id).then(res=>{
24
+      getHFiveDetail(this.$router.params.id).then(res => {
24
         this.setState({
25
         this.setState({
25
-          pageInfo:res
26
+          pageInfo: res
26
         })
27
         })
27
       })
28
       })
28
-      const { userInfo:{person} } = this.props
29
-      if (person.avatarurl ) {
29
+      const { userInfo: { person } } = this.props
30
+      if (person.avatarurl) {
30
         // 头像手机号都有
31
         // 头像手机号都有
31
-        if(person.phone){
32
+        if (person.phone) {
32
           this.setState({
33
           this.setState({
33
-            avatarVisible:false,
34
+            avatarVisible: false,
34
             phoneVisible: false,
35
             phoneVisible: false,
36
+            webViewVisible:true,
35
           })
37
           })
36
-        }else{
38
+        } else {
37
           this.onAvatarSuccess();
39
           this.onAvatarSuccess();
38
         }
40
         }
39
-      }else{
40
-        if(person.phone){
41
+      } else {
42
+        if (person.phone) {
41
           this.setState({
43
           this.setState({
42
             phoneVisible: false,
44
             phoneVisible: false,
43
           })
45
           })
49
   // 授权头像成功
51
   // 授权头像成功
50
   onAvatarSuccess() {
52
   onAvatarSuccess() {
51
     this.setState({
53
     this.setState({
52
-      avatarVisible:false,
54
+      avatarVisible: false,
53
       phoneVisible: true,
55
       phoneVisible: true,
54
     })
56
     })
55
     console.log("授权头像成功!")
57
     console.log("授权头像成功!")
79
           icon: 'none'
81
           icon: 'none'
80
         })
82
         })
81
         return
83
         return
82
-        // this.toPage(false)
83
       }
84
       }
84
     })
85
     })
85
   }
86
   }
91
           icon: 'none'
92
           icon: 'none'
92
         })
93
         })
93
       } else {
94
       } else {
94
-      console.log('授权手机成功')
95
-      this.setState({
96
-        phoneVisible: false,
97
-      })
95
+        console.log('授权手机成功')
96
+        this.setState({
97
+          phoneVisible: false,
98
+          webViewVisible:true,
99
+        })
98
       }
100
       }
99
     })
101
     })
100
   }
102
   }
101
 
103
 
102
   renderMaskBanner() {
104
   renderMaskBanner() {
103
-    const { avatarVisible, phoneVisible,pageInfo } = this.state
105
+    const { avatarVisible, phoneVisible, pageInfo } = this.state
104
     return (
106
     return (
105
       <View>
107
       <View>
106
-        <Image src={pageInfo.middleImg||bgImg} mode='widthFix' className='bg_img'></Image>
108
+        <Image src={pageInfo.middleImg || bgImg} mode='widthFix' className='bg_img'></Image>
107
         <View className="middle-page">
109
         <View className="middle-page">
108
           {avatarVisible &&
110
           {avatarVisible &&
109
             <View className="content">
111
             <View className="content">
114
             </View>
116
             </View>
115
           }
117
           }
116
           {phoneVisible &&
118
           {phoneVisible &&
117
-          <Button className="phone-btn" open-type="getPhoneNumber" lang="zh_CN" onGetphonenumber={this.getPhoneNumber}>点击授权查看详情</Button>
119
+            <Button className="phone-btn" open-type="getPhoneNumber" lang="zh_CN" onGetphonenumber={this.getPhoneNumber}>点击授权查看详情</Button>
118
           }
120
           }
119
 
121
 
120
         </View>
122
         </View>
122
     )
124
     )
123
   }
125
   }
124
   render() {
126
   render() {
127
+    const { pageInfo,webViewVisible } = this.state
125
     return (
128
     return (
126
       <Block>
129
       <Block>
127
         {this.renderMaskBanner()}
130
         {this.renderMaskBanner()}
131
+        {webViewVisible&&<WebView src={pageInfo.h5Address} />}
128
       </Block>
132
       </Block>
129
     )
133
     )
130
   }
134
   }