周立森 пре 5 година
родитељ
комит
8d5965b33c

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

+ 5
- 0
src/app.js Прегледај датотеку

@@ -95,6 +95,11 @@ class App extends Component {
95 95
       'pages/signin/index',
96 96
       'pages/card/fans/index',
97 97
       'pages/person/feedback/index',
98
+
99
+      'pages/checkin/index',
100
+      'pages/checkin/checkinsuccess/index',
101
+      // 'pages/checkin/unregistered/index',
102
+  
98 103
     ],
99 104
     window: {
100 105
       backgroundTextStyle: 'light',

BIN
src/assets/checkin/checkin.png Прегледај датотеку


BIN
src/assets/checkin/checkined.png Прегледај датотеку


BIN
src/assets/checkin/checkinsuccessfully.png Прегледај датотеку


BIN
src/assets/checkin/noentry.png Прегледај датотеку


+ 4
- 1
src/constants/api.js Прегледај датотеку

@@ -147,4 +147,7 @@ export const API_HELP_DETAIL = resolvePath('helpActivity')
147 147
 export const API_HELP_CREATE = resolvePath('helpInitiateRecord')
148 148
 export const API_HELP_FRIEND = resolvePath('helpRecord')
149 149
 
150
-//
150
+//签到
151
+export const API_CHECKIN_DETAILS = resolvePath('buildingDynamiceEnlistInfo')
152
+export const API_CHECKIN_ACTIVE = resolvePath('buildingDynamicCheckin')
153
+

+ 2
- 0
src/constants/checkin.js Прегледај датотеку

@@ -0,0 +1,2 @@
1
+export const CHECKIN_DETAILS = 'CHECKIN_DETAILS'
2
+export const CHECKIN_ACTIVE = 'CHECKIN_ACTIVE'

+ 38
- 0
src/pages/checkin/checkinsuccess/index.js Прегледај датотеку

@@ -0,0 +1,38 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import './index.scss'
3
+
4
+
5
+
6
+
7
+export default class checkinsuccess extends Component {
8
+
9
+  toshop () {
10
+    wx.switchTab({
11
+      url: '/pages/shop/index'
12
+    });
13
+  }
14
+
15
+  render () {
16
+
17
+    return (
18
+      <View className="checkin" style="width:100vw;height:100vh;background:rgba(245,245,245,1);" >
19
+        <View style="text-align: center;">
20
+          <Image className="img" src={require('@assets/checkin/checkinsuccessfully.png')}  ></Image>
21
+        </View>
22
+        <View>
23
+          <Text className="text1" style="">+20积分</Text>
24
+          <Text className="text2" style="">恭喜您签到成功!</Text>
25
+        </View>
26
+        <View >
27
+          
28
+          <Text  className="text3" onClick={this.toshop} style="">您已签到成功,快去参加活动吧更多好礼在积分商城等着你> </Text>
29
+        </View>
30
+        {/* </Text>
31
+
32
+        <Text style="position: absolute; font-size:16px;font-weight:400;color:rgba(153,153,153,1);line-height:22px;top:327px;left:81px"> */}
33
+
34
+      </View>
35
+
36
+    );
37
+  }
38
+}

+ 46
- 0
src/pages/checkin/checkinsuccess/index.scss Прегледај датотеку

@@ -0,0 +1,46 @@
1
+.checkin {
2
+  width: 100vw;
3
+  height: 100vh;
4
+  background: rgba(245, 245, 245, 1);
5
+
6
+  View {
7
+    .img {
8
+      width: 750px;
9
+      height: 898px
10
+    }
11
+  }
12
+
13
+  .text1 {
14
+    position: absolute;
15
+    font-size: 36px;
16
+    font-weight: 400;
17
+    color: rgba(255, 39, 68, 1);
18
+    line-height: 50px;
19
+    top: 380px;
20
+    left: 308px
21
+  }
22
+
23
+  .text2 {
24
+    position: absolute;
25
+    font-size: 36px;
26
+    font-weight: 400;
27
+    color: rgba(187, 156, 121, 1);
28
+    line-height: 50px;
29
+    top: 438px;
30
+
31
+
32
+    left: 246px
33
+  }
34
+
35
+  .text3 {
36
+    position: absolute;
37
+    font-size: 32px;
38
+    font-weight: 400;
39
+    color: rgba(153, 153, 153, 1);
40
+    line-height: 44px;
41
+    top: 600px;
42
+    left: 162px;
43
+    width: 426px
44
+  }
45
+
46
+}

+ 133
- 0
src/pages/checkin/index.js Прегледај датотеку

@@ -0,0 +1,133 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import './index.scss'
3
+import { AtDivider, AtList, AtListItem, AtGrid, AtButton } from 'taro-ui'
4
+
5
+import achievePhone from '@components/achievePhone'
6
+import { checkinDetails, checkinActive } from '@services/checkin'
7
+
8
+// import { checkinActive } from '@services/checkin'
9
+
10
+export default class checkin extends Component {
11
+
12
+  state = {
13
+    id:'',
14
+    // ischeck:''
15
+    // isLogin: false,
16
+    // user: {},
17
+    // isAgent: false,//经纪人
18
+    // consultant: false,//置业顾问
19
+    // tourist: false,//普通用户
20
+    data: {},
21
+  }
22
+
23
+  componentWillMount () {
24
+    console.log(this.$router.params,'22222')
25
+
26
+    const { id, type } = this.$router.params
27
+
28
+    console.log(id, type)
29
+    this.getcheckinDetails(id, type)
30
+    // this.getcheckinDetails()
31
+
32
+  }
33
+  // dynamicId
34
+  getcheckinDetails (id, type) {
35
+    console.log('1111')
36
+    // const id = '39a0e51e6fea9cb758abed08dd7fb16b'
37
+    Taro.showLoading()
38
+    checkinDetails(id, type).then(res => {
39
+      Taro.hideLoading()
40
+      this.setState({
41
+        data: res
42
+      })
43
+      console.log('1111', res)
44
+    })
45
+  }
46
+
47
+  checkinActive () {
48
+
49
+    //  alert('签到成功')
50
+    const enlistId = this.state.data.enlist.enlistId
51
+    Taro.showLoading()
52
+    checkinActive(enlistId).then(res => {
53
+      Taro.hideLoading()
54
+      Taro.navigateTo({
55
+        url: '/pages/checkin/checkinsuccess/index'
56
+      })
57
+    }).catch((err) => {
58
+      console.log('签到失败')
59
+      // Taro.navigateTo({
60
+      //   url: '/pages/checkin/checkinsuccess/index'
61
+      // })
62
+    })
63
+
64
+
65
+  }
66
+
67
+  toactivity () {
68
+    Taro.navigateTo({
69
+      // url: '/pages/checkin/checkinsuccess/index'
70
+    })
71
+  }
72
+
73
+  render () {
74
+    const { data, style } = this.props
75
+
76
+
77
+
78
+    return (
79
+      <View className="checkin" style="width:100vw;height:100vh;" >
80
+
81
+        {/* <checkinsuccess></checkinsuccess> */}
82
+        {/* <achievePhone></achievePhone> */}
83
+        <View>
84
+          <Image className="img" src={this.state.data.dynamic.imgUrl}  ></Image>
85
+        </View>
86
+        <View style="margin-bottom:20px"  >
87
+          <View className="text1"> <Text>{this.state.data.dynamic.title}</Text></View>
88
+        </View >
89
+
90
+        {this.state.data.enlist != null && <View>
91
+          <View style="text-align: center;">
92
+            <Text className="line">- - - - - - - - - </Text>
93
+            <Text className="text2">活动报名信息</Text>
94
+            <Text className="line">- - - - - - - - - </Text>
95
+          </View>
96
+
97
+          <View className="text3">
98
+            <View className='at-row'>
99
+              <View className='at-col at-col-3'>用户名:</View>
100
+              <View className='at-col at-col-9'>{this.state.data.person.name || this.state.data.person.nickname}</View>
101
+            </View>
102
+            <View className='at-row'>
103
+              <View className='at-col at-col-3'>手机号:</View>
104
+              <View className='at-col at-col-9'>{this.state.data.person.tel || this.state.data.person.phone}</View>
105
+            </View>
106
+            <View className='at-row'>
107
+              <View className='at-col at-col-3'>参与人数:</View>
108
+              <View className='at-col at-col-9'>{this.state.data.enlist.attendNum}</View>
109
+            </View>
110
+          </View>
111
+
112
+
113
+
114
+          {!this.state.data.person.status && <Image className="checkinImg" src={require('@assets/checkin/checkin.png')} onClick={this.checkinActive}   ></Image>}
115
+          {this.state.data.person.status && <Image className="checkinImg" src={require('@assets/checkin/checkined.png')}></Image>}
116
+        </View>}
117
+        {this.state.data.enlist == null && <View className="unregistered">
118
+          <View>
119
+            <Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>
120
+          </View>
121
+          <View className="message">
122
+            <Text className="messageText" >您还未报名当前活动,请先前往活动报名页报名成功后再进行扫码签到~ </Text>
123
+
124
+          </View>
125
+
126
+          <AtButton type='primary' className="toactivebutton">立即前往</AtButton>
127
+          {/* <Image src={require('@assets/checkin/checkin.png')}  style="position: absolute; width:110px;height:110px ;bottom:12vh;left:132.5px"  ></Image> */}
128
+        </View>}
129
+      </View>
130
+
131
+    );
132
+  }
133
+}

+ 122
- 0
src/pages/checkin/index.scss Прегледај датотеку

@@ -0,0 +1,122 @@
1
+@import "@styles/theme.scss";
2
+@import "~taro-ui/dist/style/components/flex.scss";
3
+@import "~taro-ui/dist/style/components/list.scss";
4
+@import "~taro-ui/dist/style/components/icon.scss";
5
+// @import "~taro-ui/dist/style/components/grid.scss";
6
+
7
+.img {
8
+  width: 750px;
9
+  height: 426px;
10
+  margin-bottom: 40px
11
+}
12
+
13
+.text1 {
14
+  // float: left;
15
+
16
+  font-size: 36px;
17
+  font-family: PingFangSC-Medium, PingFang SC;
18
+  font-weight: 500;
19
+  color: rgba(51, 51, 51, 1);
20
+  line-height: 50px;
21
+  font-weight: bold;
22
+  padding-left: 80px;
23
+  // padding-top: 40px;
24
+  margin-bottom: 40px;
25
+}
26
+
27
+.text2 {
28
+  width: 200px;
29
+  height: 48px;
30
+  font-size: 34px;
31
+  font-family: PingFangSC-Medium, PingFang SC;
32
+  font-weight: 500;
33
+  color: rgba(187, 156, 121, 1);
34
+  line-height: 48px;
35
+  letter-spacing: -0.82px;
36
+  padding: 0 36px;
37
+  margin-bottom: 20px;
38
+}
39
+
40
+.line {
41
+  // width:300px;height:50px;
42
+  // text-align:center;
43
+  // padding-top:30px;
44
+  // border-bottom:2px dashed #000;
45
+
46
+  // border-style:solid;
47
+  width: 200px;
48
+  height: 2px;
49
+  border: 3px solid rgba(0, 0, 0, 0.12);
50
+  border: none;
51
+}
52
+
53
+.text3 {
54
+
55
+  margin-left: 40px;
56
+}
57
+
58
+.at-row {
59
+  margin-top: 20px;
60
+  font-size: 32px;
61
+  font-family: PingFangSC-Regular, PingFang SC;
62
+  font-weight: 400;
63
+  color: rgba(102, 102, 102, 1);
64
+  line-height: 44px;
65
+}
66
+
67
+.unregistered {
68
+  .img1 {
69
+    width: 220px;
70
+    height: 220px;
71
+    margin-left: 264px;
72
+    margin-top: 40px
73
+  }
74
+
75
+  .message {
76
+    width: 660px;
77
+    text-align: center;
78
+    margin-top: 40px;
79
+
80
+    .messageText {
81
+
82
+      position: absolute;
83
+      font-size: 36px;
84
+      font-weight: 400;
85
+      color: rgba(187, 156, 121, 1);
86
+      line-height: 56px;
87
+      width: 660px;
88
+      text-align: center;
89
+      top: 860px;
90
+      left: 46px
91
+    }
92
+  }
93
+
94
+
95
+
96
+}
97
+
98
+.toactivebutton {
99
+  width: 360px;
100
+  height: 100px;
101
+  background: rgba(187, 156, 121, 1);
102
+  border-radius: 12px;
103
+  position: absolute;
104
+  left: 196px;
105
+  top: 1000px;
106
+  font-size: 36px;
107
+  font-family: PingFangSC-Regular, PingFang SC;
108
+  font-weight: 400;
109
+  color: rgba(255, 255, 255, 1);
110
+  line-height: 100px;
111
+  text-align: center;
112
+
113
+}
114
+
115
+.checkinImg {
116
+  position: absolute;
117
+  width: 220px;
118
+  height: 220px;
119
+  bottom: 12vh;
120
+  left: 265px
121
+}
122
+

+ 11
- 0
src/pages/person/index.js Прегледај датотеку

@@ -103,6 +103,17 @@ export default class Person extends Component {
103 103
       url: '/pages/activity/assistancePage'
104 104
     })
