@ecomplus/widget-martan 1.1.22 → 1.2.0

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.
Files changed (97) hide show
  1. package/.version +0 -0
  2. package/CHANGELOG.md +14 -0
  3. package/cms.config.js +78 -83
  4. package/dist/public/widget-martan.0.min.js +62 -0
  5. package/dist/public/widget-martan.0.min.js.map +1 -0
  6. package/dist/public/widget-martan.1.min.js.map +1 -1
  7. package/dist/public/widget-martan.2.min.js +1 -1
  8. package/dist/public/widget-martan.2.min.js.map +1 -1
  9. package/dist/public/widget-martan.3.min.js +1 -1
  10. package/dist/public/widget-martan.3.min.js.map +1 -1
  11. package/dist/public/widget-martan.4.min.js +1 -1
  12. package/dist/public/widget-martan.4.min.js.map +1 -1
  13. package/dist/public/widget-martan.5.min.js +1 -1
  14. package/dist/public/widget-martan.5.min.js.map +1 -1
  15. package/dist/public/widget-martan.6.min.js +2 -0
  16. package/dist/public/widget-martan.6.min.js.map +1 -0
  17. package/dist/public/widget-martan.7.min.js +2 -0
  18. package/dist/public/widget-martan.7.min.js.map +1 -0
  19. package/dist/public/widget-martan.8.min.js +2 -0
  20. package/dist/public/widget-martan.8.min.js.map +1 -0
  21. package/dist/public/widget-martan.9.min.js +2 -0
  22. package/dist/public/widget-martan.9.min.js.map +1 -0
  23. package/dist/public/widget-martan.var.min.js +3 -3
  24. package/dist/public/widget-martan.var.min.js.map +1 -1
  25. package/dist/widget-martan.0.min.js +62 -0
  26. package/dist/widget-martan.0.min.js.map +1 -0
  27. package/dist/widget-martan.1.min.js.map +1 -1
  28. package/dist/widget-martan.2.min.js +1 -1
  29. package/dist/widget-martan.2.min.js.map +1 -1
  30. package/dist/widget-martan.3.min.js +1 -1
  31. package/dist/widget-martan.3.min.js.map +1 -1
  32. package/dist/widget-martan.4.min.js +1 -1
  33. package/dist/widget-martan.4.min.js.map +1 -1
  34. package/dist/widget-martan.5.min.js +1 -1
  35. package/dist/widget-martan.5.min.js.map +1 -1
  36. package/dist/widget-martan.6.min.js +2 -0
  37. package/dist/widget-martan.6.min.js.map +1 -0
  38. package/dist/widget-martan.7.min.js +2 -0
  39. package/dist/widget-martan.7.min.js.map +1 -0
  40. package/dist/widget-martan.8.min.js +2 -0
  41. package/dist/widget-martan.8.min.js.map +1 -0
  42. package/dist/widget-martan.9.min.js +2 -0
  43. package/dist/widget-martan.9.min.js.map +1 -0
  44. package/dist/widget-martan.min.js +3 -3
  45. package/dist/widget-martan.min.js.map +1 -1
  46. package/package.json +2 -2
  47. package/src/append/product-block.ejs +5 -1
  48. package/src/append/product-card-slots.ejs +1 -1
  49. package/src/append/product-slots.ejs +1 -9
  50. package/src/index.js +17 -12
  51. package/src/utils/configProps.js +29 -0
  52. package/src/utils/lighten-color.js +20 -0
  53. package/src/utils/widget-initializer.js +60 -0
  54. package/src/widgets/questions/Questions.vue +436 -0
  55. package/src/widgets/questions/index.js +10 -0
  56. package/src/widgets/ratings/Rating.vue +223 -0
  57. package/src/widgets/ratings/index.js +232 -0
  58. package/src/widgets/reviews/Reviews.vue +317 -288
  59. package/src/widgets/reviews/components/Quickview.vue +390 -0
  60. package/src/widgets/reviews/components/Rating.vue +106 -0
  61. package/src/widgets/reviews/components/RatingBreakdown.vue +171 -0
  62. package/src/widgets/reviews/components/RatingHistogram.vue +306 -0
  63. package/src/widgets/reviews/components/RatingSummary.vue +226 -0
  64. package/src/widgets/reviews/components/RatingSummaryG.vue +104 -0
  65. package/src/widgets/reviews/components/ReviewCard.vue +223 -0
  66. package/src/widgets/reviews/{ReviewReply.vue → components/ReviewReply.vue} +42 -1
  67. package/src/widgets/reviews/{Score.vue → components/Score.vue} +3 -4
  68. package/src/widgets/reviews/{Sort.vue → components/Sort.vue} +1 -1
  69. package/src/widgets/reviews/components/SortDropdown.vue +184 -0
  70. package/src/widgets/reviews/components/VerifiedPurchase.vue +121 -0
  71. package/src/widgets/reviews/headers/Center.vue +248 -0
  72. package/src/widgets/reviews/headers/Compact.vue +225 -0
  73. package/src/widgets/reviews/headers/Histogram.vue +224 -0
  74. package/src/widgets/reviews/headers/Padrao.vue +113 -0
  75. package/src/widgets/reviews/headers/Summary.vue +217 -0
  76. package/src/widgets/reviews/index.js +2 -48
  77. package/src/append/body.ejs +0 -79
  78. package/src/append/head.ejs +0 -5
  79. package/src/append/stamps.ejs +0 -3
  80. package/src/widgets/reviews/AuthorAndRating.vue +0 -30
  81. package/src/widgets/reviews/AverageScore.vue +0 -160
  82. package/src/widgets/reviews/AverageTotal.vue +0 -35
  83. package/src/widgets/reviews/CardReview.vue +0 -87
  84. package/src/widgets/reviews/GridView.vue +0 -113
  85. package/src/widgets/reviews/HeaderExpanded.vue +0 -84
  86. package/src/widgets/reviews/HeaderMinimal.vue +0 -110
  87. package/src/widgets/reviews/ListView.vue +0 -47
  88. package/src/widgets/reviews/Quickview.vue +0 -397
  89. package/src/widgets/reviews/ReviewBody.vue +0 -39
  90. package/src/widgets/reviews/ThumbsPictures.vue +0 -135
  91. package/src/widgets/reviews/Total.vue +0 -79
  92. package/src/widgets/reviews/VerifiedPurchase.vue +0 -110
  93. package/src/widgets/reviews/isRecommended.vue +0 -44
  94. package/src/widgets/snippets/Rating.vue +0 -71
  95. package/src/widgets/snippets/Snippets.vue +0 -311
  96. package/src/widgets/snippets/index.js +0 -45
  97. /package/src/widgets/reviews/{VideoPlayer.vue → components/VideoPlayer.vue} +0 -0
