geer-builder 1.2.878 → 1.2.880

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/GCashOut.vue CHANGED
@@ -84,11 +84,6 @@
84
84
  <div class="summary__content-label" v-else>Payment Method Fee</div>
85
85
  <div class="summary__content-info">{{ main_currency }} {{ $_formatNumber(xfield.payment_method_fee, { decimal: 2}) }}</div>
86
86
  </div>
87
- <div class="summary__content" v-if="xfield.service_charge > 0">
88
- <div class="summary__content-label" v-if="merchant_cashout">Transaction Fee</div>
89
- <div class="summary__content-label" v-else>Service Charge</div>
90
- <div class="summary__content-info">{{ main_currency }} {{ $_formatNumber(xfield.service_charge, { decimal: 2}) }}</div>
91
- </div>
92
87
  <div v-if="settings.cashout_vortex_settings && settings.cashout_vortex_settings.cashout_vortex_reactivate_percentage > 0" class="summary__content">
93
88
  <div class="summary__content-label">Reactivation</div>
94
89
  <div class="summary__content-info">{{ main_currency }} {{ $_formatNumber(xfield.cashout_vortex_reactivate_fee, { decimal: 2}) }}</div>
@@ -97,6 +92,11 @@
97
92
  <div class="summary__content-label">Company Slot Fee</div>
98
93
  <div class="summary__content-info">{{ main_currency }} {{ $_formatNumber(xfield.cashout_vortex_receiver_fee, { decimal: 2}) }}</div>
99
94
  </div>
95
+ <div class="summary__content" v-if="xfield.service_charge > 0">
96
+ <div class="summary__content-label" v-if="merchant_cashout">Transaction Fee</div>
97
+ <div class="summary__content-label" v-else>Service Charge</div>
98
+ <div class="summary__content-info">{{ main_currency }} {{ $_formatNumber(xfield.service_charge, { decimal: 2}) }}</div>
99
+ </div>
100
100
  <div class="summary__content" v-if="xfield.witholding_tax > 0">
101
101
  <div class="summary__content-label" v-if="merchant_cashout">VAT</div>
102
102
  <div class="summary__content-label" v-else>Withholding Tax</div>
@@ -23,6 +23,15 @@
23
23
  <div class="time">{{ $_formatDate(notification.created_date, 'MM/DD/YY (hh:mm A)') }}</div>
24
24
  </div>
25
25
  </div>
26
+ <div style="text-align: right; padding-bottom:20px; padding-right:20px;" v-if="!noMoreData">
27
+ <q-btn
28
+ label="Load More"
29
+ @click="loadNotificationList(false)"
30
+ :loading="loadingMore"
31
+ v-if="lastVisible"
32
+ class="q-mt-md"
33
+ />
34
+ </div>
26
35
  </template>
27
36
  <div v-else class="earnings-log__no-notification">
28
37
  No {{complan_details.label}} earnings yet
@@ -57,6 +66,10 @@ export default
57
66
  is_loading: false,
58
67
  initial_loading: true,
59
68
  is_notification_dialog_open: false,
69
+ lastVisible: null,
70
+ pageSize: 20,
71
+ loadingMore: false,
72
+ noMoreData:false
60
73
  }),
61
74
  components: { GCard, GHeader, GLoader },
62
75
  async mounted()
@@ -79,29 +92,57 @@ export default
79
92
  },
80
93
  methods:
81
94
  {
82
- async loadNotificationList()
95
+ async loadNotificationList(initial = true)
83
96
  {
84
- let query = [];
85
- if(this.complan_details.complan == "binary_three")
86
- {
87
- query = new DB_SLOT_LOG().collection().where("recipient_id", "==", this.current_slot_info.slot_code).where("type",'in',["binary_three","binary_three_mentors"] ).orderBy('created_date', 'desc').limit(10);
97
+ let query;
98
+ const baseQuery = new DB_SLOT_LOG().collection()
99
+ .where("recipient_id", "==", this.current_slot_info.slot_code)
100
+ .orderBy('created_date', 'desc')
101
+ .limit(this.pageSize);
102
+
103
+ if (this.complan_details.complan == "binary_three") {
104
+ query = baseQuery.where("type", "in", ["binary_three", "binary_three_mentors"]);
105
+ } else {
106
+ query = baseQuery.where("type", "==", this.complan_details.complan);
88
107
  }
89
- else
90
- {
91
- query = new DB_SLOT_LOG().collection().where("recipient_id", "==", this.current_slot_info.slot_code).where("type",'==', this.complan_details.complan).orderBy('created_date', 'desc').limit(10);
108
+
109
+ if (!initial && this.lastVisible) {
110
+ query = query.startAfter(this.lastVisible);
92
111
  }
93
- await this.$bind('notification_list', query);
94
112
 
95
- if(this.is_teslab_earnings == true)
96
- {
97
- this.notification_list.map(function(obj) { // loop through array
98
-
99
- obj.message = obj.message.replace("vortex entry","cash reward entry").replace("matching bonus", "sales force bonus").replace("binary distribution","sales force distribution")
100
- return obj;
101
- });
102
- }
113
+ this.loadingMore = true;
114
+
115
+ const snapshot = await query.get();
116
+ const newItems = [];
103
117
 
118
+ snapshot.forEach(doc => {
119
+ const data = doc.data();
120
+ data.id = doc.id;
121
+
122
+ // Transform message if needed
123
+ if (this.is_teslab_earnings) {
124
+ data.message = data.message
125
+ .replace("vortex entry", "cash reward entry")
126
+ .replace("matching bonus", "sales force bonus")
127
+ .replace("binary distribution", "sales force distribution");
128
+ }
129
+
130
+ newItems.push(data);
131
+ });
132
+
133
+ if (initial) {
134
+ this.notification_list = newItems;
135
+ } else {
136
+ this.notification_list = [...this.notification_list, ...newItems];
137
+ }
138
+
139
+ this.lastVisible = snapshot.docs[snapshot.docs.length - 1] || null;
104
140
  this.initial_loading = false;
141
+ this.loadingMore = false;
142
+
143
+ console.log(snapshot.docs.length,this.pageSize);
144
+ // 👇 Hide next if it's the last page
145
+ this.noMoreData = snapshot.empty || snapshot.docs.length < this.pageSize;
105
146
  },
106
147
  async updateNotificationCount()
107
148
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.878",
3
+ "version": "1.2.880",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {