Commit 92125b20 authored by ZhuChunYang's avatar ZhuChunYang

添加应用修改

parent e10449b7
......@@ -50,7 +50,7 @@ class ApplicationController extends BaseController
if(Yii::$app->request->isPost){
Yii::$app->response->format = 'json';
$category_id = Yii::$app->request->get('category_id');
$fields = ['category_id','h5_icon','official_url','introduce_image','name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type'];
$fields = ['category_id','h5_icon','official_url','introduce_image','show_width','show_height','open_type','name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type'];
$params = array_merge(Yii::$app->request->post(),['category_id' => $category_id]);
$params = $this->initParams($params, $fields);
$coin_applicateion_form = new CoinApplicationForm();
......@@ -70,7 +70,7 @@ class ApplicationController extends BaseController
{
if (Yii::$app->request->isPost) {
Yii::$app->response->format = 'json';
$fields = ['category_id','id','h5_icon','official_url','introduce_image','name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type'];
$fields = ['category_id','id','h5_icon','official_url','introduce_image','show_width','show_height','open_type','name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type'];
$params = $this->initParams(Yii::$app->request->post(), $fields);
$coin_applicateion_form = new CoinApplicationForm();
$coin_applicateion_form->setScenario(CoinApplicationForm::SCENARIO_EDIT);
......@@ -101,12 +101,6 @@ class ApplicationController extends BaseController
}else{
$applicate['icon_url'] ="";
}
if($applicate['icon']){
$icon_info = $coin_items[$applicate['icon']];
$applicate['icon_url'] =$icon_info['base_url'].$icon_info['file_url'];
}else{
$applicate['icon_url'] ="";
}
if($applicate['h5_icon']){
$icon_info = $coin_items[$applicate['h5_icon']];
$applicate['h5_icon_url'] =$icon_info['base_url'].$icon_info['file_url'];
......
......@@ -36,12 +36,15 @@ class CoinApplicationForm extends BaseForm
public $description;
public $image_ids;
public $redirect_type;
public $show_width;
public $show_height;
public $open_type;
public function scenarios()
{
return [
self::SCENARIO_ADD => ['category_id','name','h5_icon','official_url','introduce_image','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type'],
self::SCENARIO_EDIT => ['category_id','id','h5_icon','official_url','introduce_image','name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type'],
self::SCENARIO_ADD => ['category_id','name','h5_icon','official_url','introduce_image','show_width','show_height','open_type','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type'],
self::SCENARIO_EDIT => ['category_id','id','h5_icon','official_url','introduce_image','show_width','show_height','open_type','name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type'],
];
}
......@@ -67,6 +70,9 @@ class CoinApplicationForm extends BaseForm
'advertise' => '宣传语',
'description' => '介绍',
'redirect_type' => '跳转方式',
'show_width' => '显示宽度',
'show_height' => '显示高度',
'open_type' => 'H5打开方式'
];
}
......@@ -81,6 +87,8 @@ class CoinApplicationForm extends BaseForm
['description','string', 'length' => [0, 500]],
['type', 'default', 'value' => 1],
['redirect_type', 'default', 'value' => 1],
['show_height', 'default', 'value' => 0],
['show_width', 'default', 'value' => 0],
];
}
......
......@@ -6,6 +6,11 @@
* Time: 21:01
*/
?>
<style>
.layui-form-label {
width: 110px;
}
</style>
<div class="layui-row" style="padding: 5px;">
<div class="layui-col-md6">
<form class="layui-form" method="post" action="">
......@@ -131,7 +136,19 @@
<textarea class="layui-textarea" name="description"></textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">显示尺寸</label>
<div class="layui-input-inline" style="width: 100px;">
<input type="text" name="show_width" placeholder="宽" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid">px</div>
<div class="layui-input-inline" style="width: 100px;">
<input type="text" name="show_height" placeholder="高" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid">px</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">跳转方式</label>
<div class="layui-input-block">
......@@ -143,6 +160,17 @@
</div>
<div class="layui-form-item">
<label class="layui-form-label">H5打开方式</label>
<div class="layui-input-block">
<select name="open_type" >
<option value="0">选择打开方式</option>
<option value="1">钱包内打开</option>
<option value="2">浏览器打开</option>
</select>
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn">提交</button>
</div>
</form>
......
......@@ -6,6 +6,11 @@
* Time: 16:01
*/
?>
<style>
.layui-form-label {
width: 110px;
}
</style>
<div class="layui-row" style="padding: 5px;">
<div class="layui-col-md12">
<form class="layui-form" method="post" action="" id="applicateEdit">
......@@ -133,7 +138,19 @@
<textarea class="layui-textarea" name="description" ><?= $item['description'] ?></textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">显示尺寸</label>
<div class="layui-input-inline" style="width: 100px;">
<input type="text" name="show_width" placeholder="宽" autocomplete="off" class="layui-input" value="<?= $item['show_width'] ?>">
</div>
<div class="layui-form-mid">px</div>
<div class="layui-input-inline" style="width: 100px;">
<input type="text" name="show_height" placeholder="高" autocomplete="off" class="layui-input" value="<?= $item['show_height'] ?>">
</div>
<div class="layui-form-mid">px</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">跳转方式</label>
<div class="layui-input-block">
......@@ -143,6 +160,17 @@
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">H5打开方式</label>
<div class="layui-input-block">
<select name="open_type" >
<option value="0" >选择打开方式</option>
<option value="1" <?php if($item['open_type'] ==1) echo "selected"?>>钱包内打开</option>
<option value="2" <?php if($item['open_type'] ==2) echo "selected"?>>浏览器打开</option>
</select>
</div>
</div>
</form>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment