周立森 преди 5 години
родител
ревизия
7fa87af318
променени са 4 файла, в които са добавени 3111 реда и са изтрити 3051 реда
  1. 3037
    3018
      package-lock.json
  2. 20
    1
      src/pages/checkin/checkinsuccess/index.js
  3. 42
    25
      src/pages/checkin/index.js
  4. 12
    7
      src/pages/checkin/index.scss

+ 3037
- 3018
package-lock.json
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 20
- 1
src/pages/checkin/checkinsuccess/index.js Целия файл

@@ -5,6 +5,25 @@ import './index.scss'
5 5
 
6 6
 
7 7
 export default class checkinsuccess extends Component {
8
+  state = {
9
+    
10
+    addPoints:'',
11
+  }
12
+    componentWillMount () {
13
+    console.log(this.$router.params, '22222')
14
+
15
+    const  addPoints  = this.$router.params.addPoints
16
+    this.setState({
17
+      addPoints:addPoints
18
+    })
19
+    // this.setState({
20
+    //   id: id
21
+    // })
22
+    // console.log(id, type)
23
+    // this.getcheckinDetails(id, type)
24
+    // // this.getcheckinDetails()
25
+// addPoints  = this.$router.params.addPoints
26
+  }
8 27
 
9 28
   toshop () {
10 29
     wx.switchTab({
@@ -20,7 +39,7 @@ export default class checkinsuccess extends Component {
20 39
           <Image className="img" src={require('@assets/checkin/checkinsuccessfully.png')}  ></Image>
21 40
         </View>
22 41
         <View>
23
-          <Text className="text1" style="">+20积分</Text>
42
+          <Text className="text1" style="">+{this.state.addPoints}积分</Text>
24 43
           <Text className="text2" style="">恭喜您签到成功!</Text>
25 44
         </View>
26 45
         <View >

+ 42
- 25
src/pages/checkin/index.js Целия файл

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

+ 12
- 7
src/pages/checkin/index.scss Целия файл

@@ -6,8 +6,8 @@
6 6
 
7 7
 .img {
8 8
   width: 750px;
9
-  height: 426px;
10
-  margin-bottom: 40px
9
+  height: 368px;
10
+  margin-bottom: 20px
11 11
 }
12 12
 
13 13
 .text1 {
@@ -19,13 +19,13 @@
19 19
   color: rgba(51, 51, 51, 1);
20 20
   line-height: 50px;
21 21
   font-weight: bold;
22
-  padding-left: 80px;
22
+  padding-left: 40px;
23 23
   // padding-top: 40px;
24 24
   margin-bottom: 40px;
25 25
 }
26 26
 
27 27
 .text2 {
28
-  width: 200px;
28
+  // width: 200px;
29 29
   height: 48px;
30 30
   font-size: 34px;
31 31
   font-family: PingFangSC-Medium, PingFang SC;
@@ -35,6 +35,7 @@
35 35
   letter-spacing: -0.82px;
36 36
   padding: 0 36px;
37 37
   margin-bottom: 20px;
38
+  white-space: nowrap;
38 39
 }
39 40
 
40 41
 .line {
@@ -42,12 +43,15 @@
42 43
   // text-align:center;
43 44
   // padding-top:30px;
44 45
   // border-bottom:2px dashed #000;
45
-
46
+  color:rgba(0, 0, 0, 0.12);
46 47
   // border-style:solid;
48
+  overflow: hidden;
47 49
   width: 200px;
48
-  height: 2px;
50
+  // height: 2px;
49 51
   border: 3px solid rgba(0, 0, 0, 0.12);
50 52
   border: none;
53
+  white-space: nowrap;
54
+  
51 55
 }
52 56
 
53 57
 .text3 {
@@ -116,7 +120,8 @@
116 120
   position: absolute;
117 121
   width: 220px;
118 122
   height: 220px;
119
-  bottom: 12vh;
123
+  bottom: 10vh;
120 124
   left: 265px
121 125
 }
122 126
 
127
+