人人商城

goodsseller.html 11KB

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