正在显示
14 个修改的文件
包含
1262 行增加
和
2 行删除
1 | +<?php | ||
2 | +// +---------------------------------------------------------------------- | ||
3 | +// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ] | ||
4 | +// +---------------------------------------------------------------------- | ||
5 | +// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved. | ||
6 | +// +---------------------------------------------------------------------- | ||
7 | +// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) | ||
8 | +// +---------------------------------------------------------------------- | ||
9 | +// | Author: 小夏 < 449134904@qq.com> | ||
10 | +// +---------------------------------------------------------------------- | ||
11 | +namespace app\portal\controller; | ||
12 | + | ||
13 | +use cmf\controller\AdminBaseController; | ||
14 | +use app\portal\model\PortalPostModel; | ||
15 | +use app\portal\service\PostService; | ||
16 | +use app\portal\model\PortalCategoryModel; | ||
17 | +use app\portal\model\CityCategoryModel; | ||
18 | +use think\Db; | ||
19 | +use app\admin\model\ThemeModel; | ||
20 | + | ||
21 | +//星探推荐->海外医疗 | ||
22 | +class AdminScoutOverseaController extends AdminBaseController | ||
23 | +{ | ||
24 | + //文章列表 | ||
25 | + public function index() | ||
26 | + { | ||
27 | + $content = hook_one('portal_admin_article_index_view'); | ||
28 | + | ||
29 | + if (!empty($content)) { | ||
30 | + return $content; | ||
31 | + } | ||
32 | + | ||
33 | + $param = $this->request->param(); | ||
34 | + $param['category'] = CityCategoryModel::hwyl; | ||
35 | +// $categoryId = $this->request->param('category', 0, 'intval'); | ||
36 | + $categoryId = $param['category']; | ||
37 | + $postService = new PostService(); | ||
38 | + $data = $postService->AdminArticleList($param); | ||
39 | + $data->appends($param); | ||
40 | + $articles = $data->items(); | ||
41 | + $portalCategoryModel = new PortalCategoryModel(); | ||
42 | + $categoryTree = $portalCategoryModel->adminCategoryTree($categoryId); | ||
43 | + $this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : ''); | ||
44 | + $this->assign('end_time', isset($param['end_time']) ? $param['end_time'] : ''); | ||
45 | + $this->assign('post_title', isset($param['post_title']) ? $param['post_title'] : ''); | ||
46 | + $this->assign('articles', $articles); | ||
47 | + $this->assign('category_tree', $categoryTree); | ||
48 | + $this->assign('category', $categoryId); | ||
49 | + $this->assign('page', $data->render()); | ||
50 | + | ||
51 | + return $this->fetch(); | ||
52 | + } | ||
53 | + | ||
54 | + //添加文章 | ||
55 | + public function add() | ||
56 | + { | ||
57 | + $content = hook_one('portal_admin_article_add_view'); | ||
58 | + | ||
59 | + if (!empty($content)) { | ||
60 | + return $content; | ||
61 | + } | ||
62 | + | ||
63 | + $themeModel = new ThemeModel(); | ||
64 | + $articleThemeFiles = $themeModel->getActionThemeFiles('portal/Article/index'); | ||
65 | + $this->assign('article_theme_files', $articleThemeFiles); | ||
66 | + | ||
67 | + //分类 | ||
68 | + $categories = CityCategoryModel::hwyl; | ||
69 | + $this->assign('categories', $categories); | ||
70 | + return $this->fetch(); | ||
71 | + } | ||
72 | + | ||
73 | + //添加文章提交 | ||
74 | + public function addPost() | ||
75 | + { | ||
76 | + if ($this->request->isPost()) { | ||
77 | + $data = $this->request->param(); | ||
78 | + | ||
79 | + //状态只能设置默认值。未发布、未置顶、未推荐 | ||
80 | + $data['post']['post_status'] = 0; | ||
81 | + $data['post']['is_top'] = 0; | ||
82 | + $data['post']['recommended'] = 0; | ||
83 | + | ||
84 | + $post = $data['post']; | ||
85 | + | ||
86 | + $result = $this->validate($post, 'AdminScoutOversea'); | ||
87 | + if ($result !== true) { | ||
88 | + $this->error($result); | ||
89 | + } | ||
90 | + | ||
91 | + $portalPostModel = new PortalPostModel(); | ||
92 | + | ||
93 | + if (!empty($data['photo_names']) && !empty($data['photo_urls'])) { | ||
94 | + $data['post']['more']['photos'] = []; | ||
95 | + foreach ($data['photo_urls'] as $key => $url) { | ||
96 | + $photoUrl = cmf_asset_relative_url($url); | ||
97 | + array_push($data['post']['more']['photos'], ["url" => $photoUrl, "name" => $data['photo_names'][$key]]); | ||
98 | + } | ||
99 | + } | ||
100 | + | ||
101 | + if (!empty($data['file_names']) && !empty($data['file_urls'])) { | ||
102 | + $data['post']['more']['files'] = []; | ||
103 | + foreach ($data['file_urls'] as $key => $url) { | ||
104 | + $fileUrl = cmf_asset_relative_url($url); | ||
105 | + array_push($data['post']['more']['files'], ["url" => $fileUrl, "name" => $data['file_names'][$key]]); | ||
106 | + } | ||
107 | + } | ||
108 | + | ||
109 | + | ||
110 | + $portalPostModel->adminAddArticle($data['post'], $data['post']['categories']); | ||
111 | + | ||
112 | + $data['post']['id'] = $portalPostModel->id; | ||
113 | + $hookParam = [ | ||
114 | + 'is_add' => true, | ||
115 | + 'article' => $data['post'] | ||
116 | + ]; | ||
117 | + hook('portal_admin_after_save_article', $hookParam); | ||
118 | + | ||
119 | + | ||
120 | + $this->success('添加成功!', url('AdminScoutOversea/edit', ['id' => $portalPostModel->id])); | ||
121 | + } | ||
122 | + | ||
123 | + } | ||
124 | + | ||
125 | + //编辑文章 | ||
126 | + public function edit() | ||
127 | + { | ||
128 | + $content = hook_one('portal_admin_article_edit_view'); | ||
129 | + | ||
130 | + if (!empty($content)) { | ||
131 | + return $content; | ||
132 | + } | ||
133 | + | ||
134 | + $id = $this->request->param('id', 0, 'intval'); | ||
135 | + | ||
136 | + $portalPostModel = new PortalPostModel(); | ||
137 | + $post = $portalPostModel->where('id', $id)->find(); | ||
138 | + $postCategories = $post->categories()->alias('a')->column('a.name', 'a.id'); | ||
139 | + $postCategoryIds = implode(',', array_keys($postCategories)); | ||
140 | + | ||
141 | + $themeModel = new ThemeModel(); | ||
142 | + $articleThemeFiles = $themeModel->getActionThemeFiles('portal/Article/index'); | ||
143 | + $this->assign('article_theme_files', $articleThemeFiles); | ||
144 | + $this->assign('post', $post); | ||
145 | + $this->assign('post_categories', $postCategories); | ||
146 | + $this->assign('post_category_ids', $postCategoryIds); | ||
147 | + | ||
148 | + //分类 | ||
149 | + $categories = CityCategoryModel::hwyl; | ||
150 | + $this->assign('categories', $categories); | ||
151 | + | ||
152 | + return $this->fetch(); | ||
153 | + } | ||
154 | + | ||
155 | + //编辑文章提交 | ||
156 | + public function editPost() | ||
157 | + { | ||
158 | + | ||
159 | + if ($this->request->isPost()) { | ||
160 | + $data = $this->request->param(); | ||
161 | + //需要抹除发布、置顶、推荐的修改。 | ||
162 | + unset($data['post']['post_status']); | ||
163 | + unset($data['post']['is_top']); | ||
164 | + unset($data['post']['recommended']); | ||
165 | + | ||
166 | + $post = $data['post']; | ||
167 | + $result = $this->validate($post, 'AdminScoutOversea'); | ||
168 | + if ($result !== true) { | ||
169 | + $this->error($result); | ||
170 | + } | ||
171 | + | ||
172 | + $portalPostModel = new PortalPostModel(); | ||
173 | + | ||
174 | + if (!empty($data['photo_names']) && !empty($data['photo_urls'])) { | ||
175 | + $data['post']['more']['photos'] = []; | ||
176 | + foreach ($data['photo_urls'] as $key => $url) { | ||
177 | + $photoUrl = cmf_asset_relative_url($url); | ||
178 | + array_push($data['post']['more']['photos'], ["url" => $photoUrl, "name" => $data['photo_names'][$key]]); | ||
179 | + } | ||
180 | + } | ||
181 | + | ||
182 | + if (!empty($data['file_names']) && !empty($data['file_urls'])) { | ||
183 | + $data['post']['more']['files'] = []; | ||
184 | + foreach ($data['file_urls'] as $key => $url) { | ||
185 | + $fileUrl = cmf_asset_relative_url($url); | ||
186 | + array_push($data['post']['more']['files'], ["url" => $fileUrl, "name" => $data['file_names'][$key]]); | ||
187 | + } | ||
188 | + } | ||
189 | + | ||
190 | + $portalPostModel->adminEditArticle($data['post'], $data['post']['categories']); | ||
191 | + | ||
192 | + $hookParam = [ | ||
193 | + 'is_add' => false, | ||
194 | + 'article' => $data['post'] | ||
195 | + ]; | ||
196 | + hook('portal_admin_after_save_article', $hookParam); | ||
197 | + | ||
198 | + $this->success('保存成功!'); | ||
199 | + | ||
200 | + } | ||
201 | + } | ||
202 | + | ||
203 | + //文章删除 | ||
204 | + public function delete() | ||
205 | + { | ||
206 | + $param = $this->request->param(); | ||
207 | + $portalPostModel = new PortalPostModel(); | ||
208 | + | ||
209 | + if (isset($param['id'])) { | ||
210 | + $id = $this->request->param('id', 0, 'intval'); | ||
211 | + $result = $portalPostModel->where('id', $id)->find(); | ||
212 | + $data = [ | ||
213 | + 'object_id' => $result['id'], | ||
214 | + 'create_time' => time(), | ||
215 | + 'table_name' => 'portal_post', | ||
216 | + 'name' => $result['post_title'], | ||
217 | + 'user_id' => cmf_get_current_admin_id() | ||
218 | + ]; | ||
219 | + $resultPortal = $portalPostModel | ||
220 | + ->where('id', $id) | ||
221 | + ->update(['delete_time' => time()]); | ||
222 | + if ($resultPortal) { | ||
223 | + Db::name('portal_category_post')->where('post_id', $id)->update(['status' => 0]); | ||
224 | + Db::name('portal_tag_post')->where('post_id', $id)->update(['status' => 0]); | ||
225 | + | ||
226 | + Db::name('recycleBin')->insert($data); | ||
227 | + } | ||
228 | + $this->success("删除成功!", ''); | ||
229 | + | ||
230 | + } | ||
231 | + | ||
232 | + if (isset($param['ids'])) { | ||
233 | + $ids = $this->request->param('ids/a'); | ||
234 | + $recycle = $portalPostModel->where('id', 'in', $ids)->select(); | ||
235 | + $result = $portalPostModel->where('id', 'in', $ids)->update(['delete_time' => time()]); | ||
236 | + if ($result) { | ||
237 | + Db::name('portal_category_post')->where('post_id', 'in', $ids)->update(['status' => 0]); | ||
238 | + Db::name('portal_tag_post')->where('post_id', 'in', $ids)->update(['status' => 0]); | ||
239 | + foreach ($recycle as $value) { | ||
240 | + $data = [ | ||
241 | + 'object_id' => $value['id'], | ||
242 | + 'create_time' => time(), | ||
243 | + 'table_name' => 'portal_post', | ||
244 | + 'name' => $value['post_title'], | ||
245 | + 'user_id' => cmf_get_current_admin_id() | ||
246 | + ]; | ||
247 | + Db::name('recycleBin')->insert($data); | ||
248 | + } | ||
249 | + $this->success("删除成功!", ''); | ||
250 | + } | ||
251 | + } | ||
252 | + } | ||
253 | +} |
@@ -29,6 +29,12 @@ class ScoutController extends HomeBaseController | @@ -29,6 +29,12 @@ class ScoutController extends HomeBaseController | ||
29 | $res_lylx = $this->getChildArticle($position,$field,$this->index_limit); | 29 | $res_lylx = $this->getChildArticle($position,$field,$this->index_limit); |
30 | $this->assign('res_lylx',$res_lylx); | 30 | $this->assign('res_lylx',$res_lylx); |
31 | 31 | ||
32 | + //海外医疗 | ||
33 | + $position['category_id'] = CityCategoryModel::hwyl; | ||
34 | + $field = 'id,thumbnail,post_title'; | ||
35 | + $res_hwyl = $this->getChildArticle($position,$field,$this->index_limit); | ||
36 | + $this->assign('res_hwyl',$res_hwyl); | ||
37 | + | ||
32 | //地道风物 | 38 | //地道风物 |
33 | $position['category_id'] = CityCategoryModel::ddfw; | 39 | $position['category_id'] = CityCategoryModel::ddfw; |
34 | $field = 'id,thumbnail,post_title,price'; | 40 | $field = 'id,thumbnail,post_title,price'; |
@@ -51,6 +51,7 @@ class CityCategoryModel extends Model | @@ -51,6 +51,7 @@ class CityCategoryModel extends Model | ||
51 | const cysj = 25;//创意设计 | 51 | const cysj = 25;//创意设计 |
52 | const yjyr = 26;//悦己悦人 | 52 | const yjyr = 26;//悦己悦人 |
53 | const xjhd_c = 27;//星际活动 | 53 | const xjhd_c = 27;//星际活动 |
54 | + const hwyl = 40;//海外医疗 | ||
54 | 55 | ||
55 | //城市 | 56 | //城市 |
56 | const xqgh_cc = 65;//星球故事 | 57 | const xqgh_cc = 65;//星球故事 |
1 | +<?php | ||
2 | +// +---------------------------------------------------------------------- | ||
3 | +// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ] | ||
4 | +// +---------------------------------------------------------------------- | ||
5 | +// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved. | ||
6 | +// +---------------------------------------------------------------------- | ||
7 | +// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) | ||
8 | +// +---------------------------------------------------------------------- | ||
9 | +// | Author: 小夏 < 449134904@qq.com> | ||
10 | +// +---------------------------------------------------------------------- | ||
11 | +namespace app\portal\validate; | ||
12 | + | ||
13 | +use think\Validate; | ||
14 | + | ||
15 | +class AdminScoutOverseaValidate extends Validate | ||
16 | +{ | ||
17 | + protected $rule = [ | ||
18 | + 'post_title' => 'require', | ||
19 | + 'post_excerpt' => 'require', | ||
20 | + ]; | ||
21 | + protected $message = [ | ||
22 | + 'post_title.require' => '文章标题不能为空!', | ||
23 | + 'post_excerpt.require' => '文章简介不能为空!', | ||
24 | + ]; | ||
25 | + | ||
26 | + protected $scene = [ | ||
27 | +// 'add' => ['user_login,user_pass,user_email'], | ||
28 | +// 'edit' => ['user_login,user_email'], | ||
29 | + ]; | ||
30 | +} |
@@ -250,6 +250,12 @@ return array ( | @@ -250,6 +250,12 @@ return array ( | ||
250 | 'PORTAL_ADMINSCOUTLIKE_EDIT' => '编辑显示', | 250 | 'PORTAL_ADMINSCOUTLIKE_EDIT' => '编辑显示', |
251 | 'PORTAL_ADMINSCOUTLIKE_EDITPOST' => '编辑提交', | 251 | 'PORTAL_ADMINSCOUTLIKE_EDITPOST' => '编辑提交', |
252 | 'PORTAL_ADMINSCOUTLIKE_INDEX' => '海外教育', | 252 | 'PORTAL_ADMINSCOUTLIKE_INDEX' => '海外教育', |
253 | + 'PORTAL_ADMINSCOUTOVERSEA_ADD' => '添加显示', | ||
254 | + 'PORTAL_ADMINSCOUTOVERSEA_ADDPOST' => '添加提交', | ||
255 | + 'PORTAL_ADMINSCOUTOVERSEA_DELETE' => '删除', | ||
256 | + 'PORTAL_ADMINSCOUTOVERSEA_EDIT' => '编辑显示', | ||
257 | + 'PORTAL_ADMINSCOUTOVERSEA_EDITPOST' => '编辑提交', | ||
258 | + 'PORTAL_ADMINSCOUTOVERSEA_INDEX' => '海外医疗', | ||
253 | 'PORTAL_ADMINSCOUTSCENERY_ADD' => '添加显示', | 259 | 'PORTAL_ADMINSCOUTSCENERY_ADD' => '添加显示', |
254 | 'PORTAL_ADMINSCOUTSCENERY_ADDPOST' => '添加提交', | 260 | 'PORTAL_ADMINSCOUTSCENERY_ADDPOST' => '添加提交', |
255 | 'PORTAL_ADMINSCOUTSCENERY_DELETE' => '删除', | 261 | 'PORTAL_ADMINSCOUTSCENERY_DELETE' => '删除', |
1 | +<include file="public@header"/> | ||
2 | +<style type="text/css"> | ||
3 | + .pic-list li { | ||
4 | + margin-bottom: 5px; | ||
5 | + } | ||
6 | +</style> | ||
7 | +<script type="text/html" id="photos-item-tpl"> | ||
8 | + <li id="saved-image{id}"> | ||
9 | + <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}"> | ||
10 | + <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}" | ||
11 | + style="width: 200px;" title="图片名称"> | ||
12 | + <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;" | ||
13 | + onclick="imagePreviewDialog(this.src);"> | ||
14 | + <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a> | ||
15 | + <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a> | ||
16 | + </li> | ||
17 | +</script> | ||
18 | +<script type="text/html" id="files-item-tpl"> | ||
19 | + <li id="saved-file{id}"> | ||
20 | + <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}"> | ||
21 | + <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}" | ||
22 | + style="width: 200px;" title="文件名称"> | ||
23 | + <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a> | ||
24 | + <a href="javascript:uploadOne('文件上传','#file-{id}','file');">替换</a> | ||
25 | + <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a> | ||
26 | + </li> | ||
27 | +</script> | ||
28 | +</head> | ||
29 | +<body> | ||
30 | +<div class="wrap js-check-wrap"> | ||
31 | + <ul class="nav nav-tabs"> | ||
32 | + <li><a href="{:url('AdminScoutOversea/index')}">文章管理</a></li> | ||
33 | + <li class="active"><a href="{:url('AdminScoutOversea/add')}">添加文章</a></li> | ||
34 | + </ul> | ||
35 | + <form action="{:url('AdminScoutOversea/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20"> | ||
36 | + <div class="row"> | ||
37 | + <div class="col-md-9"> | ||
38 | + <table class="table table-bordered"> | ||
39 | + <input class="form-control" type="hidden" value="{$categories}" name="post[categories]" | ||
40 | + id="js-categories-id-input"/> | ||
41 | + <tr> | ||
42 | + <th width="100">标题<span class="form-required">*</span></th> | ||
43 | + <td> | ||
44 | + <input class="form-control" type="text" name="post[post_title]" | ||
45 | + id="title" required value="" placeholder="请输入标题"/> | ||
46 | + </td> | ||
47 | + </tr> | ||
48 | + <tr> | ||
49 | + <th>预定须知<span class="form-required">*</span></th> | ||
50 | + <td> | ||
51 | + <input class="form-control" required type="text" name="post[notice]" placeholder="请输入预定须知"/> | ||
52 | + </td> | ||
53 | + </tr> | ||
54 | + <tr> | ||
55 | + <th>出发地点<span class="form-required">*</span></th> | ||
56 | + <td> | ||
57 | + <input class="form-control" required type="text" name="post[place]" placeholder="请输入出发地点"/> | ||
58 | + </td> | ||
59 | + </tr> | ||
60 | + <tr> | ||
61 | + <th>包含项目<span class="form-required">*</span></th> | ||
62 | + <td> | ||
63 | + <input class="form-control" required type="text" name="post[project]" placeholder="请输入包含项目"/> | ||
64 | + </td> | ||
65 | + </tr> | ||
66 | + <tr> | ||
67 | + <th>价格<span class="form-required">*</span></th> | ||
68 | + <td> | ||
69 | + <input class="form-control" required type="text" name="post[price]" placeholder="请输入价格"/> | ||
70 | + </td> | ||
71 | + </tr> | ||
72 | + <tr> | ||
73 | + <th>支付外链<span class="form-required">*</span></th> | ||
74 | + <td> | ||
75 | + <input class="form-control" required type="url" name="post[pay_url]" placeholder="请输入支付外链"/> | ||
76 | + </td> | ||
77 | + </tr> | ||
78 | + <tr> | ||
79 | + <th>简介<span class="form-required">*</span></th> | ||
80 | + <td> | ||
81 | + <textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;" | ||
82 | + placeholder="请填写简介"></textarea> | ||
83 | + </td> | ||
84 | + </tr> | ||
85 | + <tr> | ||
86 | + <th>相册</th> | ||
87 | + <td> | ||
88 | + <ul id="photos" class="pic-list list-unstyled form-inline"></ul> | ||
89 | + <a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');" | ||
90 | + class="btn btn-default btn-sm">选择图片</a> | ||
91 | + </td> | ||
92 | + </tr> | ||
93 | + <tr> | ||
94 | + <th>权重</th> | ||
95 | + <td> | ||
96 | + <input class="form-control" type="number" name="post[weigh]" value="0"> | ||
97 | + </td> | ||
98 | + </tr> | ||
99 | + </table> | ||
100 | + <hook name="portal_admin_article_edit_view_main"/> | ||
101 | + <div class="form-group"> | ||
102 | + <div class="col-sm-offset-2 col-sm-10"> | ||
103 | + <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button> | ||
104 | + <a class="btn btn-default" href="{:url('AdminScoutOversea/index')}">{:lang('BACK')}</a> | ||
105 | + </div> | ||
106 | + </div> | ||
107 | + </div> | ||
108 | + <div class="col-md-3"> | ||
109 | + <table class="table table-bordered"> | ||
110 | + <tr> | ||
111 | + <th><b>首页缩略图</b><span class="form-required">*</span></th> | ||
112 | + </tr> | ||
113 | + <tr> | ||
114 | + <td> | ||
115 | + <div style="text-align: center;"> | ||
116 | + <input type="hidden" name="post[index_thumbnail]" id="index_thumbnail" value=""> | ||
117 | + <a href="javascript:uploadOneImage('图片上传','#index_thumbnail');"> | ||
118 | + <img src="__TMPL__/public/assets/images/default-thumbnail.png" | ||
119 | + id="index_thumbnail-preview" | ||
120 | + width="135" style="cursor: pointer"/> | ||
121 | + </a> | ||
122 | + <input type="button" class="btn btn-sm btn-cancel-index_thumbnail" value="取消图片"> | ||
123 | + </div> | ||
124 | + <div style="margin-top:30px;"> | ||
125 | + <span class="form-required">图片参考尺寸:290*230</span> | ||
126 | + </div> | ||
127 | + </td> | ||
128 | + </tr> | ||
129 | + | ||
130 | + <tr> | ||
131 | + <th><b>列表页缩略图</b><span class="form-required">*</span></th> | ||
132 | + </tr> | ||
133 | + <tr> | ||
134 | + <td> | ||
135 | + <div style="text-align: center;"> | ||
136 | + <input type="hidden" name="post[more][thumbnail]" id="thumbnail" value=""> | ||
137 | + <a href="javascript:uploadOneImage('图片上传','#thumbnail');"> | ||
138 | + <img src="__TMPL__/public/assets/images/default-thumbnail.png" | ||
139 | + id="thumbnail-preview" | ||
140 | + width="135" style="cursor: pointer"/> | ||
141 | + </a> | ||
142 | + <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片"> | ||
143 | + </div> | ||
144 | + <div style="margin-top:30px;"> | ||
145 | + <span class="form-required">图片参考尺寸:386*303</span> | ||
146 | + </div> | ||
147 | + </td> | ||
148 | + </tr> | ||
149 | + <tr> | ||
150 | + <th><b>发布时间</b></th> | ||
151 | + </tr> | ||
152 | + <tr> | ||
153 | + <td> | ||
154 | + <input class="form-control js-bootstrap-datetime" type="text" name="post[published_time]" | ||
155 | + value="{:date('Y-m-d H:i:s',time())}"> | ||
156 | + </td> | ||
157 | + </tr> | ||
158 | + </table> | ||
159 | + | ||
160 | + <hook name="portal_admin_article_edit_view_right_sidebar"/> | ||
161 | + </div> | ||
162 | + </div> | ||
163 | + </form> | ||
164 | +</div> | ||
165 | +<script type="text/javascript" src="__STATIC__/js/admin.js"></script> | ||
166 | +<script type="text/javascript"> | ||
167 | + //编辑器路径定义 | ||
168 | + var editorURL = GV.WEB_ROOT; | ||
169 | +</script> | ||
170 | +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script> | ||
171 | +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script> | ||
172 | +<script type="text/javascript"> | ||
173 | + $(function () { | ||
174 | + | ||
175 | + editorcontent = new baidu.editor.ui.Editor(); | ||
176 | + editorcontent.render('content'); | ||
177 | + try { | ||
178 | + editorcontent.sync(); | ||
179 | + } catch (err) { | ||
180 | + } | ||
181 | + //首页缩略图 | ||
182 | + $('.btn-cancel-index_thumbnail').click(function () { | ||
183 | + $('#index_thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png'); | ||
184 | + $('#index_thumbnail').val(''); | ||
185 | + }); | ||
186 | + //列表页缩略图 | ||
187 | + $('.btn-cancel-thumbnail').click(function () { | ||
188 | + $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png'); | ||
189 | + $('#thumbnail').val(''); | ||
190 | + }); | ||
191 | + | ||
192 | + }); | ||
193 | + | ||
194 | + function doSelectCategory() { | ||
195 | + var selectedCategoriesId = $('#js-categories-id-input').val(); | ||
196 | + openIframeLayer("{:url('AdminCategory/select')}?ids=" + selectedCategoriesId, '请选择分类', { | ||
197 | + area: ['700px', '400px'], | ||
198 | + btn: ['确定', '取消'], | ||
199 | + yes: function (index, layero) { | ||
200 | + //do something | ||
201 | + | ||
202 | + var iframeWin = window[layero.find('iframe')[0]['name']]; | ||
203 | + var selectedCategories = iframeWin.confirm(); | ||
204 | + if (selectedCategories.selectedCategoriesId.length == 0) { | ||
205 | + layer.msg('请选择分类'); | ||
206 | + return; | ||
207 | + } | ||
208 | + $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(',')); | ||
209 | + $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' ')); | ||
210 | + //console.log(layer.getFrameIndex(index)); | ||
211 | + layer.close(index); //如果设定了yes回调,需进行手工关闭 | ||
212 | + } | ||
213 | + }); | ||
214 | + } | ||
215 | +</script> | ||
216 | +</body> | ||
217 | +</html> |
1 | +<include file="public@header"/> | ||
2 | +<style type="text/css"> | ||
3 | + .pic-list li { | ||
4 | + margin-bottom: 5px; | ||
5 | + } | ||
6 | +</style> | ||
7 | +<script type="text/html" id="photos-item-tpl"> | ||
8 | + <li id="saved-image{id}"> | ||
9 | + <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}"> | ||
10 | + <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}" | ||
11 | + style="width: 200px;" title="图片名称"> | ||
12 | + <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;" | ||
13 | + onclick="imagePreviewDialog(this.src);"> | ||
14 | + <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a> | ||
15 | + <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a> | ||
16 | + </li> | ||
17 | +</script> | ||
18 | +<script type="text/html" id="files-item-tpl"> | ||
19 | + <li id="saved-file{id}"> | ||
20 | + <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}"> | ||
21 | + <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}" | ||
22 | + style="width: 200px;" title="文件名称"> | ||
23 | + <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a> | ||
24 | + <a href="javascript:uploadOne('文件上传','#file-{id}','file');">替换</a> | ||
25 | + <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a> | ||
26 | + </li> | ||
27 | +</script> | ||
28 | +</head> | ||
29 | +<body> | ||
30 | +<div class="wrap js-check-wrap"> | ||
31 | + <ul class="nav nav-tabs"> | ||
32 | + <li><a href="{:url('AdminScoutOversea/index')}">文章管理</a></li> | ||
33 | + <li> | ||
34 | + <a href="{:url('AdminScoutOversea/add')}">添加文章</a> | ||
35 | + </li> | ||
36 | + <li class="active"><a href="#">编辑文章</a></li> | ||
37 | + </ul> | ||
38 | + <form action="{:url('AdminScoutOversea/editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20"> | ||
39 | + <div class="row"> | ||
40 | + <div class="col-md-9"> | ||
41 | + <table class="table table-bordered"> | ||
42 | + <input id="post-id" type="hidden" name="post[id]" value="{$post.id}"> | ||
43 | + <input class="form-control" type="hidden" value="{$categories}" name="post[categories]" | ||
44 | + id="js-categories-id-input"/> | ||
45 | + <tr> | ||
46 | + <th width="100">标题<span class="form-required">*</span></th> | ||
47 | + <td> | ||
48 | + <input class="form-control" type="text" name="post[post_title]" | ||
49 | + required value="{$post.post_title}" placeholder="请输入标题"/> | ||
50 | + </td> | ||
51 | + </tr> | ||
52 | + <tr> | ||
53 | + <th>预定须知<span class="form-required">*</span></th> | ||
54 | + <td> | ||
55 | + <input class="form-control" required type="text" name="post[notice]" placeholder="请输入预定须知" value="{$post.notice}"/> | ||
56 | + </td> | ||
57 | + </tr> | ||
58 | + <tr> | ||
59 | + <th>出发地点<span class="form-required">*</span></th> | ||
60 | + <td> | ||
61 | + <input class="form-control" required type="text" name="post[place]" placeholder="请输入出发地点" value="{$post.place}"/> | ||
62 | + </td> | ||
63 | + </tr> | ||
64 | + <tr> | ||
65 | + <th>包含项目<span class="form-required">*</span></th> | ||
66 | + <td> | ||
67 | + <input class="form-control" required type="text" name="post[project]" placeholder="请输入包含项目" value="{$post.project}"/> | ||
68 | + </td> | ||
69 | + </tr> | ||
70 | + <tr> | ||
71 | + <th>价格<span class="form-required">*</span></th> | ||
72 | + <td> | ||
73 | + <input class="form-control" required type="text" name="post[price]" placeholder="请输入价格" value="{$post.price}"/> | ||
74 | + </td> | ||
75 | + </tr> | ||
76 | + <tr> | ||
77 | + <th>支付外链<span class="form-required">*</span></th> | ||
78 | + <td> | ||
79 | + <input class="form-control" required type="url" name="post[pay_url]" placeholder="请输入支付外链" value="{$post.pay_url}"/> | ||
80 | + </td> | ||
81 | + </tr> | ||
82 | + <tr> | ||
83 | + <th>简介<span class="form-required">*</span></th> | ||
84 | + <td> | ||
85 | + <textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;" | ||
86 | + placeholder="请填写简介">{$post.post_excerpt}</textarea> | ||
87 | + </td> | ||
88 | + </tr> | ||
89 | + <tr> | ||
90 | + <th>相册</th> | ||
91 | + <td> | ||
92 | + <ul id="photos" class="pic-list list-unstyled form-inline"> | ||
93 | + <notempty name="post.more.photos"> | ||
94 | + <foreach name="post.more.photos" item="vo"> | ||
95 | + <php>$img_url=cmf_get_image_preview_url($vo['url']);</php> | ||
96 | + <li id="saved-image{$key}"> | ||
97 | + <input id="photo-{$key}" type="hidden" name="photo_urls[]" | ||
98 | + value="{$vo.url}"> | ||
99 | + <input class="form-control" id="photo-{$key}-name" type="text" | ||
100 | + name="photo_names[]" | ||
101 | + value="{$vo.name|default=''}" style="width: 200px;" title="图片名称"> | ||
102 | + <img id="photo-{$key}-preview" | ||
103 | + src="{:cmf_get_image_preview_url($vo['url'])}" | ||
104 | + style="height:36px;width: 36px;" | ||
105 | + onclick="parent.imagePreviewDialog(this.src);"> | ||
106 | + <a href="javascript:uploadOneImage('图片上传','#photo-{$key}');">替换</a> | ||
107 | + <a href="javascript:(function(){$('#saved-image{$key}').remove();})();">移除</a> | ||
108 | + </li> | ||
109 | + </foreach> | ||
110 | + </notempty> | ||
111 | + </ul> | ||
112 | + <a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');" | ||
113 | + class="btn btn-sm btn-default">选择图片</a> | ||
114 | + </td> | ||
115 | + </tr> | ||
116 | + <tr> | ||
117 | + <th>权重</th> | ||
118 | + <td> | ||
119 | + <input class="form-control" type="number" name="post[weigh]" value="{$post.weigh}"> | ||
120 | + </td> | ||
121 | + </tr> | ||
122 | + </table> | ||
123 | + | ||
124 | + <hook name="portal_admin_article_edit_view_main"/> | ||
125 | + </div> | ||
126 | + <div class="col-md-3"> | ||
127 | + <table class="table table-bordered"> | ||
128 | + <tr> | ||
129 | + <th>首页缩略图<span class="form-required">*</span></th> | ||
130 | + </tr> | ||
131 | + <tr> | ||
132 | + <td> | ||
133 | + <div style="text-align: center;"> | ||
134 | + <input type="hidden" name="post[index_thumbnail]" id="index_thumbnail" | ||
135 | + value="{$post.index_thumbnail|default=''}"> | ||
136 | + <a href="javascript:uploadOneImage('图片上传','#index_thumbnail');"> | ||
137 | + <if condition="empty($post.index_thumbnail)"> | ||
138 | + <img src="__TMPL__/public/assets/images/default-thumbnail.png" | ||
139 | + id="index_thumbnail-preview" | ||
140 | + width="135" style="cursor: pointer"/> | ||
141 | + <else/> | ||
142 | + <img src="{:cmf_get_image_preview_url($post.index_thumbnail)}" | ||
143 | + id="index_thumbnail-preview" | ||
144 | + width="135" style="cursor: pointer"/> | ||
145 | + </if> | ||
146 | + </a> | ||
147 | + <input type="button" class="btn btn-sm btn-cancel-index_thumbnail" value="取消图片"> | ||
148 | + </div> | ||
149 | + <div style="margin-top:30px;"> | ||
150 | + <span class="form-required">图片参考尺寸:290*230</span> | ||
151 | + </div> | ||
152 | + </td> | ||
153 | + </tr> | ||
154 | + | ||
155 | + <tr> | ||
156 | + <th>列表页缩略图<span class="form-required">*</span></th> | ||
157 | + </tr> | ||
158 | + <tr> | ||
159 | + <td> | ||
160 | + <div style="text-align: center;"> | ||
161 | + <input type="hidden" name="post[more][thumbnail]" id="thumbnail" | ||
162 | + value="{$post.more.thumbnail|default=''}"> | ||
163 | + <a href="javascript:uploadOneImage('图片上传','#thumbnail');"> | ||
164 | + <if condition="empty($post.more.thumbnail)"> | ||
165 | + <img src="__TMPL__/public/assets/images/default-thumbnail.png" | ||
166 | + id="thumbnail-preview" | ||
167 | + width="135" style="cursor: pointer"/> | ||
168 | + <else/> | ||
169 | + <img src="{:cmf_get_image_preview_url($post.more.thumbnail)}" | ||
170 | + id="thumbnail-preview" | ||
171 | + width="135" style="cursor: pointer"/> | ||
172 | + </if> | ||
173 | + </a> | ||
174 | + <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片"> | ||
175 | + </div> | ||
176 | + <div style="margin-top:30px;"> | ||
177 | + <span class="form-required">图片参考尺寸:386*303</span> | ||
178 | + </div> | ||
179 | + </td> | ||
180 | + </tr> | ||
181 | + <tr> | ||
182 | + <th>发布时间</th> | ||
183 | + </tr> | ||
184 | + <tr> | ||
185 | + <td> | ||
186 | + <input class="form-control js-bootstrap-datetime" type="text" name="post[published_time]" | ||
187 | + value="{:date('Y-m-d H:i',$post['published_time'])}"> | ||
188 | + </td> | ||
189 | + </tr> | ||
190 | + </table> | ||
191 | + | ||
192 | + <hook name="portal_admin_article_edit_view_right_sidebar"/> | ||
193 | + </div> | ||
194 | + </div> | ||
195 | + <div class="form-group"> | ||
196 | + <div class="col-sm-offset-2 col-sm-10"> | ||
197 | + <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button> | ||
198 | + <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a> | ||
199 | + </div> | ||
200 | + </div> | ||
201 | + </form> | ||
202 | +</div> | ||
203 | +<script type="text/javascript" src="__STATIC__/js/admin.js"></script> | ||
204 | +<script type="text/javascript"> | ||
205 | + //编辑器路径定义 | ||
206 | + var editorURL = GV.WEB_ROOT; | ||
207 | +</script> | ||
208 | +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script> | ||
209 | +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script> | ||
210 | +<script type="text/javascript"> | ||
211 | + $(function () { | ||
212 | + | ||
213 | + editorcontent = new baidu.editor.ui.Editor(); | ||
214 | + editorcontent.render('content'); | ||
215 | + try { | ||
216 | + editorcontent.sync(); | ||
217 | + } catch (err) { | ||
218 | + } | ||
219 | + //首页缩略图 | ||
220 | + $('.btn-cancel-index_thumbnail').click(function () { | ||
221 | + $('#index_thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png'); | ||
222 | + $('#index_thumbnail').val(''); | ||
223 | + }); | ||
224 | + //列表页缩略图 | ||
225 | + $('.btn-cancel-thumbnail').click(function () { | ||
226 | + $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png'); | ||
227 | + $('#thumbnail').val(''); | ||
228 | + }); | ||
229 | + | ||
230 | + $('#more-template-select').val("{$post.more.template|default=''}"); | ||
231 | + }); | ||
232 | + | ||
233 | + function doSelectCategory() { | ||
234 | + var selectedCategoriesId = $('#js-categories-id-input').val(); | ||
235 | + openIframeLayer("{:url('AdminCategory/select')}?ids=" + selectedCategoriesId, '请选择分类', { | ||
236 | + area: ['700px', '400px'], | ||
237 | + btn: ['确定', '取消'], | ||
238 | + yes: function (index, layero) { | ||
239 | + //do something | ||
240 | + | ||
241 | + var iframeWin = window[layero.find('iframe')[0]['name']]; | ||
242 | + var selectedCategories = iframeWin.confirm(); | ||
243 | + if (selectedCategories.selectedCategoriesId.length == 0) { | ||
244 | + layer.msg('请选择分类'); | ||
245 | + return; | ||
246 | + } | ||
247 | + $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(',')); | ||
248 | + $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' ')); | ||
249 | + //console.log(layer.getFrameIndex(index)); | ||
250 | + layer.close(index); //如果设定了yes回调,需进行手工关闭 | ||
251 | + } | ||
252 | + }); | ||
253 | + } | ||
254 | +</script> | ||
255 | + | ||
256 | +<script> | ||
257 | + | ||
258 | + var publishYesUrl = "{:url('AdminScoutOversea/publish',array('yes'=>1))}"; | ||
259 | + var publishNoUrl = "{:url('AdminScoutOversea/publish',array('no'=>1))}"; | ||
260 | + var topYesUrl = "{:url('AdminScoutOversea/top',array('yes'=>1))}"; | ||
261 | + var topNoUrl = "{:url('AdminScoutOversea/top',array('no'=>1))}"; | ||
262 | + var recommendYesUrl = "{:url('AdminScoutOversea/recommend',array('yes'=>1))}"; | ||
263 | + var recommendNoUrl = "{:url('AdminScoutOversea/recommend',array('no'=>1))}"; | ||
264 | + | ||
265 | + var postId = $('#post-id').val(); | ||
266 | + | ||
267 | + //发布操作 | ||
268 | + $("#post-status-checkbox").change(function () { | ||
269 | + if ($('#post-status-checkbox').is(':checked')) { | ||
270 | + //发布 | ||
271 | + $.ajax({ | ||
272 | + url: publishYesUrl, type: "post", dataType: "json", data: {ids: postId}, success: function (data) { | ||
273 | + if (data.code != 1) { | ||
274 | + $('#post-status-checkbox').removeAttr("checked"); | ||
275 | + $('#post-status-error').html(data.msg).show(); | ||
276 | + | ||
277 | + } else { | ||
278 | + $('#post-status-error').hide(); | ||
279 | + } | ||
280 | + } | ||
281 | + }); | ||
282 | + } else { | ||
283 | + //取消发布 | ||
284 | + $.ajax({ | ||
285 | + url: publishNoUrl, type: "post", dataType: "json", data: {ids: postId}, success: function (data) { | ||
286 | + if (data.code != 1) { | ||
287 | + $('#post-status-checkbox').prop("checked", 'true'); | ||
288 | + $('#post-status-error').html(data.msg).show(); | ||
289 | + } else { | ||
290 | + $('#post-status-error').hide(); | ||
291 | + } | ||
292 | + } | ||
293 | + }); | ||
294 | + } | ||
295 | + }); | ||
296 | + | ||
297 | + //置顶操作 | ||
298 | + $("#is-top-checkbox").change(function () { | ||
299 | + if ($('#is-top-checkbox').is(':checked')) { | ||
300 | + //置顶 | ||
301 | + $.ajax({ | ||
302 | + url: topYesUrl, type: "post", dataType: "json", data: {ids: postId}, success: function (data) { | ||
303 | + if (data.code != 1) { | ||
304 | + $('#is-top-checkbox').removeAttr("checked"); | ||
305 | + $('#is-top-error').html(data.msg).show(); | ||
306 | + | ||
307 | + } else { | ||
308 | + $('#is-top-error').hide(); | ||
309 | + } | ||
310 | + } | ||
311 | + }); | ||
312 | + } else { | ||
313 | + //取消置顶 | ||
314 | + $.ajax({ | ||
315 | + url: topNoUrl, type: "post", dataType: "json", data: {ids: postId}, success: function (data) { | ||
316 | + if (data.code != 1) { | ||
317 | + $('#is-top-checkbox').prop("checked", 'true'); | ||
318 | + $('#is-top-error').html(data.msg).show(); | ||
319 | + } else { | ||
320 | + $('#is-top-error').hide(); | ||
321 | + } | ||
322 | + } | ||
323 | + }); | ||
324 | + } | ||
325 | + }); | ||
326 | + //推荐操作 | ||
327 | + $("#recommended-checkbox").change(function () { | ||
328 | + if ($('#recommended-checkbox').is(':checked')) { | ||
329 | + //推荐 | ||
330 | + $.ajax({ | ||
331 | + url: recommendYesUrl, type: "post", dataType: "json", data: {ids: postId}, success: function (data) { | ||
332 | + if (data.code != 1) { | ||
333 | + $('#recommended-checkbox').removeAttr("checked"); | ||
334 | + $('#recommended-error').html(data.msg).show(); | ||
335 | + | ||
336 | + } else { | ||
337 | + $('#recommended-error').hide(); | ||
338 | + } | ||
339 | + } | ||
340 | + }); | ||
341 | + } else { | ||
342 | + //取消推荐 | ||
343 | + $.ajax({ | ||
344 | + url: recommendNoUrl, type: "post", dataType: "json", data: {ids: postId}, success: function (data) { | ||
345 | + if (data.code != 1) { | ||
346 | + $('#recommended-checkbox').prop("checked", 'true'); | ||
347 | + $('#recommended-error').html(data.msg).show(); | ||
348 | + } else { | ||
349 | + $('#recommended-error').hide(); | ||
350 | + } | ||
351 | + } | ||
352 | + }); | ||
353 | + } | ||
354 | + }); | ||
355 | + | ||
356 | + | ||
357 | +</script> | ||
358 | + | ||
359 | + | ||
360 | +</body> | ||
361 | +</html> |
1 | +<include file="public@header"/> | ||
2 | +</head> | ||
3 | +<body> | ||
4 | +<div class="wrap js-check-wrap"> | ||
5 | + <ul class="nav nav-tabs"> | ||
6 | + <li class="active"><a href="javascript:;">所有文章</a></li> | ||
7 | + <li><a href="{:url('AdminScoutOversea/add')}">添加文章</a></li> | ||
8 | + </ul> | ||
9 | + <form class="well form-inline margin-top-20" method="post" action="{:url('AdminScoutOversea/index')}"> | ||
10 | + <!--分类:--> | ||
11 | + <!--<select class="form-control" name="category" style="width: 140px;">--> | ||
12 | + <!--<option value='0'>全部</option>--> | ||
13 | + <!--{$category_tree|default=''}--> | ||
14 | + <!--</select> --> | ||
15 | + 标题: | ||
16 | + <input type="text" class="form-control" name="post_title" | ||
17 | + value="{$post_title|default=''}" | ||
18 | + style="width: 140px;"> | ||
19 | + 时间: | ||
20 | + <input type="text" class="form-control js-bootstrap-datetime" name="start_time" | ||
21 | + value="{$start_time|default=''}" | ||
22 | + style="width: 140px;" autocomplete="off">- | ||
23 | + <input type="text" class="form-control js-bootstrap-datetime" name="end_time" | ||
24 | + value="{$end_time|default=''}" | ||
25 | + style="width: 140px;" autocomplete="off"> | ||
26 | + <input type="submit" class="btn btn-primary" id="search" value="搜索"/> | ||
27 | + <a class="btn btn-danger" href="{:url('AdminScoutOversea/index')}">清空</a> | ||
28 | + </form> | ||
29 | + <form class="js-ajax-form" action="" method="post"> | ||
30 | + <div class="table-actions"> | ||
31 | + </div> | ||
32 | + <table class="table table-hover table-bordered table-list"> | ||
33 | + <thead> | ||
34 | + <tr> | ||
35 | + <th width="15"> | ||
36 | + <label> | ||
37 | + <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"> | ||
38 | + </label> | ||
39 | + </th> | ||
40 | + <!--<notempty name="category">--> | ||
41 | + <!--<th width="50">{:lang('SORT')}</th>--> | ||
42 | + <!--</notempty>--> | ||
43 | + <th width="50">ID</th> | ||
44 | + <th width="300">标题</th> | ||
45 | + <th width="100">缩略图</th> | ||
46 | + <th width="100">出发地点</th> | ||
47 | + <th width="100">包含项目</th> | ||
48 | + <th width="100">价格</th> | ||
49 | + <th width="65">点击量</th> | ||
50 | + <th width="130">创建时间</th> | ||
51 | + <th width="130">更新时间</th> | ||
52 | + <th width="70">权重</th> | ||
53 | + <th width="100">操作</th> | ||
54 | + </tr> | ||
55 | + </thead> | ||
56 | + <foreach name="articles" item="vo"> | ||
57 | + <tr> | ||
58 | + <td> | ||
59 | + <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" | ||
60 | + value="{$vo.id}" title="ID:{$vo.id}"> | ||
61 | + </td> | ||
62 | + <!--<notempty name="category">--> | ||
63 | + <!--<td>--> | ||
64 | + <!--<input name="list_orders[{$vo.post_category_id}]" class="input-order" type="text"--> | ||
65 | + <!--value="{$vo.list_order}">--> | ||
66 | + <!--</td>--> | ||
67 | + <!--</notempty>--> | ||
68 | + <td><b>{$vo.id}</b></td> | ||
69 | + <td> | ||
70 | + <notempty name="category"> | ||
71 | + {$vo.post_title} | ||
72 | + <else/> | ||
73 | + {$vo.post_title} | ||
74 | + </notempty> | ||
75 | + </td> | ||
76 | + <td> | ||
77 | + <notempty name="vo.more.thumbnail"> | ||
78 | + <a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo.more.thumbnail)}');"> | ||
79 | + <i class="fa fa-photo fa-fw"></i> | ||
80 | + </a> | ||
81 | + <else/> | ||
82 | + <i class="fa fa-close fa-fw"></i> | ||
83 | + </notempty> | ||
84 | + </td> | ||
85 | + <td>{$vo.place}</td> | ||
86 | + <td>{$vo.project}</td> | ||
87 | + <td>¥{$vo.price}</td> | ||
88 | + <td>{$vo.post_hits|default=0}</td> | ||
89 | + <td> | ||
90 | + <notempty name="vo.create_time"> | ||
91 | + {:date('Y-m-d H:i',$vo['create_time'])} | ||
92 | + </notempty> | ||
93 | + | ||
94 | + </td> | ||
95 | + <td> | ||
96 | + <notempty name="vo.update_time"> | ||
97 | + {:date('Y-m-d H:i',$vo['update_time'])} | ||
98 | + </notempty> | ||
99 | + | ||
100 | + </td> | ||
101 | + <td> | ||
102 | + <b>{$vo.weigh}</b> | ||
103 | + </td> | ||
104 | + <td> | ||
105 | + <a class="btn btn-xs btn-primary" href="{:url('AdminScoutOversea/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a> | ||
106 | + <a class="btn btn-xs btn-danger js-ajax-delete" | ||
107 | + href="{:url('AdminScoutOversea/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a> | ||
108 | + </td> | ||
109 | + </tr> | ||
110 | + </foreach> | ||
111 | + </table> | ||
112 | + <ul class="pagination">{$page|default=''}</ul> | ||
113 | + </form> | ||
114 | +</div> | ||
115 | +<script src="__STATIC__/js/admin.js"></script> | ||
116 | +<script> | ||
117 | + | ||
118 | + function reloadPage(win) { | ||
119 | + win.location.reload(); | ||
120 | + } | ||
121 | + | ||
122 | + $(function () { | ||
123 | + setCookie("refersh_time", 0); | ||
124 | + Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () { | ||
125 | + //批量复制 | ||
126 | + $('.js-articles-copy').click(function (e) { | ||
127 | + var ids = []; | ||
128 | + $("input[name='ids[]']").each(function () { | ||
129 | + if ($(this).is(':checked')) { | ||
130 | + ids.push($(this).val()); | ||
131 | + } | ||
132 | + }); | ||
133 | + | ||
134 | + if (ids.length == 0) { | ||
135 | + art.dialog.through({ | ||
136 | + id: 'error', | ||
137 | + icon: 'error', | ||
138 | + content: '您没有勾选信息,无法进行操作!', | ||
139 | + cancelVal: '关闭', | ||
140 | + cancel: true | ||
141 | + }); | ||
142 | + return false; | ||
143 | + } | ||
144 | + | ||
145 | + ids = ids.join(','); | ||
146 | + art.dialog.open("__ROOT__/index.php?g=portal&m=AdminScoutOversea&a=copy&ids=" + ids, { | ||
147 | + title: "批量复制", | ||
148 | + width: "300px" | ||
149 | + }); | ||
150 | + }); | ||
151 | + //批量移动 | ||
152 | + $('.js-articles-move').click(function (e) { | ||
153 | + var ids = []; | ||
154 | + $("input[name='ids[]']").each(function () { | ||
155 | + if ($(this).is(':checked')) { | ||
156 | + ids.push($(this).val()); | ||
157 | + } | ||
158 | + }); | ||
159 | + | ||
160 | + if (ids.length == 0) { | ||
161 | + art.dialog.through({ | ||
162 | + id: 'error', | ||
163 | + icon: 'error', | ||
164 | + content: '您没有勾选信息,无法进行操作!', | ||
165 | + cancelVal: '关闭', | ||
166 | + cancel: true | ||
167 | + }); | ||
168 | + return false; | ||
169 | + } | ||
170 | + | ||
171 | + ids = ids.join(','); | ||
172 | + art.dialog.open("__ROOT__/index.php?g=portal&m=AdminScoutOversea&a=move&old_term_id={$term.term_id|default=0}&ids=" + ids, { | ||
173 | + title: "批量移动", | ||
174 | + width: "300px" | ||
175 | + }); | ||
176 | + }); | ||
177 | + }); | ||
178 | + | ||
179 | + $('#search').click(function(){ | ||
180 | + var array = ['1','2','3','4','5','6']; | ||
181 | + var city_id = $('.check_city option:selected').val(); | ||
182 | + var index = $.inArray(city_id,array); //结果:index=1 | ||
183 | + if (index >= 0) { | ||
184 | + alert('请选择二级分类!'); | ||
185 | + return false; | ||
186 | + } | ||
187 | + }); | ||
188 | + }); | ||
189 | +</script> | ||
190 | +</body> | ||
191 | +</html> |
@@ -187,6 +187,49 @@ | @@ -187,6 +187,49 @@ | ||
187 | <div class="swiper-button-next"></div> | 187 | <div class="swiper-button-next"></div> |
188 | <div class="swiper-button-prev"></div> | 188 | <div class="swiper-button-prev"></div> |
189 | </div> | 189 | </div> |
190 | + | ||
191 | + <!--海外医疗--> | ||
192 | + <div class="Product" id="overseas" style="margin-top:106px;"> | ||
193 | + <div class="Spot_title clearfix"> | ||
194 | + <div class="Spot_icon fl"> | ||
195 | + <img src="__TMPL__/public/assets/starImg/aicon_74.png" alt=""> | ||
196 | + </div> | ||
197 | + <div class="Spot_name fl"> | ||
198 | + <div class="Spot_name_left fl"> | ||
199 | + 海外 | ||
200 | + </div> | ||
201 | + <div class="Spot_name_right fl"> | ||
202 | + 医疗 | ||
203 | + </div> | ||
204 | + </div> | ||
205 | + <div class="Spot_English_name fl"> | ||
206 | + <p>Overseas Medical Care</p> | ||
207 | + </div> | ||
208 | + </div> | ||
209 | + <div class="Product_main"> | ||
210 | + <div class="swiper-container"> | ||
211 | + <div class="swiper-wrapper"> | ||
212 | + <volist name="res_hwyl" id="vo"> | ||
213 | + <div class="swiper-slide"> | ||
214 | + <div class="Product_item"> | ||
215 | + <a href="/portal/scout/getTravelDetail?id={$vo.id}"> | ||
216 | + <div class="Product_item_img"> | ||
217 | + <img src="{:cmf_get_image_url($vo.thumbnail)}" alt=""> | ||
218 | + </div> | ||
219 | + <div class="Product_item_Route"> | ||
220 | + {$vo.post_title} | ||
221 | + </div> | ||
222 | + </a> | ||
223 | + </div> | ||
224 | + </div> | ||
225 | + </volist> | ||
226 | + </div> | ||
227 | + </div> | ||
228 | + </div> | ||
229 | + | ||
230 | + <div class="swiper-button-next swiper-button-white"></div> | ||
231 | + <div class="swiper-button-prev swiper-button-white"></div> | ||
232 | + </div> | ||
190 | </div> | 233 | </div> |
191 | </main> | 234 | </main> |
192 | <include file="public@footer"/> | 235 | <include file="public@footer"/> |
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | + | ||
4 | + <head> | ||
5 | + <meta charset="UTF-8"> | ||
6 | + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | ||
7 | + <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" /> | ||
8 | + <meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/bootstrap4.0.css"> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/happy.css" /> | ||
11 | + <title>搜索列表</title> | ||
12 | + </head> | ||
13 | + | ||
14 | + <body> | ||
15 | + <include file="public@header"/> | ||
16 | + <div class="index_searchBox"> | ||
17 | + <!--顶部标题--> | ||
18 | + <div class="in_seaTit"> | ||
19 | + <div class="in_seaTitImg"> | ||
20 | + <img src="__TMPL__/public/assets/images/bicon_45.png" alt="" /> | ||
21 | + </div> | ||
22 | + <h1 class="in_seaTitTxt1">{$keyword}</h1> | ||
23 | + <p class="in_seaTitTxt2">共搜到 {$count} 个结果</p> | ||
24 | + </div> | ||
25 | + <!--内容--> | ||
26 | + <div class="in_seaCon"> | ||
27 | + <ul> | ||
28 | + <volist name="res" id="vo"> | ||
29 | + <li> | ||
30 | + <h1 class="in_seaConTxt1 one-txt-cut">{$vo.post_title}</h1> | ||
31 | + <p class="in_seaConTxt2 txt-cut"> | ||
32 | + {$vo.post_excerpt} | ||
33 | + </p> | ||
34 | + <div class="in_seaConList"> | ||
35 | + <span>{$vo.category_name}</span> | ||
36 | + <notempty name="vo.city_name"> | ||
37 | + <span>{$vo.city_name}</span> | ||
38 | + </notempty> | ||
39 | + <span>{$vo.post_favorites}</span> | ||
40 | + </div> | ||
41 | + </li> | ||
42 | + </volist> | ||
43 | + </ul> | ||
44 | + </div> | ||
45 | + <!--分页--> | ||
46 | + <div class="page"> | ||
47 | + <!--分页--> | ||
48 | + <div class="pagination"> | ||
49 | + {$page|default=''} | ||
50 | + </div> | ||
51 | + </div> | ||
52 | + </div> | ||
53 | + <include file="public@footer"/> | ||
54 | + <script src="__TMPL__/public/assets/js/base.js"></script> | ||
55 | + <script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script> | ||
56 | + <script src="__TMPL__/public/assets/js/public.js"></script> | ||
57 | + </body> | ||
58 | + | ||
59 | +</html> |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="en"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta charset="UTF-8" /> | ||
6 | + <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" /> | ||
7 | + <meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
8 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper-3.4.2.min.css" /> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css" /> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/index.css" /> | ||
11 | + <title>星探推荐详情</title> | ||
12 | +</head> | ||
13 | + | ||
14 | +<body> | ||
15 | + <include file="public@header"/> | ||
16 | + <div class="index_fifteenth"> | ||
17 | + <div class="index_fifteenth_bg"> | ||
18 | + <div class="index_fifteenth_contant"> | ||
19 | + <div class="index_fifteenth_top"> | ||
20 | + <img src="__TMPL__/public/assets/images/cicon_58@2x.png" alt="" /> | ||
21 | + </div> | ||
22 | + <div class="index_fifteenth_one"> | ||
23 | + {$res.post_title} | ||
24 | + </div> | ||
25 | + <div class="index_fifteenth_three"> | ||
26 | + <div class="index_fifteenth_three_left"> | ||
27 | + 商品售价: | ||
28 | + </div> | ||
29 | + <div class="index_fifteenth_three_right"> | ||
30 | + ¥{$res.price} | ||
31 | + </div> | ||
32 | + </div> | ||
33 | + <div class="index_fifteenth_four"> | ||
34 | + {$res.post_excerpt} | ||
35 | + </div> | ||
36 | + <div class="index_fifteenth_five"> | ||
37 | + <a href="{$res.pay_url}"> | ||
38 | + 立即前往购买 | ||
39 | + </a> | ||
40 | + </div> | ||
41 | + </div> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + <include file="public@footer"/> | ||
45 | +</body> | ||
46 | +<script src="__TMPL__/public/assets/js/base.js"></script> | ||
47 | +<script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script> | ||
48 | +<script src="__TMPL__/public/assets/js/swiper.min.js"></script> | ||
49 | +<script src="__TMPL__/public/assets/js/public.js"></script> | ||
50 | +<script></script> | ||
51 | + | ||
52 | +</html> |
@@ -183,6 +183,42 @@ | @@ -183,6 +183,42 @@ | ||
183 | </ul> | 183 | </ul> |
184 | </div> | 184 | </div> |
185 | </div> | 185 | </div> |
186 | + <!--海外医疗--> | ||
187 | + <div class="first_scene"> | ||
188 | + <div class="first_scene_contant" id="oversea"> | ||
189 | + <div class="first_scene_img"> | ||
190 | + <div class="first_scene_top_img"> | ||
191 | + <img src="__TMPL__/public/assets/images/cicon_59@2x.png" alt="" /> | ||
192 | + </div> | ||
193 | + <div class="first_scene_top_ch">海外<span>医疗</span></div> | ||
194 | + <div class="first_scene_top_en"> | ||
195 | + Overseas Medical Care | ||
196 | + </div> | ||
197 | + </div> | ||
198 | + </div> | ||
199 | + </div> | ||
200 | + <div class="gallery"> | ||
201 | + <!-- 图片 --> | ||
202 | + <div class="star_gall_img swiper-container1"> | ||
203 | + <!-- 轮播图 --> | ||
204 | + <ul class="swiper-wrapper"> | ||
205 | + <volist name="res_hwyl" id="vo"> | ||
206 | + <li class="swiper-slide"> | ||
207 | + <div class="thirteenth_log"> | ||
208 | + <a href="/portal/scout/getTravelDetail?id={$vo.id}"> | ||
209 | + <div class="thirteenth_log_top"> | ||
210 | + <img src="{:cmf_get_image_url($vo.thumbnail)}" alt="" /> | ||
211 | + </div> | ||
212 | + <div class="thirteenth_log_bottom"> | ||
213 | + {$vo.post_title} | ||
214 | + </div> | ||
215 | + </a> | ||
216 | + </div> | ||
217 | + </li> | ||
218 | + </volist> | ||
219 | + </ul> | ||
220 | + </div> | ||
221 | + </div> | ||
186 | <include file="public@footer"/> | 222 | <include file="public@footer"/> |
187 | </body> | 223 | </body> |
188 | <script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script> | 224 | <script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script> |
@@ -109,6 +109,11 @@ $(function() { | @@ -109,6 +109,11 @@ $(function() { | ||
109 | window.location.href = '/portal/login/myCollection'; | 109 | window.location.href = '/portal/login/myCollection'; |
110 | }); | 110 | }); |
111 | 111 | ||
112 | + //跳转链接 | ||
113 | + $('.nav_downLi a').click(function(){ | ||
114 | + $('.nav_down').css('display','none'); | ||
115 | + }); | ||
116 | + | ||
112 | //评论 | 117 | //评论 |
113 | $('#comment').click(function(){ | 118 | $('#comment').click(function(){ |
114 | var content = $('#comment_content').val(); | 119 | var content = $('#comment_content').val(); |
@@ -9,9 +9,9 @@ | @@ -9,9 +9,9 @@ | ||
9 | </div> | 9 | </div> |
10 | <!-- input框 --> | 10 | <!-- input框 --> |
11 | <div class="nav_search"> | 11 | <div class="nav_search"> |
12 | - <form action=""> | 12 | + <form action="/portal/login/searchList" method="GET"> |
13 | <i></i> | 13 | <i></i> |
14 | - <input type="text" placeholder="请输入搜索内容"> | 14 | + <input type="text" placeholder="请输入搜索内容" name="keyword" value="{$keyword}" id="keywords"> |
15 | </form> | 15 | </form> |
16 | </div> | 16 | </div> |
17 | <div class="navImg3"> | 17 | <div class="navImg3"> |
-
请 注册 或 登录 后发表评论