@@ -260,7 +269,13 @@
switchTab($(item).attr("switch-tab"));
return "请填写标题";
}
- }
+ },
+ desc: function (value, item) {
+ if (!value) {
+ switchTab($(item).attr("switch-tab"));
+ return "请填写文章概述";
+ }
+ },
});
function switchTab(number) {
diff --git a/app/admin/view/mall_news/lists.html b/app/admin/view/mall_news/lists.html
index 89cd7335..28c7be02 100644
--- a/app/admin/view/mall_news/lists.html
+++ b/app/admin/view/mall_news/lists.html
@@ -126,6 +126,7 @@
, {field: 'title', title: '标题', width: 300}
, {field: 'type', title: '文章类型', width: 200, align: 'center',templet: '#news-type'}
, {field: 'is_top', title: '是否置顶', width: 320, align: 'center', templet: '#news-top'}
+ , {field: 'sort', title: '排序', width: 320, align: 'center'}
, {fixed: 'right', title: '操作', width: 400, align: 'center', toolbar: '#operation'}
]);
}
diff --git a/app/api/logic/IndexLogic.php b/app/api/logic/IndexLogic.php
index b0f78937..efbfd0ef 100644
--- a/app/api/logic/IndexLogic.php
+++ b/app/api/logic/IndexLogic.php
@@ -19,6 +19,7 @@ use app\api\logic\SeckillGoodsLogic;
use think\facade\Db;
use app\common\model\activity_area\ActivityArea;
use think\facade\Event;
+use app\common\model\MallNews;
class IndexLogic extends Logic
@@ -79,7 +80,7 @@ class IndexLogic extends Logic
$set_price_type = 3;
}
if ($set['set_pro'] != 0) {
-// $set_price_type = 1;
+ // $set_price_type = 1;
if ($set['set_pro_type'] == 1) {
$hots[$key]['purchase_price'] = round($value['purchase_price'] * (100 + $set['set_pro']) / 100, 2);
}
@@ -88,7 +89,7 @@ class IndexLogic extends Logic
}
}
if ($set['set_issued'] != 0) {
-// $set_price_type = 2;
+ // $set_price_type = 2;
if ($set['set_issued_type'] == 1) {
$hots[$key]['issuing_price'] = round($value['issuing_price'] * (100 + $set['set_issued']) / 100, 2);
}
@@ -97,7 +98,7 @@ class IndexLogic extends Logic
}
}
if ($set['set_wholesale'] != 0) {
-// $set_price_type = 3;
+ // $set_price_type = 3;
if ($set['set_wholesale_type'] == 1) {
$hots[$key]['wholesale_price'] = round($value['wholesale_price'] * (100 + $set['set_wholesale']) / 100, 2);
}
@@ -121,7 +122,7 @@ class IndexLogic extends Logic
$set_price_type = 3;
}
if ($set['set_pro'] != 0) {
-// $set_price_type = 1;
+ // $set_price_type = 1;
if ($set['set_pro_type'] == 1) {
$news[$key]['purchase_price'] = round($value['purchase_price'] * (100 + $set['set_pro']) / 100, 2);
}
@@ -130,7 +131,7 @@ class IndexLogic extends Logic
}
}
if ($set['set_issued'] != 0) {
-// $set_price_type = 2;
+ // $set_price_type = 2;
if ($set['set_issued_type'] == 1) {
$news[$key]['issuing_price'] = round($value['issuing_price'] * (100 + $set['set_issued']) / 100, 2);
}
@@ -139,7 +140,7 @@ class IndexLogic extends Logic
}
}
if ($set['set_wholesale'] != 0) {
-// $set_price_type = 3;
+ // $set_price_type = 3;
if ($set['set_wholesale_type'] == 1) {
$news[$key]['wholesale_price'] = round($value['wholesale_price'] * (100 + $set['set_wholesale']) / 100, 2);
}
@@ -166,7 +167,7 @@ class IndexLogic extends Logic
$set_price_type = 3;
}
if ($set['set_pro'] != 0) {
-// $set_price_type = 1;
+ // $set_price_type = 1;
if ($set['set_pro_type'] == 1) {
$shopRecommend[$k]['goods_list'][$key]['purchase_price'] = round($value['purchase_price'] * (100 + $set['set_pro']) / 100, 2);
}
@@ -175,7 +176,7 @@ class IndexLogic extends Logic
}
}
if ($set['set_issued'] != 0) {
-// $set_price_type = 2;
+ // $set_price_type = 2;
if ($set['set_issued_type'] == 1) {
$shopRecommend[$k]['goods_list'][$key]['issuing_price'] = round($value['issuing_price'] * (100 + $set['set_issued']) / 100, 2);
}
@@ -184,7 +185,7 @@ class IndexLogic extends Logic
}
}
if ($set['set_wholesale'] != 0) {
-// $set_price_type = 3;
+ // $set_price_type = 3;
if ($set['set_wholesale_type'] == 1) {
$shopRecommend[$k]['goods_list'][$key]['wholesale_price'] = round($value['wholesale_price'] * (100 + $set['set_wholesale']) / 100, 2);
}
@@ -507,15 +508,15 @@ class IndexLogic extends Logic
if($set['price_type']==3){
$set_price_type = 3;
}
-// if ($set['set_pro'] != 0) {
-// $set_price_type = 1;
-// }
-// if ($set['set_issued'] != 0) {
-// $set_price_type = 2;
-// }
-// if ($set['set_wholesale'] != 0) {
-// $set_price_type = 3;
-// }
+ // if ($set['set_pro'] != 0) {
+ // $set_price_type = 1;
+ // }
+ // if ($set['set_issued'] != 0) {
+ // $set_price_type = 2;
+ // }
+ // if ($set['set_wholesale'] != 0) {
+ // $set_price_type = 3;
+ // }
}
}
return [
@@ -618,7 +619,7 @@ class IndexLogic extends Logic
$set_price_type = 3;
}
if ($set['set_pro'] != 0) {
-// $set_price_type = 1;
+ // $set_price_type = 1;
if ($set['set_pro_type'] == 1) {
$lists[$key]['purchase_price'] = round($value['purchase_price'] * (100 + $set['set_pro']) / 100, 2);
}
@@ -627,7 +628,7 @@ class IndexLogic extends Logic
}
}
if ($set['set_issued'] != 0) {
-// $set_price_type = 2;
+ // $set_price_type = 2;
if ($set['set_issued_type'] == 1) {
$lists[$key]['issuing_price'] = round($value['issuing_price'] * (100 + $set['set_issued']) / 100, 2);
}
@@ -636,7 +637,7 @@ class IndexLogic extends Logic
}
}
if ($set['set_wholesale'] != 0) {
-// $set_price_type = 3;
+ // $set_price_type = 3;
if ($set['set_wholesale_type'] == 1) {
$lists[$key]['wholesale_price'] = round($value['wholesale_price'] * (100 + $set['set_wholesale']) / 100, 2);
}
@@ -706,7 +707,7 @@ class IndexLogic extends Logic
$set_price_type = 3;
}
if ($set['set_pro'] != 0) {
-// $set_price_type = 1;
+ // $set_price_type = 1;
if ($set['set_pro_type'] == 1) {
$lists[$key]['purchase_price'] = round($value['purchase_price'] * (100 + $set['set_pro']) / 100, 2);
}
@@ -715,7 +716,7 @@ class IndexLogic extends Logic
}
}
if ($set['set_issued'] != 0) {
-// $set_price_type = 2;
+ // $set_price_type = 2;
if ($set['set_issued_type'] == 1) {
$lists[$key]['issuing_price'] = round($value['issuing_price'] * (100 + $set['set_issued']) / 100, 2);
}
@@ -724,7 +725,7 @@ class IndexLogic extends Logic
}
}
if ($set['set_wholesale'] != 0) {
-// $set_price_type = 3;
+ // $set_price_type = 3;
if ($set['set_wholesale_type'] == 1) {
$lists[$key]['wholesale_price'] = round($value['wholesale_price'] * (100 + $set['set_wholesale']) / 100, 2);
}
@@ -762,6 +763,7 @@ class IndexLogic extends Logic
'mnp_share_title' => '',
'mnp_share_image' => ''
]);
+
if (empty($share_mnp['mnp_share_image'])) {
$share_mnp['mnp_share_image'] = '';
} else {
@@ -780,6 +782,9 @@ class IndexLogic extends Logic
$center_top_bg = UrlServer::getFileUrl($center_top_bg);
}
+ // 商城快讯
+ $mall_news = MallNews::where('delete_time', 0)->order('sort desc, create_time desc')->limit(3)->select();
+
$config = [
'shop_hide_goods' => ConfigServer::get('decoration', 'shop_hide_goods', 0), //商品详细是否显示店铺
'shop_street_hide' => ConfigServer::get('decoration', 'shop_street_hide', 0), //是否显示店铺街
@@ -805,6 +810,8 @@ class IndexLogic extends Logic
'android_download' => ConfigServer::get('app', 'line_android', ''),//安卓下载链接
'download_doc' => ConfigServer::get('app', 'download_doc', ''),//app下载文案
'cate_style' => ConfigServer::get('decoration', 'layout_no', 1),//分类页面风格
+ 'mall_news' => $mall_news,
+ 'show_mall_news' => true,
'index_setting' => [ // 首页设置
// 热销榜单
'host_show' => ConfigServer::get('decoration_index', 'host_show', 1),