diff --git a/beike/Admin/View/Components/Form/Input.php b/beike/Admin/View/Components/Form/Input.php index 5dfb190d..1e9c4361 100644 --- a/beike/Admin/View/Components/Form/Input.php +++ b/beike/Admin/View/Components/Form/Input.php @@ -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; diff --git a/beike/Admin/View/Components/Form/InputLocale.php b/beike/Admin/View/Components/Form/InputLocale.php index bdf946b1..a1718b2b 100644 --- a/beike/Admin/View/Components/Form/InputLocale.php +++ b/beike/Admin/View/Components/Form/InputLocale.php @@ -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; diff --git a/beike/Admin/View/Components/Form/RichText.php b/beike/Admin/View/Components/Form/RichText.php index 5d72fe31..75c84b10 100644 --- a/beike/Admin/View/Components/Form/RichText.php +++ b/beike/Admin/View/Components/Form/RichText.php @@ -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; } diff --git a/beike/Admin/View/Components/Form/Textarea.php b/beike/Admin/View/Components/Form/Textarea.php index 6d260042..b4767b41 100644 --- a/beike/Admin/View/Components/Form/Textarea.php +++ b/beike/Admin/View/Components/Form/Textarea.php @@ -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; } diff --git a/public/image/vip-icon.png b/public/image/vip-icon.png new file mode 100644 index 00000000..45fa3489 Binary files /dev/null and b/public/image/vip-icon.png differ diff --git a/public/image/vip-info.webp b/public/image/vip-info.webp new file mode 100644 index 00000000..59eaf3b3 Binary files /dev/null and b/public/image/vip-info.webp differ diff --git a/public/vendor/cookie/js.cookie.min.js b/public/vendor/cookie/js.cookie.min.js new file mode 100644 index 00000000..8a62aa5e --- /dev/null +++ b/public/vendor/cookie/js.cookie.min.js @@ -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 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 { diff --git a/resources/beike/admin/css/_iconfont.scss b/resources/beike/admin/css/_iconfont.scss index 920bece2..8f2e7fc1 100644 --- a/resources/beike/admin/css/_iconfont.scss +++ b/resources/beike/admin/css/_iconfont.scss @@ -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+*/ diff --git a/resources/beike/admin/js/app.js b/resources/beike/admin/js/app.js index 0d2b1741..bf196a69 100644 --- a/resources/beike/admin/js/app.js +++ b/resources/beike/admin/js/app.js @@ -3,7 +3,7 @@ * @link https://beikeshop.com * @Author pu shuo * @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')}, diff --git a/resources/beike/admin/js/common.js b/resources/beike/admin/js/common.js index 46ea038a..7a9f7b49 100644 --- a/resources/beike/admin/js/common.js +++ b/resources/beike/admin/js/common.js @@ -3,7 +3,7 @@ * @link https://beikeshop.com * @Author pu shuo * @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(); + }) + } + }, } \ No newline at end of file diff --git a/resources/beike/admin/views/components/header.blade.php b/resources/beike/admin/views/components/header.blade.php index f183263f..1280a30f 100644 --- a/resources/beike/admin/views/components/header.blade.php +++ b/resources/beike/admin/views/components/header.blade.php @@ -12,11 +12,14 @@ @endforeach
@@ -43,12 +44,7 @@
- @hook('admin.setting.store.before') - - - -
@@ -93,13 +89,6 @@
主题模板选择
- -
{{ __('admin/setting.enable_tax_info') }}
-
- - - -
{{ __('admin/setting.head_code_info') }}
@@ -209,8 +198,19 @@
- @hook('admin.setting.after') +
+ + + +
{{ __('admin/setting.enable_tax_info') }}
+
+ + + +
+ + @hook('admin.setting.after')
diff --git a/resources/lang/de/admin/setting.php b/resources/lang/de/admin/setting.php index e256dc48..7ffba4a1 100644 --- a/resources/lang/de/admin/setting.php +++ b/resources/lang/de/admin/setting.php @@ -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', diff --git a/resources/lang/en/admin/setting.php b/resources/lang/en/admin/setting.php index 529b1f8c..527625b5 100644 --- a/resources/lang/en/admin/setting.php +++ b/resources/lang/en/admin/setting.php @@ -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', diff --git a/resources/lang/es/admin/setting.php b/resources/lang/es/admin/setting.php index 0a903748..0952af29 100644 --- a/resources/lang/es/admin/setting.php +++ b/resources/lang/es/admin/setting.php @@ -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', diff --git a/resources/lang/fr/admin/setting.php b/resources/lang/fr/admin/setting.php index ceb18402..e992611e 100644 --- a/resources/lang/fr/admin/setting.php +++ b/resources/lang/fr/admin/setting.php @@ -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', diff --git a/resources/lang/it/admin/setting.php b/resources/lang/it/admin/setting.php index a86f2155..3372b2d0 100644 --- a/resources/lang/it/admin/setting.php +++ b/resources/lang/it/admin/setting.php @@ -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', diff --git a/resources/lang/ja/admin/setting.php b/resources/lang/ja/admin/setting.php index 0cfb9e54..54b2e955 100644 --- a/resources/lang/ja/admin/setting.php +++ b/resources/lang/ja/admin/setting.php @@ -18,6 +18,7 @@ return [ 'design_menu_index' => 'ナビゲーション エディター', 'product_per_page' => '各ページに表示される商品の数', + 'checkout_settings' => 'チェックアウト設定', 'basic_settings' => '基本設定', 'store_settings' => 'ストア設定', 'picture_settings' => '画像設定', diff --git a/resources/lang/ru/admin/setting.php b/resources/lang/ru/admin/setting.php index e628bd87..917dff30 100644 --- a/resources/lang/ru/admin/setting.php +++ b/resources/lang/ru/admin/setting.php @@ -18,6 +18,7 @@ return [ 'design_menu_index' => 'Редактор навигации', 'product_per_page' => 'Количество товаров, отображаемых на каждой странице', + 'checkout_settings' => 'настройки оформления заказа', 'basic_settings' => 'Базовые настройки', 'store_settings' => 'Настройки магазина', 'picture_settings' => 'Настройки изображения', diff --git a/resources/lang/zh_cn/admin/setting.php b/resources/lang/zh_cn/admin/setting.php index e84b5078..94be63bb 100644 --- a/resources/lang/zh_cn/admin/setting.php +++ b/resources/lang/zh_cn/admin/setting.php @@ -18,6 +18,7 @@ return [ 'design_menu_index' => '导航编辑器', 'product_per_page' => '每页显示数量', + 'checkout_settings' => '结账设置', 'basic_settings' => '基础设置', 'store_settings' => '商店设置', 'picture_settings' => '图片设置', diff --git a/resources/lang/zh_hk/admin/setting.php b/resources/lang/zh_hk/admin/setting.php index b8323f0f..2c27bf8a 100644 --- a/resources/lang/zh_hk/admin/setting.php +++ b/resources/lang/zh_hk/admin/setting.php @@ -18,6 +18,7 @@ return [ 'design_menu_index' => '導航編輯器', 'product_per_page' => '每頁顯示商品個數', + 'checkout_settings' => '結賬設置', 'basic_settings' => '基礎設置', 'store_settings' => '商店設置', 'picture_settings' => '圖片設置',