@@ -0,0 +1,223 @@
1
+ x<template>
2
+ <div class="review-card" v-if="review">
3
+ <div class="review-card__header">
4
+ <div class="review-card__author">
5
+ <span class="review-card__name">{{ review.display_name }}</span>
6
+ <span class="review-card__date" :title="timeAgo(review.created_at)">{{
7
+ formatDate(review.created_at)
8
+ }}</span>
9
+
10
+ <VerifiedPurchase v-if="review.verified_purchase" />
11
+ </div>
12
+ <div class="review-card__rating">
13
+ <div v-for="star in 5" :key="star" class="review-card__star">
14
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24"
15
+ :stroke="star <= review.rating ? starColor : '#E6E3E3'" :fill="star <= review.rating ? starColor : 'none'"
16
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
17
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
18
+ <path
19
+ d="M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z" />
20
+ </svg>
21
+ </div>
22
+ </div>
23
+ </div>
24
+
25
+ <div class="review-card__content">
26
+ <p class="review-card__title" v-if="review.title">
27
+ {{ review.title }}
28
+ </p>
29
+
30
+ <p class="review-card__text" v-if="review.body">
31
+ {{ showFullText ? review.body : truncatedText }}
32
+ <span v-if="review.body.length > 200" class="review-card__text-toggle" @click="showFullText = !showFullText">
33
+ {{ showFullText ? "Ver menos" : "Ver mais" }}
34
+ </span>
35
+ </p>
36
+ <p class="review-card__text-empty" v-else>(Avaliação sem comentário)</p>
37
+
38
+ <div v-if="review.pictures && review.pictures.length" class="review-card__images">
39
+ <img v-for="(image, index) in review.pictures" :key="index" data-loaded="false" :data-src="image.thumb"
40
+ :alt="`Review image ${index + 1}`" @click="$emit('openQuickview', { review, imageIndex: index })"
41
+ v-show="image.thumb" class="mt-lazy-image" />
42
+ </div>
43
+
44
+ <div class="review-card__recommendation">
45
+ <i class="i-happy-line"></i>
46
+ <span class="text-sm">Eu comprei e recomendo esse produto</span>
47
+ </div>
48
+ </div>
49
+
50
+ <div class="review-card-reply" v-if="review.reply">
51
+ <ReviewReply :reply="review.reply" />
52
+ </div>
53
+ </div>
54
+ </template>
55
+
56
+ <script>
57
+ import { timeAgo } from "../../../utils/time-ago";
58
+ import ReviewReply from "./ReviewReply.vue";
59
+ import VerifiedPurchase from "./VerifiedPurchase.vue";
60
+
61
+ export default {
62
+ name: "ReviewCard",
63
+
64
+ components: {
65
+ ReviewReply,
66
+ VerifiedPurchase,
67
+ },
68
+
69
+ data() {
70
+ return {
71
+ showFullText: false,
72
+ };
73
+ },
74
+
75
+ props: {
76
+ review: {
77
+ type: Object,
78
+ required: true,
79
+ },
80
+ starColor: {
81
+ type: String,
82
+ default: "#212529",
83
+ },
84
+ truncateBody: {
85
+ type: Boolean,
86
+ default: true,
87
+ },
88
+ },
89
+
90
+ methods: {
91
+ timeAgo,
92
+ formatDate(date) {
93
+ return new Date(date).toLocaleDateString("pt-BR", {
94
+ timeZone: "America/Sao_Paulo",
95
+ });
96
+ },
97
+ },
98
+
99
+ computed: {
100
+ truncatedText() {
101
+ return this.review.body.substring(0, 200) + "...";
102
+ },
103
+ },
104
+
105
+ mounted() {
106
+ const images = Array.from(document.querySelectorAll(".mt-lazy-image"));
107
+ const imageObserver = new IntersectionObserver((entries, observer) => {
108
+ entries.forEach((entry) => {
109
+ if (entry.isIntersecting && entry.target.dataset.loaded === "false") {
110
+ const image = entry.target;
111
+ image.dataset.loaded = true;
112
+ image.src = image.dataset.src;
113
+ imageObserver.unobserve(image);
114
+ }
115
+ });
116
+ });
117
+
118
+ images.forEach((img) => imageObserver.observe(img));
119
+ this.showFullText = !this.truncateBody;
120
+ },
121
+ };
122
+ </script>
123
+
124
+ <style lang="scss" scoped>
125
+ .review-card {
126
+ background-color: #F3F3F3;
127
+ border-radius: 8px;
128
+ padding: 16px;
129
+ width: 100%;
130
+ height: max-content;
131
+
132
+ &__header {
133
+ display: flex;
134
+ justify-content: space-between;
135
+ align-items: flex-start;
136
+ margin-bottom: 1rem;
137
+ }
138
+
139
+ &__author {
140
+ display: flex;
141
+ flex-direction: column;
142
+ }
143
+
144
+ &__name {
145
+ font-weight: bold;
146
+ margin-bottom: 0.25rem;
147
+ }
148
+
149
+ &__date {
150
+ font-size: 70%;
151
+ color: rgb(113 113 122 / 1);
152
+ }
153
+
154
+ &__rating {
155
+ display: flex;
156
+ gap: 0.25rem;
157
+ }
158
+
159
+ &__content {
160
+ font-size: 0.9375rem;
161
+ }
162
+
163
+ &__text {
164
+ margin-bottom: 1rem;
165
+ line-height: 1.5;
166
+ }
167
+
168
+ &__text-toggle {
169
+ cursor: pointer;
170
+ color: #047857;
171
+ font-size: 0.875rem;
172
+ line-height: 1.25rem;
173
+ }
174
+
175
+ &__images {
176
+ display: flex;
177
+ gap: 0.5rem;
178
+ flex-wrap: wrap;
179
+
180
+ img {
181
+ width: 80px;
182
+ height: 80px;
183
+ object-fit: cover;
184
+ border-radius: 0.25rem;
185
+ cursor: pointer;
186
+ }
187
+ }
188
+
189
+ &__text-empty {
190
+ font-size: 70%;
191
+ color: rgb(113 113 122 / 1);
192
+ }
193
+
194
+ &__title {
195
+ font-size: 1.125rem;
196
+ line-height: 1.75rem;
197
+ font-weight: 500;
198
+ margin-bottom: 0.5rem;
199
+ }
200
+
201
+ &__recommendation {
202
+ margin-top: 1rem;
203
+ color: #047857;
204
+ font-size: 0.875rem;
205
+ line-height: 1.25rem;
206
+ }
207
+ }
208
+
209
+ .i-happy-line {
210
+ --un-icon: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' margin-bottom='0.22rem' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z'/%3E%3Cpath fill='currentColor' d='M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12m6.5-2c-.195 0-.444.124-.606.448a1 1 0 0 1-1.788-.896C6.542 8.68 7.413 8 8.5 8s1.957.68 2.394 1.552a1 1 0 0 1-1.788.896C8.944 10.124 8.696 10 8.5 10m7 0c-.195 0-.444.124-.606.448a1 1 0 1 1-1.788-.896C13.543 8.68 14.413 8 15.5 8s1.957.68 2.394 1.552a1 1 0 0 1-1.788.896c-.162-.324-.41-.448-.606-.448m-6.896 4.338a1 1 0 0 1 1.412-.088c.53.468 1.223.75 1.984.75s1.455-.282 1.984-.75a1 1 0 1 1 1.324 1.5A4.98 4.98 0 0 1 12 17a4.98 4.98 0 0 1-3.308-1.25a1 1 0 0 1-.088-1.412'/%3E%3C/g%3E%3C/svg%3E");
211
+ -webkit-mask: var(--un-icon) no-repeat;
212
+ mask: var(--un-icon) no-repeat;
213
+ -webkit-mask-size: 100% 100%;
214
+ mask-size: 100% 100%;
215
+ background-color: #047857;
216
+ color: inherit;
217
+ display: inline-block;
218
+ vertical-align: middle;
219
+ margin-bottom: 0.22rem;
220
+ width: 1em;
221
+ height: 1em;
222
+ }
223
+ </style>
@@ -33,7 +33,7 @@
33
33
 
