ErnestoOrtiz2 3 年前
父节点
当前提交
a2b14efe32
共有 2 个文件被更改,包括 9 次插入3 次删除
  1. 1
    1
      screens/main/Calendar.js
  2. 8
    2
      screens/main/StateTime.js

+ 1
- 1
screens/main/Calendar.js 查看文件

27
     console.log(this.props.route.params.Flag)
27
     console.log(this.props.route.params.Flag)
28
     
28
     
29
     if(this.state.mapflag == false){
29
     if(this.state.mapflag == false){
30
-      this.props.navigation.navigate('StateTime', {Appointment_Date: date._d, int_id : this.state.interpreter_id, 
30
+      this.props.navigation.navigate('StateTime', {Appointment: date._d, int_id : this.state.interpreter_id, 
31
         Flag: this.state.mapflag, I_Token: this.state.i_token, U_Token: this.state.u_token
31
         Flag: this.state.mapflag, I_Token: this.state.i_token, U_Token: this.state.u_token
32
         ,Username: this.state.username, I_Username: this.state.I_username});
32
         ,Username: this.state.username, I_Username: this.state.I_username});
33
     }
33
     }

+ 8
- 2
screens/main/StateTime.js 查看文件

165
   else{
165
   else{
166
     const user = firebase.auth().currentUser
166
     const user = firebase.auth().currentUser
167
     const uid = user.uid
167
     const uid = user.uid
168
+    const username = this.state.username;
169
+    const I_username = this.state.I_username;
168
     const u_token = this.state.u_token;
170
     const u_token = this.state.u_token;
169
     const i_token = this.state.i_token;
171
     const i_token = this.state.i_token;
170
     const date = this.state.Appointment
172
     const date = this.state.Appointment
171
-    const month = date.getMonth();
173
+    const month = date.getMonth() + 1;
174
+    console.log("Month: ", month)
172
     const day = date.getDate();
175
     const day = date.getDate();
173
-    console.log("Date: ", day)
174
     const _time_ = selectedTime;
176
     const _time_ = selectedTime;
175
     const i_id = this.state.int2_id;
177
     const i_id = this.state.int2_id;
176
     console.log('Params: ')
178
     console.log('Params: ')
178
     firebase.firestore()
180
     firebase.firestore()
179
     .collection('APPOINTMENTS')
181
     .collection('APPOINTMENTS')
180
     .add({ 
182
     .add({ 
183
+      User: username,
184
+      Interpreter: I_username,
181
       participantes: [
185
       participantes: [
182
       i_id,
186
       i_id,
183
       uid, 
187
       uid, 
214
     );
218
     );
215
   }
219
   }
216
 }
220
 }
221
+
222
+