完善商城快讯
This commit is contained in:
parent
947f0bd188
commit
9189744da6
@ -3,12 +3,9 @@
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\goods\GoodsLogic;
|
||||
use app\admin\logic\live\LiveGoodsLogic;
|
||||
use app\admin\logic\live\LiveRoomLogic;
|
||||
use app\admin\logic\MallNewsLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
use think\Exception;
|
||||
|
||||
class MallNews extends AdminBase
|
||||
{
|
||||
@ -19,9 +16,7 @@ class MallNews extends AdminBase
|
||||
$lists = MallNewsLogic::lists($get);
|
||||
return JsonServer::success('', $lists);
|
||||
}
|
||||
return view('', [
|
||||
'shop' => LiveRoomLogic::shopLists()
|
||||
]);
|
||||
return view('');
|
||||
}
|
||||
|
||||
public function add()
|
||||
|
||||
@ -5,8 +5,8 @@ namespace app\admin\logic;
|
||||
use app\common\basics\Logic;
|
||||
use app\common\model\MallNews;
|
||||
use app\common\model\MallNewsFile;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\storage\Driver as StorageDriver;
|
||||
use app\common\server\UrlServer;
|
||||
use think\facade\Config;
|
||||
use think\facade\Db;
|
||||
|
||||
@ -19,8 +19,15 @@ class MallNewsLogic extends Logic
|
||||
private static function config()
|
||||
{
|
||||
return [
|
||||
'default' => ConfigServer::get('storage', 'default', 'local'),
|
||||
'engine' => ConfigServer::get('storage_engine') ?? ['local'=>[]]
|
||||
"default" => "aliyun",
|
||||
"engine" => [
|
||||
"aliyun" => [
|
||||
"bucket" => Config::get('aliyunoss.bucket'),
|
||||
"access_key_id" => Config::get('aliyunoss.access_key_id'),
|
||||
"access_key_secret" => Config::get('aliyunoss.access_key_secret'),
|
||||
"domain" => Config::get('aliyunoss.domain'),
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
@ -43,7 +50,6 @@ class MallNewsLogic extends Logic
|
||||
'var_page' => 'page'
|
||||
])
|
||||
->toArray();
|
||||
|
||||
return ['count' => $lists['total'], 'lists' => $lists['data']];
|
||||
}
|
||||
|
||||
@ -51,10 +57,13 @@ class MallNewsLogic extends Logic
|
||||
public static function detail($id)
|
||||
{
|
||||
$result = MallNews::with('files')->where(['id' => $id, 'delete_time' => 0])->find();
|
||||
|
||||
if (isset($result['files'])) {
|
||||
foreach ($result['files'] as &$v) {
|
||||
$v['src'] = Config::get('aliyunoss.domain') . self::$FILE_VIDEO_PATH . '/'. $v['src'];
|
||||
if ($result['type'] == 0) {
|
||||
$v['src'] = UrlServer::getFileUrl('uploads/images/' . $v['src']);
|
||||
} else {
|
||||
$v['src'] = Config::get('aliyunoss.domain') . self::$FILE_VIDEO_PATH . '/'. $v['src'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
</div>
|
||||
|
||||
<div id="mall-video" class="layui-form-item" style="display: none">
|
||||
<label class="layui-form-label"><span style="color:red;">*</span>视频:</label>
|
||||
<label class="layui-form-label">视频:</label>
|
||||
<div id="upload-video-block" class="layui-input-block">
|
||||
<div class="like-upload-image">
|
||||
<div class="upload-image-elem"><a class="add-upload-video"> + 上传视频</a></div>
|
||||
|
||||
@ -81,7 +81,7 @@
|
||||
<label class="layui-form-label">商品:</label>
|
||||
<div class="layui-input-inline" style="display: flex">
|
||||
<div id="shop_name">{$detail.shop['name']}</div>
|
||||
<input type="hidden" id="shop_id" name="shop_id">
|
||||
<input type="hidden" id="shop_id" name="shop_id" style="margin-right: 10px;">
|
||||
<a class="layui-btn layui-btn-normal select-goods">选择商品</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -151,8 +151,8 @@
|
||||
for(j = 0; j < detail['files'].length; j++) {
|
||||
html = html +
|
||||
'<div class="upload-image-div">' +
|
||||
'<img src="' + detail['files'] + '" alt="img" />' +
|
||||
'<input type="hidden" name="mall_news_images[]" value="' + detail['files'] + '">' +
|
||||
'<img src="' + detail['files'][j].src + '" alt="img" />' +
|
||||
'<input type="hidden" name="mall_news_images[]" value="' + detail['files'][j].src + '">' +
|
||||
'<div class="del-upload-btn">x</div>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
@ -125,7 +125,6 @@
|
||||
{field: 'goodsId', width: 80, title: 'ID', sort: true, hide: true}
|
||||
, {field: 'title', title: '标题', width: 300}
|
||||
, {field: 'type', title: '文章类型', width: 200, align: 'center',templet: '#news-type'}
|
||||
, {field: 'shop_name', title: '商品名称', width: 320, align: 'center'}
|
||||
, {field: 'is_top', title: '是否置顶', width: 320, align: 'center', templet: '#news-top'}
|
||||
, {fixed: 'right', title: '操作', width: 400, align: 'center', toolbar: '#operation'}
|
||||
]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user