34
34
  <script>
35
35
  import { formatDate } from "@ecomplus/utils";
36
- import { timeAgo } from "../../utils/time-ago";
36
+ import { timeAgo } from "../../../utils/time-ago";
37
37
 
38
38
  export default {
39
39
 
@@ -55,3 +55,44 @@ export default {
55
55
  }
56
56
  };
57
57
  </script>
58
+ <style lang="css" scoped>
59
+ .mt-reply {
60
+ margin: 10px 0 0;
61
+ display: flex;
62
+ flex-direction: column;
63
+ background: var(--white);
64
+ padding: 20px;
65
+ border-radius: 12px;
66
+ font-size: 15px;
67
+ line-height: 1.6;
68
+ gap: 10px;
69
+ border-right: 1px solid #1717171a;
70
+ border-left: 3px solid rgb(230, 230, 230);
71
+ width: 100%;
72
+ }
73
+
74
+ @media (max-width: 580px) {
75
+ .mt-reply {
76
+ margin: 10px 0;
77
+ }
78
+ }
79
+
80
+ .mt-reply__date {
81
+ font-weight: normal;
82
+ font-size: 14px;
83
+ text-decoration: none;
84
+ color: #475569;
85
+ color: #777;
86
+ }
87
+
88
+ .mt-reply__body {
89
+ font-weight: 600;
90
+ font-size: 14px;
91
+ text-decoration: none;
92
+ }
93
+
94
+ .mt-reply__wrapper {
95
+ display: flex;
96
+ align-items: center;
97
+ }
98
+ </style>
@@ -39,8 +39,8 @@
39
39
  </template>
