diff --git a/src/views/index.html b/src/views/index.html
index 45f19de..1430a60 100644
--- a/src/views/index.html
+++ b/src/views/index.html
@@ -27,6 +27,11 @@
Features
+
+
+ App
+
+
-
-
-
-
-
- You can search someone user info by phone
-
-
-
-
-
-
-
- You can search someone avatar by phone
-
-
-
-
-
-
-
- Display all groups you joined
-
-
-
-
-
-
-
- Get your privacy settings
-
-
-
+
+ Send Private Message
-
+
+
+
+
Contact
+
+
+ Send contact to any whatsapp number
+
+
+
-
+
+ Send Group Message
+
+
+
Group
@@ -178,6 +165,54 @@
+
+
+
Contact
+
+
+ Send contact to any whatsapp number
+
+
+
+
+
+
+ User
+
+
+
+
+
+
+
+ You can search someone user info by phone
+
+
+
+
+
+
+
+ You can search someone avatar by phone
+
+
+
+
+
+
+
+ Display all groups you joined
+
+
+
+
+
+
+
+ Get your privacy settings
+
+
+
@@ -369,6 +404,39 @@
+
+
+
@@ -823,6 +891,63 @@
}
}
+ const sendContact = {
+ data() {
+ return {
+ contact_type: 'user',
+ contact_phone: '',
+ contact_card_name: '',
+ contact_card_phone: '',
+ }
+ },
+ methods: {
+ sendContactModal(type) {
+ this.contact_type = type
+ $('#modalSendContact').modal('show');
+ },
+ async sendContactProcess() {
+ try {
+ let response = await this.sendContactApi()
+ showSuccessInfo(response)
+ } catch (err) {
+ showErrorInfo(err)
+ }
+ },
+ sendContactApi() {
+ return new Promise(async (resolve, reject) => {
+ try {
+ let payload = new FormData();
+ payload.append("phone", this.contact_phone)
+ payload.append("contact_name", this.contact_card_name)
+ payload.append("contact_phone", this.contact_card_phone)
+ payload.append("type", this.contact_type)
+ let response = await axios.post(`${this.app_host}/send/contact`, payload, {
+ // Axios Bug, always content-type that make boundary not set default by browser https://github.com/axios/axios/issues/1603
+ transformRequest: (data, headers) => {
+ delete headers.post['Content-Type'];
+ return data;
+ }
+ })
+ this.sendContactReset();
+ resolve(response.data.message)
+ } catch (error) {
+ if (error.response) {
+ reject(error.response.data.message)
+ } else {
+ reject(error.message)
+ }
+ }
+ })
+ },
+ sendContactReset() {
+ this.contact_phone = '';
+ this.contact_card_name = '';
+ this.contact_card_phone = '';
+ this.message_type = 'user';
+ },
+ }
+ }
+
const userGroups = {
data() {
return {
@@ -1003,7 +1128,7 @@
app_name: 'Whatsapp API Multi Device (v{{ .AppVersion }})'
}
},
- mixins: [login, logout, reconnect, sendMessage, sendImage, sendFile, sendVideo, userGroups, userPrivacy, userAvatar, userInfo]
+ mixins: [login, logout, reconnect, sendMessage, sendImage, sendFile, sendVideo, sendContact, userGroups, userPrivacy, userAvatar, userInfo]
}).mount('#app')