Почему на телеграм бот не приходят данные computed свойств filteredProducts и filteredProducts2 ??
computed: {
...mapGetters({
cartProducts: 'cart/productsList',
cartPrice: 'cart/totalPrice'
}),
filteredProducts() {
return this.cartProducts.map( p => p.product.title).toString()
},
filteredProducts2() {
return this.cartProducts.map( p => p.qty).toString()
}
},
methods: {
isValid() {
let valid = true;
if (this.fullName.length < 1) {
this.isFullNameInvalid = true;
valid = false;
} else {
this.isFullNameInvalid = false;
}
if (this.email.length < 10) {
this.isEmailInvalid = true;
valid = false;
} else {
this.isEmailInvalid = false;
}
if (this.adres.length < 3) {
this.isAdresInvalid = true;
valid = false;
} else {
this.isAdresInvalid = false;
}
return valid;
},
async onSubmit() {
if (this.isValid()) {
this.status = cartStatus.creating;
const success = await this.$store.dispatch("cart/submit", {
fullName: this.fullName,
email: this.email,
adres: this.adres
});
this.status = success ? cartStatus.success : cartStatus.fail;
this.$axios.post(
"https://api.telegram.org/bot1558775847:AAEB42_s9dLU73wqhz3t90kB5S40Tul2FCI/sendMessage?chat_id=1400064880&parse_mode=html&text=" +
JSON.stringify(
"Имя " + this.fullName + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " +
"Телефон " + this.email + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " +
"Адрес " + this.adres + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " "
+ "Блюда" + this.filteredProducts + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " "
+ "Количество " + this.filteredProducts2 + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " "
+ "Итоговая цена заказа " + this.cartPrice
)
).then(res => {
this.sent = true;
document.location.href = '/thank'
});
}
}
}