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
9076321b
Commit
9076321b
authored
Jan 07, 2019
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加设置应用详情图片尺寸功能
parent
94d69be5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
ApplicationController.php
backend/controllers/ApplicationController.php
+22
-0
image-index.php
backend/views/application/image-index.php
+18
-0
No files found.
backend/controllers/ApplicationController.php
View file @
9076321b
...
@@ -261,4 +261,25 @@ class ApplicationController extends BaseController
...
@@ -261,4 +261,25 @@ class ApplicationController extends BaseController
}
}
}
}
public
function
actionSetH5ImageShowtype
()
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
$request
=
Yii
::
$app
->
request
;
$id
=
$request
->
get
(
'app_id'
,
''
);
$h5_image_showtype
=
$request
->
get
(
'h5_image_showtype'
,
1
);
if
(
$id
){
$applicate
=
CoinApplication
::
getApplicate
(
$id
);
if
(
!
$applicate
){
return
[
'code'
=>
1
,
'msg'
=>
'应用不存在'
];
}
$applicate
->
h5_image_showtype
=
$h5_image_showtype
;
$applicate
->
save
();
return
[
'code'
=>
0
,
'msg'
=>
'显示尺寸设置成功'
];
}
else
{
return
[
'code'
=>
1
,
'msg'
=>
'显示尺寸设置失败'
];
}
}
}
}
}
\ No newline at end of file
backend/views/application/image-index.php
View file @
9076321b
...
@@ -25,6 +25,15 @@
...
@@ -25,6 +25,15 @@
</div>
</div>
<div
class=
"layui-tab-item"
>
<div
class=
"layui-tab-item"
>
<button
class=
"layui-btn layui-btn-default add_image"
image_category=
"2"
>
添加H5图片
</button>
<button
class=
"layui-btn layui-btn-default add_image"
image_category=
"2"
>
添加H5图片
</button>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 120px;"
>
显示尺寸
</label>
<div
class=
"layui-input-inline"
>
<select
class=
"layui-select"
name=
"h5_image_showtype"
lay-filter=
"type_change"
id=
"myselect"
>
<option
value=
"1"
<?php
if
(
$applicate
->
h5_image_showtype
==
1
)
:
?>
selected
<?php
endif
;
?>
>
mobile (225px * 400px)
</option>
<option
value=
"2"
<?php
if
(
$applicate
->
h5_image_showtype
==
2
)
:
?>
selected
<?php
endif
;
?>
>
pc (1200px * 630px)
</option>
</select>
</div>
</div>
<table
class=
"layui-table"
id=
"table2"
lay-filter=
"table2"
></table>
<table
class=
"layui-table"
id=
"table2"
lay-filter=
"table2"
></table>
</div>
</div>
</div>
</div>
...
@@ -207,4 +216,12 @@
...
@@ -207,4 +216,12 @@
$
(
"#image1"
).
attr
(
'src'
,
''
);
$
(
"#image1"
).
attr
(
'src'
,
''
);
}
}
$
(
"#myselect"
).
change
(
function
()
{
var
h5_image_showtype
=
$
(
this
).
val
();
var
app_id
=
$
(
"input[name='applicate_id']"
).
val
();
$
.
get
(
'/admin/application/set-h5-image-showtype'
,
{
h5_image_showtype
:
h5_image_showtype
,
app_id
:
app_id
},
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
});
});
</script>
</script>
\ 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