Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
df7d1dd5
Commit
df7d1dd5
authored
Jul 11, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多语言
parent
f4c21ec8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
572 additions
and
173 deletions
+572
-173
ApplicationController.php
api/controllers/ApplicationController.php
+38
-3
IndexAsset.php
backend/assets/applicationCategory/IndexAsset.php
+25
-0
ApplicationCategoryController.php
backend/controllers/ApplicationCategoryController.php
+10
-0
ApplicationController.php
backend/controllers/ApplicationController.php
+0
-0
CoinApplicationForm.php
backend/models/coin/CoinApplicationForm.php
+0
-0
edit.php
backend/views/application-category/edit.php
+110
-0
index.php
backend/views/application-category/index.php
+1
-0
index_v.php
backend/views/application-category/index_v.php
+69
-0
add.php
backend/views/application/add.php
+14
-2
edit.php
backend/views/application/edit.php
+14
-2
list.php
backend/views/application/list.php
+60
-50
index.php
backend/views/coin/index.php
+117
-116
index.js
backend/web/js/application-category/index.js
+114
-0
No files found.
api/controllers/ApplicationController.php
View file @
df7d1dd5
...
...
@@ -31,8 +31,22 @@ class ApplicationController extends BaseController
}
$recommendData
=
ApplicationBusiness
::
getRecommendList
(
$condition
);
foreach
(
$recommendData
as
$j
=>
&
$val
){
$name_arr
=
json_decode
(
$val
[
'name'
],
true
);
$val
[
'name'
]
=
$name_arr
[
$this
->
lang
];
}
$data
[
'recommend'
]
=
$recommendData
;
$cate_app_data
=
ApplicationBusiness
::
getCategoryAppList
(
$condition
);
foreach
(
$cate_app_data
as
$key
=>
&
$val
){
$name
=
json_decode
(
$val
[
'name'
],
true
);
$val
[
'name'
]
=
$name
[
$this
->
lang
];
if
(
!
empty
(
$val
[
'apps'
])){
foreach
(
$val
[
'apps'
]
as
$j
=>
&
$value
){
$name
=
json_decode
(
$value
[
'name'
],
true
);
$value
[
'name'
]
=
$name
[
$this
->
lang
];
}
}
}
$data
[
'cate_app_data'
]
=
$cate_app_data
;
$data
[
'banner'
]
=
ApplicationBusiness
::
getBannerList
(
$condition
);
$result
[
'code'
]
=
0
;
...
...
@@ -48,6 +62,16 @@ class ApplicationController extends BaseController
{
$result
[
'code'
]
=
0
;
$result
[
'data'
]
=
ApplicationBusiness
::
getCategoryAppList
();
foreach
(
$result
[
'data'
]
as
$key
=>
&
$val
){
$name
=
json_decode
(
$val
[
'name'
],
true
);
$val
[
'name'
]
=
$name
[
$this
->
lang
];
if
(
!
empty
(
$val
[
'apps'
])){
foreach
(
$val
[
'apps'
]
as
$j
=>
&
$value
){
$name
=
json_decode
(
$value
[
'name'
],
true
);
$value
[
'name'
]
=
$name
[
$this
->
lang
];
}
}
}
return
$result
;
}
...
...
@@ -59,7 +83,11 @@ class ApplicationController extends BaseController
$request
=
Yii
::
$app
->
request
;
$id
=
$request
->
post
(
'id'
,
0
);
if
(
$id
){
return
ApplicationBusiness
::
appInfo
(
$id
);
$result
=
ApplicationBusiness
::
appInfo
(
$id
);
$data
=
$result
[
'data'
];
$name
=
json_decode
(
$data
[
'name'
],
true
);
$data
[
'name'
]
=
$name
[
$this
->
lang
];
return
[
'code'
=>
0
,
'data'
=>
$data
];
}
else
{
return
[
'code'
=>
1
,
'data'
=>
[],
'msg'
=>
'id不能为空'
];
}
...
...
@@ -126,6 +154,8 @@ class ApplicationController extends BaseController
$icon_Items
=
array_column
(
$appItems
,
'icon'
);
$icon_Infos
=
CoinImage
::
getItemsByIds
(
$icon_Items
);
foreach
(
$appItems
as
&
$value
){
$name
=
json_decode
(
$value
[
'name'
],
true
);
$value
[
'name'
]
=
$name
[
$this
->
lang
];
if
(
$value
[
'icon'
]){
$value
[
'icon'
]
=
$icon_Infos
[
$value
[
'icon'
]][
'base_url'
]
.
$icon_Infos
[
$value
[
'icon'
]][
'file_url'
];
}
else
{
...
...
@@ -138,7 +168,9 @@ class ApplicationController extends BaseController
$cate_id
=
$item
[
'cate_id'
];
$app_id
=
$item
[
'app_id'
];
$cate_app_items
[
$cate_id
][
'cate_id'
]
=
$cate_id
;
$cate_app_items
[
$cate_id
][
'name'
]
=
$item
[
'name'
];
$name_arr
=
json_decode
(
$item
[
'name'
],
true
);
$name
=
$name_arr
[
$this
->
lang
];
$cate_app_items
[
$cate_id
][
'name'
]
=
$name
;
$cate_app_items
[
$cate_id
][
'apps'
][]
=
$appItems
[
$app_id
];
}
foreach
(
$cate_app_items
as
$item
){
...
...
@@ -159,13 +191,16 @@ class ApplicationController extends BaseController
$cate_id
=
$request
->
get
(
'cate_id'
,
''
);
if
(
$cate_id
){
$cate_info
=
CoinApplicationCategory
::
getCategoryById
(
$cate_id
);
$name
=
$cate_info
->
name
[
$this
->
lang
];
$cate_info_data
[
'id'
]
=
$cate_info
->
id
;
$cate_info_data
[
'name'
]
=
$
cate_info
->
name
;
$cate_info_data
[
'name'
]
=
$name
;
$appItems
=
ApplicationBusiness
::
getCateAppInfo
(
0
,[[
'cate_id'
=>
$cate_id
]]);
if
(
$appItems
){
$appItems
=
array_shift
(
$appItems
);
foreach
(
$appItems
as
&
$value
){
$value
[
'app_user_num'
]
=
ApplicationBusiness
::
getAppUserNum
(
$value
[
'app_id'
]);
$name_arr
=
json_decode
(
$value
[
'name'
],
true
);
$value
[
'name'
]
=
$name_arr
[
$this
->
lang
];
}
$cate_info_data
[
'apps'
]
=
$appItems
;
return
[
'code'
=>
0
,
'data'
=>
$cate_info_data
];
...
...
backend/assets/applicationCategory/IndexAsset.php
0 → 100644
View file @
df7d1dd5
<?php
/**
* Created By Sublime Text 3
*
* @authors rlgy <rlgyzhcn@qq.com>
* @date 2018-09-07 17:41:04
*/
namespace
backend\assets\applicationCategory
;
use
yii\web\AssetBundle
;
use
yii\web\View
;
class
IndexAsset
extends
AssetBundle
{
public
$sourcePath
=
'@backend/web/js/application-category'
;
public
$js
=
[
'index.js'
,
];
public
$jsOptions
=
[
'position'
=>
View
::
POS_END
,
];
}
\ No newline at end of file
backend/controllers/ApplicationCategoryController.php
View file @
df7d1dd5
...
...
@@ -75,6 +75,16 @@ class ApplicationCategoryController extends BaseController
}
}
public
function
actionEdit
()
{
$id
=
Yii
::
$app
->
request
->
get
(
'id'
,
null
);
if
(
$id
)
{
$coin
=
CoinApplicationCategory
::
getCategoryById
(
$id
);
$this
->
layout
=
false
;
return
$this
->
render
(
'edit'
,
[
'model'
=>
$coin
]);
}
}
/**
* @return array
* @throws \Throwable
...
...
backend/controllers/ApplicationController.php
View file @
df7d1dd5
This diff is collapsed.
Click to expand it.
backend/models/coin/CoinApplicationForm.php
View file @
df7d1dd5
This diff is collapsed.
Click to expand it.
backend/views/application-category/edit.php
0 → 100644
View file @
df7d1dd5
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-5-31
* Time: 下午6:23
*/
?>
<style>
.layui-form-label
{
width
:
100px
;
}
</style>
<div
class=
"layui-row"
style=
"padding: 5px;"
>
<div
class=
"layui-col-md12"
>
<form
class=
"layui-form"
method=
"post"
action=
""
id=
"coinEdit"
>
<input
name=
"_csrf"
type=
"hidden"
value=
"
<?=
Yii
::
$app
->
request
->
getCsrfToken
()
?>
"
>
<input
name=
"id"
type=
"hidden"
value=
"
<?=
$model
->
id
?>
"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
中文名
</label>
<div
class=
"layui-input-block"
style=
"width: 250px"
>
<input
class=
"layui-input"
name=
"name_json[]"
value=
"
<?=
$model
->
name_json
[
'zh-CN'
]
?>
"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
英文名
</label>
<div
class=
"layui-input-block"
style=
"width: 250px"
>
<input
class=
"layui-input"
name=
"name_json[]"
value=
"
<?=
$model
->
name_json
[
'en-US'
]
?>
"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
日文名
</label>
<div
class=
"layui-input-block"
style=
"width: 250px"
>
<input
class=
"layui-input"
name=
"name_json[]"
value=
"
<?=
$model
->
name_json
[
'ja'
]
?>
"
>
</div>
</div>
<div
class=
"layui-form-item layui-form-text"
>
<label
class=
"layui-form-label"
>
排序
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"sort"
required
lay-verify=
"required"
placeholder=
""
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
图标
</label>
<div
class=
"layui-input-block"
>
<img
src=
""
style=
"margin-top: 11px; max-width: 32px; max-height: 32px"
id=
"icon1"
>
</div>
<input
type=
"hidden"
name=
"icon"
value=
""
>
</div>
<div
class=
"layui-inline"
style=
"margin-left: 50px;"
>
<button
type=
"button"
class=
"layui-btn"
id=
"upload1"
style=
""
>
<i
class=
"layui-icon"
>

</i>
上传新图片
</button>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
banner
</label>
<div
class=
"layui-input-block"
>
<img
src=
"
<?=
$model
->
banner_image_url
?>
"
style=
"margin-top: 11px; max-width: 32px; max-height: 32px"
id=
"icon2"
>
</div>
<input
type=
"hidden"
name=
"banner"
value=
""
>
</div>
<div
class=
"layui-inline"
style=
"margin-left: 50px;"
>
<button
type=
"button"
class=
"layui-btn"
id=
"upload2"
style=
""
>
<i
class=
"layui-icon"
>

</i>
上传新图片
</button>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
banner链接
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"banner_url"
required
lay-verify=
"required"
placeholder=
""
autocomplete=
"off"
class=
"layui-input"
value=
"
<?=
$model
->
banner_url
?>
"
>
</div>
</div>
</form>
</div>
</div>
<script>
var
laydate
=
layui
.
laydate
;
laydate
.
render
({
elem
:
"#time1"
});
//图片上传
var
uploader
=
layui
.
upload
;
$_csrf
=
$
(
"input[name='_csrf']"
).
val
();
uploader
.
render
({
elem
:
"#upload1"
,
url
:
'/admin/coin/upload'
,
data
:
{
_csrf
:
$_csrf
},
done
:
function
(
res
)
{
console
.
log
(
res
.
data
.
src
);
$
(
"input[name='icon']"
).
val
(
res
.
data
.
src
);
$
(
"#icon1"
).
attr
(
'src'
,
res
.
data
.
src
);
},
error
:
function
(
res
)
{
}
});
//form render
var
form
=
layui
.
form
;
form
.
render
();
</script>
backend/views/application-category/index.php
View file @
df7d1dd5
...
...
@@ -185,6 +185,7 @@
var
event
=
obj
.
event
;
var
data
=
obj
.
data
;
if
(
event
===
'edit'
)
{
console
.
log
(
data
);
var
index
=
layer
.
open
({
title
:
'编辑应用分类'
,
area
:
'800px'
,
...
...
backend/views/application-category/index_v.php
0 → 100644
View file @
df7d1dd5
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-5-31
* Time: 上午9:59
*/
use
backend\assets\applicationCategory\IndexAsset
;
IndexAsset
::
register
(
$this
);
?>
<style>
.layui-table-tips-c
{
padding
:
0px
;
}
</style>
<h4>
应用分类列表
</h4>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md1"
>
<a
href=
"/admin/coin/add"
>
<button
class=
"layui-btn layui-btn-default"
id=
"add"
>
添加应用分类
</button>
</a>
</div>
<div
class=
"layui-col-md8"
>
<form
class=
"layui-form"
method=
"get"
action=
""
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
币种名称
</label>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"name"
>
</div>
</div>
<div
class=
"layui-inline"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"form1"
>
搜索
</button>
</div>
</form>
</div>
</div>
<div
class=
"layui-row"
>
<table
class=
"layui-table"
id=
"table1"
lay-filter=
"table1"
></table>
</div>
<script
type=
"text/html"
id=
"iconTpl"
>
<
img
src
=
"{{d.icon_url}}"
style
=
"max-width: 32px; max-height: 32px;"
/>
</script>
<!--<script type="text/html" id="operationTpl">-->
<!-- <a lay-event="edit">-->
<!-- <button class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>-->
<!-- </a>-->
<!-- <a lay-event="delete">-->
<!-- <button class="layui-btn layui-btn-sm layui-btn-danger"><i class="layui-icon"></i></button>-->
<!-- </a>-->
<!--</script>-->
<script
type=
"text/html"
id=
"operationTpl"
>
<
a
class
=
"layui-btn layui-btn-xs"
lay
-
event
=
"edit"
>
编辑
<
/a>
<
a
class
=
"layui-btn layui-btn-danger layui-btn-xs"
lay
-
event
=
"del"
>
删除
<
/a>
<
a
class
=
"layui-btn layui-btn-primary layui-btn-xs"
href
=
"/admin/application/list?id={{d.id}}"
>
应用列表
<
/a>
<
a
class
=
"layui-btn layui-btn-normal layui-btn-xs"
href
=
"/admin/application-category/banner-index?id={{d.id}}"
>
banner
图管理
<
/a>
</script>
<script
type=
"text/html"
id=
"recommendTpl"
>
<
input
type
=
"checkbox"
name
=
"isrecommend"
value
=
"{{d.id}}"
lay
-
skin
=
"switch"
lay
-
text
=
"是|否"
lay
-
filter
=
"recommendDemo"
{{
d
.
isrecommend
==
1
?
'checked'
:
''
}}
>
</script>
<script
type=
"text/html"
id=
"enableTpl"
>
<
input
type
=
"checkbox"
name
=
"isenable"
value
=
"{{d.id}}"
lay
-
skin
=
"switch"
lay
-
text
=
"启用|禁用"
lay
-
filter
=
"enableDemo"
{{
d
.
enable
==
1
?
'checked'
:
''
}}
>
</script>
backend/views/application/add.php
View file @
df7d1dd5
...
...
@@ -46,9 +46,21 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
应用名称
</label>
<label
class=
"layui-form-label"
>
中文名
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"name"
value=
""
lay-verify=
"required"
>
<input
class=
"layui-input"
name=
"name[]"
value=
""
lay-verify=
"required"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
英文名
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"name[]"
value=
""
lay-verify=
"required"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
日文名
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"name[]"
value=
""
lay-verify=
"required"
>
</div>
</div>
<div
class=
"layui-form-item"
>
...
...
backend/views/application/edit.php
View file @
df7d1dd5
...
...
@@ -48,9 +48,21 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
应用名称
</label>
<label
class=
"layui-form-label"
>
中文名
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"name"
value=
"
<?=
$item
[
'name'
]
?>
"
lay-verify=
"required"
>
<input
class=
"layui-input"
name=
"name[]"
value=
"
<?=
$item
[
'name_zh'
]
?>
"
lay-verify=
"required"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
英文名
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"name[]"
value=
"
<?=
$item
[
'name_en'
]
?>
"
lay-verify=
"required"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
日文名
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"name[]"
value=
"
<?=
$item
[
'name_ja'
]
?>
"
lay-verify=
"required"
>
</div>
</div>
<div
class=
"layui-form-item"
>
...
...
backend/views/application/list.php
View file @
df7d1dd5
This diff is collapsed.
Click to expand it.
backend/views/coin/index.php
View file @
df7d1dd5
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-5-31
* Time: 上午9:59
*/
use
backend\assets\coin\IndexAsset
;
IndexAsset
::
register
(
$this
);
?>
<style>
.layui-table-tips-c
{
padding
:
0px
;
}
</style>
<h4>
币种列表
</h4>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md1"
>
<a
href=
"/admin/coin/add"
>
<button
class=
"layui-btn layui-btn-default"
id=
"add"
>
添加币种
</button>
</a>
</div>
<div
class=
"layui-col-md8"
>
<form
class=
"layui-form"
method=
"get"
action=
""
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
币种名称
</label>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"name"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
平台
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"platform"
>
<option
value=
""
>
全部
</option>
<?php
foreach
(
$platforms
as
$platform
)
:
?>
<option
value=
"
<?=
$platform
?>
"
>
<?=
$platform
?>
</option>
<?php
endforeach
;
?>
</select>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
类型
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"chain"
>
<option
value=
""
>
全部
</option>
<?php
foreach
(
$chains
as
$chain
)
:
?>
<option
value=
"
<?=
$chain
?>
"
>
<?=
$chain
?>
</option>
<?php
endforeach
;
?>
</select>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
推介币种
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"recommend"
>
<option
value=
""
>
全部
</option>
<option
value=
"0"
>
否
</option>
<option
value=
"1"
>
是
</option>
</select>
</div>
</div>
<div
class=
"layui-inline"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"form1"
>
搜索
</button>
</div>
</form>
</div>
</div>
<div
class=
"layui-row"
>
<table
class=
"layui-table"
id=
"table1"
lay-filter=
"table1"
></table>
</div>
<script
type=
"text/html"
id=
"iconTpl"
>
<
a
href
=
"{{d.icon}}"
target
=
"_blank"
><
img
src
=
"{{d.icon}}"
style
=
"max-width: 32px; max-height: 32px;"
/><
/a
>
</script>
<script
type=
"text/html"
id=
"officialTpl"
>
{{
#
if
(
d
.
official
){
}}
{{
#
layui
.
each
(
d
.
official
.
split
(
';'
),
function
(
index
,
item
){
}}
{{
#
if
(
item
){
}}
<
a
href
=
"{{ item }}"
class
=
"layui-table-link"
target
=
"_blank"
>
官网
{{
#
if
(
index
){
}}{{
index
}}{{
#
}
}}
<
/a
>
{{
#
}
}}
{{
#
});
}}
{{
#
}
else
{
}}
-
{{
#
}
}}
</script>
<script
type=
"text/html"
id=
"paperTpl"
>
{{
#
if
(
d
.
paper
){
}}
<
a
href
=
"{{d.paper}}"
class
=
"layui-table-link"
target
=
"_blank"
>
白皮书
<
/a
>
{{
#
}
else
{
}}
-
{{
#
}
}}
</script>
<script
type=
"text/html"
id=
"operationTpl"
>
<
a
lay
-
event
=
"edit"
>
<
button
class
=
"layui-btn layui-btn-sm"
><
i
class
=
"layui-icon"
>&
#
xe642
;
<
/i></
button
>
<
/a
>
<
a
lay
-
event
=
"delete"
>
<
button
class
=
"layui-btn layui-btn-sm layui-btn-danger"
><
i
class
=
"layui-icon"
>&
#
xe640
;
<
/i></
button
>
<
/a
>
</script>
<script
type=
"text/html"
id=
"exchangeTpl"
>
{{
d
.
exchange
}}
家
</script>
<script
type=
"text/html"
id=
"recommendTpl"
>
{{
#
if
(
d
.
recommend
==
0
){
}}
否
{{
#
}
else
if
(
d
.
recommend
==
1
){
}}
首页推荐
{{
#
}
else
{
}}
次页推荐
{{
#
}
}}
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-5-31
* Time: 上午9:59
*/
use
backend\assets\coin\IndexAsset
;
IndexAsset
::
register
(
$this
);
?>
<style>
.layui-table-tips-c
{
padding
:
0px
;
}
</style>
<h4>
币种列表
</h4>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md1"
>
<a
href=
"/admin/coin/add"
>
<button
class=
"layui-btn layui-btn-default"
id=
"add"
>
添加币种
</button>
</a>
</div>
<div
class=
"layui-col-md8"
>
<form
class=
"layui-form"
method=
"get"
action=
""
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
币种名称
</label>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"name"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
平台
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"platform"
>
<option
value=
""
>
全部
</option>
<?php
foreach
(
$platforms
as
$platform
)
:
?>
<option
value=
"
<?=
$platform
?>
"
>
<?=
$platform
?>
</option>
<?php
endforeach
;
?>
</select>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
类型
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"chain"
>
<option
value=
""
>
全部
</option>
<?php
foreach
(
$chains
as
$chain
)
:
?>
<option
value=
"
<?=
$chain
?>
"
>
<?=
$chain
?>
</option>
<?php
endforeach
;
?>
</select>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
推介币种
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"recommend"
>
<option
value=
""
>
全部
</option>
<option
value=
"0"
>
否
</option>
<option
value=
"1"
>
是
</option>
</select>
</div>
</div>
<div
class=
"layui-inline"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"form1"
>
搜索
</button>
</div>
</form>
</div>
</div>
<div
class=
"layui-row"
>
<table
class=
"layui-table"
id=
"table1"
lay-filter=
"table1"
></table>
</div>
<script
type=
"text/html"
id=
"iconTpl"
>
<
a
href
=
"{{d.icon}}"
target
=
"_blank"
><
img
src
=
"{{d.icon}}"
style
=
"max-width: 32px; max-height: 32px;"
/><
/a>
</script>
<script
type=
"text/html"
id=
"officialTpl"
>
{{
#
if
(
d
.
official
){
}}
{{
#
layui
.
each
(
d
.
official
.
split
(
';'
),
function
(
index
,
item
){
}}
{{
#
if
(
item
){
}}
<
a
href
=
"{{ item }}"
class
=
"layui-table-link"
target
=
"_blank"
>
官网
{{
#
if
(
index
){
}}{{
index
}}{{
#
}
}}
<
/a>
{{
#
}
}}
{{
#
});
}}
{{
#
}
else
{
}}
-
{{
#
}
}}
</script>
<script
type=
"text/html"
id=
"paperTpl"
>
{{
#
if
(
d
.
paper
){
}}
<
a
href
=
"{{d.paper}}"
class
=
"layui-table-link"
target
=
"_blank"
>
白皮书
<
/a>
{{
#
}
else
{
}}
-
{{
#
}
}}
</script>
<script
type=
"text/html"
id=
"operationTpl"
>
<
a
lay
-
event
=
"edit"
>
<
button
class
=
"layui-btn layui-btn-sm"
><
i
class
=
"layui-icon"
>&
#
xe642
;
<
/i></
button
>
<
/a>
<
a
lay
-
event
=
"delete"
>
<
button
class
=
"layui-btn layui-btn-sm layui-btn-danger"
><
i
class
=
"layui-icon"
>&
#
xe640
;
<
/i></
button
>
<
/a>
</script>
<script
type=
"text/html"
id=
"exchangeTpl"
>
{{
d
.
exchange
}}
家
</script>
<script
type=
"text/html"
id=
"recommendTpl"
>
{{
#
if
(
d
.
recommend
==
0
){
}}
否
{{
#
}
else
if
(
d
.
recommend
==
1
){
}}
首页推荐
{{
#
}
else
{
}}
次页推荐
{{
#
}
}}
</script>
\ No newline at end of file
backend/web/js/application-category/index.js
0 → 100644
View file @
df7d1dd5
/**
* @author rlgyzhcn@qq.com
*/
var
table
=
layui
.
table
;
var
form
=
layui
.
form
;
var
layer
=
layui
.
layer
;
form
.
render
();
var
tableIns
=
table
.
render
({
elem
:
"#table1"
,
url
:
'/admin/application-category/index'
,
limit
:
10
,
page
:
1
,
loading
:
true
,
cols
:
[[
{
field
:
'name'
,
title
:
'名称'
},
{
field
:
'coin_name'
,
title
:
'名称'
},
{
field
:
'icon_url'
,
title
:
'图标'
,
templet
:
'#iconTpl'
},
{
field
:
'isrecommend'
,
title
:
'首页推荐'
,
templet
:
'#recommendTpl'
,
width
:
100
},
{
field
:
'enable'
,
title
:
'状态'
,
templet
:
'#enableTpl'
,
width
:
100
},
{
field
:
'id'
,
title
:
'操作'
,
templet
:
'#operationTpl'
}
]],
});
form
.
on
(
'submit(form1)'
,
function
(
data
)
{
table
.
reload
(
"table1"
,
{
where
:
data
.
field
,
page
:
{
curr
:
1
},
});
return
false
;
});
//监听单元格事件
table
.
on
(
'tool(table1)'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
if
(
obj
.
event
===
'getExchange'
)
{
var
load
=
layer
.
load
(
1
);
$
.
get
(
'/admin/coin/get-exchange-list-by-id?id='
+
obj
.
data
.
id
,
{},
function
(
str
)
{
layer
.
close
(
load
);
layer
.
open
({
type
:
1
,
title
:
'上架交易所列表'
,
content
:
str
,
});
});
}
else
if
(
obj
.
event
==
'delete'
)
{
layer
.
confirm
(
'真的要删除'
+
data
.
name
+
'吗?'
,
{
icon
:
3
,
title
:
'删除'
},
function
(
index
)
{
layer
.
close
(
index
);
//向服务端发送删除指令
$
.
get
(
'/admin/coin/delete?id='
+
obj
.
data
.
id
,
function
(
data
,
status
)
{
if
(
data
.
code
==
0
)
{
obj
.
del
();
//删除对应行(tr)的DOM结构
}
layer
.
msg
(
data
.
msg
);
});
});
}
else
if
(
obj
.
event
==
'edit'
)
{
$
.
get
(
'/admin/application-category/edit'
,
{
id
:
data
.
id
},
function
(
str
)
{
var
editIndex
=
layer
.
open
({
type
:
1
,
title
:
'编辑: '
+
data
.
name
,
area
:
'625px'
,
content
:
str
,
btn
:
[
'保存'
,
'取消'
],
btn1
:
function
()
{
// console.log();
$
.
post
(
'/admin/coin/edit'
,
$
(
"#coinEdit"
).
serialize
(),
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
rev
.
code
==
0
)
{
table
.
reload
(
"table1"
,
{
where
:
data
.
field
,
});
layer
.
close
(
editIndex
);
}
});
}
});
});
}
});
form
.
on
(
'switch(recommendDemo)'
,
function
(
obj
){
//layer.tips(this.value + ' ' + this.name + ':'+ obj.elem.checked, obj.othis);return;
if
(
obj
.
elem
.
checked
){
$
.
get
(
'/admin/applicate-recommend/add'
,
{
id
:
this
.
value
,
type
:
1
},
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
0
==
rev
.
code
)
{
}
else
{
}
});
}
else
{
$
.
get
(
'/admin/applicate-recommend/delete'
,
{
id
:
this
.
value
,
type
:
1
},
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
0
==
rev
.
code
)
{
}
else
{
}
});
}
});
form
.
on
(
'switch(enableDemo)'
,
function
(
obj
){
var
enable
=
1
;
if
(
obj
.
elem
.
checked
){
enable
=
1
}
else
{
enable
=
0
;
}
$
.
get
(
'/admin/application-category/set-enable'
,
{
id
:
this
.
value
,
enable
:
enable
},
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
0
==
rev
.
code
)
{
}
else
{
}
});
});
\ No newline at end of file
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