liche update for app cms add bg_img at place buy car banner

This commit is contained in:
xxb
2021-08-05 17:11:23 +08:00
parent 768b210d8c
commit 29b8d51f3d
3 changed files with 26 additions and 3 deletions
+6 -2
View File
@@ -68,6 +68,8 @@ class Cms extends HD_Controller
$covers[] = build_qiniu_image_url($val);
}
$row['btn_type'] = $json['btn_type'] ? $json['btn_type'] : 1;
$row['bg_img'] = $json['bg_img'] ? $json['bg_img'] : '';
$row['bg_img_src'] = $json['bg_img'] ? build_qiniu_image_url($json['bg_img']) : '';
$row['link'] = $row['url'];
$row['s_time'] = date('Y-m-d H:i:s', $row['s_time']);
$row['e_time'] = date('Y-m-d H:i:s', $row['e_time']);
@@ -119,7 +121,8 @@ class Cms extends HD_Controller
];
$json = array();
$input['btn_type'] = $json['btn_type'] = $input['btn_type'];
$input['btn_type'] && $json['btn_type'] = $input['btn_type'];
$input['bg_img'] && $json['bg_img'] = $input['bg_img'];
if($json){
$insert['jsondata'] = json_encode($json, JSON_UNESCAPED_UNICODE);
}
@@ -148,7 +151,8 @@ class Cms extends HD_Controller
$cover = !empty($input['cover']) ? str_replace('https://qimg.haodian.cn/', '', $input['cover']) : $input['cover'];
$input['link'] = $input['link'] . trim($input['param']);
$input['btn_type'] = $json['btn_type'] = $input['btn_type'];
$input['btn_type'] && $json['btn_type'] = $input['btn_type'];
$input['bg_img'] && $json['bg_img'] = $input['bg_img'];
$upd = [
'title' => $input['title'] ? $input['title'] : '',
'url' => $input['link'] ? $input['link'] : '',
+18
View File
@@ -65,6 +65,23 @@
<div v-if="info.position == 2">
<v-cars-select :target_id.sync="info.target_id" :app_id="app_id"></v-cars-select>
</div>
<div class="am-form-group" style="margin-bottom: 0" v-if="info.position == 2">
<label class="am-para-label">背景图片:</label>
<div class="am-para-input">
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm" data-file="1"
data-type="jpg,png,gif,png,jpeg" data-uptype="qiniu" data-field="bg_img"><i
class="am-icon-cloud-upload"></i> 选择图片
</button>
<input id="bg-img" type="hidden" name="bg_img" value="<?=$info['bg_img']?>" class="layui-input">
<?if($info['bg_img_src']){?>
<img data-tips-image style="height:auto;max-height:32px;min-width:32px" src="<?=$info['bg_img_src']?>"/>
<?} else{?>
<img data-tips-image style="height:auto;max-height:32px;min-width:32px" src=""/>
<?}?>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">简介:</label>
<div class="am-para-input wp60">
@@ -349,6 +366,7 @@
vm.info.cover = $('#cover').val();
vm.info.s_time = $('#s-time').val();
vm.info.e_time = $('#e-time').val();
vm.info.bg_img = $('#bg-img').val();
vm.info.content = editor.getData();
$.ajax({
+2 -1
View File
@@ -67,7 +67,8 @@ class Aptinfo extends Wxapp{
$img = 'https://qs.haodian.cn/wechat_app/liche/buyCar/ex-default.jpg';
if($cms_id){
$cms = $this->cms_model->get(['id'=>$cms_id]);
$cms['cover'] && $img = build_qiniu_image_url($cms['cover']);
$json = json_decode($cms['jsondata'], true);
$json['bg_img'] && $img = build_qiniu_image_url($json['bg_img']);
}
$data = [
'city_list' => $c_list,