Commit 9076321b authored by ZhuChunYang's avatar ZhuChunYang

添加设置应用详情图片尺寸功能

parent 94d69be5
......@@ -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
......@@ -25,6 +25,15 @@
</div>
<div class="layui-tab-item">
<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>
</div>
</div>
......@@ -207,4 +216,12 @@
$("#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>
\ No newline at end of file
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