切换导航条
此项目
正在载入...
登录
景龙
/
xingqiu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
景龙
6 years ago
提交
60dbd11131c4e1a422ef10919eed1c3f866a2971
1 个父辈
7305ad04
1 个管道 的构建
通过
耗费 1 秒
增加后台城市上传banner图功能
变更
10
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
10 个修改的文件
包含
101 行增加
和
22 行删除
app/portal/controller/ActiveController.php
app/portal/controller/StarController.php
public/themes/admin_simpleboot3/portal/admin_city_category/add.html
public/themes/admin_simpleboot3/portal/admin_city_category/edit.html
public/themes/admin_simpleboot3/portal/admin_city_category/index.html
public/themes/simpleboot3/portal/enjoy/index.html
public/themes/simpleboot3/portal/index/about_us.html
public/themes/simpleboot3/portal/region/get_more_video.html
public/themes/simpleboot3/portal/star/index.html
public/themes/simpleboot3/public/assets/css/happy_index.css
app/portal/controller/ActiveController.php
查看文件 @
60dbd11
...
...
@@ -17,20 +17,19 @@ use think\Db;
class
ActiveController
extends
HomeBaseController
{
private
$index_limit
=
16
;
//首页分页
private
$more_limit
=
6
;
//更多列表分页
private
$more_limit
=
5
;
//更多列表分页
public
function
index
(){
//星际活动
$page
=
$this
->
request
->
param
(
'page'
,
1
,
'intval'
);
$position
[
'category_id'
]
=
CityCategoryModel
::
xjhd_c
;
$field
=
'id,thumbnail,post_title'
;
$res_xjhd
=
$this
->
getChildArticlePage
(
$position
,
$field
,
$page
);
$this
->
assign
(
'res_xjhd'
,
$res_xjhd
);
$res
=
$this
->
getChildArticlePage
(
$position
,
$field
);
$this
->
assign
(
'res'
,
$res
[
'data'
]);
$this
->
assign
(
'page'
,
$res
[
'page'
]);
return
$this
->
fetch
();
}
//根据子类获取文章分页
public
function
getChildArticlePage
(
$position
,
$field
,
$
page
,
$
limit
=
''
){
public
function
getChildArticlePage
(
$position
,
$field
,
$limit
=
''
){
$pre
=
CityCategoryModel
::
pre
;
$limit
=
empty
(
$limit
)
?
$this
->
more_limit
:
$limit
;
$post_id
=
Db
::
table
(
$pre
.
'portal_category_post'
)
...
...
@@ -44,10 +43,10 @@ class ActiveController extends HomeBaseController
->
whereIn
(
'id'
,
$post_id
)
->
where
(
'delete_time'
,
0
)
->
field
(
$field
)
->
page
(
$page
,
$limit
)
->
order
(
'weigh desc'
)
->
select
()
->
toArray
();
->
paginate
(
$limit
);
$arr
[
'data'
]
=
$res
->
toArray
();
$arr
[
'page'
]
=
$res
->
render
();
return
$res
;
}
...
...
app/portal/controller/StarController.php
查看文件 @
60dbd11
...
...
@@ -29,6 +29,11 @@ class StarController extends HomeBaseController
$this
->
assign
(
'city_name'
,
$city_name
);
$this
->
assign
(
'city_id'
,
$city_id
);
$position
[
'city_id'
]
=
$city_id
;
//城市名称对应banner图
$city_banner
=
$this
->
getCityBanner
(
$city_id
);
$this
->
assign
(
'city_banner'
,
$city_banner
);
//星球故事
$position
[
'category_id'
]
=
CityCategoryModel
::
xqgs
;
$field
=
'id,thumbnail,post_excerpt,more'
;
...
...
@@ -79,14 +84,24 @@ class StarController extends HomeBaseController
//获取城市名称
public
function
getCityName
(
$city_id
){
$
city_name
=
Db
::
name
(
'city_category'
)
$
res
=
Db
::
name
(
'city_category'
)
->
where
(
'id'
,
$city_id
)
->
field
(
'id,name'
)
->
find
();
$city_name
=
empty
(
$
city_name
)
?
''
:
$city_name
[
'name'
];
$city_name
=
empty
(
$
res
[
'name'
])
?
''
:
$res
[
'name'
];
return
$city_name
;
}
//获取城市banner图
public
function
getCityBanner
(
$city_id
){
$res
=
Db
::
name
(
'city_category'
)
->
where
(
'id'
,
$city_id
)
->
field
(
'id,image'
)
->
find
();
$banner
=
empty
(
$res
[
'image'
])
?
''
:
$res
[
'image'
];
return
$banner
;
}
//根据子类获取文章
public
function
getChildArticle
(
$position
,
$field
,
$limit
=
''
){
$pre
=
CityCategoryModel
::
pre
;
...
...
public/themes/admin_simpleboot3/portal/admin_city_category/add.html
查看文件 @
60dbd11
...
...
@@ -33,6 +33,21 @@
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"thumbnail"
>
banner图
</label>
<div>
<input
type=
"text"
class=
"form-control"
id=
"thumbnail"
name=
"image"
>
<a
href=
"javascript:uploadOneImage('图片上传','#thumbnail');"
>
<img
src=
"__TMPL__/public/assets/images/default-thumbnail.png"
id=
"thumbnail-preview"
width=
"300"
height=
"150"
style=
"cursor: pointer"
/>
</a>
<input
type=
"button"
class=
"btn btn-sm btn-cancel-thumbnail"
value=
"取消图片"
>
<a
href=
"javascript:uploadOneImage('图片上传','#thumbnail');"
>
上传图片
</a>
</div>
<span
class=
"form-required"
>
图片参考尺寸:1920*666
</span>
</div>
</div>
</div>
<div
class=
"form-group"
>
...
...
@@ -45,4 +60,12 @@
</div>
<script
type=
"text/javascript"
src=
"__STATIC__/js/admin.js"
></script>
</body>
</html>
\ No newline at end of file
</html>
<script
type=
"text/javascript"
>
$
(
function
()
{
$
(
'.btn-cancel-thumbnail'
).
click
(
function
()
{
$
(
'#thumbnail-preview'
).
attr
(
'src'
,
'__TMPL__/public/assets/images/default-thumbnail.png'
);
$
(
'#thumbnail'
).
val
(
''
);
});
});
</script>
\ No newline at end of file
...
...
public/themes/admin_simpleboot3/portal/admin_city_category/edit.html
查看文件 @
60dbd11
...
...
@@ -32,6 +32,26 @@
<input
type=
"text"
class=
"form-control"
id=
"input-name"
name=
"name"
value=
"{$category_name.name}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"thumbnail"
>
banner图
</label>
<div>
<input
type=
"text"
class=
"form-control"
id=
"thumbnail"
name=
"image"
value=
"{$category_name.image}"
>
<a
href=
"javascript:uploadOneImage('上传图片','#thumbnail');"
>
<if
condition=
"empty($category_name.image)"
>
<img
src=
"__TMPL__/public/assets/images/default-thumbnail.png"
id=
"thumbnail-preview"
width=
"300"
height=
"150"
style=
"cursor: pointer"
/>
<else/>
<img
src=
"{:cmf_get_image_preview_url($category_name.image)}"
id=
"thumbnail-preview"
width=
"300"
height=
"150"
style=
"cursor: pointer"
/>
</if>
</a>
<input
type=
"button"
class=
"btn btn-sm btn-cancel-thumbnail"
value=
"取消图片"
>
<a
href=
"javascript:uploadOneImage('图片上传','#thumbnail');"
>
上传图片
</a>
</div>
<span
class=
"form-required"
>
图片参考尺寸:1920*666
</span>
</div>
</div>
</div>
...
...
@@ -46,4 +66,12 @@
</div>
<script
type=
"text/javascript"
src=
"__STATIC__/js/admin.js"
></script>
</body>
</html>
\ No newline at end of file
</html>
<script
type=
"text/javascript"
>
$
(
function
()
{
$
(
'.btn-cancel-thumbnail'
).
click
(
function
()
{
$
(
'#thumbnail-preview'
).
attr
(
'src'
,
'__TMPL__/public/assets/images/default-thumbnail.png'
);
$
(
'#thumbnail'
).
val
(
''
);
});
});
</script>
\ No newline at end of file
...
...
public/themes/admin_simpleboot3/portal/admin_city_category/index.html
查看文件 @
60dbd11
...
...
@@ -29,7 +29,8 @@
<thead>
<tr>
<th
width=
"200"
>
ID
</th>
<th>
分类名称
</th>
<th
width=
"400"
>
分类名称
</th>
<th>
banner图
</th>
<th
width=
"210"
>
操作
</th>
</tr>
</thead>
...
...
@@ -38,6 +39,15 @@
<td>
{$vo.id}
</td>
<td>
{$vo.name}
</td>
<td>
<notempty
name=
"vo.image"
>
<a
href=
"javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo.image)}');"
>
<i
class=
"fa fa-photo fa-fw"
></i>
</a>
<else/>
<i
class=
"fa fa-close fa-fw"
></i>
</notempty>
</td>
<td>
<a
class=
"btn btn-xs btn-primary"
href=
"{:url('AdminCityCategory/edit',array('id'=>$vo['id']))}"
>
{:lang('EDIT')}
</a>
<a
class=
"btn btn-xs btn-danger js-ajax-delete"
href=
"{:url('AdminCityCategory/delete',array('id'=>$vo['id']))}"
class=
"js-ajax-delete"
>
{:lang('DELETE')}
</a>
</td>
...
...
public/themes/simpleboot3/portal/enjoy/index.html
查看文件 @
60dbd11
...
...
@@ -38,7 +38,7 @@
<div
class=
"select"
>
<input
type=
"text"
value=
"中国"
readonly=
"readonly"
>
<img
src=
"__TMPL__/public/assets/starImg/down.png"
alt=
""
>
<ul>
<ul
style=
"height:300px;overflow-y: scroll;width:240px;"
>
<li>
所有
</li>
<volist
name=
"city_name"
id=
"vo"
>
<li
value=
"{$vo.id}"
<
eq
name=
"$vo.id"
value=
"$city_id"
>
selected
</eq>
>{$vo.name}
</li>
...
...
public/themes/simpleboot3/portal/index/about_us.html
查看文件 @
60dbd11
...
...
@@ -15,10 +15,10 @@
margin-bottom
:
100px
;
}
.excerpt
{
font-size
:
14px
;
margin
:
30px
0
40px
0
;
color
:
rgba
(
153
,
153
,
153
,
1
);
line-height
:
22px
;
font-size
:
16px
;
color
:
rgba
(
102
,
102
,
102
,
1
);
line-height
:
32px
;
}
</style>
</head>
...
...
public/themes/simpleboot3/portal/region/get_more_video.html
查看文件 @
60dbd11
...
...
@@ -30,7 +30,7 @@
<div
class=
"select"
>
<input
type=
"text"
value=
"中国"
readonly=
"readonly"
>
<img
src=
"__TMPL__/public/assets/starImg/down.png"
alt=
""
>
<ul>
<ul
style=
"height:300px;overflow-y: scroll;width:145px;"
>
<li>
所有
</li>
<volist
name=
"city_name"
id=
"vo"
>
<li
value=
"{$vo.id}"
<
eq
name=
"$vo.id"
value=
"$city_id"
>
selected
</eq>
>{$vo.name}
</li>
...
...
public/themes/simpleboot3/portal/star/index.html
查看文件 @
60dbd11
...
...
@@ -15,7 +15,11 @@
<div
class=
"happy_index"
>
<!-- banner轮播图 -->
<div
class=
"happy_banner"
>
<img
src=
"__TMPL__/public/assets/starImg/star_banner.jpg"
alt=
""
/>
<notempty
name=
"city_banner"
>
<img
src=
"{:cmf_get_image_url($city_banner)}"
alt=
""
/>
<else/>
<img
src=
"__TMPL__/public/assets/starImg/star_banner.jpg"
alt=
""
/>
</notempty>
<h3>
Planet Discovery
</h3>
</div>
<!-- main 背景 -->
...
...
public/themes/simpleboot3/public/assets/css/happy_index.css
查看文件 @
60dbd11
...
...
@@ -107,8 +107,8 @@ body {
line-height
:
48px
;
text-shadow
:
0px
6px
14px
rgba
(
0
,
0
,
0
,
0.3
);
position
:
absolute
;
top
:
499px
;
left
:
365px
top
:
75%
;
left
:
19%
;
}
...
...
请
注册
或
登录
后发表评论