@subiz/widget-v4 4.0.70 → 4.0.73
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/assets/less/order.less +1 -6
- package/compiled_src/order/order.js +13 -11
- package/compiled_src/store/store.js +16 -21
- package/dist/132.js +13 -11
- package/dist/178.js +1 -1
- package/dist/{180455656b6.132.js → 1806f67a77b.132.js} +1 -1
- package/dist/{180455656b6.178.js → 1806f67a77b.178.js} +1 -1
- package/dist/{180455656b6.213.js → 1806f67a77b.213.js} +0 -0
- package/dist/{180455656b6.335.js → 1806f67a77b.335.js} +0 -0
- package/dist/{180455656b6.362.js → 1806f67a77b.362.js} +1 -1
- package/dist/{180455656b6.441.js → 1806f67a77b.441.js} +0 -0
- package/dist/{180455656b6.605.js → 1806f67a77b.605.js} +0 -0
- package/dist/{180455656b6.678.js → 1806f67a77b.678.js} +0 -0
- package/dist/{180455656b6.782.js → 1806f67a77b.782.js} +1 -1
- package/dist/{180455656b6.app.js → 1806f67a77b.app.js} +1 -1
- package/dist/{180455656b6.index.html → 1806f67a77b.index.html} +1 -1
- package/dist/{180455656b6.library.html → 1806f67a77b.library.html} +1 -1
- package/dist/{180455656b6.library.js → 1806f67a77b.library.js} +1 -1
- package/dist/{180455656b6.preview.html → 1806f67a77b.preview.html} +1 -1
- package/dist/{180455656b6.preview.js → 1806f67a77b.preview.js} +1 -1
- package/dist/{180455656b6.screenshoot.js → 1806f67a77b.screenshoot.js} +1 -1
- package/dist/362.js +1 -1
- package/dist/782.js +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +11 -19
- package/package.json +3 -2
- package/src/order/order.js +18 -22
- package/src/store/store.js +9 -22
package/src/order/order.js
CHANGED
|
@@ -21,6 +21,7 @@ export default class Order extends common.Com {
|
|
|
21
21
|
loading: true,
|
|
22
22
|
order: {},
|
|
23
23
|
err: {},
|
|
24
|
+
shipping_address: 'new',
|
|
24
25
|
|
|
25
26
|
selectedProvince: null,
|
|
26
27
|
selectedDistrict: null,
|
|
@@ -144,7 +145,7 @@ export default class Order extends common.Com {
|
|
|
144
145
|
renderDesktopPaymentMethod(order) {
|
|
145
146
|
return null
|
|
146
147
|
let editmode = false
|
|
147
|
-
if (!order.status || order.status == '
|
|
148
|
+
if (!order.status || order.status == 'open') {
|
|
148
149
|
editmode = !order.user_confirmation
|
|
149
150
|
}
|
|
150
151
|
|
|
@@ -246,7 +247,7 @@ export default class Order extends common.Com {
|
|
|
246
247
|
|
|
247
248
|
renderDesktopShipping(order) {
|
|
248
249
|
let editmode = false
|
|
249
|
-
if (!order.status || order.status == '
|
|
250
|
+
if (!order.status || order.status == 'open') {
|
|
250
251
|
editmode = !order.user_confirmation
|
|
251
252
|
}
|
|
252
253
|
|
|
@@ -566,7 +567,7 @@ export default class Order extends common.Com {
|
|
|
566
567
|
)
|
|
567
568
|
|
|
568
569
|
let editmode = false
|
|
569
|
-
if (!order.status || order.status == '
|
|
570
|
+
if (!order.status || order.status == 'open') {
|
|
570
571
|
editmode = !order.user_confirmation
|
|
571
572
|
}
|
|
572
573
|
let $note = null
|
|
@@ -611,7 +612,7 @@ export default class Order extends common.Com {
|
|
|
611
612
|
}
|
|
612
613
|
|
|
613
614
|
renderStatusBadge(order) {
|
|
614
|
-
let status = order.status || '
|
|
615
|
+
let status = order.status || 'open'
|
|
615
616
|
return (
|
|
616
617
|
<div style='float: right !important;' class={'order_status order_status__' + status}>
|
|
617
618
|
{status}
|
|
@@ -620,7 +621,7 @@ export default class Order extends common.Com {
|
|
|
620
621
|
}
|
|
621
622
|
|
|
622
623
|
renderShippingInfo(order) {
|
|
623
|
-
if (order.status != '
|
|
624
|
+
if (order.status != 'open' || order.user_confirmation) {
|
|
624
625
|
// read only
|
|
625
626
|
}
|
|
626
627
|
|
|
@@ -752,7 +753,7 @@ export default class Order extends common.Com {
|
|
|
752
753
|
renderDesktopProducts(order) {
|
|
753
754
|
let $products = null
|
|
754
755
|
let editmode = false
|
|
755
|
-
if (!order.status || order.status == '
|
|
756
|
+
if (!order.status || order.status == 'open') {
|
|
756
757
|
editmode = !order.user_confirmation
|
|
757
758
|
}
|
|
758
759
|
|
|
@@ -868,21 +869,16 @@ export default class Order extends common.Com {
|
|
|
868
869
|
</div>
|
|
869
870
|
)
|
|
870
871
|
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
if (order.user_confirmation || order.status != 'new') {
|
|
872
|
+
if (order.user_confirmation || order.status != 'open') {
|
|
875
873
|
$status = null
|
|
876
874
|
if (this.props.cid)
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
875
|
+
$close = (
|
|
876
|
+
<div class='order_btn order__btn__light mt-3' onClick={this.close}>
|
|
877
|
+
{this.props.t('close')}
|
|
878
|
+
</div>
|
|
879
|
+
)
|
|
882
880
|
}
|
|
883
881
|
|
|
884
|
-
|
|
885
|
-
|
|
886
882
|
return (
|
|
887
883
|
<div class='order' style='height: 100% !important'>
|
|
888
884
|
<div class='order--content'>
|
|
@@ -912,7 +908,7 @@ export default class Order extends common.Com {
|
|
|
912
908
|
renderActions(order) {
|
|
913
909
|
let $actions = null
|
|
914
910
|
let editmode = false
|
|
915
|
-
if (!order.status || order.status == '
|
|
911
|
+
if (!order.status || order.status == 'open') {
|
|
916
912
|
editmode = !order.user_confirmation
|
|
917
913
|
}
|
|
918
914
|
|
|
@@ -1132,15 +1128,15 @@ export default class Order extends common.Com {
|
|
|
1132
1128
|
|
|
1133
1129
|
onCancel = () => {
|
|
1134
1130
|
if (this.props.onResponse) this.props.onResponse('rejected')
|
|
1135
|
-
this.close()
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
close = () => {
|
|
1139
1131
|
if (this.props.cid && !this.state.order.user_confirmation) {
|
|
1140
1132
|
let order = sb.cloneDeep(this.state.order)
|
|
1141
1133
|
order.user_confirmation = 'rejected'
|
|
1142
1134
|
this.props.store.updateOrder(order)
|
|
1143
1135
|
}
|
|
1136
|
+
this.close()
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
close = () => {
|
|
1144
1140
|
if (this.props.onClose) this.props.onClose()
|
|
1145
1141
|
}
|
|
1146
1142
|
}
|
package/src/store/store.js
CHANGED
|
@@ -11,16 +11,6 @@ cookie.expiresMultiplier = 60 * 60 * 24 // days
|
|
|
11
11
|
cookie.defaults.expires = 3650 // 10 year
|
|
12
12
|
|
|
13
13
|
const MAX_CONVO = 20
|
|
14
|
-
let ga_client_id = ''
|
|
15
|
-
|
|
16
|
-
setTimeout(() => {
|
|
17
|
-
if (window.gtag) {
|
|
18
|
-
window.gtag('get', 'UA-XXXXXXXX-Y', 'client_id', (clientid) => {
|
|
19
|
-
ga_client_id = clientid
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
}, 100)
|
|
23
|
-
|
|
24
14
|
const page_loaded = sb.Date.now()
|
|
25
15
|
|
|
26
16
|
// available localstorage key mask, user, session, hasManuallyClosed, isopen, close_preview_at, lastview, bot_run_logs, plugin_run_logs
|
|
@@ -1100,11 +1090,10 @@ const inmemCookie = {
|
|
|
1100
1090
|
// getGaClientId returns ID of the client in Google Analytics
|
|
1101
1091
|
// return empty string if GA is not installed
|
|
1102
1092
|
function getGaClientId() {
|
|
1103
|
-
if (ga_client_id) return ga_client_id
|
|
1104
|
-
if (!hasGA()) return ga_client_id
|
|
1105
|
-
|
|
1106
1093
|
if (!window.ga) return
|
|
1094
|
+
if (!window.ga.getAll) return
|
|
1107
1095
|
var allTrackers = window.ga.getAll() || []
|
|
1096
|
+
let ga_client_id = ''
|
|
1108
1097
|
allTrackers.forEach(function (tracker) {
|
|
1109
1098
|
ga_client_id = tracker.get('clientId')
|
|
1110
1099
|
})
|
|
@@ -1112,16 +1101,14 @@ function getGaClientId() {
|
|
|
1112
1101
|
return ga_client_id
|
|
1113
1102
|
}
|
|
1114
1103
|
|
|
1115
|
-
// hasGA tells if the website is using Google Analytics or not
|
|
1116
|
-
const hasGA = () => !!((window.ga && window.ga.getAll) || window.gtag)
|
|
1117
|
-
|
|
1118
1104
|
// getGaTrackingIds returns all tracking ids in Google Analytics
|
|
1119
1105
|
// return empty array if GA is not installed
|
|
1120
1106
|
function getGaTrackingIds() {
|
|
1121
1107
|
var trackingIds = []
|
|
1122
|
-
if (!
|
|
1108
|
+
if (!(window.ga && window.ga.getAll)) return trackingIds
|
|
1123
1109
|
|
|
1124
1110
|
if (!window.ga) return []
|
|
1111
|
+
if (!window.ga.getAll) return []
|
|
1125
1112
|
const allTrackers = window.ga.getAll() || []
|
|
1126
1113
|
allTrackers.forEach(function (tracker) {
|
|
1127
1114
|
var trackingId = tracker.get('trackingId')
|
|
@@ -1138,16 +1125,16 @@ function sendToFBPixel(category, action, label) {
|
|
|
1138
1125
|
}
|
|
1139
1126
|
|
|
1140
1127
|
function sendToGA(category, action, label) {
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
if (window.gtag) window.gtag('event', category, {Action: action, Label: label})
|
|
1144
|
-
|
|
1145
|
-
if (window.ga) {
|
|
1128
|
+
console.log('SENT.', category, action, label)
|
|
1129
|
+
if (window.ga && window.ga.getAll) {
|
|
1146
1130
|
const allTrackers = window.ga.getAll() || []
|
|
1147
1131
|
allTrackers.forEach(function (tracker) {
|
|
1148
1132
|
const name = tracker.get('name')
|
|
1149
1133
|
window.ga(name + '.send', 'event', category, action, label)
|
|
1150
1134
|
})
|
|
1135
|
+
} else {
|
|
1136
|
+
// only send gtag when ga is not available
|
|
1137
|
+
if (window.gtag) window.gtag('event', category, {Action: action, Label: label})
|
|
1151
1138
|
}
|
|
1152
1139
|
}
|
|
1153
1140
|
|