问答系统开发
|
|
@ -67,7 +67,7 @@ class Answer extends Common
|
|||
'total' => $total,
|
||||
'where' => $params,
|
||||
'page' => isset($params['page']) ? intval($params['page']) : 1,
|
||||
'url' => MyUrl('admin/order/index'),
|
||||
'url' => MyUrl('admin/answer/index'),
|
||||
);
|
||||
$page = new \base\Page($page_params);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace app\plugins\answers;
|
|||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
use app\plugins\answers\Service;
|
||||
use app\service\SearchService;
|
||||
use app\service\GoodsService;
|
||||
|
||||
/**
|
||||
* 问答 - 后台管理
|
||||
|
|
@ -39,12 +39,15 @@ class Admin extends Controller
|
|||
$this->assign('data', isset($base['data']) ? $base['data'] : []);
|
||||
|
||||
// 幻灯片
|
||||
$data_params = array(
|
||||
'where' => ['is_enable'=>1],
|
||||
);
|
||||
$data_params = [
|
||||
'where' => ['is_enable'=>1],
|
||||
];
|
||||
$slider = Service::SlideList($data_params);
|
||||
$this->assign('slider', isset($slider['data']) ? $slider['data'] : []);
|
||||
|
||||
// 商品数据
|
||||
$goods = Service::GoodsList();
|
||||
$this->assign('goods_list', $goods['data']['goods']);
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/admin/index');
|
||||
}
|
||||
|
|
@ -70,6 +73,16 @@ class Admin extends Controller
|
|||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
|
||||
// 获取推荐问答
|
||||
if(!empty($ret['data']['category_ids']))
|
||||
{
|
||||
$answers = Service::AnswerList(['n'=>100, 'field'=>'id,content as title', 'category_ids'=> $ret['data']['category_ids']]);
|
||||
$this->assign('answers_rc_list', $answers['data']);
|
||||
} else {
|
||||
$this->assign('answers_rc_list', []);
|
||||
}
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/admin/baseinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
|
|
@ -203,15 +216,12 @@ class Admin extends Controller
|
|||
*/
|
||||
public function goodsinfo($params = [])
|
||||
{
|
||||
// 数据
|
||||
if(!empty($params['id']))
|
||||
{
|
||||
$data_params = array(
|
||||
'where' => ['id'=>intval($params['id'])],
|
||||
);
|
||||
$ret = Service::SlideList($data_params);
|
||||
$this->assign('data', empty($ret['data'][0]) ? [] : $ret['data'][0]);
|
||||
}
|
||||
// 商品数据
|
||||
$goods = Service::GoodsList();
|
||||
$this->assign('goods', $goods['data']);
|
||||
|
||||
// 商品分类
|
||||
$this->assign('goods_category_list', GoodsService::GoodsCategory());
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/admin/goodsinfo');
|
||||
}
|
||||
|
|
@ -252,7 +262,28 @@ class Admin extends Controller
|
|||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
print_r($params);die;
|
||||
// 搜索数据
|
||||
return Service::GoodsSave($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 问答搜索
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function answerssearch($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 问答内容
|
||||
return Service::AnswerList(['n'=>100, 'field'=>'id,content as title']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -2,6 +2,10 @@
|
|||
namespace app\plugins\answers;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
use app\service\AnswerService;
|
||||
use app\service\UserService;
|
||||
use app\plugins\answers\Service;
|
||||
|
||||
/**
|
||||
* 问答 - 前端独立页面入口
|
||||
|
|
@ -12,13 +16,62 @@ use think\Controller;
|
|||
*/
|
||||
class Index extends Controller
|
||||
{
|
||||
// 前端页面入口
|
||||
/**
|
||||
* 前端页面入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-07
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
// 数组组装
|
||||
$this->assign('data', ['hello', 'world!']);
|
||||
$this->assign('msg', 'hello world! index');
|
||||
// 基础数据
|
||||
$base = PluginsService::PluginsData('answers', ['images']);
|
||||
$this->assign('plugins_answers_data', isset($base['data']) ? $base['data'] : []);
|
||||
|
||||
// 幻灯片
|
||||
$data_params = [
|
||||
'where' => ['is_enable'=>1],
|
||||
];
|
||||
$slider = Service::SlideList($data_params);
|
||||
$this->assign('plugins_answers_slider', isset($slider['data']) ? $slider['data'] : []);
|
||||
|
||||
// 商品数据
|
||||
$goods = Service::GoodsList();
|
||||
$this->assign('plugins_answers_goods_list', $goods['data']['goods']);
|
||||
|
||||
// 最新问答内容
|
||||
$middle_new_page_number = isset($base['data']['middle_new_page_number']) ? intval($base['data']['middle_new_page_number']) : 15;
|
||||
$answer = Service::AnswerList(['n'=>$middle_new_page_number]);
|
||||
$this->assign('plugins_answers_middle_answer_list', $answer['data']);
|
||||
|
||||
// 推荐问答
|
||||
if(!empty($base['data']['category_ids']))
|
||||
{
|
||||
$answers = Service::AnswerList(['n'=>100, 'category_ids'=> $base['data']['category_ids']]);
|
||||
$this->assign('plugins_answers_rc_list', $answers['data']);
|
||||
} else {
|
||||
$this->assign('plugins_answers_rc_list', []);
|
||||
}
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/index/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 提问
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function answer($params = [])
|
||||
{
|
||||
$params = input('post.');
|
||||
$params['user'] = UserService::LoginUserInfo();
|
||||
return AnswerService::Add($params);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -11,8 +11,9 @@
|
|||
namespace app\plugins\answers;
|
||||
|
||||
use think\Db;
|
||||
use app\service\GoodsService;
|
||||
use app\service\ResourcesService;
|
||||
use app\service\GoodsService;
|
||||
use app\service\AnswerService;
|
||||
|
||||
/**
|
||||
* 问答系统服务层
|
||||
|
|
@ -241,5 +242,112 @@ class Service
|
|||
// 获取数据
|
||||
return GoodsService::CategoryGoodsList(['where'=>$where, 'm'=>0, 'n'=>100, 'field'=>$field]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联商品保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-07
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function GoodsSave($params = [])
|
||||
{
|
||||
// 清除商品id
|
||||
Db::name('PluginsAnswersGoods')->where('id', '>', 0)->delete();
|
||||
|
||||
// 写入商品id
|
||||
if(!empty($params['category_ids']))
|
||||
{
|
||||
$ids_all = explode(',', $params['category_ids']);
|
||||
$data = [];
|
||||
foreach($ids_all as $goods_id)
|
||||
{
|
||||
$data[] = [
|
||||
'goods_id' => $goods_id,
|
||||
'add_time' => time(),
|
||||
];
|
||||
}
|
||||
if(Db::name('PluginsAnswersGoods')->insertAll($data) < count($data))
|
||||
{
|
||||
return DataReturn('操作失败', -100);
|
||||
}
|
||||
}
|
||||
return DataReturn('操作成功', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function GoodsList($params = [])
|
||||
{
|
||||
// 获取推荐商品id
|
||||
$goods_ids = Db::name('PluginsAnswersGoods')->column('goods_id');
|
||||
if(empty($goods_ids))
|
||||
{
|
||||
return DataReturn('没有商品', 0, ['goods'=>[], 'goods_ids'=>[]]);
|
||||
}
|
||||
|
||||
// 条件
|
||||
$where = [
|
||||
['g.is_delete_time', '=', 0],
|
||||
['g.is_shelves', '=', 1],
|
||||
['g.id', 'in', $goods_ids],
|
||||
];
|
||||
|
||||
// 指定字段
|
||||
$field = 'g.id,g.title,g.images';
|
||||
|
||||
// 获取数据
|
||||
$ret = GoodsService::CategoryGoodsList(['where'=>$where, 'm'=>0, 'n'=>100, 'field'=>$field]);
|
||||
return DataReturn('操作成功', 0, ['goods'=>$ret['data'], 'goods_ids'=>$goods_ids]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 问答列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function AnswerList($params = [])
|
||||
{
|
||||
// 条件
|
||||
$where = [
|
||||
['is_delete_time', '=', 0],
|
||||
['is_show', '=', 1],
|
||||
];
|
||||
|
||||
// 搜索关键字
|
||||
if(!empty($params['keywords']))
|
||||
{
|
||||
$where[] = ['content', 'like', '%'.$params['keywords'].'%'];
|
||||
}
|
||||
|
||||
// 指定问答id
|
||||
if(!empty($params['category_ids']))
|
||||
{
|
||||
$where[] = ['id', 'in', explode(',', $params['category_ids'])];
|
||||
}
|
||||
|
||||
// 字段
|
||||
$field = empty($params['field']) ? 'id,name,content,reply,is_reply,add_time' : $params['field'];
|
||||
|
||||
// 获取列表
|
||||
$data_params = array(
|
||||
'm' => 0,
|
||||
'n' => isset($params['n']) ? intval($params['n']) : 10,
|
||||
'where' => $where,
|
||||
'field' => $field,
|
||||
);
|
||||
return AnswerService::AnswerList($data_params);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -41,13 +41,13 @@
|
|||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>右侧热门问答名称<span class="fs-12 fw-100 cr-999">(默认 热门问答)</span></label>
|
||||
<input type="text" name="right_top_hot_name" placeholder="右侧热门问答名称" maxlength="30" data-validation-message="右侧热门问答名称格式最多 30 个字符" class="am-radius" {{if !empty($data['right_top_hot_name'])}} value="{{$data.right_top_hot_name}}"{{/if}} />
|
||||
<label>右侧推荐问答名称<span class="fs-12 fw-100 cr-999">(默认 推荐问答)</span></label>
|
||||
<input type="text" name="right_top_rec_name" placeholder="右侧推荐问答名称" maxlength="30" data-validation-message="右侧推荐问答名称格式最多 30 个字符" class="am-radius" {{if !empty($data['right_top_rec_name'])}} value="{{$data.right_top_rec_name}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>中间最新问答名称<span class="fs-12 fw-100 cr-999">(默认 最新问答)</span></label>
|
||||
<input type="text" name="right_middle_new_name" placeholder="中间最新问答名称" maxlength="30" data-validation-message="中间最新问答名称格式最多 30 个字符" class="am-radius" {{if !empty($data['right_middle_new_name'])}} value="{{$data.right_middle_new_name}}"{{/if}} />
|
||||
<input type="text" name="middle_new_name" placeholder="中间最新问答名称" maxlength="30" data-validation-message="中间最新问答名称格式最多 30 个字符" class="am-radius" {{if !empty($data['middle_new_name'])}} value="{{$data.middle_new_name}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
|
|
@ -55,6 +55,43 @@
|
|||
<input type="text" name="right_top_goods_name" placeholder="右侧推荐商品名称" maxlength="30" data-validation-message="右侧推荐商品名称格式最多 30 个字符" class="am-radius" {{if !empty($data['right_top_goods_name'])}} value="{{$data.right_top_goods_name}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>最新问答展示数量<span class="fs-12 fw-100 cr-999">(默认 15 条)</span></label>
|
||||
<input type="number" name="middle_new_page_number" placeholder="右侧推荐商品名称" maxlength="30" data-validation-message="请填写最新问答展示数量" class="am-radius" value="{{if !empty($data['middle_new_page_number'])}}{{$data.middle_new_page_number}}{{else /}}15{{/if}}" />
|
||||
</div>
|
||||
|
||||
<label>右侧推荐问答</label>
|
||||
<div class="forth-selection-container">
|
||||
<div class="forth-selection-form" data-search-url="{{:PluginsAdminUrl('answers', 'admin', 'answerssearch')}}">
|
||||
<input type="text" placeholder="商品名称" class="am-radius forth-selection-form-keywords" />
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm search-submit">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing forth-selection-list">
|
||||
<input type="text" name="category_ids" value="{{if !empty($data['category_ids'])}}{{$data.category_ids}}{{/if}}" data-validation-message="请选择问答" />
|
||||
<div class="forth-selection-items am-fl">
|
||||
<div class="title">可选</div>
|
||||
<ul class="forth-selection-content am-list ul-left">
|
||||
<div class="table-no">没有相关数据</div>
|
||||
</ul>
|
||||
</div>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-xs selected-all">全选 <i class="am-icon-angle-double-right"></i></button>
|
||||
<div class="forth-selection-items am-fr">
|
||||
<div class="title">已选</div>
|
||||
<ul class="forth-selection-content am-list ul-right">
|
||||
<div class="table-no {{if !empty($answers_rc_list)}}none{{/if}}">没有相关数据</div>
|
||||
{{if !empty($answers_rc_list)}}
|
||||
{{foreach $answers_rc_list as $v}}
|
||||
<li class="am-animation-slide-bottom items-li-{{$v.id}}">
|
||||
<span class="name" data-value="{{$v.id}}">{{$v.title}}</span>
|
||||
<i class="am-icon-trash-o am-fr"></i>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -17,36 +17,46 @@
|
|||
<div class="answers-content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('answers', 'admin', 'goodssave')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('answers', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<div class="goods-container">
|
||||
<div class="goods-form" data-search-url="{{:PluginsAdminUrl('answers', 'admin', 'goodssearch')}}">
|
||||
<select class="am-radius c-p chosen-select goods-form-category" data-placeholder="可选择..." data-validation-message="请选择商品分类">
|
||||
<div class="forth-selection-container">
|
||||
<div class="forth-selection-form" data-search-url="{{:PluginsAdminUrl('answers', 'admin', 'goodssearch')}}">
|
||||
<select class="am-radius c-p chosen-select forth-selection-form-category" data-placeholder="可选择..." data-validation-message="请选择商品分类">
|
||||
<option value="">可选择...</option>
|
||||
{{if !empty($goods_category_list)}}
|
||||
{{foreach $goods_category_list as $v}}
|
||||
<option value="{{$v.id}}">{{$v.name}}</option>
|
||||
<option value="{{$v.id}}">一级 - {{$v.name}}</option>
|
||||
{{if !empty($v['items'])}}
|
||||
{{foreach $v.items as $vs}}
|
||||
<option style="padding-left: 30px;" value="{{$vs.id}}">二级 - {{$vs.name}}</option>
|
||||
{{if !empty($vs['items'])}}
|
||||
{{foreach $vs.items as $vss}}
|
||||
<option style="padding-left: 60px;" value="{{$vss.id}}">三级 - {{$vss.name}}</option>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</select>
|
||||
<input type="text" placeholder="商品名称" class="am-radius goods-form-keywords" />
|
||||
<input type="text" placeholder="商品名称" class="am-radius forth-selection-form-keywords" />
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm search-submit">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing goods-list">
|
||||
<input type="text" name="goods_category_ids" value="{{if !empty($goods_category_ids)}}{{:implode(',', json_decode($data['goods_category_ids'], true))}}{{/if}}" data-validation-message="请选择商品" required />
|
||||
<div class="goods-items am-fl">
|
||||
<div class="am-form-group am-form-group-refreshing forth-selection-list">
|
||||
<input type="text" name="category_ids" value="{{if !empty($goods['goods_ids'])}}{{:implode(',', $goods['goods_ids'])}}{{/if}}" data-validation-message="请选择商品" />
|
||||
<div class="forth-selection-items am-fl">
|
||||
<div class="title">可选</div>
|
||||
<ul class="goods-content am-list ul-left">
|
||||
<ul class="forth-selection-content am-list ul-left">
|
||||
<div class="table-no">没有相关数据</div>
|
||||
</ul>
|
||||
</div>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-xs selected-all">全选 <i class="am-icon-angle-double-right"></i></button>
|
||||
<div class="goods-items am-fr">
|
||||
<div class="forth-selection-items am-fr">
|
||||
<div class="title">已选</div>
|
||||
<ul class="goods-content am-list ul-right">
|
||||
<div class="table-no {{if !empty($data)}}none{{/if}}">没有相关数据</div>
|
||||
{{if !empty($goods_list)}}
|
||||
{{foreach $goods_list as $v}}
|
||||
<ul class="forth-selection-content am-list ul-right">
|
||||
<div class="table-no {{if !empty($goods['goods'])}}none{{/if}}">没有相关数据</div>
|
||||
{{if !empty($goods['goods'])}}
|
||||
{{foreach $goods['goods'] as $v}}
|
||||
<li class="am-animation-slide-bottom items-li-{{$v.id}}">
|
||||
<span class="name" data-value="{{$v.id}}">{{$v.name}}</span>
|
||||
<span class="name" data-value="{{$v.id}}">{{$v.title}}</span>
|
||||
<i class="am-icon-trash-o am-fr"></i>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
|
|
|
|||
|
|
@ -17,21 +17,12 @@
|
|||
</div>
|
||||
<div class="am-panel-bd">
|
||||
<div class="items">
|
||||
<label>中间横幅</label>
|
||||
<div class="immages-tag">
|
||||
<a href="{{if empty($data['url'])}}javascript:;{{else /}}{{$data.url}}{{/if}}" {{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq 1}} target="_blank"{{/if}}>
|
||||
<img src="{{if !empty($data['images'])}}{{$data.images}}{{else /}}{{$attachment_host}}/static/plugins/images/answers/default-images.png{{/if}}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>右侧热门问答名称</label>
|
||||
<label>右侧推荐问答名称</label>
|
||||
<div>
|
||||
{{if empty($data['right_top_hot_name'])}}
|
||||
热门问答
|
||||
{{if empty($data['right_top_rec_name'])}}
|
||||
推荐问答
|
||||
{{else /}}
|
||||
{{$data.right_top_hot_name}}
|
||||
{{$data.right_top_rec_name}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -39,10 +30,10 @@
|
|||
<div class="items">
|
||||
<label>中间最新问答名称</label>
|
||||
<div>
|
||||
{{if empty($data['right_middle_new_name'])}}
|
||||
{{if empty($data['middle_new_name'])}}
|
||||
最新问答
|
||||
{{else /}}
|
||||
{{$data.right_middle_new_name}}
|
||||
{{$data.middle_new_name}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -57,6 +48,26 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>最新问答展示数量</label>
|
||||
<div>
|
||||
{{if empty($data['middle_new_page_number'])}}
|
||||
默认 15 条
|
||||
{{else /}}
|
||||
{{$data.middle_new_page_number}} 条
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>中间横幅</label>
|
||||
<div class="immages-tag">
|
||||
<a href="{{if empty($data['url'])}}javascript:;{{else /}}{{$data.url}}{{/if}}" {{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq 1}} target="_blank"{{/if}}>
|
||||
<img src="{{if !empty($data['images'])}}{{$data.images}}{{else /}}{{$attachment_host}}/static/plugins/images/answers/default-images.png{{/if}}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -72,7 +83,7 @@
|
|||
<ul class="am-slides">
|
||||
{{foreach $slider as $k=>$v}}
|
||||
<li>
|
||||
<a href="{{$v.url}}">
|
||||
<a href="{{$v.url}}" target="_blank">
|
||||
<img src="{{$v.images_url}}">
|
||||
<div class="am-slider-desc">
|
||||
<div class="am-slider-counter">
|
||||
|
|
@ -97,40 +108,22 @@
|
|||
<a class="am-fr" href="{{:PluginsAdminUrl('answers', 'admin', 'goodsinfo')}}">编辑</a>
|
||||
</div>
|
||||
<div class="am-panel-bd">
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-4 am-avg-lg-8 am-gallery-bordered" data-am-gallery="{ }" >
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-1.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-1.jpg" alt="远方 有一个地方 那里种有我们的梦想"/>
|
||||
<h3 class="am-gallery-title">远方 有一个地方 那里种有我们的梦想</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-2.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-2.jpg" alt="某天 也许会相遇 相遇在这个好地方"/>
|
||||
<h3 class="am-gallery-title">某天 也许会相遇 相遇在这个好地方</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-3.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-3.jpg" alt="不要太担心 只因为我相信"/>
|
||||
<h3 class="am-gallery-title">不要太担心 只因为我相信</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-4.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-4.jpg" alt="终会走过这条遥远的道路"/>
|
||||
<h3 class="am-gallery-title">终会走过这条遥远的道路</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
{{if !empty($goods_list)}}
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-4 am-avg-lg-8 am-gallery-bordered" data-am-gallery="{ }" >
|
||||
{{foreach $goods_list as $goods}}
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{else /}}
|
||||
没有商品数据
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
{{include file="public/header" /}}
|
||||
|
||||
<!-- nav start -->
|
||||
{{include file="public/nav" /}}
|
||||
<!-- nav end -->
|
||||
|
||||
<!-- header top nav -->
|
||||
{{include file="public/header_top_nav" /}}
|
||||
|
||||
|
|
@ -18,204 +14,158 @@
|
|||
|
||||
<!-- content start -->
|
||||
<div class="am-g am-container plugins-answers">
|
||||
<div class="answers-top">
|
||||
<!-- 幻灯片 -->
|
||||
<div class="am-u-md-8 answers-slider">
|
||||
<div data-am-widget="slider" class="am-slider am-slider-c3" data-am-slider='{"controlNav":false}' >
|
||||
<ul class="am-slides">
|
||||
<li>
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-1.jpg">
|
||||
<div class="am-slider-desc"><div class="am-slider-counter"><span class="am-active">1</span>/4</div>远方 有一个地方 那里种有我们的梦想</div>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-2.jpg">
|
||||
<div class="am-slider-desc"><div class="am-slider-counter"><span class="am-active">2</span>/4</div>某天 也许会相遇 相遇在这个好地方</div>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-3.jpg">
|
||||
<div class="am-slider-desc"><div class="am-slider-counter"><span class="am-active">3</span>/4</div>不要太担心 只因为我相信 终会走过这条遥远的道路</div>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-4.jpg">
|
||||
<div class="am-slider-desc"><div class="am-slider-counter"><span class="am-active">4</span>/4</div>OH PARA PARADISE 是否那么重要 你是否那么地遥远</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧列表 -->
|
||||
<div class="am-u-md-4 answers-sidebar">
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default" >
|
||||
<!--列表标题-->
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<!--带更多链接-->
|
||||
<a href="##" class="">
|
||||
<h2>热门问答</h2>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="am-list-news-bd">
|
||||
<ul class="am-list">
|
||||
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">我很囧,你保重....晒晒旅行中的那些囧!</a>
|
||||
<span class="am-list-date">2013-09-18</span>
|
||||
</li>
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">我最喜欢的一张画</a>
|
||||
<span class="am-list-date">2013-10-14</span>
|
||||
</li>
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">“你的旅行,是什么颜色?” 晒照片,换北欧梦幻极光之旅!</a>
|
||||
<span class="am-list-date">2013-11-18</span>
|
||||
</li>
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">我很囧,你保重....晒晒旅行中的那些囧!</a>
|
||||
<span class="am-list-date">2013-09-18</span>
|
||||
</li>
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">我最喜欢的一张画</a>
|
||||
<span class="am-list-date">2013-10-14</span>
|
||||
</li>
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">“你的旅行,是什么颜色?” 晒照片,换北欧梦幻极光之旅!</a>
|
||||
<span class="am-list-date">2013-11-18</span>
|
||||
</li>
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">我很囧,你保重....晒晒旅行中的那些囧!</a>
|
||||
<span class="am-list-date">2013-09-18</span>
|
||||
</li>
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">我最喜欢的一张画</a>
|
||||
<span class="am-list-date">2013-10-14</span>
|
||||
</li>
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">“你的旅行,是什么颜色?” 晒照片,换北欧梦幻极光之旅!</a>
|
||||
<span class="am-list-date">2013-11-18</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="answers-middle-banner">
|
||||
<img src="http://tp5-dev.com/static/upload/images/plugins_commontopmaxpicture/2019/02/09/1549671733978860.jpg" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="am-u-md-8 answers-middle-list">
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default" >
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<!--带更多链接-->
|
||||
<a href="##" class="">
|
||||
<h2>最新问答</h2>
|
||||
</a>
|
||||
</div>
|
||||
<div class="am-list-news-bd">
|
||||
<ul class="am-list">
|
||||
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">我很囧,你保重....晒晒旅行中的那些囧!</a>
|
||||
|
||||
<span class="am-list-date">2013-09-18</span>
|
||||
</li>
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">我最喜欢的一张画</a>
|
||||
|
||||
<span class="am-list-date">2013-10-14</span>
|
||||
</li>
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">“你的旅行,是什么颜色?” 晒照片,换北欧梦幻极光之旅!</a>
|
||||
|
||||
<span class="am-list-date">2013-11-18</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-u-md-4 answers-goods">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<!--带更多链接-->
|
||||
<a href="##" class="">
|
||||
<h2>推荐商品</h2>
|
||||
</a>
|
||||
</div>
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-2 am-avg-lg-2 am-gallery-bordered" data-am-gallery="{ }" >
|
||||
<div class="answers-top">
|
||||
<!-- 幻灯片 -->
|
||||
<div class="am-u-md-8 answers-slider">
|
||||
{{if !empty($plugins_answers_slider)}}
|
||||
<div data-am-widget="slider" class="am-slider am-slider-c3" data-am-slider='{"controlNav":false}'>
|
||||
<ul class="am-slides">
|
||||
{{foreach $plugins_answers_slider as $k=>$v}}
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-1.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-1.jpg" alt="远方 有一个地方 那里种有我们的梦想"/>
|
||||
<h3 class="am-gallery-title">远方 有一个地方 那里种有我们的梦想</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-2.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-2.jpg" alt="某天 也许会相遇 相遇在这个好地方"/>
|
||||
<h3 class="am-gallery-title">某天 也许会相遇 相遇在这个好地方</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-3.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-3.jpg" alt="不要太担心 只因为我相信"/>
|
||||
<h3 class="am-gallery-title">不要太担心 只因为我相信</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-4.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-4.jpg" alt="终会走过这条遥远的道路"/>
|
||||
<h3 class="am-gallery-title">终会走过这条遥远的道路</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-2.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-2.jpg" alt="某天 也许会相遇 相遇在这个好地方"/>
|
||||
<h3 class="am-gallery-title">某天 也许会相遇 相遇在这个好地方</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-3.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-3.jpg" alt="不要太担心 只因为我相信"/>
|
||||
<h3 class="am-gallery-title">不要太担心 只因为我相信</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-4.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-4.jpg" alt="终会走过这条遥远的道路"/>
|
||||
<h3 class="am-gallery-title">终会走过这条遥远的道路</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="http://s.amazeui.org/media/i/demos/bing-4.jpg" class="">
|
||||
<img src="http://s.amazeui.org/media/i/demos/bing-4.jpg" alt="终会走过这条遥远的道路"/>
|
||||
<h3 class="am-gallery-title">终会走过这条遥远的道路</h3>
|
||||
</a>
|
||||
</div>
|
||||
<a href="{{$v.url}}" target="_blank">
|
||||
<img src="{{$v.images_url}}">
|
||||
<div class="am-slider-desc">
|
||||
<div class="am-slider-counter">
|
||||
<span class="am-active">{{$k+1}}</span>/{{:count($plugins_answers_slider)}}</div>
|
||||
{{$v.name}}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- 右侧列表 -->
|
||||
<div class="am-u-md-4 answers-sidebar">
|
||||
<!-- 操作按钮 -->
|
||||
<div class="answers-btn-list">
|
||||
<a type="button" class="am-btn am-btn-warning am-icon-plus answers-btn-list-ask" data-am-modal="{target: '#plugins-answers-popup-ask'}"> 我要提问</a>
|
||||
<a type="button" class="am-btn am-btn-danger am-icon-list-ul am-fr answers-btn-list-my"> 我的提问</a>
|
||||
</div>
|
||||
|
||||
<!-- 右侧推荐问答 -->
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default" >
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['right_top_rec_name'])}}
|
||||
推荐问答
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.right_top_rec_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="am-list-news-bd">
|
||||
{{if !empty($plugins_answers_rc_list)}}
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_rc_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">{{$answers.content}}</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 中间横幅广告 -->
|
||||
{{if !empty($plugins_answers_data['images'])}}
|
||||
<div class="answers-middle-banner">
|
||||
<a href="{{if empty($plugins_answers_data['url'])}}javascript:;{{else /}}{{$plugins_answers_data.url}}{{/if}}" {{if isset($plugins_answers_data['is_new_window_open']) and $plugins_answers_data['is_new_window_open'] eq 1}} target="_blank"{{/if}}>
|
||||
<img src="{{$plugins_answers_data.images}}" />
|
||||
</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<!-- 最新问答 -->
|
||||
<div class="am-u-md-8 answers-middle-list">
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default" >
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['middle_new_name'])}}
|
||||
最新问答
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.middle_new_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="am-list-news-bd">
|
||||
{{if !empty($plugins_answers_middle_answer_list)}}
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_middle_answer_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="##" class="am-list-item-hd ">{{$answers.content}}</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 推荐商品 -->
|
||||
<div class="am-u-md-4 answers-goods">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['right_top_goods_name'])}}
|
||||
推荐商品
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.right_top_goods_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
</div>
|
||||
{{if !empty($plugins_answers_goods_list)}}
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-2 am-avg-lg-2 am-gallery-bordered" data-am-gallery="{}">
|
||||
{{foreach $plugins_answers_goods_list as $goods}}
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- 提问 -->
|
||||
<div class="am-popup" id="plugins-answers-popup-ask">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">提问</h4>
|
||||
<span data-am-modal-close
|
||||
class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<form class="am-form form-validation-plugins-answer-ask view-save" action="{{:PluginsHomeUrl('answers', 'index', 'answer')}}" method="POST" request-type="ajax-reload">
|
||||
<div class="am-form-group">
|
||||
<label>姓名<span class="am-form-group-label-tips">选填</span></label>
|
||||
<input type="text" name="name" placeholder="姓名" data-validation-message="请填写姓名" class="am-radius" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>电话<span class="am-form-group-label-tips">选填</span></label>
|
||||
<input type="text" name="tel" placeholder="电话" data-validation-message="请填写电话" class="am-radius" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>内容<span class="am-form-group-label-tips">必填</span></label>
|
||||
<textarea class="am-radius am-validate" name="content" rows="5" minlength="5" maxlength="300" placeholder="内容至少5个字" data-validation-message="内容格式 5~300 个字符之间" required></textarea>
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
||||
|
|
|
|||
|
|
@ -49,10 +49,11 @@ class AnswerService
|
|||
$where = empty($params['where']) ? [] : $params['where'];
|
||||
$m = isset($params['m']) ? intval($params['m']) : 0;
|
||||
$n = isset($params['n']) ? intval($params['n']) : 10;
|
||||
$field = empty($params['field']) ? '*' : $params['field'];
|
||||
$order_by = empty($params['order_by']) ? 'id desc' : $params['order_by'];
|
||||
|
||||
// 获取数据列表
|
||||
$data = Db::name('Answer')->where($where)->limit($m, $n)->order($order_by)->select();
|
||||
$data = Db::name('Answer')->field($field)->where($where)->limit($m, $n)->order($order_by)->select();
|
||||
if(!empty($data))
|
||||
{
|
||||
$common_is_show_list = lang('common_is_show_list');
|
||||
|
|
@ -60,21 +61,35 @@ class AnswerService
|
|||
foreach($data as &$v)
|
||||
{
|
||||
// 用户信息
|
||||
$user = Db::name('User')->where(['id'=>$v['user_id']])->field('username,nickname,mobile,gender,avatar')->find();
|
||||
$v['username'] = empty($user['username']) ? '' : $user['username'];
|
||||
$v['nickname'] = empty($user['nickname']) ? '' : $user['nickname'];
|
||||
$v['mobile'] = empty($user['mobile']) ? '' : $user['mobile'];
|
||||
$v['avatar'] = empty($user['avatar']) ? '' : $user['avatar'];
|
||||
$v['gender_text'] = isset($user['gender']) ? $common_gender_list[$user['gender']]['name'] : '';
|
||||
if(isset($v['user_id']))
|
||||
{
|
||||
$user = Db::name('User')->where(['id'=>$v['user_id']])->field('username,nickname,mobile,gender,avatar')->find();
|
||||
$v['username'] = empty($user['username']) ? '' : $user['username'];
|
||||
$v['nickname'] = empty($user['nickname']) ? '' : $user['nickname'];
|
||||
$v['mobile'] = empty($user['mobile']) ? '' : $user['mobile'];
|
||||
$v['avatar'] = empty($user['avatar']) ? '' : $user['avatar'];
|
||||
$v['gender_text'] = isset($user['gender']) ? $common_gender_list[$user['gender']]['name'] : '';
|
||||
}
|
||||
|
||||
// 是否显示
|
||||
$v['is_show_text'] = $common_is_show_list[$v['is_show']]['name'];
|
||||
if(isset($v['is_show']))
|
||||
{
|
||||
$v['is_show_text'] = $common_is_show_list[$v['is_show']]['name'];
|
||||
}
|
||||
|
||||
// 创建时间
|
||||
$v['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
|
||||
if(isset($v['add_time']))
|
||||
{
|
||||
$add_time = $v['add_time'];
|
||||
$v['add_time'] = date('Y-m-d H:i:s', $add_time);
|
||||
$v['add_time_date'] = date('Y-m-d', $add_time);
|
||||
}
|
||||
|
||||
// 更新时间
|
||||
$v['upd_time'] = date('Y-m-d H:i:s', $v['upd_time']);
|
||||
if(isset($v['upd_time']))
|
||||
{
|
||||
$v['upd_time'] = date('Y-m-d H:i:s', $v['upd_time']);
|
||||
}
|
||||
}
|
||||
}
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
|
|
@ -148,12 +163,12 @@ class AnswerService
|
|||
// 参数校验
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'checked_type' => 'isset',
|
||||
'key_name' => 'name',
|
||||
'error_msg' => '联系人有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'checked_type' => 'isset',
|
||||
'key_name' => 'tel',
|
||||
'error_msg' => '联系电话有误',
|
||||
],
|
||||
|
|
@ -172,8 +187,8 @@ class AnswerService
|
|||
// 开始操作
|
||||
$data = [
|
||||
'user_id' => isset($params['user']['id']) ? intval($params['user']['id']) : 0,
|
||||
'name' => $params['name'],
|
||||
'tel' => $params['tel'],
|
||||
'name' => isset($params['name']) ? $params['name'] : '',
|
||||
'tel' => isset($params['tel']) ? $params['tel'] : '',
|
||||
'content' => $params['content'],
|
||||
'add_time' => time(),
|
||||
];
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ class GoodsService
|
|||
}
|
||||
|
||||
// 产地
|
||||
if(isset($v['place_origin_name']))
|
||||
if(isset($v['place_origin']))
|
||||
{
|
||||
$v['place_origin_name'] = empty($v['place_origin']) ? null : RegionService::RegionName($v['place_origin']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,11 +16,12 @@
|
|||
/**
|
||||
* 表单优化
|
||||
*/
|
||||
.am-form-group:hover>label { color: #333 !important; }
|
||||
.am-form-group:hover>label>span { color: #FF9800 !important; }
|
||||
.am-form-group:hover>input, .am-form-group:hover>select, .am-form-group:hover>textarea, .am-form-group:hover .chosen-choices, .am-form-group:hover .chosen-single { border: 1px solid #999 ; }
|
||||
.am-form-error .chosen-choices, .am-form-error .chosen-default { border: 1px solid #dd514c !important; }
|
||||
.am-form-success .chosen-choices, .am-form-success .chosen-single { border: 1px solid #5eb95e !important; }
|
||||
form.am-form .am-form-group-label-tips { font-size: 12px; font-weight: 100; color: #ccc; margin-left: 10px; }
|
||||
.am-form-group:hover>label { color: #333 !important; }
|
||||
.am-form-group:hover>label>.am-form-group-label-tips { color: #FF9800 !important; }
|
||||
|
||||
/**
|
||||
* 插件
|
||||
|
|
@ -81,6 +82,9 @@ iframe { width: 100%; height: 100%; border: 0; }
|
|||
border-bottom: 1px dotted #DFE4EA;
|
||||
padding: 10px 20% 10px 5px;
|
||||
}
|
||||
.am-popup form.am-form .am-form-group {
|
||||
padding: 10px 5px;
|
||||
}
|
||||
form.am-form .am-form-group-refreshing, .plug-file-upload-view, .content-app-items {
|
||||
border-bottom: 0px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
padding-bottom: 20px;
|
||||
}
|
||||
.answers-content .items .immages-tag {
|
||||
text-align: center;
|
||||
text-align: left;
|
||||
}
|
||||
.answers-content .items .immages-tag img {
|
||||
max-width: 100%;
|
||||
|
|
@ -20,6 +20,9 @@
|
|||
.answers-content img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.answers-content .am-slider-c3 .am-slider-counter {
|
||||
background-color: #d13a49;
|
||||
}
|
||||
@media only screen and (min-width:640px) {
|
||||
.answers-slider .am-slider {
|
||||
width: 30%;
|
||||
|
|
@ -38,6 +41,14 @@ ul.plugins-images-view li {
|
|||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 幻灯片编辑
|
||||
*/
|
||||
ul.plug-file-upload-view li {
|
||||
min-width: 300px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 商品推荐编辑
|
||||
|
|
@ -45,41 +56,42 @@ ul.plugins-images-view li {
|
|||
form.am-form {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
form.am-form .am-form-group {
|
||||
padding: 0;
|
||||
select.forth-selection-form-category {
|
||||
display: -webkit-inline-box;
|
||||
}
|
||||
.goods-container .goods-form-category, .goods-container .chosen-container, .goods-container .goods-form-keywords {
|
||||
.forth-selection-container .forth-selection-form-category, .forth-selection-container .chosen-container, .forth-selection-container .forth-selection-form-keywords {
|
||||
width: 30% !important;
|
||||
}
|
||||
.goods-container .chosen-container, .goods-container .goods-form-keywords {
|
||||
.forth-selection-container .chosen-container, .forth-selection-container .forth-selection-form-keywords {
|
||||
display: -webkit-inline-box !important;
|
||||
}
|
||||
.goods-container .chosen-single {
|
||||
.forth-selection-container .chosen-single {
|
||||
width: 100%;
|
||||
}
|
||||
.goods-container .goods-form {
|
||||
.forth-selection-container .forth-selection-form {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.goods-list {
|
||||
.forth-selection-list {
|
||||
overflow: hidden;
|
||||
margin-bottom: 20px;
|
||||
position: relative;
|
||||
}
|
||||
.goods-list .goods-items {
|
||||
.forth-selection-list .forth-selection-items {
|
||||
width: calc(50% - 50px);
|
||||
height: 300px;
|
||||
}
|
||||
.goods-list .goods-items .title {
|
||||
.forth-selection-list .forth-selection-items .title {
|
||||
text-align: center;
|
||||
}
|
||||
.goods-list .goods-items .goods-content {
|
||||
.forth-selection-list .forth-selection-items .forth-selection-content {
|
||||
border: 1px solid #eee;
|
||||
height: calc(100% - 25px);
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
border-radius: 2px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.goods-list .goods-items .goods-content li {
|
||||
.forth-selection-list .forth-selection-items .forth-selection-content li {
|
||||
padding: 5px 45px 5px 5px;
|
||||
border-style: dotted;
|
||||
border-color: #eaeaea;
|
||||
|
|
@ -91,30 +103,30 @@ form.am-form .am-form-group {
|
|||
color: #666;
|
||||
position: relative;
|
||||
}
|
||||
.goods-list .goods-items .goods-content li:nth-child(2) {
|
||||
.forth-selection-list .forth-selection-items .forth-selection-content li:nth-child(2) {
|
||||
border-top: 0;
|
||||
}
|
||||
.goods-list .goods-items .goods-content li i {
|
||||
.forth-selection-list .forth-selection-items .forth-selection-content li i {
|
||||
cursor: pointer;
|
||||
padding: 0 10px 0 5px;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
}
|
||||
.goods-list .selected-all {
|
||||
.forth-selection-list .selected-all {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: calc(50% - 30px);
|
||||
margin-top: 140px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.goods-container input[name="goods_category_ids"] {
|
||||
.forth-selection-container input[name="category_ids"] {
|
||||
position: absolute;
|
||||
left: -1000000px;
|
||||
top: -1000000px;
|
||||
}
|
||||
.goods-list i {
|
||||
.forth-selection-list i {
|
||||
color: #888 !important;
|
||||
}
|
||||
.am-form-error .goods-items .goods-content {
|
||||
.am-form-error .forth-selection-items .forth-selection-content {
|
||||
border-color: #dd514c;
|
||||
}
|
||||
|
||||
|
|
@ -133,12 +145,12 @@ form.am-form .am-form-group {
|
|||
}
|
||||
|
||||
@media only screen and (max-width: 641px) {
|
||||
.goods-container .goods-form-category, .goods-container .goods-form-keywords
|
||||
.forth-selection-container .forth-selection-form-category, .forth-selection-container .forth-selection-form-keywords
|
||||
{
|
||||
width: calc(55% - 60px) !important;
|
||||
display: -webkit-inline-box !important;
|
||||
}
|
||||
.goods-container .chosen-container {
|
||||
.forth-selection-container .chosen-container {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,44 @@
|
|||
.plugins-answers .am-list-news-hd {
|
||||
font-weight: 500;
|
||||
}
|
||||
.plugins-answers .am-gallery-bordered .am-gallery-item {
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.plugins-answers .answers-middle-banner img {
|
||||
width: 100%;
|
||||
}
|
||||
.plugins-answers .answers-goods .am-gallery-bordered > li:nth-of-type(2n + 1) {
|
||||
padding-left: 0;
|
||||
}
|
||||
.plugins-answers .answers-goods .am-gallery-bordered > li:nth-of-type(2n + 2) {
|
||||
padding-right: 0;
|
||||
}
|
||||
.plugins-answers .am-slider-c3 .am-slider-counter {
|
||||
background-color: #d13a49;
|
||||
}
|
||||
.plugins-answers .answers-btn-list .am-btn {
|
||||
width: 48%;
|
||||
}
|
||||
.plugins-answers .answers-btn-list .am-btn-danger {
|
||||
color: #fff !important;
|
||||
background-color: #f15262;
|
||||
border-color: #f15262;
|
||||
font-size: 16px;
|
||||
}
|
||||
.plugins-answers .answers-btn-list .am-btn-warning {
|
||||
color: #fff !important;
|
||||
background-color: #F44336;
|
||||
border-color: #F44336;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width:640px) {
|
||||
.plugins-answers .am-gallery-bordered .am-gallery-item:hover {
|
||||
box-shadow: 0 0 3px rgb(251, 180, 187);
|
||||
-webkit-box-shadow: 0 0 3px rgb(251, 180, 187);
|
||||
}
|
||||
.plugins-answers .answers-top, .plugins-answers .answers-middle-banner, .plugins-answers .answers-goods {
|
||||
margin-top: 10px;
|
||||
overflow: hidden;
|
||||
|
|
@ -7,7 +47,7 @@
|
|||
padding: 0;
|
||||
}
|
||||
.plugins-answers .answers-sidebar, .plugins-answers .answers-goods {
|
||||
padding-right: 0;
|
||||
padding-right: 1px;
|
||||
}
|
||||
.plugins-answers .am-list-news-default {
|
||||
margin: 0;
|
||||
|
|
@ -18,24 +58,28 @@
|
|||
.plugins-answers .answers-middle-list .am-list-news-hd {
|
||||
padding-top: 10px;
|
||||
}
|
||||
.plugins-answers .am-list-news-hd {
|
||||
font-weight: 500;
|
||||
}
|
||||
.plugins-answers .answers-sidebar .am-list-news-bd .am-list {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.plugins-answers .answers-goods .am-list-news-hd {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.am-gallery-bordered > li:nth-of-type(2n + 1) {
|
||||
padding-left: 0;
|
||||
}
|
||||
.am-gallery-bordered > li:nth-of-type(2n + 2) {
|
||||
padding-right: 0;
|
||||
.plugins-answers .answers-btn-list .am-btn {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width:640px) {
|
||||
|
||||
.plugins-answers .answers-middle-list, .plugins-answers .answers-goods .am-gallery {
|
||||
padding: 0;
|
||||
}
|
||||
.plugins-answers .answers-sidebar .am-list-news-default {
|
||||
margin: 0;
|
||||
}
|
||||
.plugins-answers .answers-middle-banner {
|
||||
padding: 0 10px;
|
||||
}
|
||||
.plugins-answers .answers-btn-list .am-btn {
|
||||
margin-top: 15px;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,21 +3,21 @@ $(function()
|
|||
// 添加元素到右侧
|
||||
function RightElementAdd(value, name)
|
||||
{
|
||||
if($('ul.ul-right').find('.items-li-'+value).length == 0)
|
||||
if($('.forth-selection-container ul.ul-right').find('.items-li-'+value).length == 0)
|
||||
{
|
||||
var html = '<li class="am-animation-slide-bottom items-li-'+value+'"><span class="name" data-value="'+value+'">'+name+'</span><i class="am-icon-trash-o am-fr"></i></li>';
|
||||
$('ul.ul-right').append(html);
|
||||
$('.forth-selection-container ul.ul-right').append(html);
|
||||
}
|
||||
|
||||
// 右侧数据同步
|
||||
RightElementGoods();
|
||||
|
||||
// 左侧是否还有内容
|
||||
if($('ul.ul-left li').length == 0)
|
||||
if($('.forth-selection-container ul.ul-left li').length == 0)
|
||||
{
|
||||
$('ul.ul-left .table-no').removeClass('none');
|
||||
$('.forth-selection-container ul.ul-left .table-no').removeClass('none');
|
||||
} else {
|
||||
$('ul.ul-left .table-no').addClass('none');
|
||||
$('.forth-selection-container ul.ul-left .table-no').addClass('none');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -25,22 +25,22 @@ $(function()
|
|||
function RightElementGoods()
|
||||
{
|
||||
var value_all = [];
|
||||
$('ul.ul-right li').each(function(k, v)
|
||||
$('.forth-selection-container ul.ul-right li').each(function(k, v)
|
||||
{
|
||||
value_all[k] = $(this).find('span.name').data('value');
|
||||
});
|
||||
$('.goods-container input[name="goods_category_ids"]').val(value_all.join(',')).blur();
|
||||
$('.forth-selection-container input[name="category_ids"]').val(value_all.join(',')).blur();
|
||||
|
||||
// 右侧是否还有数据
|
||||
if($('ul.ul-right li').length == 0)
|
||||
if($('.forth-selection-container ul.ul-right li').length == 0)
|
||||
{
|
||||
$('ul.ul-right .table-no').removeClass('none');
|
||||
$('.forth-selection-container ul.ul-right .table-no').removeClass('none');
|
||||
} else {
|
||||
$('ul.ul-right .table-no').addClass('none');
|
||||
$('.forth-selection-container ul.ul-right .table-no').addClass('none');
|
||||
}
|
||||
}
|
||||
// 左侧点击到右侧
|
||||
$('ul.ul-left').on('click', 'i.am-icon-angle-right', function()
|
||||
$('.forth-selection-container ul.ul-left').on('click', 'i.am-icon-angle-right', function()
|
||||
{
|
||||
var value = $(this).prev().data('value');
|
||||
var name = $(this).prev().text();
|
||||
|
|
@ -49,9 +49,9 @@ $(function()
|
|||
});
|
||||
|
||||
// 左侧全部移动到右侧
|
||||
$('.selected-all').on('click', function()
|
||||
$('.forth-selection-container .selected-all').on('click', function()
|
||||
{
|
||||
$('ul.ul-left li').each(function(k, v)
|
||||
$('.forth-selection-container ul.ul-left li').each(function(k, v)
|
||||
{
|
||||
var value = $(this).find('span.name').data('value');
|
||||
var name = $(this).find('span.name').text();
|
||||
|
|
@ -61,22 +61,22 @@ $(function()
|
|||
});
|
||||
|
||||
// 右侧删除
|
||||
$('ul.ul-right').on('click', 'i.am-icon-trash-o', function()
|
||||
$('.forth-selection-container ul.ul-right').on('click', 'i.am-icon-trash-o', function()
|
||||
{
|
||||
$(this).parent().remove();
|
||||
RightElementGoods();
|
||||
});
|
||||
|
||||
// 商品搜索
|
||||
$('.goods-form .search-submit').on('click', function()
|
||||
$('.forth-selection-form .search-submit').on('click', function()
|
||||
{
|
||||
var category_id = $('.goods-form .goods-form-category').val();
|
||||
var keywords = $('.goods-form .goods-form-keywords').val();
|
||||
var category_id = $('.forth-selection-form .forth-selection-form-category').val();
|
||||
var keywords = $('.forth-selection-form .forth-selection-form-keywords').val();
|
||||
console.log(category_id, keywords)
|
||||
|
||||
// ajax请求
|
||||
$.ajax({
|
||||
url:$('.goods-form').data('search-url'),
|
||||
url:$('.forth-selection-form').data('search-url'),
|
||||
type:'POST',
|
||||
dataType:"json",
|
||||
timeout:10000,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
$(function()
|
||||
{
|
||||
// 问答表单初始化
|
||||
FromInit('form.form-validation-plugins-answer-ask');
|
||||
|
||||
});
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
0
public/static/upload/images/plugins_answers/2019/03/06/1551853529634743.png
Normal file → Executable file
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 23 KiB |