作者 zhangwei
@@ -98,6 +98,15 @@ class AdminRegionGalleryController extends AdminBaseController @@ -98,6 +98,15 @@ class AdminRegionGalleryController extends AdminBaseController
98 } 98 }
99 } 99 }
100 100
  101 + //移动相册
  102 + if (!empty($data['m_photo_names']) && !empty($data['m_photo_urls'])) {
  103 + $data['post']['more']['m_photos'] = [];
  104 + foreach ($data['m_photo_urls'] as $key => $url) {
  105 + $photoUrl = cmf_asset_relative_url($url);
  106 + array_push($data['post']['more']['m_photos'], ["url" => $photoUrl, "name" => $data['m_photo_names'][$key]]);
  107 + }
  108 + }
  109 +
101 if (!empty($data['file_names']) && !empty($data['file_urls'])) { 110 if (!empty($data['file_names']) && !empty($data['file_urls'])) {
102 $data['post']['more']['files'] = []; 111 $data['post']['more']['files'] = [];
103 foreach ($data['file_urls'] as $key => $url) { 112 foreach ($data['file_urls'] as $key => $url) {
@@ -171,6 +180,7 @@ class AdminRegionGalleryController extends AdminBaseController @@ -171,6 +180,7 @@ class AdminRegionGalleryController extends AdminBaseController
171 180
172 $portalPostModel = new PortalPostModel(); 181 $portalPostModel = new PortalPostModel();
173 182
  183 + //pc相册
174 if (!empty($data['photo_names']) && !empty($data['photo_urls'])) { 184 if (!empty($data['photo_names']) && !empty($data['photo_urls'])) {
175 $data['post']['more']['photos'] = []; 185 $data['post']['more']['photos'] = [];
176 foreach ($data['photo_urls'] as $key => $url) { 186 foreach ($data['photo_urls'] as $key => $url) {
@@ -178,6 +188,15 @@ class AdminRegionGalleryController extends AdminBaseController @@ -178,6 +188,15 @@ class AdminRegionGalleryController extends AdminBaseController
178 array_push($data['post']['more']['photos'], ["url" => $photoUrl, "name" => $data['photo_names'][$key]]); 188 array_push($data['post']['more']['photos'], ["url" => $photoUrl, "name" => $data['photo_names'][$key]]);
179 } 189 }
180 } 190 }
  191 + //移动相册
  192 + if (!empty($data['m_photo_names']) && !empty($data['m_photo_urls'])) {
  193 +
  194 + $data['post']['more']['m_photos'] = [];
  195 + foreach ($data['m_photo_urls'] as $key => $url) {
  196 + $photoUrl = cmf_asset_relative_url($url);
  197 + array_push($data['post']['more']['m_photos'], ["url" => $photoUrl, "name" => $data['m_photo_names'][$key]]);
  198 + }
  199 + }
181 200
182 if (!empty($data['file_names']) && !empty($data['file_urls'])) { 201 if (!empty($data['file_names']) && !empty($data['file_urls'])) {
183 $data['post']['more']['files'] = []; 202 $data['post']['more']['files'] = [];
@@ -236,6 +236,7 @@ class RegionController extends HomeBaseController @@ -236,6 +236,7 @@ class RegionController extends HomeBaseController
236 if($res){ 236 if($res){
237 $more = json_decode($res['more'],true); 237 $more = json_decode($res['more'],true);
238 $res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos']:''; 238 $res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos']:'';
  239 + $res['m_image_url'] = isset($more['m_photos']) && !empty($more['m_photos'])?$more['m_photos']:'';
239 } 240 }
240 $this->assign('res',$res); 241 $this->assign('res',$res);
241 return $this->fetch(); 242 return $this->fetch();
@@ -15,6 +15,18 @@ @@ -15,6 +15,18 @@
15 <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a> 15 <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
16 </li> 16 </li>
17 </script> 17 </script>
  18 +<!--移动相册-->
  19 +<script type="text/html" id="m_photos-item-tpl">
  20 + <li id="m_saved-image{id}">
  21 + <input id="m_photo-{id}" type="hidden" name="m_photo_urls[]" value="{filepath}">
  22 + <input class="form-control" id="m_photo-{id}-name" type="text" name="m_photo_names[]" value="{name}"
  23 + style="width: 200px;" title="图片名称">
  24 + <img id="m_photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
  25 + onclick="imagePreviewDialog(this.src);">
  26 + <a href="javascript:uploadOneImage('图片上传','#m_photo-{id}');">替换</a>
  27 + <a href="javascript:(function(){$('#m_saved-image{id}').remove();})();">移除</a>
  28 + </li>
  29 +</script>
18 <script type="text/html" id="files-item-tpl"> 30 <script type="text/html" id="files-item-tpl">
19 <li id="saved-file{id}"> 31 <li id="saved-file{id}">
20 <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}"> 32 <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
@@ -54,6 +66,17 @@ @@ -54,6 +66,17 @@
54 </td> 66 </td>
55 </tr> 67 </tr>
56 <tr> 68 <tr>
  69 + <th>移动相册<span class="form-required">*</span></th>
  70 + <td>
  71 + <ul id="m_photos" class="pic-list list-unstyled form-inline"></ul>
  72 + <a href="javascript:uploadMultiImage('图片上传','#m_photos','m_photos-item-tpl');"
  73 + class="btn btn-default btn-sm">选择图片</a>
  74 + <div style="margin-top:30px;">
  75 + <span class="form-required">图片参考尺寸:420*740</span>
  76 + </div>
  77 + </td>
  78 + </tr>
  79 + <tr>
57 <th>权重</th> 80 <th>权重</th>
58 <td> 81 <td>
59 <input class="form-control" type="number" name="post[weigh]" value="0"> 82 <input class="form-control" type="number" name="post[weigh]" value="0">
@@ -15,6 +15,19 @@ @@ -15,6 +15,19 @@
15 <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a> 15 <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
16 </li> 16 </li>
17 </script> 17 </script>
  18 +<!--移动端相册-->
  19 +<script type="text/html" id="m_photos-item-tpl">
  20 + <li id="m_saved-image{id}">
  21 + <input id="m_photo-{id}" type="hidden" name="m_photo_urls[]" value="{filepath}">
  22 + <input class="form-control" id="m_photo-{id}-name" type="text" name="m_photo_names[]" value="{name}"
  23 + style="width: 200px;" title="图片名称">
  24 + <img id="m_photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
  25 + onclick="imagePreviewDialog(this.src);">
  26 + <a href="javascript:uploadOneImage('图片上传','#m_photo-{id}');">替换</a>
  27 + <a href="javascript:(function(){$('#m_saved-image{id}').remove();})();">移除</a>
  28 + </li>
  29 +</script>
  30 +
18 <script type="text/html" id="files-item-tpl"> 31 <script type="text/html" id="files-item-tpl">
19 <li id="saved-file{id}"> 32 <li id="saved-file{id}">
20 <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}"> 33 <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
@@ -77,6 +90,36 @@ @@ -77,6 +90,36 @@
77 </td> 90 </td>
78 </tr> 91 </tr>
79 <tr> 92 <tr>
  93 + <th>移动相册<span class="form-required">*</span></th>
  94 + <td>
  95 + <ul id="m_photos" class="pic-list list-unstyled form-inline">
  96 + <notempty name="post.more.m_photos">
  97 + <foreach name="post.more.m_photos" item="vo">
  98 + <php>$img_url=cmf_get_image_preview_url($vo['url']);</php>
  99 + <li id="m_saved-image{$key}">
  100 + <input id="m_photo-{$key}" type="hidden" name="m_photo_urls[]"
  101 + value="{$vo.url}">
  102 + <input class="form-control" id="m_photo-{$key}-name" type="text"
  103 + name="m_photo_names[]"
  104 + value="{$vo.name|default=''}" style="width: 200px;" title="图片名称">
  105 + <img id="m_photo-{$key}-preview"
  106 + src="{:cmf_get_image_preview_url($vo['url'])}"
  107 + style="height:36px;width: 36px;"
  108 + onclick="parent.imagePreviewDialog(this.src);">
  109 + <a href="javascript:uploadOneImage('图片上传','#m_photos-{$key}');">替换</a>
  110 + <a href="javascript:(function(){$('#m_saved-image{$key}').remove();})();">移除</a>
  111 + </li>
  112 + </foreach>
  113 + </notempty>
  114 + </ul>
  115 + <a href="javascript:uploadMultiImage('图片上传','#m_photos','m_photos-item-tpl');"
  116 + class="btn btn-sm btn-default">选择图片</a>
  117 + <div style="margin-top:30px;">
  118 + <span class="form-required">图片参考尺寸:420*740</span>
  119 + </div>
  120 + </td>
  121 + </tr>
  122 + <tr>
80 <th>权重</th> 123 <th>权重</th>
81 <td> 124 <td>
82 <input class="form-control" type="number" name="post[weigh]" value="{$post.weigh}"> 125 <input class="form-control" type="number" name="post[weigh]" value="{$post.weigh}">
@@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
48 <body> 48 <body>
49 <div class="index_fourth swiper-container"> 49 <div class="index_fourth swiper-container">
50 <ul class="swiper-wrapper"> 50 <ul class="swiper-wrapper">
51 - <volist name="res['image_url']" id="vo"> 51 + <volist name="res['m_image_url']" id="vo">
52 <li class="swiper-slide"> 52 <li class="swiper-slide">
53 <!-- <img src="__TMPL__/public/assets/images/cicon_43@2x.png" alt=""> --> 53 <!-- <img src="__TMPL__/public/assets/images/cicon_43@2x.png" alt=""> -->
54 <img src="{:cmf_get_image_url($vo.url)}" alt="" /> 54 <img src="{:cmf_get_image_url($vo.url)}" alt="" />