人人商城

mass.html 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. {template 'common/header'}
  2. <style>
  3. .panel{clear: both;margin-bottom: 20px; position: relative;}
  4. .panel .btn-group{width:100%}
  5. .panel .btn-group .btn{width:33.3334%}
  6. .panel .no{position: absolute; background: #3071a9;width:85px; color:#fff; text-align:center; border-radius:3px; height:25px; line-height:25px; top:-15px; left:-10px}
  7. .panel .info{position: absolute; background: #fb6a59;width:70px; color:#fff; text-align:center; border-radius:100%; height:70px; line-height:70px; top:20%; left:40%}
  8. .panel .success{position: absolute; background: #449d44;width:70px; color:#fff; text-align:center; border-radius:100%; height:70px; line-height:70px; top:20%; left:40%}
  9. .panel .type{position: absolute; background: #CCC; padding:0 5px; color:#fff; text-align:center; border-radius:3px; height:25px; line-height:25px; top:-15px; left:80px}
  10. .panel .type.image{background: #449d44;}
  11. .panel .type.news{background: #fb6a59;}
  12. .panel .type.voice{background: #46b8da;}
  13. .panel .type.video{background: #eea236;}
  14. .reply .panel-group .panel:last-child{margin-bottom: 0;}
  15. .panel-group img{position:absolute; left:0; top:0; display:inline-block; width:100%; height:100%;}
  16. .panel-group{position:relative; cursor:pointer;}
  17. .panel-group .mask{position:absolute; width:100%; height:100%; left:0; top:0; z-index:10; background-color:rgba(0,0,0,0.6 ) !important; text-align:center; display:none; border-radius:4px;}
  18. .panel-group:hover .mask,.panel-group.selected .mask{display:block;}
  19. .panel-group>i{display:none; width:46px; height:46px; color:#fff; text-align:center; line-height:46px; z-index:20; position:absolute; top:50%; left:50%; margin-top:-23px; margin-left:-23px; font-size:46px; font-weight:200;}
  20. .panel-group.selected>i{display:inline-block}
  21. .panel .panel-body .audio-msg{position:relative; padding-left:65px; height:70px;}
  22. .panel .panel-body .audio-msg .icon span{position:absolute; left:0; top:0; background:#ccc; width:60px; height:60px; line-height:60px; vertical-align:middle; display:inline-block; cursor:pointer; font-size: 25px; text-align: center;}
  23. .panel .panel-body .audio-msg .audio-content .audio-title{ width:100%; margin-bottom:10px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
  24. .panel .panel-body .video-content{margin-bottom:10px;}
  25. .panel .panel-body .video-content .title,.panel .panel-body .video-content .abstract{word-break:break-all; overflow:hidden; text-overflow:ellipsis;}
  26. .panel .panel-body .video-content img{max-width:100%; height:140px;}
  27. .panel .panel-body .video-content .video{position:relative; margin:10px 0;}
  28. .panel .panel-body .video-content .video .video-length{display:block; width:100%; padding-right:10px; position:absolute; bottom:0; left:0; line-height:25px; background:rgba(0,0,0,0.5); color:#fff; text-align:right;}
  29. .panel .panel-body .panel-wxcard {position:relative;}
  30. .panel .panel-body .panel-wxcard .wxcard-content{width:100%; height:90px; border-radius:5px; border-bottom-left-radius:0; border-bottom-right-radius:0; border:1px solid #e7e7eb; border-bottom:0; position:relative; background-color:#A9D92C; color:#fff; font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  31. .panel .panel-body .panel-wxcard .wxcard-content img{width:60px; height:60px; position:absolute; top:15px; left:15px;}
  32. .panel .panel-body .panel-wxcard .wxcard-content .title{position:absolute; left:90px; top:30px; font-size:19px}
  33. .panel .panel-body .panel-wxcard .wxcard-footer{background-color:#fff; height:35px; line-height:35px; border:1px solid #e7e7eb; padding:0 10px; border-bottom-left-radius:5px; border-bottom-right-radius:5px;}
  34. .init-hide{display: none}
  35. </style>
  36. <ul class="nav nav-tabs">
  37. <li {if $_GPC['a'] == 'mass' && $do == 'list'}class="active"{/if}><a href="{php echo url('material/mass/')}">定时群发</a></li>
  38. <li {if $_GPC['a'] == 'mass' && $do == 'send'}class="active"{/if}><a href="{php echo url('material/mass/send')}">发送记录</a></li>
  39. </ul>
  40. <div class="alert alert-info">
  41. <strong class="text-danger"><i class="fa fa-info-circle"></i> 该功能是定时群发,如果你需要立即群发,请在素材列表里找到对用的素材直接群发</strong><br>
  42. <i class="fa fa-info-circle"></i> 使用定时群发功能可设置未来7天的群发,使用该功能前请先确保您的云服务可用<br>
  43. <i class="fa fa-info-circle"></i> <strong>如果在提交定时群发提示:某天的群发同步到云服务失败,请手动同步到云服务</strong><br>
  44. <i class="fa fa-info-circle"></i> <strong>使用该功能前,请将微信公众平台的素材同步到本系统</strong><br>
  45. </div>
  46. {if $cloud_error == 1}
  47. <div class="alert alert-danger">
  48. <h4><i class="fa fa-info-circle"></i> {$cloud['message']}</h4>
  49. </div>
  50. {/if}
  51. <form action="" class="form form-horizontal" id="mass-container" ng-controller="mass">
  52. <div class="panel panel-default">
  53. <div class="panel-heading">设置未来7天的群发</div>
  54. <div class="panel-body">
  55. <div class="row clearfix reply">
  56. <div class="col-xs-6 col-sm-3 col-md-3">
  57. <div ng-repeat="item in mass.groups">
  58. <!-- 图文 -->
  59. <div class="panel-group init-hide" ng-if="item.msgtype == 'news'" id="group-{{ $index }}">
  60. <div class="panel panel-default" ng-repeat="media in item.media.items">
  61. <div class="panel-body" ng-if="$index == 0">
  62. <div class="img">
  63. <i class="default">封面图片</i>
  64. <a ng-href="{{media.url}}" target="_blank"><img src="" ng-src="{{media.thumb_url}}"></a>
  65. <span class="text-left" ng-bind="media.title"></span>
  66. </div>
  67. </div>
  68. <div class="panel-body" ng-if="$index != 0">
  69. <a ng-href="{{media.url}}" target="_blank">
  70. <div class="text">
  71. <h4 ng-bind="media.title"></h4>
  72. </div>
  73. <div class="img">
  74. <img src="" ng-src="{{media.thumb_url}}">
  75. <i class="default">缩略图</i>
  76. </div>
  77. </a>
  78. </div>
  79. </div>
  80. <div class="panel panel-default">
  81. <div class="panel-body" style="height:20px; padding-bottom:40px; padding-top:7px; padding-right:15px;">
  82. <div class="btn-group">
  83. <a href="javascript:;" ng-click="mass.purview(item)" class="btn btn-default btn-sm">预览</a>
  84. <a href="javascript:;" ng-click="mass.emptyGroup(item)" ng-disabled="item.status == 0" class="btn btn-default btn-sm">清空</a>
  85. <a href="javascript:;" ng-click="mass.editGroup(item)" ng-disabled="item.status == 0" class="btn btn-default btn-sm">编辑</a>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="no" ng-bind="item.time"></div>
  90. <div class="type news">图文</div>
  91. <div class="info init_hide" ng-show="!item.media_id">未设置</div>
  92. <div class="success init_hide" ng-show="item.status == 0">已发送</div>
  93. </div>
  94. <!-- 图片 -->
  95. <div class="panel-group init-hide" ng-if="item.msgtype == 'image'" id="group-{{ $index }}">
  96. <div class="panel panel-default">
  97. <div class="panel-body">
  98. <div class="img">
  99. <i class="default">封面图片</i>
  100. <img src="" ng-src="{{item.media.attach}}">
  101. </div>
  102. </div>
  103. <div class="no" ng-bind="item.time"></div>
  104. <div class="type image">图片</div>
  105. <div class="info init_hide" ng-show="!item.media_id">未设置</div>
  106. <div class="success init_hide" ng-show="item.status == 0">已发送</div>
  107. </div>
  108. <div class="panel panel-default">
  109. <div class="panel-body" style="height:20px; padding-bottom:40px; padding-top:7px">
  110. <div class="btn-group">
  111. <a href="javascript:;" ng-click="mass.purview(item)" class="btn btn-default btn-sm">预览</a>
  112. <a href="javascript:;" ng-click="mass.emptyGroup(item)" ng-disabled="item.status == 0" class="btn btn-default btn-sm">清空</a>
  113. <a href="javascript:;" ng-click="mass.editGroup(item)" ng-disabled="item.status == 0" class="btn btn-default btn-sm">编辑</a>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <!-- 微信卡券 -->
  119. <div class="panel-group init-hide" ng-if="item.msgtype == 'wxcard'" id="group-{{ $index }}">
  120. <div class="panel panel-default">
  121. <div class="panel-body">
  122. <div class="panel-wxcard">
  123. <div class="wxcard-content" ng-style="{'background-color' : item.media.color}">
  124. <img src="" ng-src="{{item.media.logo_url}}" class="img-circle">
  125. <div class="title">{{item.media.title}}</div>
  126. </div>
  127. <div class="wxcard-footer clearfix">
  128. <div class="pull-right text-muted hide">2015-12-5</div>
  129. <div>{{item.media.brand_name}}</div>
  130. </div>
  131. </div>
  132. </div>
  133. <div class="no" ng-bind="item.time"></div>
  134. <div class="type wxcard">微信卡券</div>
  135. <div class="info init_hide" ng-show="!item.media_id">未设置</div>
  136. <div class="success init_hide" ng-show="item.status == 0">已发送</div>
  137. </div>
  138. <div class="panel panel-default">
  139. <div class="panel-body" style="height:20px; padding-bottom:40px; padding-top:7px">
  140. <div class="btn-group">
  141. <a href="javascript:;" ng-click="mass.purview(item)" class="btn btn-default btn-sm">预览</a>
  142. <a href="javascript:;" ng-click="mass.emptyGroup(item)" ng-disabled="item.status == 0" class="btn btn-default btn-sm">清空</a>
  143. <a href="javascript:;" ng-click="mass.editGroup(item)" ng-disabled="item.status == 0" class="btn btn-default btn-sm">编辑</a>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. <!-- 语音 -->
  149. <div class="init-hide" ng-if="item.msgtype == 'voice'" id="group-{{ $index }}">
  150. <div class="panel panel-default panel-voice">
  151. <div class="panel-body">
  152. <div class="audio-msg">
  153. <div class="icon audio-player-play" data-attach="{{item.media.attach}}"><span><i class="fa fa-play"></i></span></div>
  154. <div class="audio-content">
  155. <div class="audio-title" ng-bind="item.media.filename"></div>
  156. <div class="audio-date text-muted" ng-bind="'创建于:' + item.media.createtime_cn"></div>
  157. </div>
  158. </div>
  159. <div class="btn-group">
  160. <a href="javascript:;" ng-click="mass.purview(item)" class="btn btn-default btn-sm">预览</a>
  161. <a href="javascript:;" ng-click="mass.emptyGroup(item)" ng-disabled="item.status == 0" class="btn btn-default btn-sm">清空</a>
  162. <a href="javascript:;" ng-click="mass.editGroup(item)" ng-disabled="item.status == 0" class="btn btn-default btn-sm">编辑</a>
  163. </div>
  164. </div>
  165. <div class="no" ng-bind="item.time"></div>
  166. <div class="type voice">语音</div>
  167. <div class="info init_hide" ng-show="!item.media_id">未设置</div>
  168. <div class="success init_hide" ng-show="item.status == 0">已发送</div>
  169. </div>
  170. </div>
  171. <!-- 视频 -->
  172. <div class="init-hide" ng-if="item.msgtype == 'video'" id="group-{{ $index }}">
  173. <div class="panel panel-default panel-video">
  174. <div class="panel-body">
  175. <div class="video-content">
  176. <h4 class="title text-muted" ng-bind="item.media.tag.title">{{}}</h4>
  177. <div class="date text-muted" ng-bind="'创建于:' + item.media.createtime_cn"></div>
  178. <div class="video">
  179. <img src="../web/resource/images/banner-bg.png" alt="" />
  180. </div>
  181. <div class="abstract text-muted" ng-bind="item.media.tag.description"></div>
  182. </div>
  183. <div class="btn-group">
  184. <a href="javascript:;" ng-click="mass.purview(item)" class="btn btn-default btn-sm">预览</a>
  185. <a href="javascript:;" ng-click="mass.emptyGroup(item)" ng-disabled="item.status == 0" class="btn btn-default btn-sm">清空</a>
  186. <a href="javascript:;" ng-click="mass.editGroup(item)" ng-disabled="item.status == 0" class="btn btn-default btn-sm">编辑</a>
  187. </div>
  188. </div>
  189. <div class="no" ng-bind="item.time"></div>
  190. <div class="type video">视频</div>
  191. <div class="info init_hide" ng-show="!item.media_id">未设置</div>
  192. <div class="success init_hide" ng-show="item.status == 0">已发送</div>
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. <div class="col-xs-6 col-sm-9 col-md-9 aside" id="edit-container">
  198. <div style="margin-bottom: 20px"></div>
  199. <div class="card">
  200. <div class="arrow-left"></div>
  201. <div class="inner">
  202. <div class="panel panel-default">
  203. <div class="panel-body">
  204. <div class="form-group">
  205. <label class="col-xs-12 col-sm-3 col-md-2 control-label">接收粉丝</label>
  206. <div class="col-sm-9 col-xs-12">
  207. <label class="radio-inline"><input type="radio" name="group" value="-1" ng-model="mass.activeGroup.group"/> 全部粉丝</label>
  208. {loop $groups $group}
  209. <label class="radio-inline"><input type="radio" name="group" value="{$group['id']}" ng-model="mass.activeGroup.group"/> {$group['name']}【{$group['count']}】</label>
  210. {/loop}
  211. </div>
  212. </div>
  213. <div class="form-group">
  214. <label class="col-xs-12 col-sm-3 col-md-2 control-label">消息内容</label>
  215. <div class="col-sm-9 col-xs-12">
  216. <div class="col-xs-3 img init-hide" ng-if="!mass.activeGroup.media_id">
  217. <span ng-click="mass.changeMedia()"><i class="fa fa-plus-circle green"></i>&nbsp;选择素材</span>
  218. </div>
  219. <div class="col-xs-3 img init-hide" ng-if="mass.activeGroup.media_id">
  220. <div class="init-hide" ng-if="mass.activeGroup.msgtype == 'image'">
  221. <h3 ng-click="mass.changeMedia()">重新选择</h3>
  222. <span><i class="fa fa-image-o"></i>图片素材</span>
  223. </div>
  224. <div class="init-hide" ng-if="mass.activeGroup.msgtype == 'voice'">
  225. <h3 ng-click="mass.changeMedia()">重新选择</h3>
  226. <span><i class="fa file-audio-o"></i>语音素材</span>
  227. </div>
  228. <div class="init-hide" ng-if="mass.activeGroup.msgtype == 'video'">
  229. <h3 ng-click="mass.changeMedia()">重新选择</h3>
  230. <span><i class="fa fa-movie-o"></i>视频素材</span>
  231. </div>
  232. <div class="init-hide" ng-if="mass.activeGroup.msgtype == 'news'">
  233. <h3 ng-click="mass.changeMedia()">重新选择</h3>
  234. <span><i class="fa fa-word-o"></i>图文素材</span>
  235. </div>
  236. <div class="init-hide" ng-if="mass.activeGroup.msgtype == 'wxcard'">
  237. <h3 ng-click="mass.changeMedia()">重新选择</h3>
  238. <span><i class="fa fa-word-o"></i>微信卡券</span>
  239. </div>
  240. </div>
  241. </div>
  242. </div>
  243. <div class="form-group">
  244. <label class="col-xs-12 col-sm-3 col-md-2 control-label">发送时间</label>
  245. <div class="col-sm-3">
  246. <div class="input-group clockpicker">
  247. <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
  248. <input type="text" readonly name="clock" ng-model="mass.activeGroup.clock" class="form-control">
  249. </div>
  250. <span class="help-block text-danger">特别注意:发送时间不能小于当前时间.不要超过晚上11点</span>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. {if !$cloud_error}
  262. <div class="btn btn-primary" ng-click="mass.submit()" id="submit">提交</div>
  263. {else}
  264. <div class="btn btn-danger" disabled>云服务错误</div>
  265. {/if}
  266. </form>
  267. <!-- 群发预览 -->
  268. <div class="modal fade" id="modal-view" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  269. <form action="">
  270. <div class="modal-dialog" role="document">
  271. <div class="modal-content">
  272. <div class="modal-header">
  273. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  274. <h4 class="modal-title">请输入接受人的微信号</h4>
  275. </div>
  276. <div class="modal-body">
  277. <div class="form-group">
  278. <label for="wxname">微信号</label>
  279. <input type="text" class="form-control" id="wxname" name="wxname">
  280. <span class="help-block">微信号不能为空</span>
  281. </div>
  282. </div>
  283. <div class="modal-footer">
  284. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  285. <button type="button" class="btn btn-primary btn-view">发送</button>
  286. </div>
  287. </div>
  288. </div>
  289. </form>
  290. </div>
  291. <script>
  292. require(['angular.sanitize', 'bootstrap', 'underscore', 'jquery.wookmark', 'jquery.jplayer', 'clockpicker'], function(angular, $, _){
  293. $('.init-hide').show();
  294. $('.clockpicker').clockpicker({autoclose: true});
  295. angular.module('app', ['ngSanitize']).controller('mass', function($scope, $http){
  296. $scope.mass = {};
  297. $scope.mass.groups = {php echo json_encode($mass);};
  298. $scope.mass.activeType = 'news';
  299. $scope.mass.activeIndex = 0;
  300. $scope.mass.activeGroup = $scope.mass.groups[$scope.mass.activeIndex];
  301. $('.clockpicker').clockpicker()
  302. .find('input').change(function(){
  303. $scope.mass.activeGroup.clock = this.value;
  304. });
  305. $scope.mass.submit = function(){
  306. var error = {errno: 1, message: ''};
  307. $('#submit').addClass('disabled');
  308. $http.post("{php echo url('material/mass/post');}", {data: $scope.mass.groups}).success(function(dat, status){
  309. if(!dat.message.errno) {
  310. util.message('设置群发成功', "{php echo url('material/mass/send');}", 'success');
  311. } else if(dat.message.errno == -1000) {
  312. util.message('存在没有同步到云服务的群发,现在跳转到手动同步页面:<br>' + dat.message.message, "{php echo url('material/mass/send');}", 'error');
  313. } else {
  314. $('#submit').removeClass('disabled');
  315. util.message('设置群发失败:<br>' + dat.message.message, "", 'error');
  316. }
  317. return false;
  318. });
  319. };
  320. $scope.mass.emptyGroup = function(item){
  321. $scope.mass.editGroup(item);
  322. if($scope.mass.activeGroup.id > 0) {
  323. if(!confirm('确认清空这条群发吗?')) {
  324. return false;
  325. }
  326. $http.post("{php echo url('material/mass/del');}", {id: $scope.mass.activeGroup.id}).success(function(dat, status){
  327. if(!dat.message.errno) {
  328. $scope.mass.activeGroup.msgtype = 'news';
  329. $scope.mass.activeGroup.group = '-1';
  330. $scope.mass.activeGroup.media_id = '';
  331. $scope.mass.activeGroup.media.items = [{title: '请选择素材'}];
  332. } else {
  333. util.message('清空群发失败:<br>' + dat.message.message, "", 'error');
  334. }
  335. });
  336. } else {
  337. $scope.mass.activeGroup.msgtype = 'news';
  338. $scope.mass.activeGroup.group = '-1';
  339. $scope.mass.activeGroup.media_id = '';
  340. $scope.mass.activeGroup.media.items = [{title: '请选择素材'}];
  341. }
  342. return false;
  343. }
  344. $scope.mass.purview = function(item){
  345. $scope.mass.editGroup(item);
  346. if(!$scope.mass.activeGroup.media_id) {
  347. util.message('请先设置素材', '', 'error');
  348. return false;
  349. }
  350. var media_id = $scope.mass.activeGroup.media_id;
  351. var type = $scope.mass.activeGroup.msgtype;
  352. $('#modal-view').modal('show');
  353. $('#modal-view .btn-view').unbind().click(function(){
  354. var wxname = $.trim($('#modal-view #wxname').val());
  355. if(!wxname) {
  356. util.message('微信号不能为空', '', 'error');
  357. return false;
  358. }
  359. $('#modal-view').modal('hide');
  360. $.post("{php echo url('material/display/purview/');}", {media_id: media_id, wxname: wxname, type: type}, function(data){
  361. if(data != 'success') {
  362. util.message(data, '', 'error');
  363. } else {
  364. util.message('发送成功', '', 'success');
  365. }
  366. });
  367. return false;
  368. });
  369. }
  370. $scope.mass.editGroup = function(item){
  371. var index = $.inArray(item, $scope.mass.groups);
  372. if(index == -1) return false;
  373. var top = $('#group-' + index).offset().top;
  374. $('#edit-container').css('marginTop', top - 220);
  375. $("html,body").animate({scrollTop: top-80}, 500);
  376. $scope.mass.activeIndex = index;
  377. $scope.mass.activeGroup = $scope.mass.groups[$scope.mass.activeIndex];
  378. }
  379. $scope.mass.changeMedia = function(){
  380. if($scope.mass.activeGroup.status == 0) {
  381. util.message($scope.mass.activeGroup.time + '群发已经发送,不能编辑');
  382. return false;
  383. }
  384. util.material(function(material){
  385. if(!material.media_id) {
  386. util.message('素材media_id为空,请选择其他素材');
  387. return false;
  388. }
  389. $scope.mass.activeGroup.msgtype = material.type;
  390. $scope.mass.activeGroup.media_id = material.media_id;
  391. $scope.mass.activeGroup.media = material;
  392. $scope.mass.activeGroup.attach_id = material.id;
  393. $scope.$apply();
  394. });
  395. }
  396. $scope.mass.playaudio = function(){
  397. $("#voice, .panel").on('click', '.audio-player-play', function(){
  398. var src = $(this).data("attach");
  399. if(!src) {
  400. return;
  401. }
  402. if ($("#player")[0]) {
  403. var player = $("#player");
  404. } else {
  405. var player = $('<div id="player"></div>');
  406. $(document.body).append(player);
  407. }
  408. player.data('control', $(this));
  409. player.jPlayer({
  410. playing: function() {
  411. $(this).data('control').find("i").removeClass("fa-play").addClass("fa-stop");
  412. },
  413. pause: function (event) {
  414. $(this).data('control').find("i").removeClass("fa-stop").addClass("fa-play");
  415. },
  416. swfPath: "resource/components/jplayer",
  417. supplied: "mp3,wma,wav,amr",
  418. solution: "html, flash"
  419. });
  420. player.jPlayer("setMedia", {mp3: $(this).data("attach")}).jPlayer("play");
  421. if($(this).find("i").hasClass("fa-stop")) {
  422. player.jPlayer("stop");
  423. } else {
  424. $('.audio-msg').find('.fa-stop').removeClass("fa-stop").addClass("fa-play");
  425. player.jPlayer("setMedia", {mp3: $(this).data("attach")}).jPlayer("play");
  426. }
  427. });
  428. }
  429. $scope.mass.playaudio();
  430. });
  431. angular.bootstrap($('#mass-container')[0], ['app']);
  432. });
  433. </script>
  434. {template 'common/footer'}