goodsseller.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. {template 'header'}
  2. <div id="js-goods-seller" ng-controller="goodsSellerCtrl" ng-cloak>
  3. <ul class="we7-page-tab">
  4. <li {if $type == STORE_TYPE_MODULE || empty($type)}class="active"{/if}><a href="{php echo $this->createWebUrl('goodsSeller', array('type' => STORE_TYPE_MODULE,'direct' => '1'))}">应用模块</a></li>
  5. <li {if $type == STORE_TYPE_WXAPP_MODULE}class="active"{/if}><a href="{php echo $this->createWebUrl('goodsSeller', array('type' => STORE_TYPE_WXAPP_MODULE,'direct' => '1'))}">小程序模块</a></li>
  6. <li {if $type == STORE_TYPE_ACCOUNT}class="active"{/if}><a href="{php echo $this->createWebUrl('goodsSeller', array('type' => STORE_TYPE_ACCOUNT,'direct' => '1'))}">公众号个数</a></li>
  7. <li {if $type == STORE_TYPE_WXAPP}class="active"{/if}><a href="{php echo $this->createWebUrl('goodsSeller', array('type' => STORE_TYPE_WXAPP,'direct' => '1'))}">小程序个数</a></li>
  8. <li {if $type == STORE_TYPE_API}class="active"{/if}><a href="{php echo $this->createWebUrl('goodsSeller', array('type' => STORE_TYPE_API,'direct' => '1'))}">API浏览次数</a></li>
  9. <li {if $type == STORE_TYPE_PACKAGE}class="active"{/if}><a href="{php echo $this->createWebUrl('goodsSeller', array('type' => STORE_TYPE_PACKAGE,'direct' => '1'))}">应用权限组</a></li>
  10. <li {if $type == STORE_TYPE_ACCOUNT_RENEW}class="active"{/if}><a href="{php echo $this->createWebUrl('goodsSeller', array('type' => STORE_TYPE_ACCOUNT_RENEW,'direct' => '1'))}">公众号续费</a></li>
  11. <li {if $type == STORE_TYPE_WXAPP_RENEW}class="active"{/if}><a href="{php echo $this->createWebUrl('goodsSeller', array('type' => STORE_TYPE_WXAPP_RENEW,'direct' => '1'))}">小程序续费</a></li>
  12. </ul>
  13. {if in_array($type, array(STORE_TYPE_MODULE, STORE_TYPE_WXAPP_MODULE))}
  14. <form action="" class="form-inline clearfix we7-margin-bottom" method="post">
  15. <input type="hidden" class="online" value="{$status}">
  16. <div class="input-group form-group" style="width: 400px;">
  17. <input type="text" name="keyword" value="{$keyword}" class="form-control" placeholder="搜索">
  18. <span class="input-group-btn"><button class="btn btn-default"><i class="fa fa-search"></i></button></span>
  19. </div>
  20. </form>
  21. {/if}
  22. {if in_array($type, array(STORE_TYPE_MODULE, STORE_TYPE_WXAPP_MODULE))}
  23. <button class="pull-right btn btn-primary" ng-click="showModule()">添加</button>
  24. {elseif $type == STORE_TYPE_ACCOUNT}
  25. <a class="pull-right btn btn-primary" href="{php echo $this->createWebUrl('goodspost', array('direct' => 1, 'type' => STORE_TYPE_ACCOUNT))}">添加</a>
  26. {elseif $type == STORE_TYPE_WXAPP}
  27. <a class="pull-right btn btn-primary" href="{php echo $this->createWebUrl('goodspost', array('direct' => 1, 'type' => STORE_TYPE_WXAPP))}">添加</a>
  28. {elseif $type == STORE_TYPE_API}
  29. <a class="pull-right btn btn-primary" href="javascript:;" data-toggle="modal" data-target="#add_api">添加</a>
  30. {elseif $_GPC['type'] == STORE_TYPE_PACKAGE}
  31. <a class="pull-right btn btn-primary" href="{php echo $this->createWebUrl('goodspost', array('direct' => 1, 'type' => STORE_TYPE_PACKAGE))}">添加</a>
  32. {else}
  33. <a class="pull-right btn btn-primary" href="{php echo $this->createWebUrl('goodspost', array('direct' => 1, 'type' => $type))}">添加</a>
  34. {/if}
  35. <div class="btn-group we7-btn-group we7-margin-bottom">
  36. <a href="{php echo $this->createWebUrl('goodsSeller', array('direct' => 1, 'type' => $type))}" class="btn" ng-class="{'active': status}">已上架</a>
  37. <a href="{php echo $this->createWebUrl('goodsSeller', array('online' => STATUS_OFF, 'type' => $type, 'direct' => 1))}" class="btn" ng-class="{'active': !status}">未上架</a>
  38. </div>
  39. <table class="table we7-table vertical-middle">
  40. <col width="105px"/>
  41. <col/>
  42. <col width="170px"/>
  43. <col width="220px"/>
  44. <tr>
  45. <th colspan="2">应用信息</th>
  46. <th>单价</th>
  47. <th class="text-right">操作</th>
  48. </tr>
  49. {if !empty($goods_list)}
  50. {loop $goods_list $goods}
  51. <tr>
  52. <td>
  53. {if $_GPC['type'] == STORE_TYPE_API}
  54. <div class="icon icon-api"><span class="wi wi-api"></span></div>
  55. {elseif in_array($_GPC['type'], array(STORE_TYPE_PACKAGE, STORE_TYPE_ACCOUNT, STORE_TYPE_WXAPP, STORE_TYPE_ACCOUNT_RENEW, STORE_TYPE_WXAPP_RENEW))}
  56. <div class="icon icon-api"><span class="wi wi-appjurisdiction"></span></div>
  57. {else}
  58. <img src="{$goods['module_info']['logo']}" alt="" width="60" height="60"/>
  59. {/if}
  60. </td>
  61. <td>
  62. <div class="we7-margin-bottom-sm">
  63. {if $type == STORE_TYPE_PACKAGE}
  64. {$groups[$goods['module_group']]['name']}
  65. {elseif $type == STORE_TYPE_WXAPP}
  66. 创建{$goods['wxapp_num']}个小程序
  67. {elseif $type == STORE_TYPE_ACCOUNT}
  68. 创建{$goods['account_num']}个公众号
  69. {else}
  70. {$goods['title']}
  71. {/if}</div>
  72. <div class="color-gray text-over" style="width:460px">{$good['description']}</div>
  73. </td>
  74. <td>
  75. {$goods['price']}元 /
  76. {if $goods['unit'] == 'month'}{if $type == STORE_TYPE_ACCOUNT_RENEW}{$goods['account_num']}{elseif $type == STORE_TYPE_WXAPP_RENEW}{$goods['wxapp_num']}{/if}月
  77. {elseif $goods['unit'] == 'ten_thousand'}
  78. {$goods['api_num']}万次
  79. {elseif $goods['unit'] == 'day'}{if $type == STORE_TYPE_ACCOUNT_RENEW}{$goods['account_num']}{elseif $type == STORE_TYPE_WXAPP_RENEW}{$goods['wxapp_num']}{/if}天
  80. {elseif $goods['unit'] == 'year'}{if $type == STORE_TYPE_ACCOUNT_RENEW}{$goods['account_num']}{elseif $type == STORE_TYPE_WXAPP_RENEW}{$goods['wxapp_num']}{/if}年
  81. {/if}
  82. </td>
  83. <td ng-if="!status">
  84. <div class="link-group">
  85. <a href="{php echo $this->createWebUrl('goodspost', array('id' => $goods['id'], 'type' => $type, 'direct' => 1))}">编辑</a>
  86. <a href="{php echo $this->createWebUrl('goodsseller', array('operate' => 'changestatus', 'id' => $goods['id'], 'direct' => 1))}">上架</a>
  87. <a href="{php echo $this->createWebUrl('goodsseller', array('operate' => 'delete', 'id' => $goods['id'], 'direct' => 1))}" class="del">删除</a>
  88. </div>
  89. </td>
  90. <td ng-if="status">
  91. <div class="link-group">
  92. <a href="{php echo $this->createWebUrl('goodspost', array('id' => $goods['id'], 'type' => $type, 'direct' => 1))}">编辑</a>
  93. <a href="{php echo $this->createWebUrl('goodsseller', array('operate' => 'changestatus', 'id' => $goods['id'], 'direct' => 1))}">下架</a>
  94. </div>
  95. </td>
  96. </tr>
  97. {/loop}
  98. {else}
  99. <tr>
  100. <td colspan="4" class="text-center">暂无数据</td>
  101. </tr>
  102. {/if}
  103. </table>
  104. <div class="pull-right">
  105. {$pager}
  106. </div>
  107. <div class="uploader-modal modal fade module" id="add_module" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  108. <div class="modal-dialog modal-dialog modal-lg we7-modal-dialog">
  109. <div class="modal-content">
  110. <div class="modal-header">
  111. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  112. <h4 class="modal-title">模块(点击添加)</h4>
  113. </div>
  114. <div class="modal-body material-content clearfix">
  115. <div class="material-head">
  116. <div class="form-horizontal clearfix">
  117. <div class="input-group pull-left col-sm-4">
  118. <input type="search" ng-model='keyword' class="form-control" placeholder="搜索关键字"/>
  119. <span class="input-group-btn"><button type="button" class="btn btn-default"><i class="wi wi-search"></i></button></span>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="material-body">
  124. <div class="row">
  125. <div class="col-sm-2 select-module" ng-repeat="module in moduleList | filter:keyword">
  126. <div class="item">
  127. <img ng-src="{{module.logo}}" class="icon" ng-click="selectModule(module, $event)">
  128. <div class="name text-center">{{module.title}}</div>
  129. <div class="mask">
  130. <span class="wi wi-right"></span>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="modal-footer">
  138. <button type="button" class="btn btn-primary" ng-click="editPrice('add_module')">编辑价格</button>
  139. <button type="button" class="btn btn-primary" ng-click="toOffline('add_module')">添加到未上架</button>
  140. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="modal fade" id="add_api" tabindex="-1" role="dialog" aria-hidden="true">
  146. <div class="we7-modal-dialog modal-dialog we7-form">
  147. <div class="modal-content">
  148. <div class="modal-header">
  149. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  150. <div class="modal-title">添加API商品</div>
  151. </div>
  152. <div class="modal-body">
  153. <div class="form-group">
  154. <label class="control-label col-sm-2">商品名称</label>
  155. <div class="col-sm-10">
  156. <div class="input-group">
  157. <input type="text" class="form-control" value="API商品" readonly>
  158. </div>
  159. </div>
  160. </div>
  161. <div class="form-group">
  162. <label class="control-label col-sm-2">浏览次数</label>
  163. <div class="col-sm-10">
  164. <div class="input-group">
  165. <input type="text" ng-model="visitTimes" class="form-control">
  166. <span class="input-group-addon">万次</span>
  167. </div>
  168. </div>
  169. </div>
  170. <div class="form-group">
  171. <label class="control-label col-sm-2">设置价格</label>
  172. <div class="col-sm-10">
  173. <div class="input-group">
  174. <input type="text" ng-model="visitPrice" class="form-control">
  175. <span class="input-group-addon">元</span>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. <div class="modal-footer">
  181. <button type="button" class="btn btn-primary" ng-click="editPrice('add_api')">保存并上架</button>
  182. <button type="button" class="btn btn-primary" ng-click="toOffline('add_api')">保存至未上架</button>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. <script>
  189. angular.module('storeApp').value('config', {
  190. 'status' : {php echo $status},
  191. 'goodsList': {php echo !empty($goods_list) ? json_encode($goods_list) : 'null'},
  192. 'moduleList': {php echo !empty($module_list) ? json_encode($module_list) : 'null'},
  193. 'token': {php echo json_encode($_W['token'])},
  194. 'links': {
  195. 'changestatus': "{php echo $this->createWebUrl('goodsSeller', array('operate' => 'changestatus', 'direct' => 1))}",
  196. 'add': "{php echo $this->createWebUrl('goodsPost', array('operate' => 'add', 'type' => $type,'direct' => 1))}",
  197. 'online': "{php echo $this->createWebUrl('goodsSeller', array('online' => 1, 'type' => $type, 'direct' => 1))}",
  198. 'offline': "{php echo $this->createWebUrl('goodsSeller', array('online' => '0', 'type' => $type, 'direct' => 1))}",
  199. 'post': "{php echo $this->createWebUrl('goodsPost', array('direct' => 1, 'type' => $_GPC['type'], ))}",
  200. }
  201. });
  202. angular.bootstrap($('#js-goods-seller'), ['storeApp']);
  203. </script>
  204. {template 'common/footer'}