个人中心

This commit is contained in:
pushuo 2022-06-30 14:10:05 +08:00
parent 8a3e3fdc6b
commit 2873019c71
6 changed files with 245 additions and 163 deletions

View File

@ -433,3 +433,7 @@ table.table.table-striped > tbody > tr:nth-of-type(2n) {
.el-button {
border-radius: 0;
}
.el-tabs__header {
margin-bottom: 25px;
}

View File

@ -230,11 +230,11 @@ sup {
}
a {
color: #fd560f;
text-decoration: underline;
color: #1890ff;
text-decoration: none;
}
a:hover {
color: #ca450c;
color: #1373cc;
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
@ -2992,7 +2992,6 @@ textarea.form-control-lg {
line-height: 1.5;
color: #212529;
text-align: center;
text-decoration: none;
vertical-align: middle;
cursor: pointer;
-webkit-user-select: none;
@ -3465,11 +3464,11 @@ textarea.form-control-lg {
.btn-link {
font-weight: 400;
color: #fd560f;
text-decoration: underline;
color: #1890ff;
text-decoration: none;
}
.btn-link:hover {
color: #ca450c;
color: #1373cc;
}
.btn-link:disabled, .btn-link.disabled {
color: #6c757d;
@ -3762,7 +3761,6 @@ textarea.form-control-lg {
font-weight: 400;
color: #212529;
text-align: inherit;
text-decoration: none;
white-space: nowrap;
background-color: transparent;
border: 0;
@ -3937,8 +3935,7 @@ textarea.form-control-lg {
.nav-link {
display: block;
padding: 0.5rem 1rem;
color: #fd560f;
text-decoration: none;
color: #1890ff;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
@ -3947,7 +3944,7 @@ textarea.form-control-lg {
}
}
.nav-link:hover, .nav-link:focus {
color: #ca450c;
color: #1373cc;
}
.nav-link.disabled {
color: #6c757d;
@ -4048,7 +4045,6 @@ textarea.form-control-lg {
padding-bottom: 0.3125rem;
margin-right: 1rem;
font-size: 1.25rem;
text-decoration: none;
white-space: nowrap;
}
.navbar-nav {
@ -4798,8 +4794,7 @@ textarea.form-control-lg {
.page-link {
position: relative;
display: block;
color: #fd560f;
text-decoration: none;
color: #1890ff;
background-color: #fff;
border: 1px solid #dee2e6;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
@ -4811,13 +4806,13 @@ textarea.form-control-lg {
}
.page-link:hover {
z-index: 2;
color: #ca450c;
color: #1373cc;
background-color: #e9ecef;
border-color: #dee2e6;
}
.page-link:focus {
z-index: 3;
color: #ca450c;
color: #1373cc;
background-color: #e9ecef;
outline: 0;
box-shadow: 0 0 0 0.25rem rgba(253, 86, 15, 0.25);
@ -5089,7 +5084,6 @@ textarea.form-control-lg {
display: block;
padding: 0.5rem 1rem;
color: #212529;
text-decoration: none;
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.125);
}

View File

@ -12,6 +12,8 @@ $primary: #fd560f;
$border-radius: 0;
$form-check-input-width: 1.2em;
$form-switch-width: 2.6em;
$link-decoration: none;
$link-color: #1890ff;
@import 'node_modules/bootstrap-5.1.3/scss/bootstrap';
// @import 'node_modules/bootstrap/scss/bootstrap';

View File

@ -6,4 +6,8 @@
.el-button {
border-radius: 0;
}
.el-tabs__header {
margin-bottom: 25px;
}

View File

@ -3,124 +3,201 @@
@section('title', '顾客管理')
@section('content')
<div id="customer-app-form" class="card">
<div class="card-body">
<el-form :model="form" :rules="rules" ref="form" label-width="100px">
<el-tabs v-model="customerTab">
<el-tab-pane label="用户信息" name="customer">
<div class="form-max-w">
<el-form-item label="用户名" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="form.password"></el-input>
</el-form-item>
<el-form-item label="用户组">
<el-select v-model="form.customer_group_id" placeholder="请选择">
<el-option
v-for="item in source.customer_group"
:key="item.value"
:label="item.name"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-switch v-model="form.status"></el-switch>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('form')">提交</el-button>
</el-form-item>
</div>
</el-tab-pane>
<el-tab-pane label="地址管理" name="address">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>名称</th>
<th>电话</th>
<th>注册来源</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr v-for="address, index in form.address" :key="index">
<td>@{{ index }}</td>
<td>@{{ address.name }}</td>
<td>@{{ address.phone }}</td>
<td>222</td>
<td>222</td>
<td>
<button class="btn btn-outline-secondary btn-sm" @click="editAddress(address.id)">编辑</button>
</td>
</tr>
</tbody>
</table>
</el-tab-pane>
</el-tabs>
</el-form>
</div>
<div id="customer-app-form" class="card">
<div class="card-body">
<el-form :model="form" :rules="rules" ref="form" label-width="100px">
<el-tabs v-model="customerTab">
<el-tab-pane label="用户信息" name="customer">
<div class="form-max-w">
<el-form-item label="用户名" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="form.password"></el-input>
</el-form-item>
<el-form-item label="用户组">
<el-select v-model="form.customer_group_id" placeholder="请选择">
<el-option v-for="item in source.customer_group" :key="item.id" :label="item.description.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-switch v-model="form.status"></el-switch>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('form')">提交</el-button>
</el-form-item>
</div>
</el-tab-pane>
<el-tab-pane label="地址管理" name="address">
<button class="btn btn-primary mb-3" type="button" @click="editAddress">添加地址</button>
<table class="table">
<thead>
<tr>
<th>#</th>
<th>名称</th>
<th>电话</th>
<th>注册来源</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody v-if="form.address.length">
<tr v-for="address, index in form.address" :key="index">
<td>@{{ index }}</td>
<td>@{{ address.name }}</td>
<td>@{{ address.phone }}</td>
<td>222</td>
<td>222</td>
<td>
<button class="btn btn-outline-secondary btn-sm" type="button" @click="editAddress(index)">编辑</button>
</td>{{--
</tr> --}}
</tbody>
<tbody v-else>
<tr>
<td colspan="6" class="text-center">
<span class="me-2">当前账号无地址</span> <el-link type="primary" @click="editAddress">新增地址</el-link>
</td>{{--
</tr> --}}
</tbody>
</table>
</el-tab-pane>
</el-tabs>
</el-form>
</div>
{{-- {{ admin_route($customer->id ? 'customers.update' : 'customers.store', $customer) }} --}}
<el-dialog title="编辑地址" :visible.sync="dialogAddress.show" width="580px">
<el-form ref="addressForm" :rules="addressRules" :model="dialogAddress.form" label-width="100px">
<el-form-item label="姓名" prop="name">
<el-input v-model="dialogAddress.form.name"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input maxlength="11" v-model="dialogAddress.form.phone"></el-input>
</el-form-item>
<el-form-item label="地址">
<el-row>
<el-col :span="8">
<el-select v-model="dialogAddress.form.country_id" placeholder="请选择">
<el-option v-for="item in source.countrys" :key="item.country_id" :label="item.name"
:value="item.country_id">
</el-option>
</el-select>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="详细地址 1" prop="address_1">
<el-input v-model="dialogAddress.form.address_1"></el-input>
</el-form-item>
<el-form-item label="详细地址 2">
<el-input v-model="dialogAddress.form.address_2"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addressFormSubmit('addressForm')">保存</el-button>
<el-button @click="closeAddressDialog('addressForm')">取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
{{-- {{ admin_route($customer->id ? 'customers.update' : 'customers.store', $customer) }} --}}
@endsection
@push('footer')
<script>
<script>
new Vue({
el: '#customer-app-form',
data: {
customerTab: 'customer',
form: {
id: '',
name: '',
email: '',
password: '',
customer_group_id: 1,
status: false,
address: [
{
name: '',
phone: '',
country_id: '',
city_id: '',
address_1: '',
address_2: '',
}
]
id: '',
name: '',
email: '',
password: '',
customer_group_id: 1,
status: false,
address: []
},
source: {
customer_group: [
{name: '超级vip', value: 1},
{name: '普通vip', value: 2},
{name: '青铜', value: 3},
],
customer_group: @json($customer_groups),
countrys: [
{country_id: 44, name: "中国"},
{country_id: 22, name: "美国"},
{country_id: 122, name: "俄罗斯"},
{country_id: 123, name: "英国"},
{country_id: 113, name: "法国"},
]
},
dialogAddress: {
show: false,
index: null,
form: {
name: '',
phone: '',
country_id: 44,
city_id: '',
address_1: '',
address_2: '',
}
},
rules: {
name: [
{ required: true, message: '请输入用户名', trigger: 'blur' },
],
name: [{required: true, message: '请输入用户名', trigger: 'blur'}, ],
},
addressRules: {
name: [{required: true, message: '请输入姓名', trigger: 'blur'}, ],
phone: [{required: true, message: '请输入联系电话', trigger: 'blur'}, ],
address_1: [{required: true, message: '请输入详细地址 1', trigger: 'blur'}, ],
}
},
methods: {
submitForm(form) {
this.$refs[form].validate((valid) => {
if (!valid) {
this.$message.error('请检查表单是否填写正确');
}
});
this.$refs[form].validate((valid) => {
if (!valid) {
this.$message.error('请检查表单是否填写正确');
}
});
},
editAddress(id) {
console.log(1)
}
editAddress(index) {
if (typeof index == 'number') {
this.dialogAddress.index = index;
this.$nextTick(() => {
this.dialogAddress.form = JSON.parse(JSON.stringify(this.form.address[index]))
})
}
this.dialogAddress.show = true
},
addressFormSubmit(form) {
this.$refs[form].validate((valid) => {
if (!valid) {
this.$message.error('请检查表单是否填写正确');
}
if (this.dialogAddress.index === null) {
this.form.address.push(JSON.parse(JSON.stringify(this.dialogAddress.form)));
} else {
this.form.address[this.dialogAddress.index] = JSON.parse(JSON.stringify(this.dialogAddress.form));
}
this.$refs[form].resetFields();
this.dialogAddress.show = false
this.dialogAddress.index = null;
});
},
closeAddressDialog(form) {
this.$refs[form].resetFields();
this.dialogAddress.show = false
this.dialogAddress.index = null;
},
}
});
</script>
</script>
@endpush

View File

@ -3,56 +3,57 @@
@section('title', '插件列表')
@section('content')
<div id="category-app" class="card">
<div class="card-body">
<a href="{{ admin_route('categories.create') }}" class="btn btn-primary">创建插件</a>
<div class="mt-4" style="">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>插件类型</th>
<th width="55%">插件描述</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
@foreach ($plugins as $plugin)
<tr>
<td>{{ $plugin->code }}</td>
<td>{{ $plugin->type }}</td>
<td>
<div class="plugin-describe d-flex align-items-center">
<div class="me-2" style="width: 50px;"><img src="{{ $plugin->icon }}" class="img-fluid"></div>
<div>
<h6>{{ $plugin->name }}</h6>
<div class="">{!! $plugin->description !!}</div>
</div>
</div>
</td>
<td>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="switch-1" {{ $plugin->enabled ? 'checked' : '' }}>
<label class="form-check-label" for="switch-1"></label>
</div>
</td>
<td>
<a class="btn btn-outline-secondary btn-sm" href="{{ $plugin->getEditUrl() }}">编辑</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div id="category-app" class="card">
<div class="card-body">
<a href="{{ admin_route('categories.create') }}" class="btn btn-primary">创建插件</a>
<div class="mt-4" style="">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>插件类型</th>
<th width="55%">插件描述</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
@foreach ($plugins as $plugin)
<tr>
<td>{{ $plugin->code }}</td>
<td>{{ $plugin->type }}</td>
<td>
<div class="plugin-describe d-flex align-items-center">
<div class="me-2" style="width: 50px;"><img src="{{ $plugin->icon }}" class="img-fluid"></div>
<div>
<h6>{{ $plugin->name }}</h6>
<div class="">{!! $plugin->description !!}</div>
</div>
</div>
</td>
<td>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="switch-1"
{{ $plugin->enabled ? 'checked' : '' }}>
<label class="form-check-label" for="switch-1"></label>
</div>
</td>
<td>
<a class="btn btn-outline-secondary btn-sm" href="{{ $plugin->getEditUrl() }}">编辑</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('footer')
<script>
$('.form-switch input[type="checkbox"]').change(function(event) {
console.log($(this).prop('checked'))
});
</script>
<script>
$('.form-switch input[type="checkbox"]').change(function(event) {
console.log($(this).prop('checked'))
});
</script>
@endpush