增加专题配置项
This commit is contained in:
@@ -22,6 +22,7 @@ class Market_sytopic_module_option_model extends HD_Model
|
||||
foreach ($modelOptionsList as $item) {
|
||||
$model = $modelList[$item['moduleId']][0];
|
||||
$lists[$item['moduleId']]['type'] = $model['type'];
|
||||
$lists[$item['moduleId']]['title'] = $model['title'];
|
||||
$lists[$item['moduleId']]['lists'][] = $this->formItem($model, $item);;
|
||||
}
|
||||
}
|
||||
@@ -37,7 +38,7 @@ class Market_sytopic_module_option_model extends HD_Model
|
||||
{
|
||||
$this->load->model('market/market_sytopic_module_model');
|
||||
$moduleModel = new Market_sytopic_module_model();
|
||||
$modelList = $moduleModel->map('id','',['type' => $moduleModel::TYPE_ENROLL_BANNER, 'status' => 0], '', '', '', 'id,title');
|
||||
$modelList = $moduleModel->map('id', '', ['type' => $moduleModel::TYPE_ENROLL_BANNER, 'status' => 0], '', '', '', 'id,title');
|
||||
$lists = [];
|
||||
if ($modelList) {
|
||||
$modelIdsStr = implode(',', array_keys($modelList));
|
||||
@@ -82,7 +83,7 @@ class Market_sytopic_module_option_model extends HD_Model
|
||||
}
|
||||
}
|
||||
$data['otherImg'] = $otherImgSet;
|
||||
$jsonData = json_encode($item['jsondata'], true);
|
||||
$jsonData = $item['jsondata'] ? json_decode($item['jsondata'], true) : [];
|
||||
switch ($model['type']) {
|
||||
case Market_sytopic_module_model::TYPE_DISCOUNT: //特惠报名
|
||||
$endTime = 0;
|
||||
@@ -134,6 +135,7 @@ class Market_sytopic_module_option_model extends HD_Model
|
||||
default:
|
||||
$data['introduction'] = strip_tags($item['introduction']);
|
||||
}
|
||||
$data['jsonData'] = $jsonData;
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -298,18 +298,20 @@
|
||||
<!-- 报名模块 一行两列 0826 -->
|
||||
<div class="card-module" v-if="item.type && item.type==4 && item.lists && item.lists.length>0">
|
||||
<div class="ignore-rounded-isosceles-trapezoid absolute box-center top-0 pl5 pr5 text-center">
|
||||
<div class="ignore-trapezoid-middle font-34 color-fff">爆款车</div>
|
||||
<div class="ignore-trapezoid-middle font-34 color-fff">{{item.title}}</div>
|
||||
</div>
|
||||
<div class="fn-flex fn-flex-wrap fn-flex-between mt20">
|
||||
<div class="wp48 text-center ulib-r20 bg-fff mb30" v-for="(val,key) in item.lists" :key="key">
|
||||
<div class="ml20 mr20"><van-image :src="val.banner"></van-image></div>
|
||||
<div class="bg-f5 ulib-r20 pt80 pb30" style="margin-top: -12vw;">
|
||||
<h3 class="font-34">{{val.title}}</h3>
|
||||
<div v-if="0" class="d-coupon mt15 fn-flex fn-flex-center fn-flex-middle">
|
||||
<div class="d-coupon mt15 fn-flex fn-flex-center fn-flex-middle" v-if="val.jsonData && val.jsonData.dis_money">
|
||||
<div class="left"></div>
|
||||
<div class="middle pl10 pr10 color-fff font-22 fn-flex fn-flex-center fn-flex-middle" style="flex-direction: column;">
|
||||
<div class="fn-flex fn-flex-center text-nowrap" style="align-items: baseline;"><h5 class="font-30">12345</h5><p class="font-20 ml5">元</p></div>
|
||||
<p class="font-20 mt5 text-nowrap">现金补贴</p>
|
||||
<div class="fn-flex fn-flex-center text-nowrap" style="align-items: baseline;">
|
||||
<h5 class="font-30">{{val.jsonData.dis_money}}</h5><p class="font-20 ml5">元</p>
|
||||
</div>
|
||||
<p class="font-20 mt5 text-nowrap">{{val.jsonData.dis_title}}</p>
|
||||
</div>
|
||||
<div class="right"></div>
|
||||
</div>
|
||||
|
||||
@@ -202,6 +202,9 @@ class Module extends BaseController
|
||||
'enrollLimit' => $postData['enrollLimit'] ?: 0,
|
||||
'enrollEndTime' => $postData['enrollEndTime'] ?: '0000-00-00 00:00:00'
|
||||
];
|
||||
if ($postData['jsondata']) {
|
||||
$data['jsondata'] = json_encode($postData['jsondata'], JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
if ($postData['id']) {
|
||||
$result = $this->mSModuleOption->update($data, ['id' => $postData['id']]);
|
||||
} else {
|
||||
@@ -231,7 +234,11 @@ class Module extends BaseController
|
||||
|
||||
private function form_data($moduleType, $row)
|
||||
{
|
||||
$otherImg = $jsondata = $banner = [];
|
||||
$otherImg = $banner = [];
|
||||
$jsondata = [
|
||||
'dis_title' => '',
|
||||
'dis_money' => ''
|
||||
];
|
||||
if ($row['banner']) {
|
||||
$banner = [['uid' => 1, 'fileUrl' => $row['banner'], 'url' => build_qiniu_image_url($row['banner']), 'status' => 'done']];
|
||||
}
|
||||
@@ -242,7 +249,7 @@ class Module extends BaseController
|
||||
}
|
||||
}
|
||||
$row['otherImg'] = $otherImg;
|
||||
if ($jsondata) {
|
||||
if ($row['jsondata']) {
|
||||
$jsondata = json_decode($row['jsondata'], true);
|
||||
}
|
||||
$row['jsondata'] = $jsondata;
|
||||
|
||||
Reference in New Issue
Block a user