geer-builder 1.2.693 → 1.2.695

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/GCompanyToken.vue CHANGED
@@ -4,6 +4,9 @@
4
4
  <g-card>
5
5
  <div class="q-pt-sm grid-item" style="cursor:pointer;" @click="is_open_token_claim=true" >
6
6
  <div class="label">
7
+ <div>
8
+ Company Token (One)
9
+ </div>
7
10
  Unused Token: {{unused_token}}
8
11
  </div>
9
12
  </div>
@@ -0,0 +1,208 @@
1
+ <template>
2
+ <div class="companyplan" v-if="this.user_info">
3
+ <div class="q-mt-md">
4
+ <g-card>
5
+ <div class="q-pt-sm grid-item" style="cursor:pointer;" @click="is_open_token_claim=true" >
6
+ <div class="label">
7
+ <div>
8
+ Company Token (One)
9
+ </div>
10
+ Unused Token: {{unused_token}}
11
+ </div>
12
+ </div>
13
+ <div class="q-pt-sm grid-item" style="cursor:pointer;" @click="is_open_token_claim=true" >
14
+ <div class="label">
15
+ <q-btn size="12px" class="full-width q-pa-sm text-primary" flat>
16
+ <q-icon class="q-mr-sm" name="fas fa-money-check" size="16px"></q-icon>
17
+ <div class="token-label">Redeem Reward Points</div>
18
+ </q-btn>
19
+ </div>
20
+ </div>
21
+ <div class="q-pt-sm grid-item" style="cursor:pointer;" @click="is_open_token_history=true" >
22
+ <div class="label">
23
+ <q-btn size="12px" class="full-width q-pa-sm text-primary" flat>
24
+ <q-icon class="q-mr-sm" name="fas fa-money-check" size="16px"></q-icon>
25
+ <div class="token-label">View Reward Points History</div>
26
+ </q-btn>
27
+ </div>
28
+ </div>
29
+ </g-card>
30
+ </div>
31
+ <div class="q-mt-md">
32
+ <g-card>
33
+ <div>
34
+ <template v-if="plan_list.length > 0">
35
+ <div @click="viewPlan(plan)" class="plan" v-for="(plan, i) in plan_list" :key="i">
36
+ <div class="group">
37
+ <div class="label">Plan</div>
38
+ <div class="value text-primary" style="font-size: 1em; font-weight:500">{{plan.plan.name}}</div>
39
+ </div>
40
+ <div class="group">
41
+ <div class="label">Total amount to earn </div>
42
+ <div class="value">{{ $_formatNumber(plan.total_earn, { decimal: 2})}}</div>
43
+ </div>
44
+ <div class="group">
45
+ <div class="label">Status</div>
46
+ <div class="value">{{plan.status}}</div>
47
+ </div>
48
+ </div>
49
+ </template>
50
+ <template v-if="plan_list.length == 0">
51
+ <div class="no-plan">
52
+ No Plan
53
+ </div>
54
+ </template>
55
+ </div>
56
+ </g-card>
57
+ </div>
58
+
59
+ <q-dialog :maximized="$q.platform.is.mobile" transition-show="slide-up" transition-hide="slide-down" v-model="is_open_token_claim">
60
+ <company-token-claim @emitTest="emitTest" @closeDialog="is_open_token_claim = false"></company-token-claim>
61
+ </q-dialog>
62
+
63
+ <q-dialog :maximized="$q.platform.is.mobile" transition-show="slide-up" transition-hide="slide-down" v-model="is_open_token_claim_slot">
64
+ <company-token-claim-slot :plan_id="plan_id" @closeDialog="is_open_token_claim_slot = false"></company-token-claim-slot>
65
+ </q-dialog>
66
+
67
+ <q-dialog full-width :maximized="$q.platform.is.mobile" transition-show="slide-up" transition-hide="slide-down" v-model="is_open_token_history">
68
+ <company-token-history :plan_id="plan_id" @closeDialog="is_open_token_history = false"></company-token-history>
69
+ </q-dialog>
70
+
71
+ </div>
72
+ <div v-else>
73
+ <span>You need to login to view this component.</span>
74
+ </div>
75
+
76
+ </template>
77
+ <script>
78
+
79
+ import GHeader from './components/GHeader';
80
+ import GCard from './components/GCard';
81
+ import DB_USER from './models/DB_USER';
82
+ import DB_SLOT from './models/DB_SLOT';
83
+ import DB_COMPANY_TOKEN_TWO_PLAN from './models/DB_COMPANY_TOKEN_TWO_PLAN';
84
+ import GlobalMixins from './mixins/global_mixins';
85
+ import CompanyTokenClaim from './dialogs/CompanyTokenTwoClaim';
86
+ import CompanyTokenClaimSlot from './dialogs/CompanyTokenTwoClaimSlot';
87
+ import CompanyTokenHistory from './dialogs/CompanyTokenTwoHistory';
88
+
89
+
90
+ export default
91
+ {
92
+ components: { GHeader, GCard, CompanyTokenClaim, CompanyTokenClaimSlot, CompanyTokenHistory },
93
+ mixins: [GlobalMixins],
94
+ data: () =>
95
+ ({
96
+ unused_token: 0,
97
+ is_open_token_claim: false,
98
+ is_open_token_claim_slot: false,
99
+ is_open_token_history: false,
100
+ db_user: new DB_USER(),
101
+ db_slot: new DB_SLOT(),
102
+ plan_list: [],
103
+ plan_id: null,
104
+ settings:{}
105
+ }),
106
+ props:
107
+ {
108
+
109
+ },
110
+ async mounted()
111
+ {
112
+ await this.$_getSlotInfo();
113
+ await this.loadPlan();
114
+ this.settings = await this.$_getData('public_settings');
115
+ },
116
+ methods:
117
+ {
118
+ emitTest(value)
119
+ {
120
+ this.unused_token = this.unused_token - value;
121
+ },
122
+ async loadPlan()
123
+ {
124
+
125
+ this.unused_token = this.current_slot_info.points.company_token_two;
126
+
127
+ // console.log(this.current_slot_info.points.company_token);
128
+ await this.$bind('plan_list', new DB_COMPANY_TOKEN_TWO_PLAN().collection().where('slot_owner', '==', this.current_slot_info.id));
129
+ },
130
+ async viewPlan(plan)
131
+ {
132
+ this.plan_id = plan.id;
133
+ this.is_open_token_claim_slot = true;
134
+ }
135
+ },
136
+ computed:
137
+ {
138
+
139
+ },
140
+ }
141
+ </script>
142
+
143
+ <style lang="scss">
144
+ .companyplan {
145
+ margin-bottom: 20px;
146
+
147
+ &-tabs {
148
+ display: grid;
149
+ grid-template-columns: 1fr 1fr;
150
+ text-align: center;
151
+ width: 100%;
152
+ grid-gap: 1px;
153
+ background-color: #ddd;
154
+ margin-bottom: 10px;
155
+
156
+ .tab {
157
+ padding: 10px;
158
+ border-bottom: 1px solid #ddd;
159
+ background-color: #fafafa;
160
+ color: #666;
161
+ font-weight: bold;
162
+ cursor: pointer;
163
+
164
+ &.active {
165
+ border-bottom: 1px solid #fff;
166
+ background-color: #fff;
167
+ color: #333;
168
+ }
169
+ }
170
+ }
171
+
172
+ .no-plan {
173
+ padding: 100px 20px;
174
+ text-align: center;
175
+ color: #aaa;
176
+ }
177
+
178
+ .plan {
179
+ border-bottom: 1px dashed #eee;
180
+ display: grid;
181
+ padding: 10px;
182
+ grid-template-columns: 1fr 1fr 1fr;
183
+ align-items: center;
184
+ grid-gap: 20px;
185
+ cursor: pointer;
186
+
187
+ &:hover {
188
+ background-color: #fafafa;
189
+ }
190
+
191
+ .icon {
192
+ color: #aaa;
193
+ width: 60px;
194
+ text-align: center;
195
+ }
196
+ .group {
197
+ .label {
198
+ font-weight: bold;
199
+ color: #aaa;
200
+ text-transform: uppercase;
201
+ }
202
+ .value {
203
+ font-size: 20px;
204
+ }
205
+ }
206
+ }
207
+ }
208
+ </style>
@@ -0,0 +1,205 @@
1
+ <template>
2
+ <q-card class="claim-investment-dialog">
3
+ <q-bar class='bg-primary text-white q-pa-lg'>
4
+ <b>Use Token</b>
5
+ <q-space />
6
+ <q-btn dense flat icon='close' v-close-popup><q-tooltip content-class='bg-white text-primary'>Close</q-tooltip></q-btn>
7
+ </q-bar>
8
+ <div class="plan-holder">
9
+ <div class="plan" style="border-bottom: 1px dashed #eee;" v-for="(plan, i) in plan_list" :key="i">
10
+ <div class="claim-grid desc text-center q-pa-lg">
11
+ <div class="label">Plan Name:</div>
12
+ <div class="value">{{plan.name}}</div>
13
+ <div class="label">Required Token:</div>
14
+ <div class="value">{{plan.token_required}}</div>
15
+ <div class="label">Lock-in Days:</div>
16
+ <div class="value">{{plan.total_days}}</div>
17
+ <div class="label">Days to earn:</div>
18
+ <div class="value">{{plan.days_to_earn}}</div>
19
+ <div class="label">Amount to earned:</div>
20
+ <div class="value">{{ $_formatNumber(plan.earned_amount, { decimal: 2}) }} </div>
21
+
22
+ <!-- <h6 style="margin:0 auto">Plan Name: {{plan.name}} </h6> -->
23
+ <!-- <h6 style="margin:0 auto">Required Token: {{plan.token_required}} </h6>
24
+ <h6 style="margin:0 auto">Lock-in Days: {{plan.total_days}} </h6>
25
+ <h6 style="margin:0 auto">Days to earn: Every {{plan.days_to_earn}} days </h6>
26
+ <h6 style="margin:0 auto">Amount to earned: {{ $_formatNumber(plan.earned_amount, { decimal: 2}) }} </h6> -->
27
+ </div>
28
+ <div class="button-holder text-center q-pa-md">
29
+ <q-btn size="12px" @click="claimPlan(plan,i)" class="claim-btn text-white bg-primary investment__actions-button q-pa-sm">
30
+ <q-icon class="q-mr-sm claim-icon" name="fas fa-chart-line" size="16px"></q-icon>
31
+ <div class="token-claim">Claim</div>
32
+ </q-btn>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </q-card>
37
+ </template>
38
+ <script>
39
+
40
+ import DB_SLOT from '../models/DB_SLOT';
41
+ import GlobalMixins from '../mixins/global_mixins.js';
42
+
43
+
44
+ export default
45
+ {
46
+ components: { },
47
+ mixins: [GlobalMixins],
48
+ data: () =>
49
+ ({
50
+ is_open_add_slot_dialog: false,
51
+ db_slot: new DB_SLOT(),
52
+ membership_list: null,
53
+ slot_membership:null,
54
+ plan_list: null,
55
+ settings:{}
56
+ }),
57
+ props:
58
+ {
59
+
60
+ },
61
+ async mounted()
62
+ {
63
+ await this.$_getSlotInfo();
64
+ await this.loadPlan();
65
+
66
+ this.settings = await this.$_getData('public_settings');
67
+ },
68
+ methods:
69
+ {
70
+ async loadPlan()
71
+ {
72
+ this.membership_list = await this.$_getData('membership_list');
73
+
74
+ this.slot_membership = this._getMembershipByID(this.current_slot_info.membership,this.membership_list);
75
+
76
+ this.plan_list = this.slot_membership.computation.company_token_two_plan;
77
+
78
+ console.log(this.plan_list);
79
+ },
80
+ async viewPlan()
81
+ {
82
+
83
+ },
84
+ async claimPlan(plan,id)
85
+ {
86
+ this.$q.dialog(
87
+ {
88
+ title: 'Confirm',
89
+ message: 'Would you to like claim this '+plan.name+'?',
90
+ cancel: true,
91
+ persistent: true
92
+ }).onOk(() =>
93
+ {
94
+ this.submitCompanyToken(plan,id);
95
+ });
96
+ },
97
+ async submitCompanyToken(plan,id)
98
+ {
99
+ this.$q.loading.show();
100
+
101
+ let sendData = {};
102
+ sendData.id = id;
103
+ sendData.slot_id = this.current_slot_info.id;
104
+
105
+ try
106
+ {
107
+ let res = await this.$_fbCall('memberClaimCompanyTokenTwo', sendData);
108
+ this.$emit('emitTest',plan.token_required);
109
+ this.$q.loading.hide();
110
+ this.$emit('closeDialog');
111
+ }
112
+ catch (error)
113
+ {
114
+ this.$q.loading.hide();
115
+ this.$q.dialog({ title: `Something's not quite right`, message: error.message });
116
+ }
117
+ },
118
+ _getMembershipByID(mem, mem_list)
119
+ {
120
+ let membership = null;
121
+
122
+ mem_list.forEach(val =>
123
+ {
124
+ if(val.membership_id === mem.membership_id)
125
+ {
126
+ membership = val;
127
+ }
128
+ });
129
+
130
+ return membership;
131
+ }
132
+ },
133
+ computed:
134
+ {
135
+
136
+ },
137
+ }
138
+ </script>
139
+
140
+ <style lang="scss">
141
+ .companyplan {
142
+ margin-bottom: 20px;
143
+
144
+ &-tabs {
145
+ display: grid;
146
+ grid-template-columns: 1fr 1fr;
147
+ text-align: center;
148
+ width: 100%;
149
+ grid-gap: 1px;
150
+ background-color: #ddd;
151
+ margin-bottom: 10px;
152
+
153
+ .tab {
154
+ padding: 10px;
155
+ border-bottom: 1px solid #ddd;
156
+ background-color: #fafafa;
157
+ color: #666;
158
+ font-weight: bold;
159
+ cursor: pointer;
160
+
161
+ &.active {
162
+ border-bottom: 1px solid #fff;
163
+ background-color: #fff;
164
+ color: #333;
165
+ }
166
+ }
167
+ }
168
+
169
+ .no-plan {
170
+ padding: 100px 20px;
171
+ text-align: center;
172
+ color: #aaa;
173
+ }
174
+
175
+ .plan {
176
+ border-bottom: 1px dashed #eee;
177
+ display: grid;
178
+ padding: 10px;
179
+ grid-template-columns: 1fr 1fr 1fr;
180
+ align-items: center;
181
+ grid-gap: 20px;
182
+ cursor: pointer;
183
+
184
+ &:hover {
185
+ background-color: #fafafa;
186
+ }
187
+
188
+ .icon {
189
+ color: #aaa;
190
+ width: 60px;
191
+ text-align: center;
192
+ }
193
+ .group {
194
+ .label {
195
+ font-weight: bold;
196
+ color: #aaa;
197
+ text-transform: uppercase;
198
+ }
199
+ .value {
200
+ font-size: 20px;
201
+ }
202
+ }
203
+ }
204
+ }
205
+ </style>
@@ -0,0 +1,121 @@
1
+ <template>
2
+ <q-card >
3
+ <q-bar class='bg-primary text-white q-pa-lg'>
4
+ <b>Claim</b>
5
+ <q-space />
6
+ <q-btn dense flat icon='close' v-close-popup><q-tooltip content-class='bg-white text-primary'>Close</q-tooltip></q-btn>
7
+ </q-bar>
8
+ <q-card-section class='content'>
9
+ <div class="row">
10
+ <!-- TABLE -->
11
+ <div class="col-12 text-right q-mb-md">
12
+ <div class="q-mt-sm text-left">
13
+ <table style="width: 500px; min-width: 500px;">
14
+ <tr>
15
+ <th>Plan</th>
16
+ <th>Amount</th>
17
+ <th style="min-width: 30px;"></th>
18
+ <th></th>
19
+ </tr>
20
+ <tr v-for="(plan_data, i) in table_data" :key="i">
21
+ <td>{{ $_formatDate(plan_data.available_date, 'MM/DD/YY (hh:mm A)')}} </td>
22
+ <td>{{ $_formatNumber(plan_data.amount, { decimal: 2})}}</td>
23
+ <td></td>
24
+ <td v-if="plan_data.status == 'Claimed'">
25
+ <q-btn style="min-width: 130px;" :disabled="true" color="primary" label="Claimed" />
26
+ </td>
27
+ <td v-else-if="date_now >= plan_data.available_date.toDate() == true">
28
+ <q-btn style="min-width: 130px;" @click="claimNow(plan_data)" color="primary" label="Claim" />
29
+ </td>
30
+ <td v-else>
31
+ <q-btn style="min-width: 130px;" :disabled="true" color="primary" label="Unclaimable" />
32
+ </td>
33
+ </tr>
34
+ </table>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </q-card-section>
39
+ </q-card>
40
+ </template>
41
+
42
+ <script>
43
+ import DB_COMPANY_TOKEN_TWO_PLAN_DATE from '../models/DB_COMPANY_TOKEN_TWO_PLAN_DATE';
44
+ import GlobalMixins from '../mixins/global_mixins.js';
45
+ import moment from 'moment';
46
+ export default
47
+ {
48
+ mixins: [GlobalMixins],
49
+ components:{
50
+ },
51
+ data: () =>
52
+ ({
53
+ pagination: { rowsPerPage: 8 },
54
+ table_loading: true,
55
+ table_data: [],
56
+ public_settings:[],
57
+ date_now:null
58
+ }),
59
+ props:
60
+ {
61
+ plan_id : String,
62
+ },
63
+ async mounted()
64
+ {
65
+ this.date_now = moment();
66
+
67
+ await this.$_getSlotInfo();
68
+ await this.getTableData();
69
+ },
70
+ methods:
71
+ {
72
+ async getTableData()
73
+ {
74
+
75
+ await this.$bind("table_data", new DB_COMPANY_TOKEN_TWO_PLAN_DATE(this.plan_id).collection().orderBy('available_date', 'asc'));
76
+
77
+
78
+ this.table_loading = false;
79
+ },
80
+ getHumanDate : function (date)
81
+ {
82
+ return moment(date);
83
+ },
84
+ async claimNow(plan_data)
85
+ {
86
+ this.$q.dialog(
87
+ {
88
+ title: 'Confirm',
89
+ message: 'It may take a couple of minutes to reflect on your wallet. Please confirm.',
90
+ cancel: true,
91
+ persistent: true
92
+ }).onOk(() =>
93
+ {
94
+ this.claimNextStep(plan_data);
95
+ });
96
+ },
97
+ async claimNextStep(plan_data)
98
+ {
99
+ this.$q.loading.show();
100
+ try
101
+ {
102
+ let sendData = {};
103
+ sendData.id = plan_data.id;
104
+ sendData.plan_id = this.plan_id;
105
+
106
+ let res = await this.$_fbCall('memberClaimCompanyTokenTwoEarn', sendData);
107
+ this.$q.loading.hide();
108
+ }
109
+ catch (error)
110
+ {
111
+ this.$q.loading.hide();
112
+ this.$q.dialog({ title: `Something's not quite right`, message: error.message });
113
+ }
114
+ }
115
+ },
116
+ created()
117
+ {
118
+
119
+ }
120
+ }
121
+ </script>
@@ -0,0 +1,120 @@
1
+ <template>
2
+ <q-card >
3
+ <q-bar class='bg-primary text-white q-pa-lg'>
4
+ <b>History</b>
5
+ <q-space />
6
+ <q-btn dense flat icon='close' v-close-popup><q-tooltip content-class='bg-white text-primary'>Close</q-tooltip></q-btn>
7
+ </q-bar>
8
+ <q-card-section class='content'>
9
+ <div class="row">
10
+ <!-- TABLE -->
11
+ <div class="col-12 text-right q-mb-md">
12
+ <div class="q-mt-sm text-left">
13
+ <q-table :pagination.sync="pagination" :loading="table_loading" separator="cell" bordered flat :data="!table_loading ? table_data : []" :columns="table_column" row-key="email">
14
+ <template v-slot:body-cell-message="cellProperties">
15
+ <q-td :props="cellProperties">
16
+ <span v-html="cellProperties.value"></span>
17
+ </q-td>
18
+ </template>
19
+ </q-table>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </q-card-section>
24
+ </q-card>
25
+ </template>
26
+
27
+ <script>
28
+ import DB_POINTS_LOG from '../models/DB_POINTS_LOG';
29
+ import GlobalMixins from '../mixins/global_mixins.js';
30
+ import moment from 'moment';
31
+ import {formatDate} from '../utilities/DateUtils';
32
+ import { formatNumber } from '../utilities/NumberUtils';
33
+ export default
34
+ {
35
+ mixins: [GlobalMixins],
36
+ components:{
37
+ },
38
+ data: () =>
39
+ ({
40
+ pagination: { rowsPerPage: 8 },
41
+ table_loading: true,
42
+ table_data: [],
43
+ public_settings:[],
44
+ date_now:null,
45
+ table_column:
46
+ [
47
+ {
48
+ name : 'created_date',
49
+ label : 'Log Date',
50
+ field : row => formatDate(row.created_date, 'MM/DD/YY (hh:mm A)'),
51
+ align : 'left',
52
+ required: true,
53
+ format: val => `${val}`,
54
+ sortable: true,
55
+
56
+ },
57
+ {
58
+ name : 'message',
59
+ label : 'Message',
60
+ field : row => row.message,
61
+ align : 'left',
62
+ required: true,
63
+ format: val => `${val}`,
64
+ sortable: true,
65
+ },
66
+ {
67
+ name : 'amount',
68
+ label : 'Amount',
69
+ field : row => row.amount,
70
+ align : 'left',
71
+ required: true,
72
+ format : val => formatNumber(val, { decimal: 2 }),
73
+ sortable: true,
74
+ align : "right",
75
+
76
+ },
77
+ {
78
+ name : 'plan_taken',
79
+ label : 'Claimed Plan',
80
+ field : row => row.plan_token ? row.plan_token.name : "--",
81
+ align : 'left',
82
+ required: true,
83
+ format : val => val,
84
+ sortable: true,
85
+ align : "right",
86
+
87
+ }
88
+ ]
89
+ }),
90
+ props:
91
+ {
92
+ plan_id : String,
93
+ },
94
+ async mounted()
95
+ {
96
+ this.date_now = moment();
97
+
98
+ await this.$_getSlotInfo();
99
+ await this.getTableData();
100
+ },
101
+ methods:
102
+ {
103
+ async getTableData()
104
+ {
105
+ await this.$bind("table_data", new DB_POINTS_LOG().collection().where("recipient_id","==",this.current_slot_info.slot_code).where("type","==","company_token_two").orderBy('created_date', 'desc'));
106
+ console.log(this.table_data);
107
+
108
+ this.table_loading = false;
109
+ },
110
+ getHumanDate : function (date)
111
+ {
112
+ return moment(date);
113
+ }
114
+ },
115
+ created()
116
+ {
117
+
118
+ }
119
+ }
120
+ </script>
@@ -0,0 +1,9 @@
1
+ import MODEL from './MODEL';
2
+
3
+ export default class DB_COMPANY_TOKEN_TWO_PLAN extends MODEL
4
+ {
5
+ constructor()
6
+ {
7
+ super('company_token_two_plan');
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ import MODEL from './MODEL';
2
+
3
+ export default class DB_COMPANY_TOKEN_TWO_PLAN_DATE extends MODEL
4
+ {
5
+ constructor(plan_id)
6
+ {
7
+ super(`company_token_two_plan/${plan_id}/date`);
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.693",
3
+ "version": "1.2.695",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {