mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Subscriptions v2
This commit is contained in:
parent
be2d6afc63
commit
1ca6810132
@ -222,24 +222,16 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updatedLogin()
|
|
||||||
|
public function handleLogin($log)
|
||||||
{
|
{
|
||||||
nlog($this->login);
|
nlog($log);
|
||||||
|
|
||||||
}
|
}
|
||||||
public function handleLogin()
|
|
||||||
{
|
|
||||||
nlog($this->all());
|
|
||||||
|
|
||||||
nlog($this->login);
|
|
||||||
nlog($this->otp);
|
|
||||||
nlog($this->value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function handleEmail()
|
public function handleEmail()
|
||||||
{
|
{
|
||||||
$this->validateOnly('email', ['email' => 'required|bail|email:rfc']);
|
$this->validateOnly('email', ['email' => 'required|bail|email:rfc']);
|
||||||
|
|
||||||
$rand = rand(100000,999999);
|
$rand = rand(100000,999999);
|
||||||
|
|
||||||
$email_hash = "{$this->email}:" . $rand;
|
$email_hash = "{$this->email}:" . $rand;
|
||||||
|
@ -145,8 +145,6 @@ class UpdateReminder extends AbstractService
|
|||||||
$reminder_date = $this->addTimeInterval($this->invoice->last_sent_date, (int) $this->settings->endless_reminder_frequency_id);
|
$reminder_date = $this->addTimeInterval($this->invoice->last_sent_date, (int) $this->settings->endless_reminder_frequency_id);
|
||||||
|
|
||||||
if ($reminder_date) {
|
if ($reminder_date) {
|
||||||
// $reminder_date->addSeconds($offset);
|
|
||||||
|
|
||||||
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date))) {
|
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date))) {
|
||||||
$date_collection->push($reminder_date);
|
$date_collection->push($reminder_date);
|
||||||
}
|
}
|
||||||
|
@ -258,46 +258,44 @@
|
|||||||
</form>
|
</form>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if($email && !$errors->has('email'))
|
||||||
<div class="py-6 px-6 w-80 border mx-auto text-center my-6">
|
<div class="py-6 px-6 w-80 border mx-auto text-center my-6">
|
||||||
<form wire:submit.prevent="handleLogin" action="#" class="" x-data="otpForm()">
|
<form wire:submit.prevent="handleLogin" class="" x-data="otpForm()">
|
||||||
<div class="flex justify-between">
|
<p class="mb-4">Enter the code we emailed</p>
|
||||||
<template x-for="(input, index) in length" :key="index">
|
<div class="flex justify-between">
|
||||||
<input
|
<template x-for="(input, index) in length" :key="index">
|
||||||
type="text"
|
<input
|
||||||
maxlength="1"
|
type="text"
|
||||||
class="border border-gray-500 w-10 h-10 text-center text-gray-700"
|
maxlength="1"
|
||||||
:x-ref="index"
|
class="border border-gray-500 w-10 h-10 text-center text-gray-700"
|
||||||
x-on:input="handleInput($event)"
|
:x-ref="index"
|
||||||
x-on:paste="handlePaste($event)"
|
x-on:input="handleInput($event)"
|
||||||
x-on:keydown.backspace="$event.target.value || handleBackspace($event.target.getAttribute('x-ref'))"
|
x-on:paste="handlePaste($event)"
|
||||||
/>
|
x-on:keydown.backspace="$event.target.value || handleBackspace($event.target.getAttribute('x-ref'))"
|
||||||
</template>
|
/>
|
||||||
</div>
|
</template>
|
||||||
<input type="hidden" wire:model.defer="login" x-model="value" x-data="value">
|
</div>
|
||||||
<button type="submit" class="btn-primary mx-auto block bg-gray-500 w-full p-2 mt-2 text-white">
|
<button x-on:click="buttonDisabled = true" x-bind:disabled="buttonDisabled" class="btn-primary mx-auto block bg-gray-500 w-full p-2 mt-2 text-white">
|
||||||
{{ ctrans('texts.login') }}
|
{{ ctrans('texts.verify') }}
|
||||||
</button>
|
</button>
|
||||||
<p class="absolute bottom-0" x-text="`value: ${value}`"></p>
|
</form>
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function otpForm() {
|
function otpForm() {
|
||||||
return {
|
return {
|
||||||
length: 6,
|
length: 6,
|
||||||
value: "",
|
login: "",
|
||||||
|
buttonDisabled: true,
|
||||||
|
|
||||||
handleInput(e) {
|
handleInput(e) {
|
||||||
const input = e.target;
|
const input = e.target;
|
||||||
|
|
||||||
this.value = Array.from(Array(this.length), (element, i) => {
|
this.login = Array.from(Array(this.length), (element, i) => {
|
||||||
return this.$refs[i].value || "";
|
return this.$refs[i].value || "";
|
||||||
}).join("");
|
}).join("");
|
||||||
|
|
||||||
@ -305,6 +303,15 @@
|
|||||||
input.nextElementSibling.focus();
|
input.nextElementSibling.focus();
|
||||||
input.nextElementSibling.select();
|
input.nextElementSibling.select();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.login.length == 6){
|
||||||
|
this.$wire.handleLogin(this.login);
|
||||||
|
this.buttonDisabled = false;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.buttonDisabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handlePaste(e) {
|
handlePaste(e) {
|
||||||
@ -325,3 +332,5 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user