@burh/nuxt-core 1.0.138 → 1.0.141

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.
@@ -1,169 +1,228 @@
1
1
  <template>
2
- <div>
3
- <notifications></notifications>
4
- <modal :show.sync="show.modal0" class="modal-share" v-on:close="resetCopy()">
5
- <template slot="header">
6
- <h5 class="modal-title" id="exampleModalLabel">Compartilhar</h5>
7
- </template>
2
+ <div>
3
+ <!-- <notifications></notifications> -->
4
+ <modal :show.sync="show" class="modal-share" v-on:close="resetCopy()">
5
+ <template slot="header">
6
+ <h5 class="modal-title" id="exampleModalLabel">Compartilhar</h5>
7
+ </template>
8
8
 
9
- <ul class="list-inline mb-4">
10
- <li @click="shareJobOnFacebook()" class="list-inline-item">
11
- <base-button icon class="btn-facebook btn-icon rounded-circle">
12
- <span class="btn-inner--icon"><i class="fab fa-facebook"></i></span>
13
- </base-button>
14
- <span class="btn-inner--text">Facebook</span>
15
- </li>
16
- <li @click="shareJobOnTwitter()" class="list-inline-item">
17
- <base-button icon class="btn-twitter rounded-circle">
18
- <span class="btn-inner--icon"><i class="fab fa-twitter"></i></span>
19
- </base-button>
20
- <span class="btn-inner--text">Twitter</span>
21
- </li>
22
- <li @click="shareJobOnLinkedin()" class="list-inline-item">
23
- <base-button icon class="btn-linkedin rounded-circle">
24
- <span class="btn-inner--icon"><i class="fab fa-linkedin"></i></span>
25
- </base-button>
26
- <span class="btn-inner--text">Linkedin</span>
27
- </li>
28
- <!-- $shareOnWhatsapp(url, +551533426237) -->
29
- <li @click="modals.modal0 = true" class="plist-inline-item ointer">
30
- <base-button icon class="btn-whatsapp rounded-circle">
31
- <span class="btn-inner--icon"><i class="fab fa-whatsapp"></i></span>
32
- </base-button>
33
- <span class="btn-inner--text">Whatsapp</span>
34
- </li>
35
- </ul>
36
- <div class="input-group" @click="copyToClipboard">
37
- <input id="linkShareModal" type="text" readonly class="form-control pointer" :value="url">
38
- <div class="input-group-prepend">
39
- <button class="btn btn-outline-primary custom-copy my-0 px-2" id="btnCopyLinkShare">Copiar</button>
40
- </div>
41
- </div>
9
+ <ul class="list-inline mb-4 text-center">
10
+ <li class="list-inline-item">
11
+ <a
12
+ v-show="
13
+ userData.user_complementary_information.facebook_url
14
+ "
15
+ :href="
16
+ userData.user_complementary_information.facebook_url
17
+ "
18
+ target="_blank"
19
+ rel="noopener noreferrer"
20
+ >
21
+ <base-button
22
+ icon
23
+ class="btn-facebook btn-icon rounded-circle"
24
+ >
25
+ <span class="btn-inner--icon"
26
+ ><i class="fab fa-facebook"></i
27
+ ></span>
28
+ </base-button>
29
+ <span class="btn-inner--text">Facebook</span>
30
+ </a>
31
+ </li>
32
+ <li class="list-inline-item">
33
+ <a
34
+ v-show="
35
+ userData.user_complementary_information.twitter_url
36
+ "
37
+ :href="
38
+ userData.user_complementary_information.twitter_url
39
+ "
40
+ target="_blank"
41
+ rel="noopener noreferrer"
42
+ >
43
+ <base-button icon class="btn-twitter rounded-circle">
44
+ <span class="btn-inner--icon"
45
+ ><i class="fab fa-twitter"></i
46
+ ></span>
47
+ </base-button>
48
+ <span class="btn-inner--text">Twitter</span>
49
+ </a>
50
+ </li>
51
+ <li class="list-inline-item">
52
+ <a
53
+ v-show="
54
+ userData.user_complementary_information.linkedin_url
55
+ "
56
+ :href="
57
+ userData.user_complementary_information.linkedin_url
58
+ "
59
+ target="_blank"
60
+ rel="noopener noreferrer"
61
+ >
62
+ <base-button icon class="btn-linkedin rounded-circle">
63
+ <span class="btn-inner--icon"
64
+ ><i class="fab fa-linkedin"></i
65
+ ></span>
66
+ </base-button>
67
+ <span class="btn-inner--text">Linkedin</span>
68
+ </a>
69
+ </li>
70
+ <li class="plist-inline-item ointer">
71
+ <a
72
+ v-show="userData.user_contact.cellphone"
73
+ :href="
74
+ `https://api.whatsapp.com/send?phone=+55${userData.user_contact.cellphone}`
75
+ "
76
+ target="_blank"
77
+ rel="noopener noreferrer"
78
+ >
79
+ <base-button icon class="btn-whatsapp rounded-circle">
80
+ <span class="btn-inner--icon"
81
+ ><i class="fab fa-whatsapp"></i
82
+ ></span>
83
+ </base-button>
84
+ <span class="btn-inner--text">Whatsapp</span>
85
+ </a>
86
+ </li>
87
+ </ul>
88
+ <div class="input-group" @click="copyToClipboard">
89
+ <input
90
+ id="linkShareModal"
91
+ type="text"
92
+ readonly
93
+ class="form-control pointer"
94
+ :value="`${url}/${userData.slug.slug}`"
95
+ />
96
+ <div class="input-group-prepend">
97
+ <button
98
+ class="btn btn-outline-primary custom-copy my-0 px-2"
99
+ id="btnCopyLinkShare"
100
+ >
101
+ Copiar
102
+ </button>
103
+ </div>
104
+ </div>
42
105
 
43
- <!-- <modal :show.sync="modals.modal0" class="modal-share__mini"/> -->
44
- <sub-modal :show="modals">
45
- <h1 class="display-3 mb-0 pb-0" slot="header">Compartilhar</h1>
46
- <p class="lead mt-0">Insira aqui o número do telefone.</p>
47
- <base-input
48
- class="mb-1" v-model="phoneNumber" v-mask="['(##) ####-####', '(##) #####-####']" placeholder="Ex: (15) 3342-6237"
49
- type="text"
50
- name="NumberCellphone"
51
- :error="getError('NumberCellphone')"
52
- :valid="isValid('NumberCellphone')"
53
- v-validate="'required|min:14'">
54
- </base-input>
55
- <base-button class="btn btn-outline-primary d-block ml-auto" @click="onShareWhatsapp">Enviar</base-button>
56
- </sub-modal>
57
-
58
- </modal>
59
- </div>
106
+ <!-- <modal :show.sync="modals.modal0" class="modal-share__mini"/> -->
107
+ <sub-modal :show="modals">
108
+ <h1 class="display-3 mb-0 pb-0" slot="header">Compartilhar</h1>
109
+ <p class="lead mt-0">Insira aqui o número do telefone.</p>
110
+ <base-input
111
+ class="mb-1"
112
+ v-model="phoneNumber"
113
+ v-mask="['(##) ####-####', '(##) #####-####']"
114
+ placeholder="Ex: (15) 3342-6237"
115
+ type="text"
116
+ name="NumberCellphone"
117
+ >
118
+ </base-input>
119
+ <base-button
120
+ class="btn btn-outline-primary d-block ml-auto"
121
+ @click="onShareWhatsapp"
122
+ >Enviar</base-button
123
+ >
124
+ </sub-modal>
125
+ </modal>
126
+ </div>
60
127
  </template>
61
128
 
62
129
  <script>
63
- import SubModal from '~/components/burh-ds/Modals/SubModal';
130
+ import SubModal from './SubModal.vue';
64
131
  // import {TheMask} from 'vue-the-mask';
65
132
  import { mask } from 'vue-the-mask';
66
133
 
