人人商城

material-post.html 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. {template 'common/header'}
  2. <div class="" ng-module="materialApp" ng-controller="materialAdd" id="main" ng-cloak>
  3. <div class="penel we7-panel panel-special">
  4. <div class="panel-heading">
  5. <ol class="breadcrumb we7-breadcrumb">
  6. <a href="{php echo url('platform/material')}"><i class="wi wi-back-circle"></i> </a>
  7. <li>
  8. <a href="{php echo url('platform/material')}">素材库</a>
  9. </li>
  10. <li>
  11. {if !empty($news_list)}编辑{else}新建{/if}图文素材
  12. </li>
  13. </ol>
  14. </div>
  15. <div class="panel-body">
  16. <div class="appmsg-edit-box">
  17. <div class="appmsg-preview-area">
  18. <div class="appmsg-edit-container appmsg-preview-container js-aside">
  19. <div class="appmsg-container-hd">
  20. <h4 class="appmsg-container-title">图文列表</h4>
  21. </div>
  22. <div class="appmsg-container-bd">
  23. <div class="material-appmsg-item multi">
  24. <div class="appmsg-content">
  25. <div ng-repeat="material in materialList" ng-click="changeIndex($index)" ng-class="material.class">
  26. <h4 class="appmsg-title">
  27. <a href="" target="-blank">{{ material.title }}</a>
  28. </h4>
  29. <div class="appmsg-thumb" ng-style="{'background-image' : 'url('+material.thumb+')'}">
  30. </div>
  31. <a href="javascript:;" ng-if="$index == 0" ng-click="exportFromCms()">导入文章</a>
  32. <div class="appmsg-edit-mask">
  33. <a onclick="return false;" class="sort-up" href="javascript:;" ng-click="changeOrder('up', $index)" data-toggle="tooltip" data-placement="bottom" title="上移" ng-if="$index != 0"><i class="wi wi-stick-sign"></i></a>
  34. <a onclick="return false;" class="sort-down" href="javascript:;" ng-click="changeOrder('down', $index)" data-toggle="tooltip" data-placement="bottom" title="下移" ng-if="$index != (materialList.length - 1)"><i class="wi wi-down-sign"></i></a>
  35. <a href="javascript:;" ng-click="exportFromCms()">导入文章</a>
  36. <a onclick="return false;" class="del" href="javascript:;" ng-if="$index != 0 && (operate == 'add' || model == 'local')" ng-click="deleteMaterial($index)" data-toggle="tooltip" data-placement="bottom" title="删除"><i class="wi wi-delete2"></i></a>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <a title="添加一篇图文" ng-click="addMaterial()" ng-show="(materialList.length < 8 && (operate == 'add' || operate == 'edit'))" class="appmsg-add" href="javascript:void(0);" style="display: block;">
  42. <i class="add-gray">+</i>
  43. </a>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="appmsg-input-area" id="edit-container">
  48. <div class="reply" ng-if="new_type == 'reply'">
  49. <!--标题-->
  50. <div class="appmsg-edit-item title">
  51. <label for="title" class="" style="display:none">请在这里输入标题</label>
  52. <input id="title" placeholder="请在这里输入标题" class="form-control" name="title" id="title" ng-model="materialList[activeIndex].title" max-length="64" type="text">
  53. <em class="form-control-append hidden">0/64</em>
  54. </div>
  55. <!--作者-->
  56. <div class="appmsg-edit-item author">
  57. <label for="author" class="" style="display:none">请输入作者</label>
  58. <input id="author" placeholder="请输入作者" class="form-control" ng-model="materialList[activeIndex].author" name="author" max-length="8" type="text">
  59. <em class="form-control-append hidden">0/8</em>
  60. </div>
  61. <!-- 阅读原文链接 -->
  62. <div we7-linker we7-my-url="materialList[activeIndex].content_source_url"></div>
  63. <!--正文-->
  64. <div class="editor-area" ng-my-upurl="{php echo url('utility/file/upload')}" ng-my-editor ng-my-value="materialList[activeIndex].content" >
  65. <textarea ></textarea>
  66. </div>
  67. </div>
  68. <div class="link" ng-if="new_type == 'link'">
  69. <div class="appmsg-edit-function-area ">
  70. <!-- 标题 -->
  71. <div class="appmsg-edit-item title">
  72. <label for="title" class="" style="display:none">请在这里输入标题</label>
  73. <input id="title" placeholder="请在这里输入标题" class="form-control" name="title" id="title" ng-model="materialList[activeIndex].title" max-length="64" type="text">
  74. <em class="form-control-append hidden">0/64</em>
  75. </div>
  76. <!-- END 标题 -->
  77. <!-- BEGIN 跳转链接 -->
  78. <div class="we7-form appmsg-edit-item origin-url-area">
  79. <div class="form-group">
  80. <div class="col-sm-12 form-control-box">
  81. <div we7-linker we7-my-url="materialList[activeIndex].content_source_url" we7-my-title="materialList[activeIndex].content_source_url"></div>
  82. </div>
  83. </div>
  84. </div>
  85. <!-- END 跳转链接 -->
  86. </div>
  87. </div>
  88. </div>
  89. <div class="appmsg-edit-highlight-area">
  90. <div class="appmsg-edit-title">发布样式编辑</div>
  91. <!-- EBGIN 封面 -->
  92. <div class="appmsg-edit-item gap-left we7-form">
  93. <div class="form-group">
  94. <label class="col-sm-12 control-label">封面<br><span class="color-gray">建议尺寸:<br>大图片:900 * 500(单图文或多图文第一篇)<br>小图片200 * 200(多图文第一篇图文下面)</span></label>
  95. <div>
  96. <a href="javascript:void(0);" class="btn btn-default" ng-click="pickPicture('local')">本地图片</a>
  97. <a href="javascript:void(0);" class="btn btn-default we7-margin-left" ng-click="pickPicture('wechat')">{$_W['account']['type_name']}图片</a>
  98. <div style="margin: 20px 0 10px 0;">
  99. <input type="checkbox" ng-checked="{{ materialList[activeIndex].show_cover_pic }}" ng-click="updateSelection()" id="display-cover"/>
  100. <label for="display-cover">在正文顶部显示封面图</label>
  101. </div>
  102. <image ng-src="{{ materialList[activeIndex].thumb }}" style="max-height: 200px;"></image>
  103. </div>
  104. </div>
  105. <div class="form-group">
  106. <label class="col-sm-12 control-label" ng-click="zhaiyao()">摘要<span class="color-gray">(选填,如果不填写会默认抓取正文前54个字)</span></label>
  107. <div>
  108. <span class="form-textarea-box">
  109. <textarea class="form-textarea" ng-model="materialList[activeIndex]['digest']" name="digest" max-length="120" rows="4" ></textarea>
  110. <em class="form-control-append hidden">0/120</em>
  111. </span>
  112. </div>
  113. </div>
  114. </div>
  115. <!-- END 封面 -->
  116. </div>
  117. </div>
  118. <nav class="navbar navbar-wxapp-bottom navbar-fixed-bottom" role="navigation">
  119. <div class="container">
  120. <div class="pager">
  121. <a type="button" class="btn btn-default pull-left hidden">收起正文</a>
  122. <div class="pull-right hidden">
  123. <a type="button" class="btn btn-primary" ng-click="saveNews()">保存</a>
  124. <a type="button" class="btn btn-default">预览</a>
  125. <a type="button" class="btn btn-default">保存并群发</a>
  126. </div>
  127. <a type="button" class="btn btn-primary" ng-if="model == 'local' || operate == 'add'" ng-click="saveNews('local')">保存到本地</a>
  128. <a id="savewechat" type="button" class="btn btn-primary" ng-click="saveNews('wechat')" ng-show="(!hidenbutton && materialList.length <= 8) || operate == 'add' && new_type == 'reply'">保存并上传到{$_W['account']['type_name']}</a>
  129. </div>
  130. </div>
  131. </nav>
  132. </div>
  133. </div>
  134. </div>
  135. <script>
  136. require(['underscore', 'fileUploader'], function() {
  137. angular.module('materialApp').value('material', {
  138. 'materialList' : {php echo json_encode($news_list)},
  139. 'type' : '{$type}',
  140. 'news_rid' : '{$reply_news_id}',
  141. 'operate' : {if !empty($newsid)}'edit'{else}'add'{/if},
  142. 'model' : {if !empty($attachment['model'])}'{$attachment['model']}'{else}''{/if},
  143. 'url' : "{php echo url('platform/material-post/tomedia')}",
  144. 'newsUpload_url' : "{php echo url('platform/material-post/addnews')}",
  145. 'msg_url' : "{php echo url('platform/material/display')}",
  146. 'upload_thumb_url' : "{php echo url('platform/material-post/thumb_upload')}",
  147. 'upload_iamge_url' : "{php echo url('platform/material-post/image_upload')}",
  148. 'replace_url' : "{php echo url('platform/material-post/replace_image_url')}",
  149. 'num_limit' : "{$upload_limit['num']}",
  150. 'image_limit' : "{$upload_limit['image']}",
  151. 'voice_limit' : "{$upload_limit['voice']}",
  152. 'video_limit' : "{$upload_limit['video']}",
  153. 'new_type' : "{$new_type}",
  154. 'typeName' : "{$_W['account']['type_name']}"
  155. });
  156. angular.bootstrap($('#main'), ['materialApp']);
  157. });
  158. $('[data-toggle="tooltip"]').tooltip();
  159. </script>
  160. {template 'common/footer'}