105 105
   }
106
+  // Scan code check in
107
+  toScanCode() {
108
+   Taro.navigateTo({
109
+    url: `/pages/checkin/index`
110
+  })
111
+  }
112
+  
113
+
114
+  // Taro.navigateTo({
115
+  //   url: `/pages/city/index`
116
+  // })pages/checkin/index
106 117
 
107 118
   getRoleName(type) {
108 119
     switch (type) {

+ 22
- 0
src/services/checkin.js Прегледај датотеку

@@ -0,0 +1,22 @@
1
+import { fetch } from '@utils/request'
2
+import {
3
+  API_CHECKIN_DETAILS,
4
+  API_CHECKIN_ACTIVE
5
+} from '@constants/api'
6
+
7
+
8
+
9
+/**
10
+ * 获取签到详情
11
+ */
12
+export const checkinDetails = (id, type) => fetch({ url: `${API_CHECKIN_DETAILS}/${id}?type=${type}`, method: 'GET' })
13
+
14
+
15
+
16
+/**
17
+ * 签到
18
+ * @param {*} enlistId 
19
+ */
20
+export const checkinActive = enlistId => fetch({ url: `${API_CHECKIN_ACTIVE}/${enlistId}`, method: 'PUT' })
21
+
22
+// /wx/buildingDynamicCheckin/{enlistId} 扫码活动签到 PUT