优化后台 vip ui 等

同上

后台 form 组件value 添加 html_entity_decode

修改结账设置词条

优化获取版本更新、vip 状态逻辑

wip
This commit is contained in:
pushuo 2023-02-07 15:21:23 +08:00 committed by Edward Yang
parent 1a653be8fa
commit 9191f51176
24 changed files with 130 additions and 64 deletions

View File

@ -22,11 +22,11 @@ class Input extends Component
public bool $required;
public function __construct(string $name, string $title, ?string $value, bool $required = false, ?string $error = '', ?string $width = '400', ?string $type = 'text', ?string $step = '')
public function __construct(string $name, string $title, string $value, bool $required = false, string $error = '', string $width = '400', string $type = 'text', string $step = '')
{
$this->name = $name;
$this->title = $title;
$this->value = $value;
$this->value = html_entity_decode($value);
$this->error = $error;
$this->width = $width;
$this->type = $type;

View File

@ -17,7 +17,7 @@ class InputLocale extends Component
public bool $required;
public function __construct(string $name, string $title, $value, ?string $width = '400', ?bool $required = false)
public function __construct(string $name, string $title, $value, string $width = '400', bool $required = false)
{
$this->name = $name;
$this->title = $title;

View File

@ -18,7 +18,7 @@ class RichText extends Component
{
$this->name = $name;
$this->title = $title;
$this->value = $value;
$this->value = html_entity_decode($value);
$this->required = $required;
}

View File

@ -18,7 +18,7 @@ class Textarea extends Component
{
$this->name = $name;
$this->title = $title;
$this->value = $value;
$this->value = html_entity_decode($value);
$this->required = $required;
}

BIN
public/image/vip-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
public/image/vip-info.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

1
public/vendor/cookie/js.cookie.min.js vendored Normal file
View File

@ -0,0 +1 @@
!function(e){var n;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var t=window.Cookies,o=window.Cookies=e();o.noConflict=function(){return window.Cookies=t,o}}}(function(){function f(){for(var e=0,n={};e<arguments.length;e++){var t=arguments[e];for(var o in t)n[o]=t[o]}return n}function a(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function e(u){function c(){}function t(e,n,t){if("undefined"!=typeof document){"number"==typeof(t=f({path:"/"},c.defaults,t)).expires&&(t.expires=new Date(1*new Date+864e5*t.expires)),t.expires=t.expires?t.expires.toUTCString():"";try{var o=JSON.stringify(n);/^[\{\[]/.test(o)&&(n=o)}catch(e){}n=u.write?u.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var r="";for(var i in t)t[i]&&(r+="; "+i,!0!==t[i]&&(r+="="+t[i].split(";")[0]));return document.cookie=e+"="+n+r}}function n(e,n){if("undefined"!=typeof document){for(var t={},o=document.cookie?document.cookie.split("; "):[],r=0;r<o.length;r++){var i=o[r].split("="),c=i.slice(1).join("=");n||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var f=a(i[0]);if(c=(u.read||u)(c,f)||a(c),n)try{c=JSON.parse(c)}catch(e){}if(t[f]=c,e===f)break}catch(e){}}return e?t[e]:t}}return c.set=t,c.get=function(e){return n(e,!1)},c.getJSON=function(e){return n(e,!0)},c.remove=function(e,n){t(e,"",f(n,{expires:-1}))},c.defaults={},c.withConverter=e,c}(function(){})});

View File

@ -49,16 +49,6 @@
padding: 0;
list-style: none;
> li {
html[lang="zh_cn"] &, html[lang="zh_hk"] &, html[lang="en"] &, html[lang="ja"] & {
padding: 0 1rem;
}
@media screen and (max-width: 1200px) {
html[lang="zh_cn"] &, html[lang="zh_hk"] &, html[lang="en"] &, html[lang="ja"] & {
padding: 0 .2rem;
}
}
.dropdown {
&:hover {
.nav-link {
@ -92,6 +82,16 @@
.navbar {
&.navbar-left {
li {
html[lang="zh_cn"] &, html[lang="zh_hk"] &, html[lang="en"] &, html[lang="ja"] & {
padding: 0 1rem;
}
@media screen and (max-width: 1200px) {
html[lang="zh_cn"] &, html[lang="zh_hk"] &, html[lang="en"] &, html[lang="ja"] & {
padding: 0 .2rem;
}
}
a.nav-link {
position: relative;
@ -121,10 +121,34 @@
&.navbar-right {
> li {
padding: 0 0.3rem !important;
&.vip-serve {
&:not(.active) {
a {
color: #999;
img {
filter: grayscale(100%);
}
}
}
a {
color: #ff6c00;
}
img {
width: 22px;
position: relative;
top: -3px;
}
span {
margin-left: 3px;
}
}
a.nav-link {
padding: 0 10px;
padding: 0 14px;
}
&.update-btn a {

View File

@ -8,13 +8,6 @@
* @LastEditTime 2022-09-16 19:05:25
*/
// @font-face {
// font-family: 'iconfont'; /* Project id 2787822 */
// src: url('//at.alicdn.com/t/font_2787822_7mtbg56vojp.woff2?t=1634612961708') format('woff2'),
// url('//at.alicdn.com/t/font_2787822_7mtbg56vojp.woff?t=1634612961708') format('woff'),
// url('//at.alicdn.com/t/font_2787822_7mtbg56vojp.ttf?t=1634612961708') format('truetype');
// }
@font-face {font-family: 'iconfont';
src: url('/fonts/iconfont/iconfont.woff') format('woff'), /* chrome、firefox */
url('/fonts/iconfont/iconfont.ttf') format('truetype'); /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/

View File

@ -3,7 +3,7 @@
* @link https://beikeshop.com
* @Author pu shuo <pushuo@guangda.work>
* @Date 2022-08-26 18:18:22
* @LastEditTime 2023-02-03 17:46:06
* @LastEditTime 2023-02-08 15:35:25
*/
import http from "../../../js/http";
@ -51,7 +51,8 @@ if (typeof Vue != 'undefined') {
}
$(document).ready(function ($) {
bk.setVersionUpdateTips();
bk.versionUpdateTips();
bk.vipUpdateTips();
$.ajaxSetup({
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},

View File

@ -3,7 +3,7 @@
* @link https://beikeshop.com
* @Author pu shuo <pushuo@guangda.work>
* @Date 2022-08-22 18:32:26
* @LastEditTime 2023-02-03 17:50:57
* @LastEditTime 2023-02-08 15:36:09
*/
export default {
@ -103,15 +103,44 @@ export default {
},
// 设置版本更新提示
setVersionUpdateTips() {
const version = JSON.parse(localStorage.getItem('beike_version'));
if (version && version.has_new_version) {
localStorage.setItem('version', process.env.VUE_APP_VERSION);
$('.new-version').text(version.latest);
$('.update-date').text(version.release_date);
$('.update-btn').show();
versionUpdateTips() {
const data = JSON.parse(Cookies.get('beike_version') || null);
if (data) {
if (data.latest === config.beike_version) {
return;
}
if (data.has_new_version) {
$('.new-version').text(data.latest);
$('.update-date').text(data.release_date);
$('.update-btn').show();
} else {
$('.update-btn').hide();
}
} else {
$('.update-btn').hide();
$http.get(`https://beikeshop.com/api/version?version=${config.beike_version}`).then((res) => {
Cookies.set('beike_version', res, { expires: 1 });
bk.versionUpdateTips();
})
}
}
},
// 设置vip更新提示
vipUpdateTips() {
const data = JSON.parse(Cookies.get('beike_vip') || null);
if (data) {
if (data.vip) {
$('.vip-serve').addClass('active');
}
} else {
$http.get(`https://beikeshop.com/api/vip?domain=${config.app_url}`).then((res) => {
Cookies.set('beike_vip', res, { expires: 1 });
bk.vipUpdateTips();
})
}
},
}

View File

@ -12,11 +12,14 @@
@endforeach
</ul>
<ul class="navbar navbar-right">
<li class="nav-item update-btn" style="display: none">
<li class="nav-item update-btn me-2" style="display: none">
<a href="javascript:void(0)" class="btn btn-outline-primary btn-sm">@lang('admin/common.update_nav')</a>
</li>
<li class="nav-item vip-serve">
<a href="javascript:void(0)" class="nav-link"><img src="/image/vip-icon.png" class="img-fluid"> <span>VIP</span></a>
</li>
<li class="nav-item">
<a href="{{ admin_route('marketing.index') }}" class="nav-link"><i class="bi bi-gem text-primary"></i>&nbsp;@lang('admin/common.marketing')</a>
<a href="{{ admin_route('marketing.index') }}" class="nav-link">@lang('admin/common.marketing')</a>
</li>
<li class="nav-item">
<div class="dropdown">
@ -108,7 +111,7 @@
<div class="mb-4 fs-5 fw-bold text-center">{{ __('admin/common.update_title') }}</div>
<div class="py-3 px-4 bg-light mx-3 lh-lg mb-4">
<div>{{ __('admin/common.update_new_version') }}<span class="new-version fs-5 fw-bold text-success"></span></div>
<div>{{ __('admin/common.update_old_version') }}<span class="fs-5">v{{ config('beike.version') }}</span></div>
<div>{{ __('admin/common.update_old_version') }}<span class="fs-5">{{ config('beike.version') }}</span></div>
<div>{{ __('admin/common.update_date') }}<span class="update-date fs-5"></span></div>
</div>
@ -118,6 +121,7 @@
</div>
</div>
@push('footer')
<script>
let updatePop = null;
@ -134,5 +138,14 @@
$('.update-pop .btn-outline-secondary').click(function() {
layer.close(updatePop)
});
$('.vip-serve').click(function(event) {
layer.open({
type: 1,
title: '',
area: ['500px', '80%'],
content: '<div><img src="image/vip-info.webp" class="img-fluid"></div>',
});
});
</script>
@endpush

View File

@ -13,6 +13,7 @@
<script src="{{ asset('vendor/jquery/jquery-3.6.0.min.js') }}"></script>
<script src="{{ asset('vendor/layer/3.5.1/layer.js') }}"></script>
<script src="{{ asset('vendor/bootstrap/5.1.3/js/bootstrap.bundle.min.js') }}"></script>
<script src="{{ asset('vendor/cookie/js.cookie.min.js') }}"></script>
<link href="{{ mix('/build/beike/admin/css/bootstrap.css') }}" rel="stylesheet">
<link rel="stylesheet" href="{{ asset('vendor/element-ui/2.15.6/css.css') }}">
@if (locale() != 'zh_cn')
@ -56,6 +57,11 @@
const lang = {
file_manager: '{{ __('admin/file_manager.file_manager') }}',
}
const config = {
beike_version: '{{ config('beike.version') }}',
app_url: '{{ config('app.url') }}',
}
</script>
@stack('footer')
</body>

View File

@ -304,14 +304,4 @@
upDate(ordersChart, labels, data);
});
</script>
<script>
$.ajax({
url: 'https://beikeshop.com/api/version?version={{ config('beike.version') }}',
success: function(data) {
localStorage.setItem('beike_version', JSON.stringify(data));
bk.setVersionUpdateTips()
}
});
</script>
@endpush

View File

@ -17,6 +17,9 @@
<li class="nav-item" role="presentation">
<a class="nav-link" data-bs-toggle="tab" href="#tab-store">{{ __('admin/setting.store_settings') }}</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" data-bs-toggle="tab" href="#tab-checkout">{{ __('admin/setting.checkout_settings') }}</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" data-bs-toggle="tab" href="#tab-image">{{ __('admin/setting.picture_settings') }}</a>
</li>
@ -26,9 +29,7 @@
<li class="nav-item" role="presentation">
<a class="nav-link" data-bs-toggle="tab" href="#tab-mail">{{ __('admin/setting.mail_settings') }}</a>
</li>
@hook('admin.setting.nav.after')
</ul>
<div class="tab-content">
@ -43,12 +44,7 @@
</div>
<div class="tab-pane fade" id="tab-store">
@hook('admin.setting.store.before')
<x-admin-form-switch name="guest_checkout" title="{{ __('admin/setting.guest_checkout') }}" value="{{ old('guest_checkout', system_setting('base.guest_checkout', '1')) }}">
</x-admin-form-switch>
<x-admin::form.row title="{{ __('admin/setting.default_address') }}">
<div class="d-lg-flex">
<div>
@ -93,13 +89,6 @@
<div class="help-text font-size-12 lh-base">主题模板选择</div>
</x-admin-form-select>
<x-admin-form-switch name="tax" title="{{ __('admin/setting.enable_tax') }}" value="{{ old('tax', system_setting('base.tax', '0')) }}">
<div class="help-text font-size-12 lh-base">{{ __('admin/setting.enable_tax_info') }}</div>
</x-admin-form-switch>
<x-admin-form-select title="{{ __('admin/setting.tax_address') }}" name="tax_address" :value="old('tax_address', system_setting('base.tax_address', 'shipping'))" :options="$tax_address">
</x-admin-form-select>
<x-admin-form-textarea name="head_code" title="{{ __('admin/setting.head_code') }}" value="{!! old('head_code', system_setting('base.head_code', '')) !!}">
<div class="help-text font-size-12 lh-base">{{ __('admin/setting.head_code_info') }}</div>
</x-admin-form-textarea>
@ -209,8 +198,19 @@
</div>
@hook('admin.setting.after')
<div class="tab-pane fade" id="tab-checkout">
<x-admin-form-switch name="guest_checkout" title="{{ __('admin/setting.guest_checkout') }}" value="{{ old('guest_checkout', system_setting('base.guest_checkout', '1')) }}">
</x-admin-form-switch>
<x-admin-form-switch name="tax" title="{{ __('admin/setting.enable_tax') }}" value="{{ old('tax', system_setting('base.tax', '0')) }}">
<div class="help-text font-size-12 lh-base">{{ __('admin/setting.enable_tax_info') }}</div>
</x-admin-form-switch>
<x-admin-form-select title="{{ __('admin/setting.tax_address') }}" name="tax_address" :value="old('tax_address', system_setting('base.tax_address', 'shipping'))" :options="$tax_address">
</x-admin-form-select>
</div>
@hook('admin.setting.after')
</div>
<x-admin::form.row title="">

View File

@ -18,6 +18,7 @@ return [
'design_menu_index' => 'Navigationseditor',
'product_per_page' => 'Die Anzahl der auf jeder Seite angezeigten Produkte',
'checkout_settings' => 'Checkout-Einstellungen',
'basic_settings' => 'Grundeinstellungen',
'store_settings' => 'Store-Einstellungen',
'picture_settings' => 'Bildeinstellungen',

View File

@ -18,6 +18,7 @@ return [
'design_menu_index' => 'Design Menu',
'product_per_page' => 'The Number of Per Page',
'checkout_settings' => 'checkout settings',
'basic_settings' => 'Basic Settings',
'store_settings' => 'Store Settings',
'picture_settings' => 'Picture Settings',

View File

@ -18,6 +18,7 @@ return [
'design_menu_index' => 'Editor de navegación',
'product_per_page' => 'El número de productos mostrados en cada página',
'checkout_settings' => 'configuración de pago',
'basic_settings' => 'configuraciones básicas',
'store_settings' => 'configuración de la tienda',
'picture_settings' => 'configuraciones de imagen',

View File

@ -18,6 +18,7 @@ return [
'design_menu_index' => 'Éditeur de navigation',
'product_per_page' => 'Le nombre de produits affichés sur chaque page',
'checkout_settings' => 'paramètres de paiement',
'basic_settings' => 'paramètres de base',
'store_settings' => 'paramètres du magasin',
'picture_settings' => 'paramètres de l\'image',

View File

@ -18,6 +18,7 @@ return [
'design_menu_index' => 'Editor di navigazione',
'product_per_page' => 'Il numero di prodotti visualizzati su ogni pagina',
'checkout_settings' => 'impostazioni di pagamento',
'basic_settings' => 'impostazioni di base',
'store_settings' => 'impostazioni negozio',
'picture_settings' => 'impostazioni immagine',

View File

@ -18,6 +18,7 @@ return [
'design_menu_index' => 'ナビゲーション エディター',
'product_per_page' => '各ページに表示される商品の数',
'checkout_settings' => 'チェックアウト設定',
'basic_settings' => '基本設定',
'store_settings' => 'ストア設定',
'picture_settings' => '画像設定',

View File

@ -18,6 +18,7 @@ return [
'design_menu_index' => 'Редактор навигации',
'product_per_page' => 'Количество товаров, отображаемых на каждой странице',
'checkout_settings' => 'настройки оформления заказа',
'basic_settings' => 'Базовые настройки',
'store_settings' => 'Настройки магазина',
'picture_settings' => 'Настройки изображения',

View File

@ -18,6 +18,7 @@ return [
'design_menu_index' => '导航编辑器',
'product_per_page' => '每页显示数量',
'checkout_settings' => '结账设置',
'basic_settings' => '基础设置',
'store_settings' => '商店设置',
'picture_settings' => '图片设置',

View File

@ -18,6 +18,7 @@ return [
'design_menu_index' => '導航編輯器',
'product_per_page' => '每頁顯示商品個數',
'checkout_settings' => '結賬設置',
'basic_settings' => '基礎設置',
'store_settings' => '商店設置',
'picture_settings' => '圖片設置',