admin_material_1203

This commit is contained in:
dengbw
2021-12-03 17:48:19 +08:00
parent c065fab653
commit c7faf370e2
3 changed files with 32 additions and 0 deletions
@@ -164,6 +164,7 @@ class Template extends HD_Controller
$info['cover'] = array('value' => '', 'src' => '');
$info['moments'] = '';
$info['tag_id'] = '';
$info['biz_pop'] = 0;
$json_lists = $json_item = $brands = $pyqwa_list = array();
foreach ($this->mdTemplate->typeAry() as $key => $value) {
$json_lists[$key] = array();
@@ -175,8 +176,10 @@ class Template extends HD_Controller
return $this->show_json(SYS_CODE_FAIL, '模板不存在!');
}
$moments = $tag_id = '';
$biz_pop = 0;
if ($re['json_data']) {
$json_data = json_decode($re['json_data'], true);
$json_data['biz_pop'] && $biz_pop = $json_data['biz_pop'];
$json_data['moments'] && $moments = $json_data['moments'];
$json_data['tag_id'] && $tag_id = $json_data['tag_id'];
$lists = array();
@@ -214,6 +217,7 @@ class Template extends HD_Controller
unset($re['json_data']);
}
$info = $re;
$info['biz_pop'] = $biz_pop;
$info['moments'] = $moments;
$info['tag_id'] = $tag_id;
$info['cover'] = $info['cover'] ? array('value' => $info['cover'], 'src' => build_qiniu_image_url($info['cover']))
@@ -231,6 +235,7 @@ class Template extends HD_Controller
$showInfo['statusAry'] = $this->mdTemplate->statusAry();
$showInfo['typeAry'] = $this->mdTemplate->typeAry();
$showInfo['tagAry'] = $this->mdTemplate->tagAry();
$showInfo['bizPopAry'] = [0 => '否', 1 => '是'];
$showInfo['brands'] = $brands;
$showInfo['pyqwa_list'] = $pyqwa_list;
$showInfo['json_lists'] = $json_lists;
@@ -275,6 +280,7 @@ class Template extends HD_Controller
$brand_ids .= ',0';
}
}
$json_data['biz_pop'] = $info['biz_pop'];
$json_data['moments'] = $info['moments'];
$json_data['tag_id'] = $info['tag_id'];
if ($info['lists']) {
@@ -336,6 +342,7 @@ class Template extends HD_Controller
$brand_ids .= ',0';
}
}
$json_data['biz_pop'] = $info['biz_pop'];
$json_data['moments'] = $info['moments'];
$json_data['tag_id'] = $info['tag_id'];
if ($info['lists']) {
@@ -58,6 +58,14 @@
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">授权弹窗:</label>
<div class="am-para-input">
<label class="am-checkbox-inline" v-for="(v,i) in showInfo.bizPopAry">
<input type="radio" :value="i" v-model="info.biz_pop"> {{v}}
</label>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">朋友圈文案:</label>
<div class="am-para-input" style="width: 60%">
+17
View File
@@ -42,6 +42,7 @@ class Topic extends Wxapp
if (!$re || empty($re)) {
throw new Hd_exception('专题不存在', API_CODE_FAIL);
}
$biz_info = ['pop' => 0];
if ($biz_id) {
$re_biz = $this->mdMaterialBiz->get(array('app_id' => $this->app_id, 't_id' => $id, 'biz_id' => $biz_id));
if (!$re_biz || empty($re_biz)) {
@@ -61,10 +62,25 @@ class Topic extends Wxapp
$this->mdBizStatistics->add($where_s);
$this->app_redis->save($key, 1, 24 * 3600);//有效期1天
}
}
$lists = array();
if ($re['json_data']) {
$json_data = json_decode($re['json_data'], true);
if ($json_data['biz_pop']) {//授权弹窗
$biz_info['pop'] = $json_data['biz_pop'];
$biz_info['biz_name'] = '';
$biz_info['headimg'] = 'https://qs.haodian.cn/wechat_app/liche/common/dark-logo2.jpg';
$biz_info['pop_content'] = '您好,欢迎您访问狸车。授权手机号后将给您提供最新的新能源汽车资讯和优惠活动哦~';
if ($biz_id) {
$this->load->model("biz/biz_model", 'mdBiz');
$re_biz = $this->mdBiz->get(array('id' => $biz_id, 'status' => 1));
if ($re_biz) {
$biz_info['biz_name'] = $re_biz['biz_name'];
$re_biz['headimg'] && $biz_info['headimg'] = build_qiniu_image_url($re_biz['headimg']);
}
}
}
foreach ($json_data['lists'] as $key => $value) {
$setValue = array();
$setValue['title'] = $value['title'];
@@ -90,6 +106,7 @@ class Topic extends Wxapp
$this->data['type'] = $re['type'];
$this->data['sign_up'] = 1;
$this->data['lists'] = $lists;
$this->data['biz_info'] = $biz_info;
return $this->data;
}