Files
exchange-2.0/resources/assets/vue/components/settings/elements/AffiliateSectionComponent.vue
T
Edmond Lang 30ed77f304 Merge branch 'affiliate-program' of https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0 into vapor/production
# Conflicts:
#	resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue
#	routes/api.php
2026-01-26 00:13:10 +08:00

137 lines
6.7 KiB
Vue

<template>
<div class="row">
<div class="col">
<loading-component style="height: 200px; top: 0;" key="1" color="success" v-show="$store.getters.isLoading('affiliateSettingsSection')"></loading-component>
<div class="row" v-show="!$store.getters.isLoading('affiliateSettingsSection')">
<div class="col">
<!-- <div class="row p-b-5 m-b-20 b-b b-grey align-items-center parentContainer">
<div class="col">
<div class="font-heading all-caps fs-10 hint-text">
Settings
</div>
</div>
</div> -->
<div class="row m-b-20">
<div class="col">
<affiliate-settings-component section="affiliateSettingsSection"></affiliate-settings-component>
</div>
</div>
</div>
</div>
<div class="row m-t-30" v-show="!$store.getters.isLoading('affiliateSettingsSection')">
<div class="col">
<div class="row p-b-5 m-b-20 b-b b-grey align-items-center parentContainer">
<div class="col">
<div class="font-heading all-caps fs-10 hint-text">
Affiliate Codes
</div>
</div>
<div class="col-auto">
<button class="btn btn-xs btn-primary b-rad-none requestModal" data-type="createModal">
<i class="fa fa-plus m-r-5"></i>
New Code
</button>
<button class="btn btn-xs btn-outline-success" @click="refreshAffiliateCodes()">
<i class="fa fa-refresh m-r-5"></i>
Refresh
</button>
<modal-form-component section="affiliatesSection">
<template slot="form" slot-scope="{section}">
<affiliate-form-component :section="section"></affiliate-form-component>
</template>
</modal-form-component>
</div>
</div>
<div class="row m-b-15">
<div class="col">
<div class="row">
<div class="col p-r-0">
<div class="form-group no-margin form-group-default b-rad-none">
<label class="text-primary">Search</label>
<input type="text" class="form-control" v-model="searchTerm" @keyup.enter="search" placeholder="Search by campaign name, code, or description"/>
</div>
</div>
<div class="col-auto p-l-0 p-r-0">
<div class="btn btn-primary b-rad-none" @click="search">
<i class="fa fa-search lh-40"></i>
</div>
</div>
<div class="col-auto p-l-0">
<div class="btn btn-secondary b-rad-none" @click="reset">
<i class="fa fa-remove lh-40"></i>
</div>
</div>
</div>
</div>
</div>
<div class="row m-b-10 b-b p-b-5" style="border-color: #e0e0e0 !important;">
<div class="col-2">
<div class="font-heading all-caps fs-9 muted">Campaign</div>
</div>
<div class="col-4">
<div class="font-heading all-caps fs-9 muted">Tracking Link</div>
</div>
<div class="col-3">
<div class="row">
<div class="col-4">
<div class="font-heading all-caps fs-9 muted">Clicks</div>
</div>
<div class="col-4">
<div class="font-heading all-caps fs-9 muted">Registers</div>
</div>
<div class="col-4">
<div class="font-heading all-caps fs-9 muted">Orders</div>
</div>
</div>
</div>
<div class="col-1">
<div class="font-heading all-caps fs-9 muted">Status</div>
</div>
<div class="col-auto">
<div class="font-heading all-caps fs-9 muted">Actions</div>
</div>
</div>
<div class="row m-b-20">
<div class="col">
<list-component section="affiliatesSection" :endpoint="route('api.affiliate.list')" :key="refreshKey" :options="options">
<template slot="list" slot-scope="{data}">
<affiliate-single-item-component section="affiliatesSection" :data="data"></affiliate-single-item-component>
</template>
</list-component>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
refreshKey: 1,
searchTerm: '',
options: {}
}
},
methods: {
refreshAffiliateCodes() {
this.refreshKey++;
},
search() {
if (this.searchTerm && this.searchTerm.trim()) {
this.options['affiliate_search'] = this.searchTerm.trim();
} else {
delete this.options['affiliate_search'];
}
this.refreshKey++;
},
reset() {
this.searchTerm = '';
delete this.options['affiliate_search'];
this.refreshKey++;
}
}
}
</script>