67
134
  export default {
68
- name: 'share-modal',
69
- directives:{
70
- mask
71
- },
72
- components: {
73
- SubModal
74
- },
75
- props: {
76
- show: Object,
77
- url: String
78
- },
79
- data() {
80
- return {
81
- modals: {
82
- modal0: false
83
- },
84
- phoneNumber: null
85
- };
86
- },
87
- mounted(){
135
+ name: 'share-modal',
136
+ directives: {
137
+ mask
138
+ },
139
+ components: {
140
+ SubModal
141
+ },
142
+ props: {
143
+ show: Boolean,
144
+ url: String,
145
+ userData: Object
146
+ },
147
+ data() {
148
+ return {
149
+ modals: {
150
+ modal0: false
151
+ },
152
+ phoneNumber: null
153
+ };
154
+ },
155
+ mounted() {
156
+ console.log(this.userData);
157
+ },
158
+ methods: {
159
+ async onShareWhatsapp() {
160
+ let phoneNumber = this.phoneNumber.replace(/[^\w\s]/gi, '');
161
+ phoneNumber = phoneNumber.replace(' ', '');
162
+ const pass = await this.$validator.validateAll();
163
+ if (!pass) {
164
+ return;
165
+ }
166
+ this.$shareOnWhatsapp(this.url, 55 + '' + phoneNumber);
167
+ },
88
168
 
89
- },
90
- methods:{
91
- async onShareWhatsapp(){
92
- let phoneNumber = this.phoneNumber.replace(/[^\w\s]/gi, '');
93
- phoneNumber = phoneNumber.replace(' ', '');
94
- const pass = await this.$validator.validateAll();
95
- if(!pass) {
96
- return;
97
- }
98
- this.$shareOnWhatsapp(this.url, 55+''+phoneNumber);
99
- },
169
+ shareJobOnFacebook() {
170
+ this.$shareOnFacebook(this.url, function() {
171
+ //
172
+ });
173
+ },
100
174
 
101
- shareJobOnFacebook() {
102
- this.$shareOnFacebook(
103
- this.url,
104
- function() {
105
- //
106
- }
107
- );
108
- },
175
+ shareJobOnLinkedin() {
176
+ this.$shareOnLinkedin(this.url, function(popup) {
177
+ //
178
+ });
179
+ },
109
180
 
110
- shareJobOnLinkedin() {
111
- this.$shareOnLinkedin(
112
- this.url,
113
- function(popup) {
114
- //
115
- }
116
- );
117
- },
181
+ shareJobOnTwitter() {
182
+ this.$shareOnTwitter(this.url, function(popup) {
183
+ //
184
+ });
185
+ },
118
186
 
119
- shareJobOnTwitter() {
120
- this.$shareOnTwitter(
121
- this.url,
122
- function(popup) {
123
- //
124
- }
125
- );
126
- },
187
+ resetCopy() {
188
+ let btnCopy = document.getElementById('btnCopyLinkShare');
189
+ btnCopy.innerText = 'Copiar';
190
+ btnCopy.classList.add('btn-outline-primary');
191
+ btnCopy.classList.remove('btn-primary');
192
+ },
193
+ copyToClipboard() {
194
+ let text = document.getElementById('linkShareModal');
195
+ let btnCopy = document.getElementById('btnCopyLinkShare');
196
+ text.select();
197
+ document.execCommand('copy');
127
198
 
128
- resetCopy(){
129
- let btnCopy = document.getElementById('btnCopyLinkShare');
130
- btnCopy.innerText = 'Copiar';
131
- btnCopy.classList.add('btn-outline-primary');
132
- btnCopy.classList.remove('btn-primary');
133
- },
134
- copyToClipboard() {
135
- let text = document.getElementById('linkShareModal');
136
- let btnCopy = document.getElementById('btnCopyLinkShare');
137
- text.select();
138
- document.execCommand('copy');
139
-
140
- if(btnCopy.innerText == 'Copiado') return;
199
+ if (btnCopy.innerText == 'Copiado') return;
141
200
 
142
- btnCopy.innerText = 'Copiado';
143
- btnCopy.classList.remove('btn-outline-primary');
144
- btnCopy.classList.add('btn-primary');
145
- // this.$notify({
146
- // message:
147
- // `<h6 style="color: #fff;">Link copiado com sucesso!</6>`,
148
- // timeout: 5000,
149
- // icon: 'far fa-bell',
150
- // type: 'success'
151
- // });
152
- },
153
- getError(name){
154
- return this.errors.first(name);
155
- },
156
- isValid(name) {
157
- return this.validated && !this.errors.has(name);
158
- }
159
- }
201
+ btnCopy.innerText = 'Copiado';
202
+ btnCopy.classList.remove('btn-outline-primary');
203
+ btnCopy.classList.add('btn-primary');
204
+ // this.$notify({
205
+ // message:
206
+ // `<h6 style="color: #fff;">Link copiado com sucesso!</6>`,
207
+ // timeout: 5000,
208
+ // icon: 'far fa-bell',
209
+ // type: 'success'
210
+ // });
211
+ }
212
+ // getError(name) {
213
+ // return this.errors.first(name);
214
+ // },
215
+ // isValid(name) {
216
+ // return this.validated && !this.errors.has(name);
217
+ // }
218
+ }
160
219
  };
161
220
  </script>
162
221
  <style lang="scss">
163
- .pointer {
164
- cursor: pointer;
165
- }
166
- .custom-copy {
167
- box-shadow: none;
168
- }
169
- </style>
222
+ .pointer {
223
+ cursor: pointer;
224
+ }
225
+ .custom-copy {
226
+ box-shadow: none;
227
+ }
228
+ </style>