Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
backend
Commits
0f7eca77
Commit
0f7eca77
authored
Nov 20, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商家bug 美行者排序
parent
a092826e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
546 additions
and
112 deletions
+546
-112
application/admin/controller/Guide.php
+19
-1
application/admin/controller/Project.php
+45
-18
application/admin/view/guide/create.html
+176
-0
application/admin/view/guide/index.html
+73
-52
application/admin/view/guide/update2.html
+92
-0
application/admin/view/project/addCatalogs.html
+12
-8
application/admin/view/project/index.html
+69
-31
application/admin/view/project/pricepage.html
+58
-0
application/admin/view/project/save.html
+1
-1
application/api/controller/Guide.php
+1
-1
No files found.
application/admin/controller/Guide.php
View file @
0f7eca77
...
...
@@ -15,11 +15,16 @@ class Guide extends AuthBase
$title
=
input
(
'title'
);
$map
=
array
();
if
(
input
(
'order'
)
==
2
)
{
$order
=
[
'sort'
=>
'desc'
,
'id'
=>
'desc'
];
}
else
{
$order
=
[
'id'
=>
'desc'
];
}
// 模糊查询title
if
(
$title
)
{
$map
[
'title'
]
=
[
'like'
,
"%"
.
$title
.
"%"
];
}
$posts
=
model
(
'guide'
)
->
where
(
$map
)
->
order
(
'id desc'
)
->
paginate
(
10
);
$posts
=
model
(
'guide'
)
->
where
(
$map
)
->
order
(
$order
)
->
paginate
(
10
);
$this
->
assign
(
'articles'
,
$posts
);
return
view
(
"index"
);
...
...
@@ -181,4 +186,17 @@ class Guide extends AuthBase
echo
json_encode
(
$result
);
}
//修改排序
public
function
changeSort
()
{
if
(
request
()
->
isPost
()){
$res
=
\app\common\model\Guide
::
update
(
input
(
'post.'
));
if
(
$res
){
return
json
([
'code'
=>
0
,
'msg'
=>
'修改成功'
]);
}
else
{
return
json
([
'code'
=>
1
,
'msg'
=>
'修改失败'
]);
}
}
}
}
application/admin/controller/Project.php
View file @
0f7eca77
...
...
@@ -552,11 +552,12 @@ class Project extends AuthBase
halt
(
$project
->
getLastSql
());
}
//商家保存
public
function
save
()
{
if
(
input
(
'id'
))
{
$info
=
ProjectModel
::
get
(
input
(
'id'
));
$info
[
'tags_arr'
]
=
explode
(
'|'
,
trim
(
$info
->
getData
(
'tags'
),
'|'
));
$info
=
ProjectModel
::
get
(
input
(
'id'
));
$info
[
'tags_arr'
]
=
explode
(
'|'
,
trim
(
$info
->
getData
(
'tags'
),
'|'
));
$this
->
assign
(
'info'
,
$info
);
}
//分类
...
...
@@ -565,46 +566,71 @@ class Project extends AuthBase
$city
=
Citys
::
all
();
//标签
$tags
=
Tags
::
all
();
if
(
request
()
->
isPost
())
{
$isUpdate
=
input
(
'id'
)
?
true
:
false
;
$model
=
new
ProjectModel
();
$data
=
input
(
'post.'
);
if
(
input
(
'post.type'
)
==
1
)
{
if
(
request
()
->
isPost
())
{
$isUpdate
=
input
(
'id'
)
?
true
:
false
;
$model
=
new
ProjectModel
();
$data
=
input
(
'post.'
);
if
(
input
(
'post.type'
)
==
1
)
{
unset
(
$data
[
'kf_qrcode'
]);
}
else
{
}
else
{
unset
(
$data
[
'sign_limits'
]);
unset
(
$data
[
'time_period'
]);
unset
(
$data
[
'sign_endtime'
]);
}
$res
=
$model
->
allowField
(
true
)
->
isUpdate
(
$isUpdate
)
->
save
(
$data
);
if
(
$res
)
{
$this
->
success
(
'操作成功'
,
url
(
'index'
)
.
"?page="
.
input
(
'page'
,
1
));
}
else
{
if
(
$res
)
{
$this
->
success
(
'操作成功'
,
url
(
'index'
)
.
"?page="
.
input
(
'page'
,
1
));
}
else
{
$this
->
error
(
'操作失败'
);
}
}
return
$this
->
fetch
(
''
,
compact
(
'catalogs'
,
'city'
,
'tags'
));
}
//上传图片
public
function
uploadImg
()
{
$upload
=
new
Upload
();
$res
=
$upload
->
sava
(
input
(
'file.file'
));
if
(
$res
[
'error'
]
===
0
)
{
return
json
([
'code'
=>
0
,
'msg'
=>
'上传成功'
,
'url'
=>
$res
[
'result'
][
'url'
]]);
$res
=
$upload
->
sava
(
input
(
'file.file'
));
if
(
$res
[
'error'
]
===
0
)
{
return
json
([
'code'
=>
0
,
'msg'
=>
'上传成功'
,
'url'
=>
$res
[
'result'
][
'url'
]]);
}
return
json
([
'code'
=>
1
,
'msg'
=>
$res
[
'msg'
]]);
return
json
([
'code'
=>
1
,
'msg'
=>
$res
[
'msg'
]]);
}
//上传本地图片
public
function
uploadLocalImg
()
{
$file
=
request
()
->
file
(
'file'
);
$info
=
$file
->
move
(
'./upload/qrcode/'
);
if
(
$info
)
{
$kf_qrcode
=
"/upload/qrcode/"
.
$info
->
getSaveName
();
return
json
([
'code'
=>
0
,
'msg'
=>
'上传成功'
,
'url'
=>
$kf_qrcode
]);
$kf_qrcode
=
"/upload/qrcode/"
.
$info
->
getSaveName
();
return
json
([
'code'
=>
0
,
'msg'
=>
'上传成功'
,
'url'
=>
$kf_qrcode
]);
}
return
json
([
'code'
=>
1
,
'msg'
=>
'上传失败'
]);
}
//修改价格
public
function
pricePage
()
{
$info
=
ProjectModel
::
get
(
input
(
'id'
));
$this
->
assign
(
'info'
,
$info
);
return
$this
->
fetch
();
}
//修改价格
public
function
priceSave
()
{
if
(
request
()
->
isPost
())
{
$res
=
ProjectModel
::
update
(
input
(
'post.'
));
if
(
$res
)
{
return
json
([
'code'
=>
0
,
'msg'
=>
'修改成功'
]);
}
else
{
return
json
([
'code'
=>
1
,
'msg'
=>
'修改失败'
]);
}
}
return
json
([
'code'
=>
1
,
'msg'
=>
'上传失败'
]);
}
}
\ No newline at end of file
application/admin/view/guide/create.html
0 → 100644
View file @
0f7eca77
{layout name="public/fullscreen"}
<link
rel=
"stylesheet"
href=
"/static/fileinput/css/fileinput.css"
>
<link
rel=
"stylesheet"
href=
"/static/bootstrap-select/css/bootstrap-select.min.css"
>
<style
type=
"text/css"
>
.progress-bar
{
text-align
:
center
;
}
.dropdown-menu
{
z-index
:
100000
;
}
</style>
<section
class=
"wrapper"
>
<h3
class=
""
>
<a
href=
"<?php echo url('@admin/Guide/index')?>"
>
<i
class=
"fa fa-angle-right"
></i>
<a
href=
"{:url('admin/Guide/index')}"
>
美行攻略
</a>
<i
class=
"fa fa-angle-right"
></i>
发布攻略
</a>
</h3>
<hr>
<?php if(isset($msg) && $msg):?>
<div
class=
"row margin-bottom"
>
<div
class=
"col-md-12"
>
<div
class=
"alert alert-danger alert-dismissible fade in"
role=
"alert"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<?php echo $msg;?>
</div>
</div>
</div>
<?php endif;?>
<div
class=
"row margin-bottom"
>
<div
class=
"col-md-12"
>
<form
name=
"myFrom"
class=
"form-horizontal"
enctype=
"multipart/form-data"
method=
"POST"
action=
"<?php echo url("
@
admin
/
Guide
/
create
")?
>
" id="article-create-form">
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略标题
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"text"
class=
"form-control validate[required]"
name=
"title"
id=
"title"
placeholder=
"请输入美行攻略的标题"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略简介
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<textarea
name=
"intro"
id=
""
cols=
"30"
rows=
"3"
class=
"form-control"
placeholder=
"请输入美行攻略的简单描述"
></textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略封面
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
id=
"input-b1"
name=
"poster"
type=
"file"
>
<span
class=
"form-group-tip"
>
* 尺寸建议:260px*190px
</span>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略标签
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"hidden"
name=
"tags"
id=
"tags"
value=
""
>
<select
class=
"selectpicker form-control"
id=
"tags_select"
multiple
data-live-search=
"true"
onchange=
"setTags()"
>
{volist name="tag_list" name="tag_list" id="vo"}
<option
value=
"{$vo.id}"
>
{$vo.name}
</option>
{/volist}
</select>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
攻略类型
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<select
class=
"form-control"
name=
"type"
id=
"post_type"
>
<option
value=
"1"
>
手动编写文章
</option>
<option
value=
"2"
>
链接到网络文章
</option>
</select>
</div>
</div>
<div
class=
"form-group"
id=
"href"
style=
"display: none"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
请输入url
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"text"
name=
"href"
class=
"form-control"
>
<code>
http:// + 网址 或 https:// + 网址
</code>
</div>
</div>
<div
class=
"form-group"
id=
"content"
>
<label
for=
"content"
class=
"col-sm-2 control-label text-right"
>
攻略详情
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<!-- 加载编辑器的容器 -->
<script
id=
"post_container"
name=
"content"
type=
"text/plain"
style=
"width: 100%"
>
</script>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<button
type=
"submit"
class=
"btn btn-success"
id=
"btn-save"
>
提交
</button>
</div>
</div>
</form>
</div>
</div>
</section>
<!-- 文件上传和select插件 -->
<script
type=
"text/javascript"
src=
"/static/fileinput/js/fileinput.min.js"
></script>
<script
type=
"text/javascript"
src=
"/static/fileinput/js/locales/zh.js"
></script>
<script
type=
"text/javascript"
src=
"/static/bootstrap-select/js/bootstrap-select.min.js"
></script>
<script
type=
"text/javascript"
src=
"/static/bootstrap-select/js/i18n/defaults-zh_CN.js"
></script>
<!-- 配置文件 -->
<script
type=
"text/javascript"
src=
"/static/ueditor/ueditor.config.js"
></script>
<!-- 编辑器源码文件 -->
<script
type=
"text/javascript"
src=
"/static/ueditor/ueditor.all.js"
></script>
<script
type=
"text/javascript"
>
$
(
function
(){
// 即时显示封面图
$
(
'#poster'
).
change
(
function
(
e
){
var
file
=
e
.
target
.
files
[
0
];
preview
(
file
,
0
);
});
var
type
=
$
(
"#post_type"
).
val
();
if
(
type
==
1
){
$
(
"#content"
).
show
();
$
(
"#href"
).
hide
();
}
else
{
$
(
"#href"
).
show
();
$
(
"#content"
).
hide
();
}
});
$
(
"#post_type"
).
change
(
function
(){
var
type
=
$
(
this
).
val
();
if
(
type
==
1
){
$
(
"#content"
).
show
();
$
(
"#href"
).
hide
();
}
else
{
$
(
"#href"
).
show
();
$
(
"#content"
).
hide
();
}
});
// 初始化文件上传
$
(
"#input-b1"
).
fileinput
({
language
:
'zh'
,
showUpload
:
false
,
//是否显示上传按钮
allowedFileExtensions
:
[
'bmp'
,
'jpg'
,
'png'
,
'tif'
,
'gif'
,
'pcx'
,
'tga'
,
'exif'
,
'fpx'
,
'svg'
,
'cdr'
,
'pcd'
,
'dxf'
,
'ufo'
,
'eps'
,
'raw'
,
'WMF'
,
'webp'
],
//接收的文件后缀
})
function
setTags
(){
var
slected
=
$
(
"#tags_select"
).
val
();
if
(
slected
){
$
(
"#tags"
).
val
(
slected
.
toString
());
}
else
{
$
(
"#tags"
).
val
(
""
);
}
}
UE
.
getEditor
(
'post_container'
,
{
//编辑区域大小
'initialFrameHeight'
:
'350'
,
'elementPathEnabled'
:
false
,
'autoHeight'
:
true
,
'autoHeightEnabled'
:
true
,
'autoFloatEnabled'
:
true
,
'iframeCssUrl'
:
'/static/ueditor/themes/iframe.css'
,
// 引入css
//定制菜单
'toolbars'
:
[
[
'fullscreen'
,
'source'
,
'undo'
,
'redo'
,
'|'
,
'fontsize'
,
'bold'
,
'italic'
,
'underline'
,
'fontborder'
,
'strikethrough'
,
'removeformat'
,
'formatmatch'
,
'blockquote'
,
'pasteplain'
,
'|'
,
'forecolor'
,
'backcolor'
,
'|'
,
'lineheight'
,
'|'
,
'indent'
,
'|'
,
'insertimage'
,
'|'
,
'justifyleft'
,
//居左对齐
'justifyright'
,
//居右对齐
'justifycenter'
,
//居中对齐
'justifyjustify'
,
//两端对齐
],
]
});
</script>
application/admin/view/guide/index.html
View file @
0f7eca77
...
...
@@ -8,13 +8,21 @@
<div
class=
"row margin-bottom"
>
<div
class=
"col-md-12"
>
<form
class=
"form-inline pull-left"
method=
"GET"
action=
"<?php echo url('@admin/Guide/index')?>"
>
<div
class=
"form-group margin-right"
>
<input
class=
"form-control"
type=
"text"
name=
"title"
id=
"title"
value=
"<?php echo input('title');?>"
placeholder=
"攻略标题"
/>
<div
class=
"form-group margin-right"
>
<select
name=
""
id=
""
class=
"form-control"
onchange=
"location.href='{:url('index')}'+'?order='+this.value"
>
<option
value=
"1"
{
:input
('
sort
',
0
)==
1
?'
selected
'
:
'';}
>
最新(排序)
</option>
<option
value=
"2"
{
:input
('
sort
',
0
)==
2
?'
selected
'
:
'';}
>
最热(排序)
</option>
</select>
</div>
<div
class=
"form-group margin-right"
>
<input
class=
"form-control"
type=
"text"
name=
"title"
id=
"title"
value=
"<?php echo input('title');?>"
placeholder=
"攻略标题"
/>
</div>
<button
type=
"submit"
class=
"btn btn-primary"
>
搜索
</button>
</form>
<div
class=
"pull-left margin-left"
>
<a
href=
'<?php echo url("@admin/Guide/create")?>'
type=
"button"
class=
"btn btn-success"
style=
"margin-left:30px;"
>
<a
href=
'<?php echo url("@admin/Guide/create")?>'
type=
"button"
class=
"btn btn-success"
style=
"margin-left:30px;"
>
发布攻略
</a>
</div>
...
...
@@ -26,53 +34,60 @@
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered table-striped"
>
<thead>
<tr>
<th>
ID
</th>
<th>
攻略标题
</th>
<th>
类型
</th>
<th>
简介
</th>
<th>
标签
</th>
<th>
封面
</th>
<th>
发布时间
</th>
<th>
操作
</th>
</tr>
<tr>
<th>
ID
</th>
<th>
攻略标题
</th>
<th>
类型
</th>
<th>
简介
</th>
<th>
标签
</th>
<th>
封面
</th>
<th>
最热
</th>
<th>
发布时间
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<?php foreach ($articles as $k => $article):?>
<tr
id=
"tr_<?php echo $article->id;?>"
>
<td>
<?php echo $article->id;?>
</td>
<td
style=
"max-width:450px;"
>
{if condition="$article.type == 1"}
<a
href=
"<?php echo url('@mob/Guide/read', 'id='.$article->id);?>/"
target=
'_blank'
>
<?php echo $article->title;?>
</a>
{else/}
<a
href=
"{$article->content}"
target=
'_blank'
>
<?php echo $article->title;?>
</a>
{/if}
</td>
<td>
<?=$article->type=='1'?'自建文章':'网络文章';?>
</td>
<td
style=
"max-width:200px;"
>
<?=$article->intro;?>
</td>
<td
style=
"max-width: 200px"
>
{volist name="$article.tags" id="tag" key="k"}{if condition="$k!=1"}/{/if}{$tag}{/volist}
</td>
<td>
<a
href=
"<?=$article->poster?>"
target=
"_blank"
data-fancybox=
"images"
>
<img
src=
"<?=$article->poster?>"
width=
'100'
>
</a>
</td>
<td>
<?php echo $article->created_at;?>
</td>
<td
style=
"min-width:100px;"
>
<a
href=
"<?php echo url('@admin/Guide/update', 'id='.$article->id);?>"
type=
"button"
class=
"btn btn-primary btn-xs"
data-toggle=
"tooltip"
data-placement=
"top"
data-original-title=
"编辑"
>
<i
class=
"fa fa-pencil"
></i>
</a>
<button
oid=
"<?php echo $article->id;?>"
type=
"button"
class=
"btn btn-danger btn-xs btn-delete"
data-toggle=
"tooltip"
data-placement=
"top"
data-original-title=
"删除"
>
<i
class=
"fa fa-trash-o"
></i>
</button>
</td>
</tr>
<?php endforeach;?>
<?php foreach ($articles as $k => $article):?>
<tr
id=
"tr_<?php echo $article->id;?>"
>
<td>
<?php echo $article->id;?>
</td>
<td
style=
"max-width:450px;"
>
{if condition="$article.type == 1"}
<a
href=
"<?php echo url('@mob/Guide/read', 'id='.$article->id);?>/"
target=
'_blank'
>
<?php echo $article->title;?>
</a>
{else/}
<a
href=
"{$article->content}"
target=
'_blank'
>
<?php echo $article->title;?>
</a>
{/if}
</td>
<td>
<?=$article->type=='1'?'自建文章':'网络文章';?>
</td>
<td
style=
"max-width:200px;"
>
<?=$article->intro;?>
</td>
<td
style=
"max-width: 200px"
>
{volist name="$article.tags" id="tag" key="k"}{if condition="$k!=1"}/{/if}{$tag}{/volist}
</td>
<td>
<a
href=
"<?=$article->poster?>"
target=
"_blank"
data-fancybox=
"images"
>
<img
src=
"<?=$article->poster?>"
width=
'100'
>
</a>
</td>
<td
align=
"center"
><input
onchange=
"changeSort({$article['id']},this.value);"
style=
"width: 80px"
type=
"text"
name=
"sort"
value=
"{$article.sort}"
></td>
<td>
<?php echo $article->created_at;?>
</td>
<td
style=
"min-width:100px;"
>
<a
href=
"<?php echo url('@admin/Guide/update', 'id='.$article->id);?>"
type=
"button"
class=
"btn btn-primary btn-xs"
data-toggle=
"tooltip"
data-placement=
"top"
data-original-title=
"编辑"
>
<i
class=
"fa fa-pencil"
></i>
</a>
<button
oid=
"<?php echo $article->id;?>"
type=
"button"
class=
"btn btn-danger btn-xs btn-delete"
data-toggle=
"tooltip"
data-placement=
"top"
data-original-title=
"删除"
>
<i
class=
"fa fa-trash-o"
></i>
</button>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
...
...
@@ -88,24 +103,30 @@
<script
type=
"text/javascript"
>
// 文档加载完毕之后,会进入该方法
$
(
function
()
{
$
(
".btn-delete"
).
click
(
function
()
{
$
(
function
()
{
$
(
".btn-delete"
).
click
(
function
()
{
var
_this
=
$
(
this
);
var
url
=
"delete"
;
var
oid
=
_this
.
attr
(
'oid'
);
showDialog
(
"提示"
,
"确定删除这篇文章吗?"
,
function
()
{
// ajax post 方法
$
.
post
(
url
,
{
id
:
oid
},
function
(
res
)
{
$
.
post
(
url
,
{
id
:
oid
},
function
(
res
)
{
var
res
=
JSON
.
parse
(
res
);
if
(
res
.
error
==
1
)
{
// javascript 的默认弹出提示方法
alert
(
res
.
msg
);
}
else
{
_this
.
remove
();
$
(
"#tr_"
+
oid
).
fadeOut
();
$
(
"#tr_"
+
oid
).
fadeOut
();
}
});
});
});
});
//修改排序
function
changeSort
(
id
,
sort
)
{
$
.
post
(
"{:url('changeSort')}"
,{
id
:
id
,
sort
:
sort
},
function
(
res
)
{
layer
.
msg
(
res
.
msg
);
});
}
</script>
application/admin/view/guide/update2.html
0 → 100644
View file @
0f7eca77
{layout name="public/layout_main"}
<style
type=
"text/css"
>
.progress-bar
{
text-align
:
center
;
}
</style>
<section
class=
"wrapper"
>
<h3
class=
"top-back"
>
<a
href=
"<?php echo url('@admin/Post/index')?>"
>
<i
class=
"fa fa-angle-left"
></i>
编辑文章
</a>
</h3>
<hr>
<?php if(isset($msg) && $msg !== ''):?>
<div
class=
"row margin-bottom"
>
<div
class=
"col-md-12"
>
<div
class=
"alert alert-danger alert-dismissible fade in"
role=
"alert"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<?php echo $msg;?>
</div>
</div>
</div>
<?php endif;?>
<div
class=
"row margin-bottom"
>
<div
class=
"col-md-12"
>
<form
class=
"form-horizontal"
enctype=
"multipart/form-data"
method=
"POST"
id=
"robot-create-form"
>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-2 control-label text-right"
>
文章标题
</label>
<div
class=
"col-lg-8"
>
<input
type=
"text"
class=
"form-control validate[required]"
name=
"title"
id=
"title"
value=
"<?php echo $article->title;?>"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"content"
class=
"col-sm-2 control-label text-right"
>
文章内容
</label>
<div
class=
"col-lg-8"
>
<!-- 加载编辑器的容器 -->
<script
id=
"post_container"
name=
"content"
type=
"text/plain"
>
<
?
php
echo
htmlspecialchars_decode
(
$article
->
content
);
?
>
</script>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<button
type=
"submit"
class=
"btn btn-default"
>
提交
</button>
</div>
</div>
</form>
</div>
</div>
</section>
<!-- 配置文件 -->
<script
type=
"text/javascript"
src=
"/static/ueditor/ueditor.config.js"
></script>
<!-- 编辑器源码文件 -->
<script
type=
"text/javascript"
src=
"/static/ueditor/ueditor.all.js"
></script>
<script
type=
"text/javascript"
>
var
ue
=
UE
.
getEditor
(
'post_container'
,{
// 图片上传配置路径
'serverUrl'
:
"{:url('@admin/Ueditor/index')}"
,
'elementPathEnabled'
:
false
,
// autoHeight: true,
'autoHeightEnabled'
:
false
,
//编辑区域大小
'initialFrameHeight'
:
'300'
,
//定制菜单
'toolbars'
:
[
[
'fullscreen'
,
'source'
,
'undo'
,
'redo'
,
'|'
,
'fontsize'
,
'bold'
,
'italic'
,
'underline'
,
'fontborder'
,
'strikethrough'
,
'removeformat'
,
'formatmatch'
,
'blockquote'
,
'pasteplain'
,
'|'
,
'forecolor'
,
'backcolor'
,
'|'
,
'lineheight'
,
'|'
,
'indent'
,
'|'
,
'insertimage'
,
'|'
,
'justifyleft'
,
//居左对齐
'justifyright'
,
//居右对齐
'justifycenter'
,
//居中对齐
'justifyjustify'
,
//两端对齐
],
]
});
/*
* 初始化分类
*/
$
(
function
()
{
});
</script>
\ No newline at end of file
application/admin/view/project/addCatalogs.html
View file @
0f7eca77
{layout name="public/layout_main"}
<link
rel=
"stylesheet"
href=
"/static/fileinput/css/fileinput.css"
>
<section
class=
"wrapper"
>
<h3><i
class=
"fa fa-angle-right"
></i>
<a
href=
"{:url('admin/project/catalogs')}"
>
分类管理
</a>
<i
class=
"fa fa-angle-right"
></i>
修改
分类
</h3>
<h3><i
class=
"fa fa-angle-right"
></i>
<a
href=
"{:url('admin/project/catalogs')}"
>
分类管理
</a>
<i
class=
"fa fa-angle-right"
></i>
添加
分类
</h3>
<!-- 分割线 -->
<hr>
<div
class=
"col-xs-12"
>
<form
method=
"post"
class=
"form-horizontal"
enctype=
"multipart/form-data"
action=
"{:url('admin/project/addCatalogs')}"
>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-
1
control-label text-right"
>
分类名
</label>
<div
class=
"col-
lg-10
"
>
<label
for=
"title"
class=
"col-sm-
2
control-label text-right"
>
分类名
</label>
<div
class=
"col-
sm-10 col-md-8 col-lg-6
"
>
<input
type=
"text"
class=
"form-control"
name=
"name"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-
1
control-label text-right"
>
分类图标
</label>
<div
class=
"col-
lg-10
"
>
<label
for=
"title"
class=
"col-sm-
2
control-label text-right"
>
分类图标
</label>
<div
class=
"col-
sm-10 col-md-8 col-lg-6
"
>
<input
type=
"hidden"
name=
'old_poster'
>
<input
id=
"input-b1"
name=
"poster"
type=
"file"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-sm-
1
control-label text-right"
>
排序
</label>
<div
class=
"col-
lg-10
"
>
<label
for=
"title"
class=
"col-sm-
2
control-label text-right"
>
排序
</label>
<div
class=
"col-
sm-10 col-md-8 col-lg-6
"
>
<input
type=
"number"
class=
"form-control"
name=
"sort"
>
</div>
</div>
<button
type=
"submit"
class=
"btn btn-success"
>
修改
</button>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<button
class=
"btn btn-success"
id=
"btn-save"
>
提交
</button>
</div>
</div>
</form>
</div>
...
...
application/admin/view/project/index.html
View file @
0f7eca77
{layout name="public/layout_main"}
<link
rel=
"stylesheet"
href=
"/static/layui/css/layui.css"
>
<script
src=
"/static/layui/layui.js"
></script>
<script
src=
"/static/js/bootstrap-switch.js"
></script>
<style>
.table-detail-left
{
.table-detail-left
{
float
:
left
;
width
:
40%
;
}
.table-detail-right
{
.table-detail-right
{
float
:
left
;
width
:
60%
;
}
.table-detail-row
{
.table-detail-row
{
margin-bottom
:
5px
;
padding-left
:
80px
;
}
.table-detail-row
span
{
.table-detail-row
span
{
display
:
inline-block
;
width
:
70px
;
text-align
:
right
;
margin-left
:
-80px
;
}
.table-detail-full
{
.table-detail-full
{
width
:
100%
;
float
:
left
;
}
...
...
@@ -32,7 +38,7 @@
<div
class=
"row margin-bottom"
>
<div
class=
"col-md-12"
>
<form
class=
"form-inline pull-left"
method=
"GET"
action=
"{:url('admin/project/index')}"
>
<form
class=
"form-inline pull-left"
method=
"GET"
action=
"{:url('admin/project/index')}"
>
<div
class=
"form-group margin-right"
>
<select
name=
"order"
class=
"form-control"
>
<option
value=
"1"
>
最新(排序)
</option>
...
...
@@ -43,24 +49,28 @@
<select
name=
"catalog_id"
class=
"form-control"
>
<option
value=
""
>
所有分类
</option>
{volist name="$catalog_list" id="vo"}
<option
value=
"{$vo.id}"
{
if
condition=
"input('catalog_id')==$vo.id"
}
selected
{/
if
}
>
{$vo.name}
</option>
<option
value=
"{$vo.id}"
{
if
condition=
"input('catalog_id')==$vo.id"
}
selected
{
/
if
}
>
{$vo.name}
</option>
{/volist}
</select>
</div>
<div
class=
"form-group margin-right"
>
<select
name=
"type"
class=
"form-control"
>
<option
value=
""
>
活动/商家
</option>
<option
value=
"1"
{
if
condition=
"input('type')==1"
}
selected
{/
if
}
>
活动
</option>
<option
value=
"2"
{
if
condition=
"input('type')==2"
}
selected
{/
if
}
>
商家
</option>
<option
value=
"1"
{
if
condition=
"input('type')==1"
}
selected
{
/
if
}
>
活动
</option>
<option
value=
"2"
{
if
condition=
"input('type')==2"
}
selected
{
/
if
}
>
商家
</option>
</select>
</div>
<div
class=
"form-group margin-right"
>
<input
class=
"form-control"
type=
"text"
name=
"title"
id=
"title"
value=
"<?php echo input('title');?>"
placeholder=
"活动/商家名称"
/>
<input
class=
"form-control"
type=
"text"
name=
"title"
id=
"title"
value=
"<?php echo input('title');?>"
placeholder=
"活动/商家名称"
/>
</div>
<button
type=
"submit"
class=
"btn btn-primary"
>
搜索
</button>
</form>
<div
class=
" pull-left margin-left"
>
<a
href=
"{:url('admin/project/save')}"
class=
"btn btn-success"
>
创建活动/商家
</a>
<a
href=
"{:url('admin/project/save')}"
class=
"btn btn-success"
>
创建活动/商家
</a>
</div>
</div>
</div>
...
...
@@ -70,11 +80,11 @@
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered table-striped"
>
<!--<colgroup>-->
<!--<col style="width: 2%;">-->
<!--<col style="width: 80%;">-->
<!--<col style="width: 5%;">-->
<!--<col style="width: 5%;">-->
<!--<col style="width: 10%;">-->
<!--<col style="width: 2%;">-->
<!--<col style="width: 80%;">-->
<!--<col style="width: 5%;">-->
<!--<col style="width: 5%;">-->
<!--<col style="width: 10%;">-->
<!--</colgroup>-->
<thead>
<tr>
...
...
@@ -102,11 +112,11 @@
</a>
</td>
<td>
{if condition="$vo.region_type==1"}
{if condition="$vo.region_type==1"}
国内
{else/}
{else/}
国外
{/if}
{/if}
</td>
<td>
{$vo.city_str.name}
</td>
<td>
{$vo.catalog_id_str.name}
</td>
...
...
@@ -115,12 +125,15 @@
<div
class=
"clearfix"
style=
"width: 500px"
>
<div
class=
"table-detail-left"
>
<p
class=
"table-detail-row"
><span>
类
型:
</span>
活动
</p>
<p
class=
"table-detail-row"
><span>
晚
数:
</span>
{$vo.night_num}
</p>
<p
class=
"table-detail-row"
><span>
价
格:
</span>
¥{$vo.price}
</p>
<p
class=
"table-detail-row"
><span>
晚
数:
</span>
{$vo.night_num}
</p>
<p
class=
"table-detail-row"
><span>
价
格:
</span>
¥{$vo.price}
</p>
<p
class=
"table-detail-row"
><span>
会员价:
</span>
¥{$vo.vip_price}
</p>
</div>
<div
class=
"table-detail-right"
>
<p
class=
"table-detail-row"
><span>
总
组
数:
</span>
{$vo.sign_limits}
</p>
<p
class=
"table-detail-row"
><span>
总
组
数:
</span>
{$vo.sign_limits}
</p>
<p
class=
"table-detail-row"
><span>
已售组数:
</span>
{$vo.sign_num}
</p>
<p
class=
"table-detail-row"
><span>
活动时间:
</span>
{$vo.time_period}
</p>
...
...
@@ -128,12 +141,16 @@
</div>
<div
class=
"table-detail-full"
>
<p
class=
"table-detail-row"
><span>
所在地:
</span>
{$vo.location}
</p>
<p
class=
"table-detail-row"
><span>
标
签:
</span>
{$vo.tags}
</p>
<p
class=
"table-detail-row"
><span>
标
签:
</span>
{$vo.tags}
</p>
</div>
</div>
{else/}
<div
class=
"clearfix"
style=
"width: 500px"
>
<p
class=
"table-detail-row"
><span>
类
型:
</span>
商家
</p>
<p
class=
"table-detail-row"
><span>
价
格:
</span>
¥{$vo.price}
</p>
<p
class=
"table-detail-row"
><span>
晚
数:
</span>
{$vo.night_num}
<p
class=
"table-detail-row"
><span>
所在地:
</span>
{$vo.location}
</p>
<p
class=
"table-detail-row"
><span>
标
签:
</span>
{$vo.tags}
</p>
</div>
...
...
@@ -141,16 +158,21 @@
</td>
<td>
{$vo.sign_endtime_str}
</td>
<td>
<div
data-id=
"{$vo.id}"
class=
"switch"
checked
data-on-label=
"开启"
data-off-label=
"关闭"
data-off=
"success"
>
<div
data-id=
"{$vo.id}"
class=
"switch"
checked
data-on-label=
"开启"
data-off-label=
"关闭"
data-off=
"success"
>
<input
type=
"checkbox"
name=
"heat"
{$
vo
.
heat
?
'
checked
'
:
''
;}
/>
</div>
</td>
<td>
<input
type=
"number"
size=
"4"
style=
"width:50px"
onchange=
"setSort(this.value,{$vo.id})"
value=
"{$vo.sort}"
>
<input
type=
"number"
size=
"4"
style=
"width:50px"
onchange=
"setSort(this.value,{$vo.id})"
value=
"{$vo.sort}"
>
</td>
<td>
<a
href=
"{:url('admin/project/save',['id'=>$vo.id,'page'=>input('page')])}"
class=
"btn btn-xs btn-primary"
><i
class=
"fa fa-pencil"
></i></a>
<a
href=
"javascript:"
oid=
"{$vo.id}"
class=
"btn btn-xs btn-danger btn-delete"
><i
class=
"fa fa-trash"
></i></a>
<button
onclick=
"changePrice({$vo.id})"
href=
""
class=
"btn btn-xs btn-primary"
>
修改价格
</button>
<a
href=
"{:url('admin/project/save',['id'=>$vo.id,'page'=>input('page')])}"
class=
"btn btn-xs btn-primary"
><i
class=
"fa fa-pencil"
></i></a>
<a
href=
"javascript:"
oid=
"{$vo.id}"
class=
"btn btn-xs btn-danger btn-delete"
><i
class=
"fa fa-trash"
></i></a>
</td>
</tr>
{/volist}
...
...
@@ -168,16 +190,16 @@
<script
type=
"text/javascript"
>
$
(
'.switch'
).
on
(
'switch-change'
,
function
(
e
,
data
)
{
var
heat
=
data
.
value
?
1
:
0
;
var
heat
=
data
.
value
?
1
:
0
;
var
id
=
$
(
this
).
attr
(
'data-id'
);
$
.
post
(
"{:url('setHeat')}"
,
{
id
:
id
,
heat
:
heat
},
function
(
res
)
{
$
.
post
(
"{:url('setHeat')}"
,
{
id
:
id
,
heat
:
heat
},
function
(
res
)
{
location
.
reload
();
});
});
//设置排序
function
setSort
(
sort
,
id
)
{
$
.
post
(
"{:url('setSort')}"
,
{
id
:
id
,
sort
:
sort
},
function
()
{
function
setSort
(
sort
,
id
)
{
$
.
post
(
"{:url('setSort')}"
,
{
id
:
id
,
sort
:
sort
},
function
()
{
location
.
reload
();
});
}
...
...
@@ -204,4 +226,20 @@
});
});
function
changePrice
(
id
)
{
layui
.
use
([
'layer'
,
'jquery'
],
function
()
{
var
layer
=
layui
.
layer
,
$
=
layui
.
jquery
;
$
.
post
(
"{:url('pricePage')}"
,{
id
:
id
},
function
(
html
){
layer
.
open
({
type
:
1
,
area
:[
'500px'
,
'350px'
],
content
:
html
,
});
});
});
}
</script>
application/admin/view/project/pricepage.html
0 → 100644
View file @
0f7eca77
<form
action=
""
class=
"layui-form"
style=
"padding: 10px;"
>
<div
class=
"form-group"
>
<label
class=
"layui-form-label"
>
价格
</label>
<div
class=
"layui-input-block"
>
<input
type=
"number"
step=
"0.01"
class=
"layui-input"
name=
"price"
value=
"{$info['price']}"
>
</div>
</div>
{if $info.type==1}
<div
class=
"form-group"
>
<label
class=
"layui-form-label"
>
Vip价格
</label>
<div
class=
"layui-input-block"
>
<input
type=
"number"
step=
"0.01"
class=
"layui-input"
name=
"vip_price"
value=
"{$info['vip_price']}"
>
</div>
</div>
{/if}
<div
class=
"form-group"
>
<label
class=
"layui-form-label"
>
晚数
</label>
<div
class=
"layui-input-block"
>
<input
type=
"number"
class=
"layui-input"
name=
"night_num"
value=
"{$info['night_num']}"
>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"layui-input-block"
>
<span
class=
"layui-word-aux"
>
* 数据保存后,需要刷新,页面才会显示最新数据
</span>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"layui-input-block"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"*"
>
修改
</button>
</div>
</div>
<div>
<input
type=
"hidden"
name=
"id"
value=
"{$info['id']}"
>
</div>
</form>
<script>
layui
.
use
([
'jquery'
,
'form'
,
'layer'
],
function
()
{
var
form
=
layui
.
form
,
$
=
layui
.
jquery
,
layer
=
layui
.
layer
;
form
.
on
(
'submit(*)'
,
function
(
data
)
{
//提交
$
.
post
(
"{:url('priceSave')}"
,
data
.
field
,
function
(
res
){
layer
.
msg
(
res
.
msg
);
setTimeout
(
function
(){
layer
.
closeAll
();
},
1500
);
});
return
false
;
});
});
</script>
\ No newline at end of file
application/admin/view/project/save.html
View file @
0f7eca77
...
...
@@ -158,7 +158,7 @@
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group
type-business
"
>
<label
class=
"col-sm-2 control-label text-right"
>
会员价
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
step=
"0.01"
type=
"number"
class=
"form-control validate[required,custom[number]]"
name=
"vip_price"
...
...
application/api/controller/Guide.php
View file @
0f7eca77
...
...
@@ -20,7 +20,7 @@ class Guide extends Base
public
function
detail
(
$id
=
0
)
{
if
(
empty
(
$id
))
return
[
'code'
=>
1
,
'msg'
=>
'缺少参数ID'
];
$data
=
GuideModel
::
get
(
$id
);
$data
=
GuideModel
::
order
(
'sort'
,
'desc'
)
->
order
(
'id'
,
'desc'
)
->
find
(
$id
);
if
(
!
$data
)
return
[
'code'
=>
1
,
'msg'
=>
'攻略不存在'
];
return
[
'code'
=>
1
,
'msg'
=>
'success'
,
'data'
=>
$data
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment