人人商城

material.html 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. {template 'common/header'}
  2. <div class="we7-page-title">
  3. 素材管理
  4. </div>
  5. <ul class="we7-page-tab">
  6. {loop $active_sub_permission $active_menu}
  7. {if permission_check_account_user($active_menu['permission_name'], false) && $active_menu['is_display'] !== false && (empty($active_menu['is_display']) || is_array($active_menu['is_display']) && in_array($_W['account']['type'], $active_menu['is_display']))}
  8. <li {if $type == $active_menu['active']}class="active"{/if}><a href="{$active_menu['url']}">{$active_menu['title']}</a></li>
  9. {/if}
  10. {/loop}
  11. </ul>
  12. <div id="main" ng-controller="materialDisplay" ng-cloak>
  13. <div class="material">
  14. {if $type == 'news'}
  15. <div class="material-appmsg">
  16. <div class="material-list-head clearfix">
  17. <div class="info col-sm-6 we7-padding-none">
  18. <div class="we7-form">
  19. <div class="form-controls">
  20. <form action="{php echo url('platform/material/list', array('type' => 'news', 'server' => $server))}" method="post" >
  21. <div class="input-group">
  22. <input type="text" id="" name="title" class="form-control" size="40" value="{$_GPC['title']}" placeholder="标题/作者/摘要">
  23. <span class="input-group-btn">
  24. <button class="btn btn-default"><i class="fa fa-search"></i></button>
  25. </span>
  26. </div>
  27. </form>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="pull-right">
  32. {if $_W['account']['level'] > 2 || $_W['account']['type'] == ACCOUNT_TYPE_XZAPP_NORMAL && $_W['account']['isconnect'] = 1}
  33. <a href="javascript:;" ng-click="sync('{$type}')" class="btn btn-default">同步{$_W['account']['type_name']}</a>
  34. {/if}
  35. <a href="javascript:;" data-toggle="modal" data-target="#new_type" class="btn btn-primary we7-margin-left">新建图文消息</a>
  36. </div>
  37. <div class="modal fade" id="new_type" tabindex="-1" role="dialog" aria-hidden="true">
  38. <div class="we7-modal-dialog modal-dialog">
  39. <div class="modal-content">
  40. <div class="modal-header">
  41. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  42. <div class="modal-title">新建图文消息</div>
  43. </div>
  44. <div class="modal-body">
  45. <div class="reply" ng-click="createNew('reply')">
  46. <a href="javascript:;">
  47. <img src="./resource/images/reply.png" alt="" />
  48. <div class="content">
  49. <div class="title">创建{$_W['account']['type_name']}图文</div>
  50. <div class="state">
  51. 图文消息会自动同步至{$_W['account']['type_name']}素材库,
  52. 并可以直接群发给粉丝
  53. </div>
  54. </div>
  55. </a>
  56. </div>
  57. <div class="link" ng-click="createNew('link')">
  58. <a href="javascript:;">
  59. <img src="./resource/images/link.png" alt="" />
  60. <div class="content">
  61. <div class="title">创建图文链接</div>
  62. <div class="state">
  63. 点击图文直接跳转至指定链接,可用于自动回复及认证号菜单
  64. 配置,不能同步至微信素材库。
  65. </div>
  66. </div>
  67. </a>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="btn-group we7-btn-group" style="top:15px;">
  75. <a href="{php echo url('platform/material', array('type' => $type))}" class="btn {if $server != MATERIAL_WEXIN && $server != MATERIAL_LOCAL} active {/if}">全部</a>
  76. <a href="{php echo url('platform/material', array('type' => $type, 'server' => MATERIAL_WEXIN))}" class="btn {if $server == MATERIAL_WEXIN} active {/if}">{$_W['account']['type_name']}</a>
  77. <a href="{php echo url('platform/material', array('type' => $type, 'server' => MATERIAL_LOCAL))}" class="btn {if $server == MATERIAL_LOCAL} active {/if}">服务器</a>
  78. </div>
  79. <div class="material-appmsg-list">
  80. {loop $material_list $material}
  81. <div class="material-appmsg-item{if !empty($material['items']['1'])} multi{/if}">
  82. <div class="appmsg-content">
  83. <div class="appmsg-info">
  84. <em class="appmsg-date">{php echo date('Y年m月d', $material['createtime'])}</em>
  85. {if $material['model'] == 'local'}
  86. <i class="wi wi-local pull-right color-default" style="font-size: 20px;"></i>
  87. {else}
  88. {if in_array($_W['account']['type'], array(ACCOUNT_TYPE_XZAPP_NORMAL, ACCOUNT_TYPE_XZAPP_AUTH))}
  89. <i class="wi wi-xzapp pull-right color-green" style="font-size: 20px;"></i>
  90. {else}
  91. <i class="wi wi-wx-circle pull-right color-green" style="font-size: 20px;"></i>
  92. {/if}
  93. {/if}
  94. {if $material['prompt_msg'] && $material['model'] != 'local'}
  95. <div class="undone-tips">
  96. 图文内容不完整
  97. <br> 请补全每一篇图文的封面图、标题和正文
  98. </div>
  99. {/if}
  100. </div>
  101. <div class="{if !empty($material['items']['1'])}cover-{/if}appmsg-item">
  102. <h4 class="appmsg-title">
  103. <a href="" target="-blank">{$material['items']['0']['title']}</a>
  104. </h4>
  105. <div class="appmsg-thumb" style="background-image:url('{php echo tomedia($material['items']['0']['thumb_url'])}')">
  106. </div>
  107. <p class="appmsg-desc">{$material['items']['0']['digest']}</p>
  108. {if $material['model'] == 'local'}
  109. <a href="javascript:;" target="_blank" class="cover-dark">
  110. {else}
  111. <a href="javascript:;" data-toggle="modal" data-target="#modalWechatView" ng-click="choiceSendType('{$material['items']['0']['url']}', 'news', '{$material['media_id']}')" class="cover-dark">
  112. {/if}
  113. <div class="edit-mask-content">
  114. {if $material['model'] == 'local'}
  115. 本地预览<span data-toggle="tooltip" data-placement="bottom" title="本地文章,不可以群发,可以转换成为微信文章."><i class="wi wi-explain-sign"></i></span>
  116. <span class="hidden">外部链接预览<span data-toggle="tooltip" data-placement="bottom" title="外部链接,内容不是文章,不可以群发或转换为微信文章."><i class="wi wi-explain-sign"></i></span></span>
  117. {else}
  118. 微信预览
  119. {/if}
  120. </div>
  121. <span class="vm-box"></span>
  122. </a>
  123. </div>
  124. {loop $material['items'] $key $material_row}
  125. {if !empty($key)}
  126. <div class="appmsg-item has-cover">
  127. {if !empty($material_row['thumb_url'])}
  128. <div class="appmsg-thumb" style="background-image:url('{php echo tomedia($material_row['thumb_url'])}">
  129. </div>
  130. {/if}
  131. <h4 class="appmsg-title">
  132. <a href="" target="_blank" >{$material_row['title']}</a>
  133. </h4>
  134. {if !empty($material_row['thumb_url']) && !empty($material_row['url'])}
  135. <a href="{$material_row['url']}" target="_blank" class="cover-dark">
  136. <div class="edit-mask-content">
  137. <p class="">
  138. 预览文章 </p>
  139. </div>
  140. <span class="vm-box"></span>
  141. </a>
  142. {/if}
  143. </div>
  144. {/if}
  145. {/loop}
  146. </div>
  147. <div class="appmsg-opr">
  148. <ul>
  149. {if $material['model'] == 'perm'}
  150. <li class="appmsg-opr-item">
  151. <a href="javascript:;" class="" ng-click="checkGroup('news', {$material['id']})" data-toggle="tooltip" data-placement="bottom" title="群发"><i class="wi wi-send"></i></a>
  152. </li>
  153. {else}
  154. <li class="appmsg-opr-item">
  155. <a href="javascript:;" ng-click="newsToWechat({$material['id']})" class="" data-toggle="tooltip" data-placement="bottom" title="转换为微信文章"><i class="wi wi-transform"></i></a>
  156. </li>
  157. {/if}
  158. <li class="appmsg-opr-item">
  159. <a href="{php echo url('platform/material-post/news', array('newsid' => $material['id']))}" class="" data-toggle="tooltip" data-placement="bottom" title="编辑">&nbsp;<i class="wi wi-text"></i></a>
  160. </li>
  161. <li class="appmsg-opr-item">
  162. <a class="" href="javascript:void(0);" ng-click="del_material('{$type}', '{$material['id']}', 'wechat')" data-toggle="tooltip" data-placement="bottom" title="删除">&nbsp;<i class="wi wi-delete2"></i></a>
  163. </li>
  164. </ul>
  165. </div>
  166. </div>
  167. {/loop}
  168. </div>
  169. </div>
  170. {elseif $type == 'image'}
  171. <div class="material-appmsg">
  172. <div class="upload-queue"></div>
  173. <div class="material-list-head clearfix">
  174. <div class="action">
  175. {if $_W['account']['level'] > 2 || $_W['account']['type'] == ACCOUNT_TYPE_XZAPP_NORMAL && $_W['account']['isconnect'] = 1}
  176. <a href="javascript:;" class="btn btn-default" ng-click="sync('{$type}')">同步{$_W['account']['type_name']}</a>
  177. {/if}
  178. {if $server == MATERIAL_WEXIN}
  179. <a href="javascript:;" class="btn btn-primary we7-margin-left" ng-click="upload('image', true, true)">上传{$_W['account']['type_name']}图片</a>
  180. {else}
  181. <a href="javascript:;" class="btn btn-primary we7-margin-left" ng-click="upload('image', true, false)">上传服务器图片</a>
  182. {/if}
  183. </div>
  184. <div class="btn-group we7-btn-group">
  185. <a href="{php echo url('platform/material', array('type' => $type, 'server' => MATERIAL_WEXIN))}" class="btn {if $server == MATERIAL_WEXIN} active {/if}">{$_W['account']['type_name']}</a>
  186. <a href="{php echo url('platform/material', array('type' => $type, 'server' => MATERIAL_LOCAL))}" class="btn {if $server == MATERIAL_LOCAL} active {/if}">服务器</a>
  187. </div>
  188. </div>
  189. <ul class="material-img-list clearfix">
  190. {loop $material_list $image}
  191. <li class="material-img-item">
  192. <div class="appimg-info">
  193. {if $server == 'local'}
  194. <i class="wi wi-local pull-right color-default" style="font-size: 20px;"></i>
  195. {else}
  196. {if in_array($_W['account']['type'], array(ACCOUNT_TYPE_XZAPP_NORMAL, ACCOUNT_TYPE_XZAPP_AUTH))}
  197. <i class="wi wi-xzapp pull-right color-green" style="font-size: 20px;"></i>
  198. {else}
  199. <i class="wi wi-wx-circle pull-right color-green" style="font-size: 20px;"></i>
  200. {/if}
  201. {/if}
  202. <span class="appimg-title">{$image['filename']}</span>
  203. </div>
  204. <div class="img-item">
  205. {if $server == 'local' || !empty($_W['setting']['remote']['type'])}
  206. <img class="img-thumb" src="{php echo tomedia($image['attachment']);}">
  207. {else}
  208. <img class="img-thumb" src="{php echo tomedia($image['attachment'], true);}">
  209. {/if}
  210. </div>
  211. <div class="img-opr">
  212. <ul>
  213. {if $server == 'local'}
  214. <li class="img-opr-item">
  215. <a href="javascript:;" class="" ng-click="transToWechat('{$type}', '{$image['id']}')" data-toggle="tooltip" data-placement="bottom" title="转换为微信图片"><i class="wi wi-transform"></i></a>
  216. </li>
  217. {else}
  218. <li class="img-opr-item">
  219. <a href="javascript:;" class="" ng-click="checkGroup('image', {$image['id']})" data-toggle="tooltip" data-placement="bottom" title="群发"><i class="wi wi-send"></i></a>
  220. </li>
  221. {/if}
  222. <li class="img-opr-item">
  223. <a class="" href="javascript:void(0);" ng-click="del_material('{$type}', '{$image['id']}', '{php echo $server == 'local'? local : wechat}')" data-toggle="tooltip" data-placement="bottom" title="删除">&nbsp;<i class="wi wi-delete2"></i></a>
  224. </li>
  225. </ul>
  226. </div>
  227. </li>
  228. {/loop}
  229. </ul>
  230. </div>
  231. {elseif $type == 'voice'}
  232. <div class="material-appmsg">
  233. <div class="upload-queue"></div>
  234. <div class="material-list-head clearfix">
  235. <div class="action">
  236. {if $_W['account']['level'] > 2 && $_W['account']['isconnect'] = 1}
  237. <a href="javascript:;" class="btn btn-default" ng-click="sync('voice')">同步{$_W['account']['type_name']}</a>
  238. {/if}
  239. {if $server == MATERIAL_WEXIN}
  240. <a href="javascript:;" class="btn btn-primary we7-margin-left" ng-click="upload('voice', true, true)">上传{$_W['account']['type_name']}语音</a>
  241. {else}
  242. <a href="javascript:;" class="btn btn-primary we7-margin-left" ng-click="upload('voice', true, false)">上传服务器语音</a>
  243. {/if}
  244. </div>
  245. <div class="btn-group we7-btn-group">
  246. <a href="{php echo url('platform/material', array('type' => $type, 'server' => MATERIAL_WEXIN))}" class="btn {if $server == MATERIAL_WEXIN} active {/if}">微信</a>
  247. <a href="{php echo url('platform/material', array('type' => $type, 'server' => MATERIAL_LOCAL))}" class="btn {if $server == MATERIAL_LOCAL} active {/if}">服务器</a>
  248. </div>
  249. </div>
  250. <ul class="material-audio-list">
  251. {loop $material_list $voice}
  252. <li class="material-audio-item">
  253. <div class="audio-info clearfix">
  254. {if $server == 'local'}
  255. <i class="wi wi-local pull-right color-default" style="font-size: 20px;"></i>
  256. {else}
  257. {if in_array($_W['account']['type'], array(ACCOUNT_TYPE_XZAPP_NORMAL, ACCOUNT_TYPE_XZAPP_AUTH))}
  258. <i class="wi wi-xzapp pull-right color-green" style="font-size: 20px;"></i>
  259. {else}
  260. <i class="wi wi-wx-circle pull-right color-green" style="font-size: 20px;"></i>
  261. {/if}
  262. {/if}
  263. <span class="audio-time">{php echo date('m月d日', $voice['createtime'])}</span>
  264. </div>
  265. <div class="audio-item">
  266. <div class="icon-audio-wrp">
  267. <span class="icon-audio-msg"></span>
  268. </div>
  269. <div class="audio-content">
  270. <div class="audio-title">{$voice['attachment']}</div>
  271. <div class="audio-length">{php echo date('h:i', $voice['createtime'])}</div>
  272. </div>
  273. </div>
  274. <div class="audio-opr">
  275. <ul>
  276. {if $server == 'local'}
  277. <li class="audio-opr-item">
  278. <a href="javascript:;" class="" ng-click="transToWechat('{$type}', '{$voice['id']}')" data-toggle="tooltip" data-placement="bottom" title="转换为微信语音"><i class="wi wi-transform"></i></a>
  279. </li>
  280. {else}
  281. <li class="audio-opr-item">
  282. <a href="javascript:;" class="" ng-click="checkGroup('voice', {$voice['id']})" data-toggle="tooltip" data-placement="bottom" title="群发"><i class="wi wi-send"></i></a>
  283. </li>
  284. {/if}
  285. <li class="audio-opr-item">
  286. <a class="" href="javascript:void(0);" ng-click="del_material('{$type}', '{$voice['id']}', '{php echo $server == 'local'? local : wechat}')" data-toggle="tooltip" data-placement="bottom" title="删除">&nbsp;<i class="wi wi-delete2"></i></a>
  287. </li>
  288. </ul>
  289. </div>
  290. </li>
  291. {/loop}
  292. </ul>
  293. </div>
  294. {elseif $type == 'video'}
  295. <div class="material-appmsg">
  296. <div class="upload-queue"></div>
  297. <div class="material-list-head clearfix">
  298. <div class="action">
  299. {if $_W['account']['level'] > 2 && $_W['account']['isconnect'] = 1}
  300. <a href="javascript:;" class="btn btn-default" ng-click="sync('video')">同步微信</a>
  301. {/if}
  302. {if $server == MATERIAL_WEXIN}
  303. <a href="javascript:;" class="btn btn-primary we7-margin-left" ng-click="upload('video', true, true)">上传微信视频</a>
  304. {else}
  305. <a href="javascript:;" class="btn btn-primary we7-margin-left" ng-click="upload('video', true, false)">上传服务器视频</a>
  306. {/if}
  307. </div>
  308. <div class="btn-group we7-btn-group">
  309. <a href="{php echo url('platform/material', array('type' => $type, 'server' => MATERIAL_WEXIN))}" class="btn {if $server == MATERIAL_WEXIN} active {/if}">微信</a>
  310. <a href="{php echo url('platform/material', array('type' => $type, 'server' => MATERIAL_LOCAL))}" class="btn {if $server == MATERIAL_LOCAL} active {/if}">服务器</a>
  311. </div>
  312. </div>
  313. <ul class="material-img-list">
  314. {loop $material_list $video}
  315. <li class="material-img-item">
  316. <div class="img-item">
  317. <div class="appimg-info">
  318. {if $server == 'local'}
  319. <i class="wi wi-local pull-right color-default" style="font-size: 20px;"></i>
  320. {else}
  321. <i class="wi wi-wx-circle pull-right color-green" style="font-size: 20px;"></i>
  322. {/if}
  323. <span class="appimg-title">{$video['filename']}</span>
  324. </div>
  325. <div class="img-thumb" style="background-image:url('{php echo tomedia($video['attachment'])}')">
  326. </div>
  327. </div>
  328. <div class="img-opr">
  329. <ul>
  330. {if $server == 'local'}
  331. <li class="img-opr-item">
  332. <a href="javascript:;" class="" ng-click="transToWechat('{$type}', '{$video['id']}')" data-toggle="tooltip" data-placement="bottom" title="转换为微信视频"><i class="wi wi-transform"></i></a>
  333. </li>
  334. {else}
  335. <li class="img-opr-item">
  336. <a href="javascript:;" class="" ng-click="checkGroup('video', {$video['id']})" data-toggle="tooltip" data-placement="bottom" title="群发"><i class="wi wi-send"></i></a>
  337. </li>
  338. {/if}
  339. <li class="img-opr-item">
  340. <a class="" href="javascript:void(0);" ng-click="del_material('{$type}', '{$video['id']}', '{php echo $server == 'local'? local : wechat}')" data-toggle="tooltip" data-placement="bottom" title="删除">&nbsp;<i class="wi wi-delete2"></i></a>
  341. </li>
  342. </ul>
  343. </div>
  344. </li>
  345. {/loop}
  346. </ul>
  347. </div>
  348. {/if}
  349. </div>
  350. <div class="modal fade" id="check-group" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  351. <div class="modal-dialog">
  352. <div class="modal-content">
  353. <div class="modal-header">
  354. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  355. <h4 class="modal-title" id="myModalLabel">选择群发的粉丝组</h4>
  356. </div>
  357. <div class="modal-body">
  358. <select class="form-control" ng-model="group">
  359. <option value="">请选择粉丝组</option>
  360. <option value="-1">全部粉丝</option>
  361. <option ng-repeat="group in groups" value="{{ group.id }}">{{ group.name }}({{ group.count }})</option>
  362. </select>
  363. </div>
  364. <div class="modal-footer">
  365. <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="sendMaterial()">发送</button>
  366. </div>
  367. </div>
  368. </div>
  369. </div>
  370. <!-- Modal -->
  371. <div class="modal fade" id="modalWechatView" tabindex="-1" role="dialog" aria-labelledby="modalWechatViewLabel">
  372. <div class="modal-dialog">
  373. <div class="modal-content">
  374. <div class="modal-header">
  375. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  376. <h4 class="modal-title default-color" id="modalWechatViewLabel">微信预览</h4>
  377. </div>
  378. <div class="modal-body material-content clearfix web-mobile-choice-type">
  379. <div class="material-wechat-view">
  380. <a href="javascript:;" ng-click="wabPreview()" data-url="" class="we7-margin-bottom">
  381. <span class="wi wi-wechat"></span>
  382. <span>网页预览</span>
  383. </a>
  384. <a href="javascript:;" ng-click="mobilePreview()" data-type="" data-media-id="" class="we7-mobile-material-preview">
  385. <span class="wi wi-iphone"></span>
  386. <span>手机预览</span>
  387. </a>
  388. </div>
  389. <div id="weixin-dialog" class="wechat-view-telephone hidden">
  390. <div class="nav">
  391. <span class="wi wi-back-circle color-gray" ng-click="previewBack()"></span>
  392. <a class="color-gray">微信预览</a>
  393. <span class="color-gray">/</span>
  394. <a href="javscript:;" class="color-default">输入微信号</a>
  395. </div>
  396. <form action="" class="form-horizontal">
  397. <div class="form-group we7-margin-top">
  398. <div class="col-sm-12">
  399. <div class="input-group">
  400. <input type="text" id="wxname" name="wxname" class="form-control" placeholder="输入接收人的微信号预览"/>
  401. <span class="input-group-btn">
  402. <button class="btn btn-default btn-send">
  403. 发送
  404. </button>
  405. </span>
  406. </div>
  407. </div>
  408. </div>
  409. </form>
  410. </div>
  411. </div>
  412. <div class="modal-footer">
  413. <button type="button" class="btn btn-primary btn-view" data-dismiss="modal" ng-click="previewBack()">取消</button>
  414. </div>
  415. </div>
  416. </div>
  417. </div>
  418. <!--end 素材:微信预览-->
  419. </div>
  420. <div class="text-right">
  421. {$pager}
  422. </div>
  423. <script>
  424. require(['jquery.wookmark', 'fileUploader'], function() {
  425. //同步素材
  426. angular.module('materialApp').value('config', {
  427. 'del_url' : "{php echo url('platform/material/delete')}",
  428. 'sync_url' : "{php echo url('platform/material/sync')}",
  429. 'send_url' : "{php echo url('platform/material/send')}",
  430. 'create_new_url' : "{php echo url('platform/material-post')}",
  431. 'trans_url' : "{php echo url('platform/material-post/upload_material')}",
  432. 'postwechat_url' : "{php echo url('platform/material-post/upload_news')}",
  433. 'group' : {php echo json_encode($group)},
  434. 'syncNews' : "{$_GPC['sync_news']}",
  435. 'typeName' : "{$_W['account']['type_name']}"
  436. });
  437. angular.bootstrap($('#main'), ['materialApp']);
  438. $('.material-appmsg-list .material-appmsg-item').wookmark({
  439. align: 'center',
  440. autoResize: false,
  441. container: $('.material-appmsg-list'),
  442. itemWidth: 289,
  443. offset: 30
  444. });
  445. });
  446. </script>
  447. {template 'common/footer'}