40
40
 
41
41
  <script>
42
- import { getWidth } from './../../utils/get-width'
43
- import { numberToText } from './../../utils/textToNumber'
42
+ import { getWidth } from './../../../utils/get-width'
43
+ import { numberToText } from './../../../utils/textToNumber'
44
44
 
45
45
  export default {
46
46
  name: 'Score',
@@ -106,7 +106,7 @@ export default {
106
106
  }
107
107
  });
108
108
  }
109
-
109
+ this.$emit('updateOrderByAverage', { rating })
110
110
  this.$parent.$emit('updateOrderByAverage', { rating })
111
111
  },
112
112
  },
@@ -160,7 +160,6 @@ export default {
160
160
  margin: 0;
161
161
  list-style: none;
162
162
  padding: 0;
163
- max-width: 800px;
164
163
  width: 100%;
165
164
  }
166
165
 
@@ -66,7 +66,7 @@ export default {
66
66
  .mt-select {
67
67
  height: 30px;
68
68
  border: none;
69
- background: #fff;
69
+ background: transparent;
70
70
  line-height: 1.14;
71
71
  font-weight: 400;
72
72
  letter-spacing: normal;
@@ -0,0 +1,184 @@
1
+ <template>
2
+ <div v-if="visible" ref="dropdown" class="mrtn-sort-dropdown">
3
+ <div class="mrtn-sort-dropdown__header">
4
+ <h3 class="mrtn-sort-dropdown__title">Ordenar por</h3>
5
+ </div>
6
+
7
+ <div class="mrtn-sort-dropdown__options">
8
+ <div
9
+ v-for="option in sortOptions"
10
+ :key="option.value"
11
+ class="mrtn-sort-option"
12
+ :class="{ 'mrtn-sort-option--active': currentSort === option.value }"
13
+ @click="selectSort(option.value)"
14
+ >
15
+ <span class="mrtn-sort-option__text">{{ option.label }}</span>
16
+ <svg
17
+ v-if="currentSort === option.value"
18
+ class="mrtn-sort-option__check"
19
+ width="16"
20
+ height="16"
21
+ viewBox="0 0 16 16"
22
+ fill="none"
23
+ >
24
+ <path d="M13.5 4.5L6 12L2.5 8.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
25
+ </svg>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="mrtn-sort-dropdown__footer">
30
+ <span class="mrtn-sort-dropdown__powered">Powered by MARTAN.app</span>
31
+ </div>
32
+ </div>
33
+ </template>
34
+
35
+ <script>
36
+ export default {
37
+ name: 'SortDropdown',
38
+
39
+ props: {
40
+ visible: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+
45
+ currentSort: {
46
+ type: String,
47
+ default: 'most_recent'
48
+ }
49
+ },
50
+
51
+ data() {
52
+ return {
53
+ sortOptions: [
54
+ { value: 'most_recent', label: 'Recentes' },
55
+ { value: 'most_voted', label: 'Mais úteis' },
56
+ { value: 'most_positive', label: 'Positivas' },
57
+ { value: 'most_negative', label: 'Negativas' }
58
+ ]
59
+ }
60
+ },
61
+
62
+ mounted() {
63
+ this.addClickOutsideListener()
64
+ },
65
+
66
+ beforeDestroy() {
67
+ this.removeClickOutsideListener()
68
+ },
69
+
70
+ watch: {
71
+ visible(newValue) {
72
+ if (newValue) {
73
+ this.$nextTick(() => {
74
+ this.addClickOutsideListener()
75
+ })
76
+ } else {
77
+ this.removeClickOutsideListener()
78
+ }
79
+ }
80
+ },
81
+
82
+ methods: {
83
+ selectSort(sortValue) {
84
+ this.$emit('sort-selected', sortValue)
85
+ },
86
+
87
+ addClickOutsideListener() {
88
+ document.addEventListener('click', this.handleClickOutside)
89
+ },
90
+
91
+ removeClickOutsideListener() {
92
+ document.removeEventListener('click', this.handleClickOutside)
93
+ },
94
+
95
+ handleClickOutside(event) {
96
+ if (!this.visible) return
97
+ if (
98
+ event.target &&
99
+ event.target.classList &&
100
+ event.target.classList.contains('mrtn-filter-btn') &&
101
+ event.target.nodeName !== 'svg' &&
102
+ event.target.nodeName !== 'SVG'
103
+ ) {
104
+ return
105
+ }
106
+ if (this.$refs.dropdown && !this.$refs.dropdown.contains(event.target)) {
107
+ this.$emit('close')
108
+ }
109
+ }
110
+ }
111
+ }
112
+ </script>
113
+
114
+ <style lang="scss" scoped>
115
+ .mrtn-sort-dropdown {
116
+ position: absolute;
117
+ top: 100%;
118
+ right: 0;
119
+ background: white;
120
+ border: 1px solid #e5e5e5;
121
+ border-radius: 8px;
122
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
123
+ z-index: 1000;
124
+ margin-top: 8px;
125
+ padding: 16px;
126
+ min-width: 200px;
127
+ }
128
+
129
+ .mrtn-sort-dropdown__header {
130
+ margin-bottom: 12px;
131
+ }
132
+
133
+ .mrtn-sort-dropdown__title {
134
+ font-size: 16px;
135
+ font-weight: 600;
136
+ color: #000000;
137
+ margin: 0;
138
+ }
139
+
140
+ .mrtn-sort-dropdown__options {
141
+ display: flex;
142
+ flex-direction: column;
143
+ gap: 4px;
144
+ }
145
+
146
+ .mrtn-sort-option {
147
+ display: flex;
148
+ align-items: center;
149
+ justify-content: space-between;
150
+ padding: 8px 12px;
151
+ border-radius: 4px;
152
+ cursor: pointer;
153
+ transition: background-color 0.2s ease;
154
+
155
+ &:hover {
156
+ background: #f8f8f8;
157
+ }
158
+
159
+ &--active {
160
+ background: #f0f0f0;
161
+ }
162
+ }
163
+
164
+ .mrtn-sort-option__text {
165
+ font-size: 14px;
166
+ color: #000000;
167
+ font-weight: 400;
168
+ }
169
+
170
+ .mrtn-sort-option__check {
171
+ color: #000000;
172
+ flex-shrink: 0;
173
+ }
174
+
175
+ .mrtn-sort-dropdown__footer {
176
+ margin-top: 12px;
177
+ text-align: right;
178
+ }
179
+
180
+ .mrtn-sort-dropdown__powered {
181
+ font-size: 11px;
182
+ color: #999999;
183
+ }
184
+ </style>
@@ -0,0 +1,121 @@
1
+ <template>
2
+ <div>
3
+ <div class="mt-rating__verified">
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ class="icon icon-tabler icon-tabler-discount-check-filled"
7
+ width="24"
8
+ height="24"
9
+ viewBox="0 0 24 24"
10
+ stroke-width="2"
11
+ stroke="currentColor"
12
+ fill="none"
13
+ stroke-linecap="round"
14
+ stroke-linejoin="round"
15
+ >
16
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
17
+ <path
18
+ d="M12.01 2.011a3.2 3.2 0 0 1 2.113 .797l.154 .145l.698 .698a1.2 1.2 0 0 0 .71 .341l.135 .008h1a3.2 3.2 0 0 1 3.195 3.018l.005 .182v1c0 .27 .092 .533 .258 .743l.09 .1l.697 .698a3.2 3.2 0 0 1 .147 4.382l-.145 .154l-.698 .698a1.2 1.2 0 0 0 -.341 .71l-.008 .135v1a3.2 3.2 0 0 1 -3.018 3.195l-.182 .005h-1a1.2 1.2 0 0 0 -.743 .258l-.1 .09l-.698 .697a3.2 3.2 0 0 1 -4.382 .147l-.154 -.145l-.698 -.698a1.2 1.2 0 0 0 -.71 -.341l-.135 -.008h-1a3.2 3.2 0 0 1 -3.195 -3.018l-.005 -.182v-1a1.2 1.2 0 0 0 -.258 -.743l-.09 -.1l-.697 -.698a3.2 3.2 0 0 1 -.147 -4.382l.145 -.154l.698 -.698a1.2 1.2 0 0 0 .341 -.71l.008 -.135v-1l.005 -.182a3.2 3.2 0 0 1 3.013 -3.013l.182 -.005h1a1.2 1.2 0 0 0 .743 -.258l.1 -.09l.698 -.697a3.2 3.2 0 0 1 2.269 -.944zm3.697 7.282a1 1 0 0 0 -1.414 0l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.32 1.497l2 2l.094 .083a1 1 0 0 0 1.32 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z"
19
+ stroke-width="0"
20
+ fill="currentColor"
21
+ />
22
+ </svg>
23
+
24
+ <span title="Esta compra foi auditada por Martan.app"> {{ i19verifiedBuyer }} </span>
25
+ </div>
26
+ <div class="collapse multi-collapse" :id="collapseId">
27
+ <div class="card card-body">
28
+ <h5>{{ i19howProcessVerifiedMsg }}</h5>
29
+
30
+ <p>
31
+ {{ i19useMartanPrivacyMsg }}
32
+ </p>
33
+
34
+ <p>
35
+ {{ i19howWeCollectMsg }}
36
+ </p>
37
+
38
+ <p>
39
+ {{ i19howClientsReviewMsg }}
40
+ </p>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </template>
45
+
46
+ <script>
47
+ import { i18n } from "@ecomplus/utils";
48
+ import $ from "../../../../../storefront-twbs/src";
49
+
50
+ export default {
51
+ name: "VerifiedPurchase",
52
+
53
+ props: {
54
+ showVerified: {
55
+ type: Boolean,
56
+ default: false,
57
+ },
58
+ },
59
+
60
+ data() {
61
+ return {
62
+ collapseId: null,
63
+ };
64
+ },
65
+
66
+ computed: {
67
+ i19verifiedBuyer: () => "Comprador verificado",
68
+ i19howProcessVerifiedMsg: () =>
69
+ i18n({
70
+ en_us: "How we verify and process reviews",
71
+ pt_br: "Como verificamos e processamos avaliações",
72
+ }),
73
+ i19useMartanPrivacyMsg: () =>
74
+ i18n({
75
+ en_us:
76
+ "We use Martan, a web-based application that provides an online reviews and marketing solution, to collect, source, process and display reviews on our website.",
77
+ pt_br:
78
+ "Utilizamos o Martan, uma aplicação baseada na web que oferece uma solução de avaliações online e marketing, para coletar, originar, processar e exibir avaliações em nosso site.",
79
+ }),
80
+ i19howWeCollectMsg: () =>
81
+ i18n({
82
+ en_us:
83
+ 'We automatically send review requests through Martan to customers for whom we have a record of purchasing products directly from our website. This allows us to verify the reliability of the review through technical means such as the customers email address. Reviews submitted directly through these requests are marked as "Verified Purchase", and the following statement will be displayed in the interface where the review is published: "This review was collected from a verified customer who purchased this item."',
84
+ pt_br:
85
+ 'Enviamos automaticamente solicitações de avaliações por meio do Martan aos clientes para os quais temos registro de que compraram produtos diretamente em nosso site. Isso nos permite verificar a confiabilidade da avaliação por meio de meios técnicos, como o endereço de e-mail do cliente. As avaliações enviadas diretamente por essas solicitações são marcadas como "Compra verificada", e a seguinte declaração será exibida na interface em que a avaliação for publicada: "Esta avaliação foi coletada de um cliente verificado que comprou este item".',
86
+ }),
87
+ i19howClientsReviewMsg: () =>
88
+ i18n({
89
+ en_us:
90
+ "Customers can choose how to rate reviewed products with a score between 1 and 5. The average review score is calculated using a simple mathematical average, which is then rounded to a half or full star rating using standard rounding rules. The average review score includes reviews for which customers received discounts on future purchases for adding a photo or video to their review.",
91
+ pt_br:
92
+ "Os clientes podem escolher como avaliar os produtos avaliados com uma pontuação entre 1 e 5. A pontuação média das avaliações é calculada usando uma média matemática simples, que é então arredondada para uma meia ou uma avaliação de estrela completa usando regras padrão de arredondamento. A pontuação média das avaliações inclui avaliações para as quais os clientes receberam descontos em compras futuras por adicionar uma foto ou um vídeo à sua avaliação.",
93
+ }),
94
+ },
95
+
96
+ methods: {
97
+ open: function () {
98
+ $("#" + this.collapseId).collapse("toggle");
99
+ },
100
+ },
101
+
102
+ mounted: function () {
103
+ this.collapseId = "mt-verified-" + Date.now();
104
+ },
105
+ };
106
+ </script>
107
+
108
+ <style lang="scss">
109
+ .mt-rating__verified {
110
+ color: #9e9e9e;
111
+ font-size: 10px;
112
+ font-weight: 400;
113
+ display: flex;
114
+ align-items: center;
115
+ gap: 3px;
116
+ svg {
117
+ width: 15px;
118
+ color: var(--success);
119
+ }
120
+ }
121
+ </style>