biz9-logic 4.8.323 → 4.8.328
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/biz9_config +1 -1
- package/index.js +534 -734
- package/package.json +2 -3
- package/test.js +2 -666
package/index.js
CHANGED
|
@@ -35,14 +35,47 @@ class Message {
|
|
|
35
35
|
static REVIEW_REMOVE_SUCCESS="Review Remove Success.";
|
|
36
36
|
static REVIEW_USER_LOGIN="Please Login To Add Review.";
|
|
37
37
|
}
|
|
38
|
-
class TemplateType {
|
|
39
|
-
static PRIMARY='primary';
|
|
40
|
-
static HEADER='header';
|
|
41
|
-
static NAVIGATION='navigation';
|
|
42
|
-
static BODY='body';
|
|
43
|
-
static FOOTER='footer';
|
|
44
|
-
}
|
|
45
38
|
class Item_Logic {
|
|
39
|
+
static url_copy = (app_id,url,data_type,id,param) => {
|
|
40
|
+
let action_url = "main/crud/copy/"+data_type + "/" + id;
|
|
41
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
42
|
+
};
|
|
43
|
+
static url_delete = (app_id,url,data_type,id,param) => {
|
|
44
|
+
let action_url = "main/crud/delete/"+data_type + "/" + id;
|
|
45
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
46
|
+
};
|
|
47
|
+
static url_delete_check_protection = (app_id,url,data_type,id,param) => {
|
|
48
|
+
let action_url = "main/crud/delete_item_check_protection/"+data_type + "/" + id;
|
|
49
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
50
|
+
};
|
|
51
|
+
static url_delete_search = (app_id,url,data_type,param) => {
|
|
52
|
+
let action_url = "main/crud/delete_list/"+data_type;
|
|
53
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
54
|
+
};
|
|
55
|
+
static url_get = (app_id,url,data_type,key,param) => {
|
|
56
|
+
let action_url= "main/crud/get/"+data_type + "/" + key;
|
|
57
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
58
|
+
};
|
|
59
|
+
static url_get_parent_top = (app_id,url,data_type,id,param) => {
|
|
60
|
+
let action_url = "main/crud/get_parent_top/"+data_type+"/"+id;
|
|
61
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
62
|
+
};
|
|
63
|
+
static url_search = (app_id,url,data_type,param) => {
|
|
64
|
+
let action_url = "main/crud/search/"+data_type;
|
|
65
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
66
|
+
};
|
|
67
|
+
static url_post = (app_id,url,data_type,id,param) => {
|
|
68
|
+
let action_url = "main/crud/post/"+data_type + "/" + id;
|
|
69
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
70
|
+
};
|
|
71
|
+
static url_post_list = (app_id,url,param) => {
|
|
72
|
+
let action_url = "main/crud/post_list";
|
|
73
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
74
|
+
};
|
|
75
|
+
static url_post_cms = (app_id,url,data_type,id,param) => {
|
|
76
|
+
let action_url = "item/post_cms/"+data_type+"/"+id;
|
|
77
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
78
|
+
};
|
|
46
79
|
static get_test = (title,data_type,id,option)=>{
|
|
47
80
|
data_type = data_type ? data_type : DataType.BLANK;
|
|
48
81
|
id = id ? id : 0;
|
|
@@ -127,56 +160,6 @@ class Item_Logic {
|
|
|
127
160
|
}
|
|
128
161
|
return Item_Logic.get_search(query.data_type,filter,sort_by,query.page_current,query.page_size);
|
|
129
162
|
}
|
|
130
|
-
static get_field_value = (item_data_type,item_id,value_type,value_id,value,value_list) => {
|
|
131
|
-
return {item_data_type:item_data_type,item_id:item_id,value_type:value_type,value_id:value_id,value:value,value_list:value_list};
|
|
132
|
-
};
|
|
133
|
-
static get_item_field_value_type_list = () => {
|
|
134
|
-
return [
|
|
135
|
-
{value:'text',label:'Text'},
|
|
136
|
-
{value:'note',label:'Note'},
|
|
137
|
-
{value:'image',label:'Image'},
|
|
138
|
-
{value:'list',label:'List'},
|
|
139
|
-
];
|
|
140
|
-
};
|
|
141
|
-
static get_field_value_value = (value_type,item,value_id) =>{
|
|
142
|
-
switch(value_type){
|
|
143
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_TEXT:
|
|
144
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_NOTE:
|
|
145
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_IMAGE:
|
|
146
|
-
return !Str.check_is_null(item[Item_Logic.get_field_value_title(value_type,value_id)]) ? item[Item_Logic.get_field_value_title(value_type,value_id)] : "";
|
|
147
|
-
break;
|
|
148
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_LIST:
|
|
149
|
-
let r_list = [];
|
|
150
|
-
for(let a=0;a<30;a++){
|
|
151
|
-
if(!Str.check_is_null(item[Item_Logic.get_field_value_title(value_type,value_id,a+1)])){
|
|
152
|
-
r_list.push(item[Item_Logic.get_field_value_title(value_type,value_id,a+1)]);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return r_list;
|
|
156
|
-
break;
|
|
157
|
-
default:
|
|
158
|
-
return "";
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
static get_field_value_title = (value_type,value_id,row_id) =>{
|
|
162
|
-
let type_str = '';
|
|
163
|
-
switch(value_type){
|
|
164
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_TEXT:
|
|
165
|
-
return 'text'+'_value_'+value_id;
|
|
166
|
-
break;
|
|
167
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_NOTE:
|
|
168
|
-
return 'note'+'_value_'+value_id;
|
|
169
|
-
break;
|
|
170
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_IMAGE:
|
|
171
|
-
return 'image'+'_value_'+value_id;
|
|
172
|
-
break;
|
|
173
|
-
case FieldType.ITEM_FIELD_VALUE_TYPE_LIST:
|
|
174
|
-
return 'list'+'_value_'+value_id +'_row_'+row_id;
|
|
175
|
-
break;
|
|
176
|
-
default:
|
|
177
|
-
return "";
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
163
|
static get_data_search_result = (app_id,data_type,item_count,page_count,filter,data_list,option) =>{
|
|
181
164
|
return{
|
|
182
165
|
option:option?option:{},
|
|
@@ -190,14 +173,20 @@ class Item_Logic {
|
|
|
190
173
|
}
|
|
191
174
|
}
|
|
192
175
|
class Stat_Logic {
|
|
193
|
-
|
|
194
|
-
static
|
|
195
|
-
static
|
|
196
|
-
static
|
|
197
|
-
static
|
|
198
|
-
static
|
|
199
|
-
static
|
|
200
|
-
|
|
176
|
+
static TYPE_STAT_VIEW='view_post';
|
|
177
|
+
static TYPE_STAT_LIKE='like_post';
|
|
178
|
+
static TYPE_STAT_FAVORITE='favorite_post';
|
|
179
|
+
static TYPE_STAT_CART='cart_post';
|
|
180
|
+
static TYPE_STAT_ORDER='order_post';
|
|
181
|
+
static TYPE_STAT_REVIEW='review_post';
|
|
182
|
+
static TYPE_STAT_LOGIN='login_post';
|
|
183
|
+
static TYPE_STAT_REGISTER='register_post';
|
|
184
|
+
|
|
185
|
+
static url_search_activity = (app_id,url,param) => {
|
|
186
|
+
let action_url="item/search_activity";
|
|
187
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
188
|
+
};
|
|
189
|
+
|
|
201
190
|
static get_new = (user_id,stat_type_id,parent_item_list)=>{
|
|
202
191
|
return {
|
|
203
192
|
user_id:user_id,
|
|
@@ -207,6 +196,64 @@ class Stat_Logic {
|
|
|
207
196
|
}
|
|
208
197
|
}
|
|
209
198
|
class Page_Logic {
|
|
199
|
+
static TYPE_PAGE_HOME='home';
|
|
200
|
+
static TYPE_PAGE_ABOUT='about';
|
|
201
|
+
static TYPE_PAGE_CONTACT='contact';
|
|
202
|
+
static TYPE_PAGE_FAQ='faq';
|
|
203
|
+
|
|
204
|
+
static TYPE_PAGE_BLOG_POST='blog_post';
|
|
205
|
+
static TYPE_PAGE_BLOG_POST_DETAIL='blog_post_detail';
|
|
206
|
+
|
|
207
|
+
static TYPE_PAGE_EVENT='event';
|
|
208
|
+
static TYPE_PAGE_EVENT_DETAIL='event_detail';
|
|
209
|
+
|
|
210
|
+
static TYPE_PAGE_GALLERY='gallery';
|
|
211
|
+
static TYPE_PAGE_GALLERY_DETAIL='gallery_detail';
|
|
212
|
+
|
|
213
|
+
static TYPE_PAGE_SERVICE='service';
|
|
214
|
+
static TYPE_PAGE_SERVICE_DETAIL='service_detail';
|
|
215
|
+
|
|
216
|
+
static TYPE_PAGE_PRODUCT='product';
|
|
217
|
+
static TYPE_PAGE_PRODUCT_DETAIL='product_detail';
|
|
218
|
+
|
|
219
|
+
static TYPE_PAGE_LIST = [
|
|
220
|
+
Page_Logic.TYPE_PAGE_HOME,
|
|
221
|
+
Page_Logic.TYPE_PAGE_ABOUT,
|
|
222
|
+
Page_Logic.TYPE_PAGE_CONTACT,
|
|
223
|
+
Page_Logic.TYPE_PAGE_FAQ,
|
|
224
|
+
Page_Logic.TYPE_PAGE_BLOG_POST,
|
|
225
|
+
Page_Logic.TYPE_PAGE_EVENT,
|
|
226
|
+
Page_Logic.TYPE_PAGE_GALLERY,
|
|
227
|
+
Page_Logic.TYPE_PAGE_SERVICE,
|
|
228
|
+
Page_Logic.TYPE_PAGE_PRODUCT];
|
|
229
|
+
|
|
230
|
+
static get_page_title = (data_type) => {
|
|
231
|
+
if(!data_type){
|
|
232
|
+
return "";
|
|
233
|
+
}else{
|
|
234
|
+
return String(Str.get_title(data_type.replaceAll('_',' '))).trim();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
static url_get_page = (app_id,url,title_url,param) => {
|
|
238
|
+
let action_url="page/get/"+title_url;
|
|
239
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
240
|
+
};
|
|
241
|
+
static url_home = (app_id,url,param) => {
|
|
242
|
+
let action_url="page/home";
|
|
243
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
244
|
+
};
|
|
245
|
+
static url_about = (app_id,url,param) => {
|
|
246
|
+
let action_url="page/about";
|
|
247
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
248
|
+
};
|
|
249
|
+
static url_contact = (app_id,url,param) => {
|
|
250
|
+
let action_url="page/contact";
|
|
251
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
252
|
+
};
|
|
253
|
+
static url_faq = (app_id,url,key,param) => {
|
|
254
|
+
let action_url="page/faq/"+key;
|
|
255
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
256
|
+
};
|
|
210
257
|
static get_test = (title,option) =>{
|
|
211
258
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
212
259
|
option = Field_Logic.get_option(DataType.PAGE,option?option:{});
|
|
@@ -227,9 +274,43 @@ class Page_Logic {
|
|
|
227
274
|
};
|
|
228
275
|
}
|
|
229
276
|
class Order_Logic {
|
|
277
|
+
|
|
278
|
+
static ORDER_NUMBER="OR-";
|
|
279
|
+
static TRANSACTION_ID="TR-";
|
|
280
|
+
|
|
281
|
+
static TYPE_PAYMENT_STATUS_OPEN="Open";
|
|
282
|
+
static TYPE_PAYMENT_STATUS_COMPLETE="Complete";
|
|
283
|
+
|
|
284
|
+
static TYPE_PAYMENT_PLAN_PENDING="Pending";
|
|
285
|
+
static TYPE_PAYMENT_PLAN_1="1 Payment";
|
|
286
|
+
static TYPE_PAYMENT_PLAN_2="2 Payments";
|
|
287
|
+
static TYPE_PAYMENT_PLAN_3="3 Payments";
|
|
288
|
+
static TYPE_PAYMENT_PLAN_4="4 Payments";
|
|
289
|
+
|
|
290
|
+
static TYPE_PAYMENT_METHOD_STRIPE="Stripe";
|
|
291
|
+
static TYPE_PAYMENT_METHOD_CASH="Cash";
|
|
292
|
+
static TYPE_PAYMENT_METHOD_OTHER="Other";
|
|
293
|
+
static TYPE_PAYMENT_METHOD_TEST="Test";
|
|
294
|
+
|
|
295
|
+
static url_search_order = (app_id,url,parent_data_type,param) => {
|
|
296
|
+
let action_url="item/search_order/"+parent_data_type;
|
|
297
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
298
|
+
};
|
|
299
|
+
static url_post_order = (app_id,url,param) => {
|
|
300
|
+
let action_url="item/post_order";
|
|
301
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
302
|
+
};
|
|
303
|
+
static url_get_order = (app_id,url,order_number,param) => {
|
|
304
|
+
let action_url="item/get_order/"+order_number;
|
|
305
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
306
|
+
};
|
|
307
|
+
static url_delete_order = (app_id,url,id,param) => {
|
|
308
|
+
let action_url="item/delete_order/"+id;
|
|
309
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
310
|
+
};
|
|
230
311
|
static get_new = (cart) => {
|
|
231
312
|
let order = DataItem.get_new(DataType.ORDER,0,{
|
|
232
|
-
order_number:
|
|
313
|
+
order_number:Order_Logic.ORDER_NUMBER + Num.get_id(99999),
|
|
233
314
|
parent_data_type:cart.parent_data_type,
|
|
234
315
|
user_id:cart.user_id,
|
|
235
316
|
cart_number:cart.cart_number,
|
|
@@ -267,13 +348,31 @@ class Order_Logic {
|
|
|
267
348
|
order_number:order_number,
|
|
268
349
|
payment_method_type:payment_method_type,
|
|
269
350
|
payment_amount:payment_amount,
|
|
270
|
-
transaction_id:
|
|
351
|
+
transaction_id:Order_Logic.TRANSACTION_ID + Num.get_id(99999)
|
|
271
352
|
});
|
|
272
353
|
};
|
|
273
354
|
}
|
|
274
355
|
class Cart_Logic {
|
|
356
|
+
static CART_NUMBER="CA-";
|
|
357
|
+
|
|
358
|
+
static url_search_cart = (app_id,url,parent_data_type,param) => {
|
|
359
|
+
let action_url="item/search_cart/"+parent_data_type;
|
|
360
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
361
|
+
};
|
|
362
|
+
static url_post_cart = (app_id,url,parent_data_type,param) => {
|
|
363
|
+
let action_url="item/post_cart/"+parent_data_type;
|
|
364
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
365
|
+
};
|
|
366
|
+
static url_delete_cart = (app_id,url,id,param) => {
|
|
367
|
+
let action_url="item/delete_cart/"+id;
|
|
368
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
369
|
+
};
|
|
370
|
+
static url_get_cart = (app_id,url,cart_number,param) => {
|
|
371
|
+
let action_url="item/get_cart/"+cart_number;
|
|
372
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
373
|
+
};
|
|
275
374
|
static get_new = (parent_data_type,user_id) => {
|
|
276
|
-
return DataItem.get_new(DataType.CART,0,{user_id:user_id,cart_number:
|
|
375
|
+
return DataItem.get_new(DataType.CART,0,{user_id:user_id,cart_number:Cart_Logic.CART_NUMBER + Num.get_id(99999),parent_data_type:parent_data_type,grand_total:0,cart_item_list:[]});
|
|
277
376
|
};
|
|
278
377
|
static get_new_cart_item = (parent_data_type,parent_id,cart_number,quanity) =>{
|
|
279
378
|
return DataItem.get_new(DataType.CART_ITEM,0,{parent_data_type:parent_data_type,parent_id:parent_id,cart_number:cart_number,quanity:quanity,cart_sub_item_list:[]});
|
|
@@ -283,6 +382,49 @@ class Cart_Logic {
|
|
|
283
382
|
};
|
|
284
383
|
}
|
|
285
384
|
class Product_Logic {
|
|
385
|
+
static url_detail = (app_id,url,key,param) => {
|
|
386
|
+
let action_url="product/detail/"+key;
|
|
387
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
388
|
+
};
|
|
389
|
+
static url_home = (app_id,url,param) => {
|
|
390
|
+
let action_url="product";
|
|
391
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
392
|
+
};
|
|
393
|
+
static url_search = (app_id,url,param) => {
|
|
394
|
+
let action_url="product/search";
|
|
395
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
396
|
+
};
|
|
397
|
+
static get_stock_list = () => {
|
|
398
|
+
const r_list=
|
|
399
|
+
[
|
|
400
|
+
{ value: "0", label: "Out of Stock" },
|
|
401
|
+
{ value: "1", label: "Only 1 Left" },
|
|
402
|
+
{ value: "2", label: "Less Than 3 Left" },
|
|
403
|
+
{ value: "3", label: "Availble" }
|
|
404
|
+
];
|
|
405
|
+
return r_list;
|
|
406
|
+
};
|
|
407
|
+
static get_stock_by_value = (stock_val) => {
|
|
408
|
+
switch(stock_val)
|
|
409
|
+
{
|
|
410
|
+
case "0":
|
|
411
|
+
return 'Out of Stock';
|
|
412
|
+
break;
|
|
413
|
+
case "1":
|
|
414
|
+
return 'Only 1 Left';
|
|
415
|
+
break;
|
|
416
|
+
case "2":
|
|
417
|
+
return 'Less Than 3 Left';
|
|
418
|
+
break;
|
|
419
|
+
case "3":
|
|
420
|
+
return 'Availble';
|
|
421
|
+
break;
|
|
422
|
+
default:
|
|
423
|
+
return 'Availble';
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
|
|
286
428
|
static get_test = (title,option) =>{
|
|
287
429
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
288
430
|
option = Field_Logic.get_option(DataType.PRODUCT,option?option:{});
|
|
@@ -310,7 +452,7 @@ class Product_Logic {
|
|
|
310
452
|
return product;
|
|
311
453
|
};
|
|
312
454
|
static get_test_cart = (cart_number,user_id,option) =>{
|
|
313
|
-
[cart_number,option] =
|
|
455
|
+
[cart_number,option] = ield_Logic.get_option_title(cart_number,option);
|
|
314
456
|
option = Field_Logic.get_option(DataType.CART,option?option:{});
|
|
315
457
|
let cart = DataItem.get_new(DataType.CART,Num.get_guid(),Field_Logic.get_test(cart_number,option));
|
|
316
458
|
cart.user_id = user_id;
|
|
@@ -352,6 +494,42 @@ class Product_Logic {
|
|
|
352
494
|
};
|
|
353
495
|
}
|
|
354
496
|
class Service_Logic {
|
|
497
|
+
static url_detail = (app_id,url,key,param) => {
|
|
498
|
+
let action_url="service/detail/"+key;
|
|
499
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
500
|
+
};
|
|
501
|
+
static url_home = (app_id,url,param) => {
|
|
502
|
+
let action_url="service/search";
|
|
503
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
504
|
+
};
|
|
505
|
+
static url_search = (app_id,url,param) => {
|
|
506
|
+
let action_url="service/search";
|
|
507
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
508
|
+
};
|
|
509
|
+
static get_stock_list = () => {
|
|
510
|
+
const r_list=
|
|
511
|
+
[
|
|
512
|
+
{ value: "0", label: "No Sessions Availble" },
|
|
513
|
+
{ value: "1", label: "Ready For Booking" },
|
|
514
|
+
{ value: "2", label: "No Sessions Availble" }
|
|
515
|
+
];
|
|
516
|
+
return r_list;
|
|
517
|
+
};
|
|
518
|
+
static get_stock_by_value = (stock_val) => {
|
|
519
|
+
switch(stock_val)
|
|
520
|
+
{
|
|
521
|
+
case "0":
|
|
522
|
+
return 'No Sessions Availble';
|
|
523
|
+
break;
|
|
524
|
+
case "1":
|
|
525
|
+
return 'Ready For Booking';
|
|
526
|
+
break;
|
|
527
|
+
case "2":
|
|
528
|
+
return 'No Sessions Availble';
|
|
529
|
+
break;
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
|
|
355
533
|
static get_test = (title,option) =>{
|
|
356
534
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
357
535
|
option = Field_Logic.get_option(DataType.SERVICE,option?option:{});
|
|
@@ -392,6 +570,10 @@ class Service_Logic {
|
|
|
392
570
|
};
|
|
393
571
|
}
|
|
394
572
|
class Content_Logic {
|
|
573
|
+
static url_get_content = (app_id,url,key,param) => {
|
|
574
|
+
let action_url="item/get_content/"+key;
|
|
575
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
576
|
+
};
|
|
395
577
|
static get_test = (title,option) =>{
|
|
396
578
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
397
579
|
option = Field_Logic.get_option(DataType.CONTENT,option?option:{});
|
|
@@ -429,6 +611,16 @@ class Content_Logic {
|
|
|
429
611
|
};
|
|
430
612
|
}
|
|
431
613
|
class Template_Logic {
|
|
614
|
+
static TYPE_PAGE_PRIMARY='primary';
|
|
615
|
+
static TYPE_PAGE_HEADER='header';
|
|
616
|
+
static TYPE_PAGE_NAVIGATION='navigation';
|
|
617
|
+
static TYPE_PAGE_BODY='body';
|
|
618
|
+
static TYPE_PAGE_FOOTER='footer';
|
|
619
|
+
|
|
620
|
+
static url_get_template = (app_id,url,key,param) => {
|
|
621
|
+
let action_url="item/get_template/"+key;
|
|
622
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
623
|
+
};
|
|
432
624
|
static get_test = (title,option) =>{
|
|
433
625
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
434
626
|
option = Field_Logic.get_option(DataType.TEMPLATE,option?option:{});
|
|
@@ -437,6 +629,19 @@ class Template_Logic {
|
|
|
437
629
|
};
|
|
438
630
|
}
|
|
439
631
|
class Blog_Post_Logic {
|
|
632
|
+
static url_detail = (app_id,url,key,param) => {
|
|
633
|
+
let action_url="blog_post/detail/"+key;
|
|
634
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
635
|
+
};
|
|
636
|
+
static url_home = (app_id,url,param) => {
|
|
637
|
+
let action_url="blog_post";
|
|
638
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
639
|
+
};
|
|
640
|
+
static url_search = (app_id,url,param) => {
|
|
641
|
+
let action_url="blog_post/search";
|
|
642
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
643
|
+
};
|
|
644
|
+
|
|
440
645
|
static get_test = (title,option) =>{
|
|
441
646
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
442
647
|
option = Field_Logic.get_option(DataType.BLOG_POST,option?option:{});
|
|
@@ -478,6 +683,18 @@ class Blog_Post_Logic {
|
|
|
478
683
|
};
|
|
479
684
|
}
|
|
480
685
|
class Gallery_Logic {
|
|
686
|
+
static url_detail = (app_id,url,key,param) => {
|
|
687
|
+
let action_url="gallery/detail/"+key;
|
|
688
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
689
|
+
};
|
|
690
|
+
static url_home = (app_id,url,param) => {
|
|
691
|
+
let action_url="gallery";
|
|
692
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
693
|
+
};
|
|
694
|
+
static url_search = (app_id,url,param) => {
|
|
695
|
+
let action_url="gallery/search";
|
|
696
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
697
|
+
};
|
|
481
698
|
static get_test = (title,option) =>{
|
|
482
699
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
483
700
|
option = Field_Logic.get_option(DataType.GALLERY,option?option:{});
|
|
@@ -497,31 +714,70 @@ class Gallery_Logic {
|
|
|
497
714
|
};
|
|
498
715
|
|
|
499
716
|
class Event_Logic {
|
|
500
|
-
static
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
717
|
+
static url_detail = (app_id,url,key,param) => {
|
|
718
|
+
let action_url="event/detail/"+key;
|
|
719
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
720
|
+
};
|
|
721
|
+
static url_home = (app_id,url,param) => {
|
|
722
|
+
let action_url="event";
|
|
723
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
724
|
+
};
|
|
725
|
+
static url_search = (app_id,url,param) => {
|
|
726
|
+
let action_url="event/search";
|
|
727
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
728
|
+
};
|
|
729
|
+
static get_stock_list = () => {
|
|
730
|
+
const r_list=
|
|
731
|
+
[
|
|
732
|
+
{ value: "0", label: "Sold Out" },
|
|
733
|
+
{ value: "1", label: "Less Than 25 Tickets Remaining" },
|
|
734
|
+
{ value: "2", label: "Tickets Are Availble" },
|
|
735
|
+
{ value: "3", label: "Sold Out" },
|
|
736
|
+
];
|
|
737
|
+
return r_list;
|
|
738
|
+
};
|
|
739
|
+
static get_stock_by_value = (stock_val) => {
|
|
740
|
+
switch(stock_val)
|
|
741
|
+
{
|
|
742
|
+
case "0":
|
|
743
|
+
return 'Sold Out';
|
|
744
|
+
break;
|
|
745
|
+
case "1":
|
|
746
|
+
return 'Less Than 25 Tickets Remaining';
|
|
747
|
+
break;
|
|
748
|
+
case "2":
|
|
749
|
+
return 'Tickets Are Availble';
|
|
750
|
+
break;
|
|
751
|
+
case "3":
|
|
752
|
+
return 'Sold Out';
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
static get_test = (title,option) =>{
|
|
757
|
+
[title,option] = Field_Logic.get_option_title(title,option);
|
|
758
|
+
option = Field_Logic.get_option(DataType.EVENT,option?option:{});
|
|
759
|
+
let event = DataItem.get_new(DataType.EVENT,0,Field_Logic.get_test(title,option));
|
|
760
|
+
if(!option.get_blank){
|
|
761
|
+
event.cost = Field_Logic.get_test_cost();
|
|
762
|
+
event.old_cost = Field_Logic.get_test_cost();
|
|
763
|
+
event.date = String(String(Num.get_id(2030)) + "-" + String(Num.get_id(13)) + "-" + String(Num.get_id(30))).trim();
|
|
764
|
+
event.time = String(Num.get_id(24)) + ":" + String(Num.get_id(59));
|
|
765
|
+
event.website = "Website "+String(Num.get_id());
|
|
766
|
+
event.location = "Location "+String(Num.get_id());
|
|
767
|
+
event.meeting_link = "Meeting Link "+String(Num.get_id());
|
|
768
|
+
event.stock = String(Num.get_id(3-1));
|
|
769
|
+
event.category ="Category " + String(Num.get_id());
|
|
770
|
+
event.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
771
|
+
}else{
|
|
772
|
+
event.cost = "";
|
|
773
|
+
event.old_cost = "";
|
|
774
|
+
event.date = "";
|
|
775
|
+
event.time = "";
|
|
776
|
+
event.website = "";
|
|
777
|
+
event.location = "";
|
|
778
|
+
event.meeting_link = "";
|
|
779
|
+
event.stock = "";
|
|
780
|
+
event.category ="";
|
|
525
781
|
event.tag = "";
|
|
526
782
|
}
|
|
527
783
|
if(option.get_item){
|
|
@@ -554,7 +810,70 @@ class Event_Logic {
|
|
|
554
810
|
};
|
|
555
811
|
}
|
|
556
812
|
class Field_Logic {
|
|
557
|
-
static
|
|
813
|
+
static TYPE_FIELD_VALUE_TEXT="text";
|
|
814
|
+
static TYPE_FIELD_VALUE_NOTE="note";
|
|
815
|
+
static TYPE_FIELD_VALUE_IMAGE="image";
|
|
816
|
+
static TYPE_FIELD_VALUE_LIST="list";
|
|
817
|
+
|
|
818
|
+
static url_post_field_value = (app_id,url,item_data_type,parent_item_id,value_id,param) => {
|
|
819
|
+
let action_url="item/post_field_value/"+item_data_type+"/"+parent_item_id;
|
|
820
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
821
|
+
};
|
|
822
|
+
static url_get_custom_field = (app_id,url,data_type,key,param) => {
|
|
823
|
+
let action_url="item/get_custom_field/"+data_type+"/"+key;
|
|
824
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
825
|
+
};
|
|
826
|
+
static get_field_value = (item_data_type,item_id,value_type,value_id,value,value_list) => {
|
|
827
|
+
return {item_data_type:item_data_type,item_id:item_id,value_type:value_type,value_id:value_id,value:value,value_list:value_list};
|
|
828
|
+
};
|
|
829
|
+
static get_item_field_value_type_list = () => {
|
|
830
|
+
return [
|
|
831
|
+
{value:'text',label:'Text'},
|
|
832
|
+
{value:'note',label:'Note'},
|
|
833
|
+
{value:'image',label:'Image'},
|
|
834
|
+
{value:'list',label:'List'},
|
|
835
|
+
];
|
|
836
|
+
};
|
|
837
|
+
static get_field_value_value = (value_type,item,value_id) =>{
|
|
838
|
+
switch(value_type){
|
|
839
|
+
case Field_Logic.TYPE_FIELD_VALUE_TEXT:
|
|
840
|
+
case Field_Logic.TYPE_FIELD_VALUE_NOTE:
|
|
841
|
+
case Field_Logic.TYPE_FIELD_VALUE_IMAGE:
|
|
842
|
+
return !Str.check_is_null(item[Field_Logic.get_field_value_title(value_type,value_id)]) ? item[Field_Logic.get_field_value_title(value_type,value_id)] : "";
|
|
843
|
+
break;
|
|
844
|
+
case Field_Logic.TYPE_FIELD_VALUE_LIST:
|
|
845
|
+
let r_list = [];
|
|
846
|
+
for(let a=0;a<30;a++){
|
|
847
|
+
if(!Str.check_is_null(item[Field_Logic.get_field_value_title(value_type,value_id,a+1)])){
|
|
848
|
+
r_list.push(item[Field_Logic.get_field_value_title(value_type,value_id,a+1)]);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
return r_list;
|
|
852
|
+
break;
|
|
853
|
+
default:
|
|
854
|
+
return "";
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
static get_field_value_title = (value_type,value_id,row_id) =>{
|
|
858
|
+
let type_str = '';
|
|
859
|
+
switch(value_type){
|
|
860
|
+
case Field_Logic.TYPE_FIELD_VALUE_TEXT:
|
|
861
|
+
return 'text'+'_value_'+value_id;
|
|
862
|
+
break;
|
|
863
|
+
case Field_Logic.TYPE_FIELD_VALUE_NOTE:
|
|
864
|
+
return 'note'+'_value_'+value_id;
|
|
865
|
+
break;
|
|
866
|
+
case Field_Logic.TYPE_FIELD_VALUE_IMAGE:
|
|
867
|
+
return 'image'+'_value_'+value_id;
|
|
868
|
+
break;
|
|
869
|
+
case Field_Logic.TYPE_FIELD_VALUE_LIST:
|
|
870
|
+
return 'list'+'_value_'+value_id +'_row_'+row_id;
|
|
871
|
+
break;
|
|
872
|
+
default:
|
|
873
|
+
return "";
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
static get_test_cost(){
|
|
558
877
|
return String(Num.get_id(999)) + "." + String(Num.get_id(99));
|
|
559
878
|
}
|
|
560
879
|
static get_test_note = () => {
|
|
@@ -765,137 +1084,6 @@ class Field_Logic {
|
|
|
765
1084
|
}
|
|
766
1085
|
|
|
767
1086
|
}
|
|
768
|
-
class FieldType {
|
|
769
|
-
static APP_ID='app_id';
|
|
770
|
-
static ID='id';
|
|
771
|
-
static DATA_TYPE='data_type';
|
|
772
|
-
static DATE_CREATE='date_create';
|
|
773
|
-
static PARENT_ID='parent_id';
|
|
774
|
-
static PARENT_DATA_TYPE='parent_data_type';
|
|
775
|
-
static IMAGE_DATA='image_data';
|
|
776
|
-
static TOP_ID='top_id';
|
|
777
|
-
static TOP_DATA_TYPE='top_data_type';
|
|
778
|
-
static TITLE='title';
|
|
779
|
-
static TITLE_URL='title_url';
|
|
780
|
-
static SETTING_DELETE_PROTECTION='setting_delete_protection';
|
|
781
|
-
static SETTING_VISIBLE='setting_visible';
|
|
782
|
-
static SETTING_ORDER='setting_order';
|
|
783
|
-
static SOURCE='source';
|
|
784
|
-
static SOURCE_ID='source_id';
|
|
785
|
-
static SOURCE_DATA_TYPE='source_data_type';
|
|
786
|
-
static SOURCE_PARENT_ID='source_parent_id';
|
|
787
|
-
static SOURCE_PARENT_DATA_TYPE='source_parent_data_type';
|
|
788
|
-
static SOURCE_TOP_ID='source_top_id';
|
|
789
|
-
static SOURCE_TOP_DATA_TYPE='source_top_data_type';
|
|
790
|
-
static DATE_CREATE='date_create';
|
|
791
|
-
static DATE_SAVE='date_save';
|
|
792
|
-
|
|
793
|
-
static USER_ROLE_SUPER_ADMIN='super_admin';
|
|
794
|
-
static USER_ROLE_ADMIN='admin';
|
|
795
|
-
static USER_ROLE_MANAGER='manager';
|
|
796
|
-
static USER_ROLE_USER='user';
|
|
797
|
-
static USER_ROLE_GUEST='guest';
|
|
798
|
-
|
|
799
|
-
static STAT_VIEW_ADD_ID='1';
|
|
800
|
-
static STAT_LIKE_ADD_ID='2';
|
|
801
|
-
static STAT_FAVORITE_ADD_ID='3';
|
|
802
|
-
static STAT_CART_ADD_ID='4';
|
|
803
|
-
static STAT_ORDER_ADD_ID='5';
|
|
804
|
-
static STAT_REVIEW_ADD_ID='6';
|
|
805
|
-
|
|
806
|
-
/*
|
|
807
|
-
static KEY_ADMIN="key_admin";
|
|
808
|
-
static KEY_APP_ID="key_app_id";
|
|
809
|
-
static KEY_TEMPLATE="key_template";
|
|
810
|
-
static KEY_CART="key_cart";
|
|
811
|
-
static KEY_ORDER="key_order";
|
|
812
|
-
static KEY_USER="key_user";
|
|
813
|
-
*/
|
|
814
|
-
|
|
815
|
-
static ORDER_NUMBER="OR-";
|
|
816
|
-
static CART_NUMBER="CA-";
|
|
817
|
-
static TRANSACTION_ID="TR-";
|
|
818
|
-
|
|
819
|
-
static ORDER_PAYMENT_STATUS_OPEN="Open";
|
|
820
|
-
static ORDER_PAYMENT_STATUS_COMPLETE="Complete";
|
|
821
|
-
|
|
822
|
-
static PAYMENT_PLAN_TYPE_PENDING="Pending";
|
|
823
|
-
static PAYMENT_PLAN_TYPE_1="1 Payment";
|
|
824
|
-
static PAYMENT_PLAN_TYPE_2="2 Payments";
|
|
825
|
-
static PAYMENT_PLAN_TYPE_3="3 Payments";
|
|
826
|
-
static PAYMENT_PLAN_TYPE_4="4 Payments";
|
|
827
|
-
|
|
828
|
-
static PAYMENT_METHOD_STRIPE="Stripe";
|
|
829
|
-
static PAYMENT_METHOD_CASH="Cash";
|
|
830
|
-
static PAYMENT_METHOD_OTHER="Other";
|
|
831
|
-
static PAYMENT_METHOD_TEST="Test";
|
|
832
|
-
|
|
833
|
-
static APP_TYPE_MOBILE="Mobile";
|
|
834
|
-
static APP_TYPE_WEBSITE="Website";
|
|
835
|
-
static APP_TYPE_LANDING="Landing";
|
|
836
|
-
|
|
837
|
-
static DATA_SOURCE_CACHE="cache";
|
|
838
|
-
static DATA_SOURCE_DATABASE="database";
|
|
839
|
-
static DATA_SOURCE_SERVER="server";
|
|
840
|
-
static DATA_SOURCE_NOT_FOUND="not_found";
|
|
841
|
-
|
|
842
|
-
static ENV_TEST="test";
|
|
843
|
-
static ENV_STAGE="stage";
|
|
844
|
-
static ENV_PRODUCTION="production";
|
|
845
|
-
|
|
846
|
-
static ACTIVITY_TYPE_LOGIN="login";
|
|
847
|
-
static ACTIVITY_TYPE_REGISTER="register";
|
|
848
|
-
|
|
849
|
-
static ITEM_FIELD_VALUE_TYPE_TEXT="text";
|
|
850
|
-
static ITEM_FIELD_VALUE_TYPE_NOTE="note";
|
|
851
|
-
static ITEM_FIELD_VALUE_TYPE_IMAGE="image";
|
|
852
|
-
static ITEM_FIELD_VALUE_TYPE_LIST="list";
|
|
853
|
-
|
|
854
|
-
static IMAGE_SIZE_THUMB="thumb";
|
|
855
|
-
static IMAGE_SIZE_MID="mid";
|
|
856
|
-
static IMAGE_SIZE_LARGE="large";
|
|
857
|
-
static IMAGE_SIZE_SQUARE_THUMB="squre_thumb";
|
|
858
|
-
static IMAGE_SIZE_SQUARE_MID="squre_mid";
|
|
859
|
-
static IMAGE_SIZE_SQUARE_LARGE="squre_large";
|
|
860
|
-
}
|
|
861
|
-
class Social {
|
|
862
|
-
static FACEBOOK_URL="https://facebook.com/";
|
|
863
|
-
static TWITTER_URL="https://twitter.com/";
|
|
864
|
-
static INSTAGRAM_URL="https://instagram.com/";
|
|
865
|
-
static YOUTUBE_URL="https://youtube.com/";
|
|
866
|
-
static LINKEDIN_URL="https://linkedin.com/";
|
|
867
|
-
}
|
|
868
|
-
class PageType {
|
|
869
|
-
static HOME='home';
|
|
870
|
-
static ABOUT='about';
|
|
871
|
-
static CONTACT='contact';
|
|
872
|
-
static FAQ='faq';
|
|
873
|
-
|
|
874
|
-
static BLOG_POST='blog_post';
|
|
875
|
-
static BLOG_POST_DETAIL='blog_post_detail';
|
|
876
|
-
|
|
877
|
-
static EVENT='event';
|
|
878
|
-
static EVENT_DETAIL='event_detail';
|
|
879
|
-
|
|
880
|
-
static GALLERY='gallery';
|
|
881
|
-
static GALLERY_DETAIL='gallery_detail';
|
|
882
|
-
|
|
883
|
-
static SERVICE='service';
|
|
884
|
-
static SERVICE_DETAIL='service_detail';
|
|
885
|
-
|
|
886
|
-
static PRODUCT='product';
|
|
887
|
-
static PRODUCT_DETAIL='product_detail';
|
|
888
|
-
|
|
889
|
-
static PAGE_LIST = [PageType.HOME,PageType.ABOUT,PageType.CONTACT,PageType.FAQ,PageType.BLOG_POST,PageType.EVENT,PageType.GALLERY,PageType.SERVICE,PageType.PRODUCT];
|
|
890
|
-
|
|
891
|
-
static get_title = (data_type) => {
|
|
892
|
-
if(!data_type){
|
|
893
|
-
return "";
|
|
894
|
-
}else{
|
|
895
|
-
return String(Str.get_title(data_type.replaceAll('_',' '))).trim();
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
1087
|
class DataType {
|
|
900
1088
|
|
|
901
1089
|
static SECTION='section';
|
|
@@ -1010,9 +1198,17 @@ class Favorite_Logic {
|
|
|
1010
1198
|
user_id:user_id
|
|
1011
1199
|
});
|
|
1012
1200
|
}
|
|
1201
|
+
static url_search_favorite = (app_id,url,parent_data_type,param) => {
|
|
1202
|
+
let action_url="item/search_favorite/"+parent_data_type;
|
|
1203
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1204
|
+
};
|
|
1205
|
+
static url_post_favorite = (app_id,url,parent_data_type,parent_id,user_id,param) => {
|
|
1206
|
+
let action_url="item/post_favorite/"+parent_data_type+"/"+parent_id+"/"+user_id;
|
|
1207
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1208
|
+
};
|
|
1013
1209
|
static get_favorite_by_list = (favorite_list,item_list) =>{
|
|
1014
1210
|
favorite_list.forEach(item => {
|
|
1015
|
-
const item_match = item_list.find(item_find => item_find.id === item.
|
|
1211
|
+
const item_match = item_list.find(item_find => item_find.id === item.parent_id);
|
|
1016
1212
|
if (item_match) {
|
|
1017
1213
|
item_match.is_favorite = true;
|
|
1018
1214
|
}
|
|
@@ -1036,6 +1232,14 @@ class Favorite_Logic {
|
|
|
1036
1232
|
}
|
|
1037
1233
|
}
|
|
1038
1234
|
class Review_Logic {
|
|
1235
|
+
static url_post_review = (app_id,url,parent_data_type,parent_id,user_id,param) => {
|
|
1236
|
+
let action_url="item/post_review/"+parent_data_type+"/"+parent_id+"/"+user_id;
|
|
1237
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1238
|
+
};
|
|
1239
|
+
static url_search_review = (app_id,url,parent_data_type,page_current,page_size,param) => {
|
|
1240
|
+
let action_url="item/search_review/"+parent_data_type+"/"+page_current+"/"+page_size;
|
|
1241
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1242
|
+
};
|
|
1039
1243
|
static get_new = (parent_data_type,parent_id,user_id,title,comment,rating) =>{
|
|
1040
1244
|
return DataItem.get_new(DataType.REVIEW,0,{
|
|
1041
1245
|
parent_data_type:parent_data_type,
|
|
@@ -1131,270 +1335,19 @@ class DataItem {
|
|
|
1131
1335
|
return get_new_full_item_main(item,parent_item,top_item,option?option:{});
|
|
1132
1336
|
};
|
|
1133
1337
|
}
|
|
1134
|
-
class
|
|
1135
|
-
static
|
|
1136
|
-
let action_url="dashboard/user_home";
|
|
1137
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1138
|
-
};
|
|
1139
|
-
static app_home = (app_id,url,param) => {
|
|
1140
|
-
let action_url="dashboard/app_home";
|
|
1141
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1142
|
-
};
|
|
1143
|
-
}
|
|
1144
|
-
class Blog_Post_Url {
|
|
1145
|
-
static detail = (app_id,url,key,param) => {
|
|
1146
|
-
let action_url="blog_post/detail/"+key;
|
|
1147
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1148
|
-
};
|
|
1149
|
-
static home = (app_id,url,param) => {
|
|
1150
|
-
let action_url="blog_post";
|
|
1151
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1152
|
-
};
|
|
1153
|
-
static search = (app_id,url,param) => {
|
|
1154
|
-
let action_url="blog_post/search";
|
|
1155
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1156
|
-
};
|
|
1157
|
-
}
|
|
1158
|
-
class Product_Url {
|
|
1159
|
-
static detail = (app_id,url,key,param) => {
|
|
1160
|
-
let action_url="product/detail/"+key;
|
|
1161
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1162
|
-
};
|
|
1163
|
-
static home = (app_id,url,param) => {
|
|
1164
|
-
let action_url="product";
|
|
1165
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1166
|
-
};
|
|
1167
|
-
static search = (app_id,url,param) => {
|
|
1168
|
-
let action_url="product/search";
|
|
1169
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1170
|
-
};
|
|
1171
|
-
}
|
|
1172
|
-
class Event_Url {
|
|
1173
|
-
static detail = (app_id,url,key,param) => {
|
|
1174
|
-
let action_url="event/detail/"+key;
|
|
1175
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1176
|
-
};
|
|
1177
|
-
static home = (app_id,url,param) => {
|
|
1178
|
-
let action_url="event";
|
|
1179
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1180
|
-
};
|
|
1181
|
-
static search = (app_id,url,param) => {
|
|
1182
|
-
let action_url="event/search";
|
|
1183
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1184
|
-
};
|
|
1185
|
-
}
|
|
1186
|
-
class Service_Url {
|
|
1187
|
-
static detail = (app_id,url,key,param) => {
|
|
1188
|
-
let action_url="service/detail/"+key;
|
|
1189
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1190
|
-
};
|
|
1191
|
-
static home = (app_id,url,param) => {
|
|
1192
|
-
let action_url="service/search";
|
|
1193
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1194
|
-
};
|
|
1195
|
-
static search = (app_id,url,param) => {
|
|
1196
|
-
let action_url="service/search";
|
|
1197
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1198
|
-
};
|
|
1199
|
-
}
|
|
1200
|
-
class Gallery_Url {
|
|
1201
|
-
static detail = (app_id,url,key,param) => {
|
|
1202
|
-
let action_url="gallery/detail/"+key;
|
|
1203
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1204
|
-
};
|
|
1205
|
-
static home = (app_id,url,param) => {
|
|
1206
|
-
let action_url="gallery";
|
|
1207
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1208
|
-
};
|
|
1209
|
-
static search = (app_id,url,param) => {
|
|
1210
|
-
let action_url="gallery/search";
|
|
1211
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1212
|
-
};
|
|
1213
|
-
}
|
|
1214
|
-
class User_Url {
|
|
1215
|
-
static info = (app_id,url,param) => {
|
|
1216
|
-
let action_url="user/info/";
|
|
1217
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1218
|
-
};
|
|
1219
|
-
static register = (app_id,url,param) => {
|
|
1220
|
-
let action_url="user/register";
|
|
1221
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1222
|
-
};
|
|
1223
|
-
static login = (app_id,url,param) => {
|
|
1224
|
-
let action_url="user/login";
|
|
1225
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1226
|
-
};
|
|
1227
|
-
static logout = (app_id,url,param) => {
|
|
1228
|
-
let action_url="user/logout";
|
|
1229
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1230
|
-
};
|
|
1231
|
-
}
|
|
1232
|
-
class Image_Url {
|
|
1233
|
-
static post = (app_id,url,param) => {
|
|
1234
|
-
let action_url="main/image/post";
|
|
1235
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1236
|
-
};
|
|
1237
|
-
static post_cdn = (app_id,url,param) => {
|
|
1238
|
-
let action_url="main/image/post_cdn";
|
|
1239
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1240
|
-
};
|
|
1241
|
-
}
|
|
1242
|
-
class Item_Url {
|
|
1243
|
-
static delete_order = (app_id,url,id,param) => {
|
|
1244
|
-
let action_url="item/delete_order/"+id;
|
|
1245
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1246
|
-
};
|
|
1247
|
-
static delete_cart = (app_id,url,id,param) => {
|
|
1248
|
-
let action_url="item/delete_cart/"+id;
|
|
1249
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1250
|
-
};
|
|
1251
|
-
static get_cart = (app_id,url,cart_number,param) => {
|
|
1252
|
-
let action_url="item/get_cart/"+cart_number;
|
|
1253
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1254
|
-
};
|
|
1255
|
-
static get_template = (app_id,url,key,param) => {
|
|
1256
|
-
let action_url="item/get_template/"+key;
|
|
1257
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1258
|
-
};
|
|
1259
|
-
static get_content = (app_id,url,key,param) => {
|
|
1260
|
-
let action_url="item/get_content/"+key;
|
|
1261
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1262
|
-
};
|
|
1263
|
-
static get_custom_field = (app_id,url,data_type,key,param) => {
|
|
1264
|
-
let action_url="item/get_custom_field/"+data_type+"/"+key;
|
|
1265
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1266
|
-
};
|
|
1267
|
-
static get_order = (app_id,url,order_number,param) => {
|
|
1268
|
-
let action_url="item/get_order/"+order_number;
|
|
1269
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1270
|
-
};
|
|
1271
|
-
static post_cart = (app_id,url,parent_data_type,param) => {
|
|
1272
|
-
let action_url="item/post_cart/"+parent_data_type;
|
|
1273
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1274
|
-
};
|
|
1275
|
-
static post_cms = (app_id,url,data_type,id,param) => {
|
|
1276
|
-
let action_url = "item/post_cms/"+data_type+"/"+id;
|
|
1277
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1278
|
-
};
|
|
1279
|
-
static post_favorite = (app_id,url,parent_data_type,parent_id,user_id,param) => {
|
|
1280
|
-
let action_url="item/post_favorite/"+parent_data_type+"/"+parent_id+"/"+user_id;
|
|
1281
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1282
|
-
};
|
|
1283
|
-
static post_field_value = (app_id,url,item_data_type,parent_item_id,value_id,param) => {
|
|
1284
|
-
let action_url="item/post_field_value/"+item_data_type+"/"+parent_item_id;
|
|
1285
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1286
|
-
};
|
|
1287
|
-
static post_review = (app_id,url,parent_data_type,parent_id,user_id,param) => {
|
|
1288
|
-
let action_url="item/post_review/"+parent_data_type+"/"+parent_id+"/"+user_id;
|
|
1289
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1290
|
-
};
|
|
1291
|
-
static post_order = (app_id,url,param) => {
|
|
1292
|
-
let action_url="item/post_order";
|
|
1293
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1294
|
-
};
|
|
1295
|
-
static search_activity = (app_id,url,param) => {
|
|
1296
|
-
let action_url="item/search_activity";
|
|
1297
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1298
|
-
};
|
|
1299
|
-
static search_favorite = (app_id,url,parent_data_type,param) => {
|
|
1300
|
-
let action_url="item/search_favorite/"+parent_data_type;
|
|
1301
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1302
|
-
};
|
|
1303
|
-
static search_review = (app_id,url,parent_data_type,page_current,page_size,param) => {
|
|
1304
|
-
let action_url="item/search_review/"+parent_data_type+"/"+page_current+"/"+page_size;
|
|
1305
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1306
|
-
};
|
|
1307
|
-
static search_cart = (app_id,url,parent_data_type,param) => {
|
|
1308
|
-
let action_url="item/search_cart/"+parent_data_type;
|
|
1309
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1310
|
-
};
|
|
1311
|
-
static search_order = (app_id,url,parent_data_type,param) => {
|
|
1312
|
-
let action_url="item/search_order/"+parent_data_type;
|
|
1313
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1314
|
-
};
|
|
1315
|
-
}
|
|
1316
|
-
class Category_Url {
|
|
1317
|
-
static detail = (app_id,url,key,param) => {
|
|
1338
|
+
class Category_Logic {
|
|
1339
|
+
static url_detail = (app_id,url,key,param) => {
|
|
1318
1340
|
let action_url="category/detail/"+key;
|
|
1319
1341
|
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1320
1342
|
};
|
|
1321
|
-
static
|
|
1343
|
+
static url_home = (app_id,url,param) => {
|
|
1322
1344
|
let action_url="category";
|
|
1323
1345
|
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1324
1346
|
};
|
|
1325
|
-
static
|
|
1347
|
+
static url_search = (app_id,url,param) => {
|
|
1326
1348
|
let action_url="category/search";
|
|
1327
1349
|
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1328
1350
|
};
|
|
1329
|
-
}
|
|
1330
|
-
class Page_Url {
|
|
1331
|
-
static get = (app_id,url,title_url,param) => {
|
|
1332
|
-
let action_url="page/get/"+title_url;
|
|
1333
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1334
|
-
};
|
|
1335
|
-
static home = (app_id,url,param) => {
|
|
1336
|
-
let action_url="page/home";
|
|
1337
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1338
|
-
};
|
|
1339
|
-
static about = (app_id,url,param) => {
|
|
1340
|
-
let action_url="page/about";
|
|
1341
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1342
|
-
};
|
|
1343
|
-
static contact = (app_id,url,param) => {
|
|
1344
|
-
let action_url="page/contact";
|
|
1345
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1346
|
-
};
|
|
1347
|
-
static faq = (app_id,url,key,param) => {
|
|
1348
|
-
let action_url="page/faq/"+key;
|
|
1349
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1350
|
-
};
|
|
1351
|
-
}
|
|
1352
|
-
class Url{
|
|
1353
|
-
static copy = (app_id,url,data_type,id,param) => {
|
|
1354
|
-
let action_url = "main/crud/copy/"+data_type + "/" + id;
|
|
1355
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1356
|
-
};
|
|
1357
|
-
static delete = (app_id,url,data_type,id,param) => {
|
|
1358
|
-
let action_url = "main/crud/delete/"+data_type + "/" + id;
|
|
1359
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1360
|
-
};
|
|
1361
|
-
static delete_check_protection = (app_id,url,data_type,id,param) => {
|
|
1362
|
-
let action_url = "main/crud/delete_item_check_protection/"+data_type + "/" + id;
|
|
1363
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1364
|
-
};
|
|
1365
|
-
static delete_search = (app_id,url,data_type,param) => {
|
|
1366
|
-
let action_url = "main/crud/delete_list/"+data_type;
|
|
1367
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1368
|
-
};
|
|
1369
|
-
static url = (app_id,url,action_url,param) => {
|
|
1370
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1371
|
-
}
|
|
1372
|
-
static get = (app_id,url,data_type,key,param) => {
|
|
1373
|
-
let action_url= "main/crud/get/"+data_type + "/" + key;
|
|
1374
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1375
|
-
};
|
|
1376
|
-
static get_parent_top = (app_id,url,data_type,id,param) => {
|
|
1377
|
-
let action_url = "main/crud/get_parent_top/"+data_type+"/"+id;
|
|
1378
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1379
|
-
};
|
|
1380
|
-
static search = (app_id,url,data_type,param) => {
|
|
1381
|
-
let action_url = "main/crud/search/"+data_type;
|
|
1382
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1383
|
-
};
|
|
1384
|
-
static upload_file = (app_id,url,data_type,id,param) => {
|
|
1385
|
-
let action_url = "main/crud/post/"+data_type + "/" + id;
|
|
1386
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1387
|
-
};
|
|
1388
|
-
static post = (app_id,url,data_type,id,param) => {
|
|
1389
|
-
let action_url = "main/crud/post/"+data_type + "/" + id;
|
|
1390
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1391
|
-
};
|
|
1392
|
-
static post_list = (app_id,url,param) => {
|
|
1393
|
-
let action_url = "main/crud/post_list";
|
|
1394
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1395
|
-
};
|
|
1396
|
-
}
|
|
1397
|
-
class Category_Logic {
|
|
1398
1351
|
static get_test = (title,option) =>{
|
|
1399
1352
|
title = (title) ? title : "Category 1";
|
|
1400
1353
|
option = Field_Logic.get_option(DataType.CATEGORY,option?option:{});
|
|
@@ -1481,212 +1434,6 @@ class Category_Logic {
|
|
|
1481
1434
|
}
|
|
1482
1435
|
}
|
|
1483
1436
|
};
|
|
1484
|
-
class CMS {
|
|
1485
|
-
static Tab_Edit_Title_General = 'general';
|
|
1486
|
-
static Tab_Edit_Title_Image = 'image';
|
|
1487
|
-
static Tab_Edit_Title_List = 'list';
|
|
1488
|
-
static Tab_Edit_Title_Value = 'value';
|
|
1489
|
-
static Tab_Edit_Title_Setting = 'setting';
|
|
1490
|
-
static Tab_Edit_Title_Custom_Field = 'custom_field';
|
|
1491
|
-
static Tab_Edit_Title_Audio = 'audio';
|
|
1492
|
-
static Tab_Edit_Title_Video = 'video';
|
|
1493
|
-
static Tab_Edit_Title_Note = 'note';
|
|
1494
|
-
static get_new_query_item_by_item = (item) => {
|
|
1495
|
-
return {
|
|
1496
|
-
id: item.id ? item.id : 0,
|
|
1497
|
-
data_type:item.data_type ? item.data_type : DataType.BLANK,
|
|
1498
|
-
|
|
1499
|
-
parent_id:item.parent_id ? item.parent_id : 0,
|
|
1500
|
-
parent_data_type:item.parent_data_type ? item.parent_data_type : DataType.BLANK,
|
|
1501
|
-
|
|
1502
|
-
top_id:item.top_id ? item.top_id : 0,
|
|
1503
|
-
top_data_type:item.top_data_type ? item.top_data_type : DataType.BLANK
|
|
1504
|
-
}
|
|
1505
|
-
};
|
|
1506
|
-
static get_new_query_item = (item,parent_item,top_item) => {
|
|
1507
|
-
return {
|
|
1508
|
-
id: item.id ? item.id : 0,
|
|
1509
|
-
data_type:item.data_type ? item.data_type : DataType.BLANK,
|
|
1510
|
-
parent_id:parent_item.id ? parent_item.id : 0,
|
|
1511
|
-
parent_data_type:parent_item.data_type ? parent_item.data_type : DataType.BLANK,
|
|
1512
|
-
|
|
1513
|
-
top_id:top_item.id ? top_item.id : 0,
|
|
1514
|
-
top_data_type:top_item.data_type ? top_item.data_type : DataType.BLANK
|
|
1515
|
-
}
|
|
1516
|
-
};
|
|
1517
|
-
static get_query_itemz_by_query = (item) => {
|
|
1518
|
-
return [];
|
|
1519
|
-
};
|
|
1520
|
-
static get_query_item_by_page = (item) => {
|
|
1521
|
-
return { id:item.id ? item.id : 0, data_type:item.data_type ? item.data_type : DataType.BLANK };
|
|
1522
|
-
};
|
|
1523
|
-
static get_query_parent_item_by_page = (parent_item) => {
|
|
1524
|
-
return { id:parent_item.id ? parent_item.id : 0, data_type:parent_item.data_type ? parent_item.data_type : DataType.BLANK };
|
|
1525
|
-
};
|
|
1526
|
-
static get_query_top_item_by_page = (top_item) => {
|
|
1527
|
-
return { id:top_item.id ? top_item.id : 0, data_type:top_item.data_type ? top_item.data_type : DataType.BLANK };
|
|
1528
|
-
};
|
|
1529
|
-
static get_query_item_by_query = (query) => {
|
|
1530
|
-
return { id:query.get('id') ? query.get('id') : 0, data_type:query.get('data_type') ? query.get('data_type') : DataType.BLANK } ;
|
|
1531
|
-
};
|
|
1532
|
-
static get_query_parent_item_by_query = (query) => {
|
|
1533
|
-
return { id:query.get('parent_id') ? query.get('parent_id') : 0, data_type:query.get('parent_data_type') ? query.get('parent_data_type') : DataType.BLANK } ;
|
|
1534
|
-
};
|
|
1535
|
-
static get_query_top_item_by_query = (query) => {
|
|
1536
|
-
return { id:query.get('top_id') ? query.get('top_id') : 0, data_type:query.get('top_data_type') ? query.get('top_data_type') : DataType.BLANK } ;
|
|
1537
|
-
};
|
|
1538
|
-
static get_sub_page_title = (title) => {
|
|
1539
|
-
switch(title)
|
|
1540
|
-
{
|
|
1541
|
-
case CMS.Tab_Edit_Title_General:
|
|
1542
|
-
return 'General';
|
|
1543
|
-
break;
|
|
1544
|
-
case CMS.Tab_Edit_Title_Image:
|
|
1545
|
-
return 'Images';
|
|
1546
|
-
break;
|
|
1547
|
-
case CMS.Tab_Edit_Title_Value:
|
|
1548
|
-
return 'Values';
|
|
1549
|
-
break;
|
|
1550
|
-
case CMS.Tab_Edit_Title_Setting:
|
|
1551
|
-
return 'Settings';
|
|
1552
|
-
break;
|
|
1553
|
-
case CMS.Tab_Edit_Title_Note:
|
|
1554
|
-
return 'Note';
|
|
1555
|
-
break;
|
|
1556
|
-
case CMS.Tab_Edit_Title_Audio:
|
|
1557
|
-
return 'Audio';
|
|
1558
|
-
break;
|
|
1559
|
-
case CMS.Tab_Edit_Title_Video:
|
|
1560
|
-
return 'Video';
|
|
1561
|
-
case CMS.Tab_Edit_Title_Custom_Field:
|
|
1562
|
-
return 'Custom Fields';
|
|
1563
|
-
break;
|
|
1564
|
-
default:
|
|
1565
|
-
return 'N/A';
|
|
1566
|
-
break;
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
static get_page_url = (url,tab_title,item,parent_item,top_item,parms) => {
|
|
1570
|
-
let r_url="?tab_title="+tab_title
|
|
1571
|
-
+"&id="+item.id
|
|
1572
|
-
+"&data_type="
|
|
1573
|
-
+item.data_type
|
|
1574
|
-
+"&parent_id="
|
|
1575
|
-
+parent_item.id
|
|
1576
|
-
+"&parent_data_type="
|
|
1577
|
-
+parent_item.data_type
|
|
1578
|
-
+"&top_id="
|
|
1579
|
-
+top_item.id
|
|
1580
|
-
+"&top_data_type="
|
|
1581
|
-
+top_item.data_type;
|
|
1582
|
-
if(parms){
|
|
1583
|
-
r_url = r_url + parms;
|
|
1584
|
-
}
|
|
1585
|
-
return url+r_url;
|
|
1586
|
-
}
|
|
1587
|
-
}
|
|
1588
|
-
class Stock {
|
|
1589
|
-
static get_event_stock_list = () => {
|
|
1590
|
-
const r_list=
|
|
1591
|
-
[
|
|
1592
|
-
{ value: "0", label: "Sold Out" },
|
|
1593
|
-
{ value: "1", label: "Less Than 25 Tickets Remaining" },
|
|
1594
|
-
{ value: "2", label: "Tickets Are Availble" },
|
|
1595
|
-
{ value: "3", label: "Sold Out" },
|
|
1596
|
-
];
|
|
1597
|
-
return r_list;
|
|
1598
|
-
};
|
|
1599
|
-
static get_event_stock_by_value = (stock_val) => {
|
|
1600
|
-
switch(stock_val)
|
|
1601
|
-
{
|
|
1602
|
-
case "0":
|
|
1603
|
-
return 'Sold Out';
|
|
1604
|
-
break;
|
|
1605
|
-
case "1":
|
|
1606
|
-
return 'Less Than 25 Tickets Remaining';
|
|
1607
|
-
break;
|
|
1608
|
-
case "2":
|
|
1609
|
-
return 'Tickets Are Availble';
|
|
1610
|
-
break;
|
|
1611
|
-
case "3":
|
|
1612
|
-
return 'Sold Out';
|
|
1613
|
-
break;
|
|
1614
|
-
}
|
|
1615
|
-
};
|
|
1616
|
-
static get_service_stock_list = () => {
|
|
1617
|
-
const r_list=
|
|
1618
|
-
[
|
|
1619
|
-
{ value: "0", label: "No Sessions Availble" },
|
|
1620
|
-
{ value: "1", label: "Ready For Booking" },
|
|
1621
|
-
{ value: "2", label: "No Sessions Availble" }
|
|
1622
|
-
];
|
|
1623
|
-
return r_list;
|
|
1624
|
-
};
|
|
1625
|
-
static get_service_stock_by_value = (stock_val) => {
|
|
1626
|
-
switch(stock_val)
|
|
1627
|
-
{
|
|
1628
|
-
case "0":
|
|
1629
|
-
return 'No Sessions Availble';
|
|
1630
|
-
break;
|
|
1631
|
-
case "1":
|
|
1632
|
-
return 'Ready For Booking';
|
|
1633
|
-
break;
|
|
1634
|
-
case "2":
|
|
1635
|
-
return 'No Sessions Availble';
|
|
1636
|
-
break;
|
|
1637
|
-
}
|
|
1638
|
-
};
|
|
1639
|
-
static get_product_stock_list = () => {
|
|
1640
|
-
const r_list=
|
|
1641
|
-
[
|
|
1642
|
-
{ value: "0", label: "Out of Stock" },
|
|
1643
|
-
{ value: "1", label: "Only 1 Left" },
|
|
1644
|
-
{ value: "2", label: "Less Than 3 Left" },
|
|
1645
|
-
{ value: "3", label: "Availble" }
|
|
1646
|
-
];
|
|
1647
|
-
return r_list;
|
|
1648
|
-
};
|
|
1649
|
-
static get_product_stock_by_value = (stock_val) => {
|
|
1650
|
-
switch(stock_val)
|
|
1651
|
-
{
|
|
1652
|
-
case "0":
|
|
1653
|
-
return 'Out of Stock';
|
|
1654
|
-
break;
|
|
1655
|
-
case "1":
|
|
1656
|
-
return 'Only 1 Left';
|
|
1657
|
-
break;
|
|
1658
|
-
case "2":
|
|
1659
|
-
return 'Less Than 3 Left';
|
|
1660
|
-
break;
|
|
1661
|
-
case "3":
|
|
1662
|
-
return 'Availble';
|
|
1663
|
-
break;
|
|
1664
|
-
default:
|
|
1665
|
-
return 'Availble';
|
|
1666
|
-
break;
|
|
1667
|
-
}
|
|
1668
|
-
};
|
|
1669
|
-
}
|
|
1670
|
-
class Schedule {
|
|
1671
|
-
static get_start_date_time = (item) => {
|
|
1672
|
-
item.date = (item.date) ? item.date : new Date();
|
|
1673
|
-
item.time = (item.time) ? item.time : new Date();
|
|
1674
|
-
item.start_date = DateTime.get_full_date_by_date_time(item.date,item.time);
|
|
1675
|
-
item.start_time = DateTime.get_full_time_by_date_time(item.date,item.time);
|
|
1676
|
-
item.start_date_time = DateTime.get_full_date_time_by_date_time(item.date,item.time);
|
|
1677
|
-
return item;
|
|
1678
|
-
}
|
|
1679
|
-
static get_start_date_time_by_list = (list) => {
|
|
1680
|
-
for(let a=0;a<list.length;a++){
|
|
1681
|
-
list[a].date = (list[a].date) ? list[a].date : new Date();
|
|
1682
|
-
list[a].time = (list[a].time) ? list[a].time : new Date();
|
|
1683
|
-
list[a].start_date = DateTime.get_full_date_by_date_time(list[a].date,list[a].time);
|
|
1684
|
-
list[a].start_time = DateTime.get_full_time_by_date_time(list[a].date,list[a].time);
|
|
1685
|
-
list[a].start_date_time = DateTime.get_full_date_time_by_date_time(list[a].date,list[a].time);
|
|
1686
|
-
}
|
|
1687
|
-
return list;
|
|
1688
|
-
}
|
|
1689
|
-
};
|
|
1690
1437
|
class Storage {
|
|
1691
1438
|
static get = (window,key) => {
|
|
1692
1439
|
if(!Obj.check_is_empty(window)){
|
|
@@ -1722,6 +1469,24 @@ class Storage {
|
|
|
1722
1469
|
}
|
|
1723
1470
|
}
|
|
1724
1471
|
class User_Logic {
|
|
1472
|
+
static TYPE_ROLE_SUPER_ADMIN='super_admin';
|
|
1473
|
+
static TYPE_ROLE_ADMIN='admin';
|
|
1474
|
+
static TYPE_ROLE_MANAGER='manager';
|
|
1475
|
+
static TYPE_ROLE_USER='user';
|
|
1476
|
+
static TYPE_ROLE_GUEST='guest';
|
|
1477
|
+
|
|
1478
|
+
static url_register = (app_id,url,param) => {
|
|
1479
|
+
let action_url="user/register";
|
|
1480
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1481
|
+
};
|
|
1482
|
+
static url_login = (app_id,url,param) => {
|
|
1483
|
+
let action_url="user/login";
|
|
1484
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1485
|
+
};
|
|
1486
|
+
static url_logout = (app_id,url,param) => {
|
|
1487
|
+
let action_url="user/logout";
|
|
1488
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1489
|
+
};
|
|
1725
1490
|
static get_role_list(){
|
|
1726
1491
|
return [
|
|
1727
1492
|
{value:'admin',label:"Admin"},
|
|
@@ -1732,15 +1497,15 @@ class User_Logic {
|
|
|
1732
1497
|
};
|
|
1733
1498
|
static get_role_title(role_type){
|
|
1734
1499
|
switch(role_type){
|
|
1735
|
-
case
|
|
1500
|
+
case User_Logic.TYPE_ROLE_SUPER_ADMIN:
|
|
1736
1501
|
return "Super Admin";
|
|
1737
|
-
case
|
|
1502
|
+
case User_Logic.TYPE_ROLE_ADMIN:
|
|
1738
1503
|
return "Admin";
|
|
1739
|
-
case
|
|
1504
|
+
case User_Logic.TYPE_ROLE_MANAGER:
|
|
1740
1505
|
return "Manager";
|
|
1741
|
-
case
|
|
1506
|
+
case User_Logic.TYPE_ROLE_USER:
|
|
1742
1507
|
return "User";
|
|
1743
|
-
case
|
|
1508
|
+
case User_Logic.TYPE_ROLE_GUEST:
|
|
1744
1509
|
return "Guest";
|
|
1745
1510
|
}
|
|
1746
1511
|
}
|
|
@@ -1886,6 +1651,33 @@ class Sub_Item_Logic {
|
|
|
1886
1651
|
}
|
|
1887
1652
|
}
|
|
1888
1653
|
class App_Logic {
|
|
1654
|
+
static TYPE_APP_MOBILE="Mobile";
|
|
1655
|
+
static TYPE_APP_WEBSITE="Website";
|
|
1656
|
+
static TYPE_APP_LANDING="Landing";
|
|
1657
|
+
|
|
1658
|
+
static TYPE_DATA_SOURCE_CACHE="cache";
|
|
1659
|
+
static TYPE_DATA_SOURCE_DATABASE="database";
|
|
1660
|
+
static TYPE_DATA_SOURCE_SERVER="server";
|
|
1661
|
+
static TYPE_DATA_SOURCE_NOT_FOUND="not_found";
|
|
1662
|
+
|
|
1663
|
+
static TYPE_ENV_TEST="test";
|
|
1664
|
+
static TYPE_ENV_STAGE="stage";
|
|
1665
|
+
static TYPE_ENV_PRODUCTION="production";
|
|
1666
|
+
|
|
1667
|
+
static TYPE_SOCIAL_URL_FACEBOOK="https://facebook.com/";
|
|
1668
|
+
static TYPE_SOCIAL_URL_TWITTER="https://twitter.com/";
|
|
1669
|
+
static TYPE_SOCIAL_URL_INSTAGRAM="https://instagram.com/";
|
|
1670
|
+
static TYPE_SOCIAL_URL_YOUTUBE="https://youtube.com/";
|
|
1671
|
+
static TYPE_SOCIAL_URL_LINKEDIN="https://linkedin.com/";
|
|
1672
|
+
|
|
1673
|
+
static url_dashboard_user_home = (app_id,url,param) => {
|
|
1674
|
+
let action_url="dashboard/user_home";
|
|
1675
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1676
|
+
};
|
|
1677
|
+
static url_dashboard_app_home = (app_id,url,param) => {
|
|
1678
|
+
let action_url="dashboard/app_home";
|
|
1679
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1680
|
+
};
|
|
1889
1681
|
static get_new = (title,user_id,type,option) =>{
|
|
1890
1682
|
option = Field_Logic.get_option(DataType.APP,option?option:{});
|
|
1891
1683
|
let app = DataItem.get_new(DataType.APP,0);
|
|
@@ -1896,52 +1688,79 @@ class App_Logic {
|
|
|
1896
1688
|
}
|
|
1897
1689
|
}
|
|
1898
1690
|
class Image_Logic {
|
|
1899
|
-
static
|
|
1691
|
+
static TYPE_SIZE_THUMB="thumb";
|
|
1692
|
+
static TYPE_SIZE_MID="mid";
|
|
1693
|
+
static TYPE_SIZE_LARGE="large";
|
|
1694
|
+
static TYPE_SIZE_ORIGINAL="original";
|
|
1695
|
+
static TYPE_SIZE_SQUARE_THUMB="squre_thumb";
|
|
1696
|
+
static TYPE_SIZE_SQUARE_MID="squre_mid";
|
|
1697
|
+
static TYPE_SIZE_SQUARE_LARGE="squre_large";
|
|
1698
|
+
|
|
1699
|
+
static TYPE_RESIZE_NORMAL="normal";
|
|
1700
|
+
static TYPE_RESIZE_SQUARE="squre";
|
|
1701
|
+
static TYPE_RESIZE_NONE="none";
|
|
1702
|
+
|
|
1703
|
+
static url_post = (app_id,url,param) => {
|
|
1704
|
+
let action_url="main/image/post";
|
|
1705
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1706
|
+
};
|
|
1707
|
+
static url_post_cdn = (app_id,url,param) => {
|
|
1708
|
+
let action_url="main/image/post_cdn";
|
|
1709
|
+
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1710
|
+
};
|
|
1711
|
+
|
|
1712
|
+
static url = (host,image_filename,size,param) =>{
|
|
1900
1713
|
host = host ? host : "";
|
|
1901
1714
|
image_filename = image_filename ? image_filename : "";
|
|
1902
1715
|
size = size ? size : "";
|
|
1903
1716
|
param = param ? param : "";
|
|
1904
1717
|
return host+"/"+size + "_"+image_filename+param;
|
|
1905
1718
|
}
|
|
1906
|
-
static get_process_list = (upload_dir,image_filename) =>{
|
|
1719
|
+
static get_process_list = (upload_dir,image_filename) =>{
|
|
1907
1720
|
upload_dir = upload_dir ? upload_dir : "";
|
|
1908
1721
|
image_filename = image_filename ? image_filename : "";
|
|
1909
1722
|
return [
|
|
1910
1723
|
{
|
|
1911
|
-
image_filename:
|
|
1912
|
-
path_filename:upload_dir+"/"+
|
|
1724
|
+
image_filename:Image_Logic.TYPE_SIZE_ORIGINAL+"_"+image_filename,
|
|
1725
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_ORIGINAL+"_"+image_filename,
|
|
1726
|
+
size:0,
|
|
1727
|
+
type_resize:Image_Logic.TYPE_RESIZE_NONE,
|
|
1728
|
+
},
|
|
1729
|
+
{
|
|
1730
|
+
image_filename:Image_Logic.TYPE_SIZE_THUMB+"_"+image_filename,
|
|
1731
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_THUMB+"_"+image_filename,
|
|
1913
1732
|
size:250,
|
|
1914
|
-
|
|
1733
|
+
type_resize:Image_Logic.TYPE_RESIZE_NORMAL,
|
|
1915
1734
|
},
|
|
1916
1735
|
{
|
|
1917
|
-
image_filename:
|
|
1918
|
-
path_filename:upload_dir+"/"+
|
|
1736
|
+
image_filename:Image_Logic.TYPE_SIZE_MID+"_"+image_filename,
|
|
1737
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_MID+"_"+image_filename,
|
|
1919
1738
|
size:720,
|
|
1920
|
-
|
|
1739
|
+
type_resize:Image_Logic.TYPE_RESIZE_NORMAL,
|
|
1921
1740
|
},
|
|
1922
1741
|
{
|
|
1923
|
-
image_filename:
|
|
1924
|
-
path_filename:upload_dir+"/"+
|
|
1742
|
+
image_filename:Image_Logic.TYPE_SIZE_LARGE+"_"+image_filename,
|
|
1743
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_LARGE+"_"+image_filename,
|
|
1925
1744
|
size:1000,
|
|
1926
|
-
|
|
1745
|
+
type_resize:Image_Logic.TYPE_RESIZE_NORMAL,
|
|
1927
1746
|
},
|
|
1928
1747
|
{
|
|
1929
|
-
image_filename:
|
|
1930
|
-
path_filename:upload_dir+"/"+
|
|
1748
|
+
image_filename:Image_Logic.TYPE_SIZE_SQUARE_THUMB+"_"+image_filename,
|
|
1749
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_SQUARE_THUMB+"_"+image_filename,
|
|
1931
1750
|
size:250,
|
|
1932
|
-
|
|
1751
|
+
type_resize:Image_Logic.TYPE_RESIZE_SQUARE,
|
|
1933
1752
|
},
|
|
1934
1753
|
{
|
|
1935
|
-
image_filename:
|
|
1936
|
-
path_filename:upload_dir+"/"+
|
|
1754
|
+
image_filename:Image_Logic.TYPE_SIZE_SQUARE_MID+"_"+image_filename,
|
|
1755
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_SQUARE_MID+"_"+image_filename,
|
|
1937
1756
|
size:720,
|
|
1938
|
-
|
|
1757
|
+
type_resize:Image_Logic.TYPE_RESIZE_SQUARE,
|
|
1939
1758
|
},
|
|
1940
1759
|
{
|
|
1941
|
-
image_filename:
|
|
1942
|
-
path_filename:upload_dir+"/"+
|
|
1760
|
+
image_filename:Image_Logic.TYPE_SIZE_SQUARE_LARGE+"_"+image_filename,
|
|
1761
|
+
path_filename:upload_dir+"/"+Image_Logic.TYPE_SIZE_SQUARE_LARGE+"_"+image_filename,
|
|
1943
1762
|
size:1000,
|
|
1944
|
-
|
|
1763
|
+
type_resize:Image_Logic.TYPE_RESIZE_SQUARE,
|
|
1945
1764
|
},
|
|
1946
1765
|
];
|
|
1947
1766
|
}
|
|
@@ -1950,45 +1769,26 @@ module.exports = {
|
|
|
1950
1769
|
App_Logic,
|
|
1951
1770
|
Admin_Logic,
|
|
1952
1771
|
Blog_Post_Logic,
|
|
1953
|
-
Blog_Post_Url,
|
|
1954
|
-
Dashboard_Url,
|
|
1955
1772
|
Cart_Logic,
|
|
1956
1773
|
Category_Logic,
|
|
1957
|
-
Category_Url,
|
|
1958
1774
|
Content_Logic,
|
|
1959
|
-
CMS,
|
|
1960
1775
|
DataItem,
|
|
1961
1776
|
DataType,
|
|
1962
|
-
|
|
1777
|
+
Event_Logic,
|
|
1963
1778
|
Field_Logic,
|
|
1964
|
-
FieldType,
|
|
1965
1779
|
Favorite_Logic,
|
|
1966
1780
|
Gallery_Logic,
|
|
1967
|
-
Gallery_Url,
|
|
1968
1781
|
Item_Logic,
|
|
1969
1782
|
Image_Logic,
|
|
1970
|
-
Image_Url,
|
|
1971
|
-
Item_Url,
|
|
1972
|
-
Event_Logic,
|
|
1973
1783
|
Message,
|
|
1784
|
+
Order_Logic,
|
|
1974
1785
|
Page_Logic,
|
|
1975
|
-
Page_Url,
|
|
1976
|
-
Product_Url,
|
|
1977
|
-
PageType,
|
|
1978
1786
|
Product_Logic,
|
|
1979
1787
|
Review_Logic,
|
|
1980
|
-
Order_Logic,
|
|
1981
1788
|
Service_Logic,
|
|
1982
|
-
Service_Url,
|
|
1983
|
-
Social,
|
|
1984
1789
|
Sub_Item_Logic,
|
|
1985
1790
|
Stat_Logic,
|
|
1986
1791
|
Storage,
|
|
1987
|
-
Schedule,
|
|
1988
|
-
Stock,
|
|
1989
1792
|
Template_Logic,
|
|
1990
|
-
TemplateType,
|
|
1991
|
-
Url,
|
|
1992
|
-
User_Url,
|
|
1993
1793
|
User_Logic,
|
|
1994
1794
|
};
|