edit-liche-group_code

This commit is contained in:
lccsw
2021-09-03 17:38:03 +08:00
parent 4048bfa9ab
commit 2b5abd535e
7 changed files with 56 additions and 4 deletions
+33 -1
View File
@@ -46,7 +46,7 @@ class Cms extends HD_Controller
foreach ($lists as $key => $value) {
$lists[$key]['s_time'] = date('Y-m-d H:i:s', $value['s_time']);
$lists[$key]['e_time'] = date('Y-m-d H:i:s', $value['e_time']);
$lists[$key]['position'] = $this->pos_arr[$value['position']];
$lists[$key]['position_name'] = $this->pos_arr[$value['position']];
}
$count = $this->liche_cms_model->count($where);
$this->data['pos_arr'] = $this->pos_arr;
@@ -71,6 +71,7 @@ class Cms extends HD_Controller
$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['qrcode'] = $json['qrcode'];
$cfrom_id2 = $cfrom_id = 0;
if($json['cfrom_id']){
$c_row = $this->clues_cfrom_model->get(['id'=>$json['cfrom_id']],'id,pid');
@@ -140,6 +141,7 @@ class Cms extends HD_Controller
$input['cfrom_id2'] && $json['cfrom_id'] = $input['cfrom_id2'];
$input['btn_type'] && $json['btn_type'] = $input['btn_type'];
$input['bg_img'] && $json['bg_img'] = $input['bg_img'];
$input['qrcode'] && $json['qrcode'] = $input['qrcode'];
if($json){
$insert['jsondata'] = json_encode($json, JSON_UNESCAPED_UNICODE);
}
@@ -172,6 +174,7 @@ class Cms extends HD_Controller
$input['bg_img'] && $json['bg_img'] = $input['bg_img'];
$input['cfrom_id'] && $json['cfrom_id'] = $input['cfrom_id'];
$input['cfrom_id2'] && $json['cfrom_id'] = $input['cfrom_id2'];
$input['qrcode'] && $json['qrcode'] = $input['qrcode'];
$upd = [
'title' => $input['title'] ? $input['title'] : '',
'url' => $input['link'] ? $input['link'] : '',
@@ -231,4 +234,33 @@ class Cms extends HD_Controller
$this->data['data'] = $rows;
return $this->show_json(SYS_CODE_SUCCESS);
}
//群码二维码
public function get_share_link(){
$app_id = 1;
$this->load->model('app/app_model', 'mdApp');
$id = $this->input->get('id');
$cms = $this->liche_cms_model->get(['id'=>$id]);
if(!$cms){
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
$wxconfig = $this->mdApp->appConfig()[$app_id]['wx'];
$openlink = '';
$page = $this->mdApp->appConfig()[$app_id]['wx']['pages_groupcode_detail'];
$scene = $id;
$width = '850px';
$path = "{$page}?id={$scene}";
$width && $path .= "{$width}";
$filename = "{$this->mdApp->appConfig()[$app_id]['app_key']}/" . substr(md5($path), 8, 16);
$this->load->library('hdwechat', $wxconfig);
$result = $this->hdwechat->qrcode($filename, $scene, $page, $width);
if ($result) {
$base_url = http_host_com('api');
$this->data['qrcode'] = $base_url.'/'. $result['url'];
}
$this->data['page'] = $page . '?' . $scene;
$this->data['openlink'] = $openlink;
return $this->show_view('common/share_link');
}
}
+14
View File
@@ -43,6 +43,19 @@
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0" v-if="info.position == 8">
<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="qrcode"><i
class="am-icon-cloud-upload"></i> 选择要上传的文件
</button>
<input id="qrcode" type="hidden" name="qrcode" value="<?=$info['qrcode']?>" class="layui-input">
<img data-tips-image style="height:auto;max-height:32px;min-width:32px" src="<?=$info['qrcode']?build_qiniu_image_url($info['qrcode']):''?>"/>
</div>
</div>
</div>
<div class="am-form-group" v-if="info.position == 2">
<label class="am-para-label">线索来源:</label>
<div class="am-para-input wp60">
@@ -392,6 +405,7 @@
vm.info.s_time = $('#s-time').val();
vm.info.e_time = $('#e-time').val();
vm.info.bg_img = $('#bg-img').val();
vm.info.qrcode = $('#qrcode').val();
vm.info.content = editor.getData();
$.ajax({
+3 -1
View File
@@ -70,7 +70,7 @@
<!-- <td rowspan="2"><input class="cms-ids" :value="value.id" type="checkbox" /></td>-->
<td>{{value.id}}</td>
<td>{{value.title}}</td>
<td>{{value.position}}</td>
<td>{{value.position_name}}</td>
<td>{{value.sort}}</td>
<td>{{value.s_time}}</td>
<td>{{value.e_time}}</td>
@@ -79,6 +79,8 @@
</tr>
<tr>
<td colspan="7" class="align-r">
<input type="button" class="am-btn am-btn-xs am-btn-primary"
:data-modal="'/app/liche/cms/get_share_link?&id='+value.id" value="查看二维码" v-if="value.position==8"/>
<input type="button" class="am-btn am-btn-xs am-btn-primary"
:data-open="'/app/liche/cms/get?&id='+value.id" value="修改"/>
<input v-if="value.status == '0'" type="button" class="am-btn am-btn-xs am-btn-danger"
+1 -1
View File
@@ -51,4 +51,4 @@
console.error('Trigger:', e.trigger);
});
});
</script>
</script>
@@ -82,6 +82,7 @@ class Sub_cms extends Wxapp{
if(!$row){
throw new Exception('数据不存在', API_CODE_INVILD_PARAM);
}
$jsondata =json_decode($row['jsondata'],true);
$data = array(
'id' => $row['id'],
'title' => $row['title'],
@@ -91,6 +92,7 @@ class Sub_cms extends Wxapp{
'e_time' => date('Y-m-d H:i:s',$row['e_time']),
'target_id' => $row['target_id'],
'status' => $row['e_time']<time() ? 0 : 1,
'qrcode' => $jsondata['qrcode'] ? build_qiniu_image_url($jsondata['qrcode']) : '',
);
return $data;
}
+1
View File
@@ -33,6 +33,7 @@ class App_model extends HD_Model
'wx' => array(
'appid' => 'wx98e64c11aac45966',
'secret' => 'f8eec7be1c87a1c8e40213e144821ec3',
'pages_groupcode_detail' => 'pages/groupCode/index',
),
),
);
@@ -12,7 +12,8 @@ class App_liche_cms_model extends HD_Model{
private $posion_arr = [
0 => '首页bannber',1 => '热门活动', 2 => '购车banner',
4 => '狸车海报', 3 => '活动专题', 5 => '公号测评',
6 => '朋友圈',7 => '其它'
6 => '朋友圈',7 => '其它',
8 => '群码'
];
public function __construct()