人人商城

goodspost.html 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. {template 'header'}
  2. <div id="js-goods-post" ng-controller="goodsPostCtrl" ng-cloak>
  3. <!--编辑模块-->
  4. <ol class="breadcrumb we7-breadcrumb">
  5. <a href="javascript:history.back()"><i class="wi wi-back-circle"></i> </a>
  6. <li>商品列表</li>
  7. <li>编辑设置</li>
  8. </ol>
  9. <form action="" class="we7-form" method="post">
  10. <input type="hidden" name="type" value="{$type}">
  11. {if $type == STORE_TYPE_API}
  12. <table class="table we7-table table-hover table-form">
  13. <col width="140px"/>
  14. <col />
  15. <col width="140px"/>
  16. <tr>
  17. <th colspan="3">编辑API商品信息</th>
  18. </tr>
  19. <tr>
  20. <td class="table-label">API商品价格</td>
  21. <td><span ng-bind="goodsInfo.price"></span> 元 / <span ng-bind="goodsInfo.api_num"></span>万次</td>
  22. <td class="text-right">
  23. <div class="link-group">
  24. <a href="javascript:;" data-toggle="modal" data-target="#add_api">修改</a>
  25. </div>
  26. </td>
  27. </tr>
  28. </table>
  29. <div class="modal fade" id="add_api" tabindex="-1" role="dialog" aria-hidden="true">
  30. <div class="we7-modal-dialog modal-dialog we7-form">
  31. <div class="modal-content">
  32. <div class="modal-header">
  33. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  34. <div class="modal-title">编辑API商品</div>
  35. </div>
  36. <div class="modal-body">
  37. <div class="form-group">
  38. <label class="control-label col-sm-2">商品名称</label>
  39. <div class="col-sm-10">
  40. <div class="input-group">
  41. <input type="text" class="form-control" value="应用访问流量(API)" readonly>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label class="control-label col-sm-2">浏览次数</label>
  47. <div class="col-sm-10">
  48. <div class="input-group">
  49. <input type="text" name="api_num" ng-model="goodsInfo.api_num" class="form-control">
  50. <span class="input-group-addon">万次</span>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="form-group">
  55. <label class="control-label col-sm-2">设置价格</label>
  56. <div class="col-sm-10">
  57. <div class="input-group">
  58. <input type="text" name="price" ng-model="goodsInfo.price" class="form-control">
  59. <span class="input-group-addon">元</span>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="user-group-price-content"></div>
  64. <div class="form-group" ng-if="userGroups">
  65. <label class="control-label col-sm-2"></label>
  66. <div class="col-sm-8">
  67. <div class="input-group-btn">
  68. <button type="button" class="btn btn-default" style="color: #999;border-style: dashed" ng-click="addGroupPrice()">
  69. + 添加用户组价格
  70. </button>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="modal-footer">
  76. <input type="hidden" name="token" value="{$_W['token']}">
  77. <input type="submit" class="btn btn-primary" name="submit" value="保存">
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. {else}
  83. {if $type != STORE_TYPE_PACKAGE && $type != STORE_TYPE_USER_PACKAGE}
  84. <div class="form-group">
  85. <label class="control-label col-sm-2">商品名称</label>
  86. <div class="col-sm-8">
  87. <div class="input-group">
  88. {if $type == STORE_TYPE_ACCOUNT}
  89. <input type="text" name="title" class="form-control" value="公众号" readonly>
  90. {elseif $type == STORE_TYPE_WXAPP}
  91. <input type="text" name="title" class="form-control" value="小程序" readonly>
  92. {elseif $type == STORE_TYPE_WXAPP_RENEW}
  93. <input type="text" name="title" class="form-control" value="小程序续费" readonly>
  94. {elseif $type == STORE_TYPE_ACCOUNT_RENEW}
  95. <input type="text" name="title" class="form-control" value=" 公众号续费" readonly>
  96. {else}
  97. <input type="text" name="title" class="form-control" ng-model="goodsInfo.title" readonly>
  98. {/if}
  99. </div>
  100. </div>
  101. </div>
  102. {/if}
  103. <div class="form-group">
  104. <label class="control-label col-sm-2">设置价格</label>
  105. <div class="col-sm-8">
  106. <div class="input-group">
  107. <input type="number" class="form-control" min="0" name="price" ng-model="goodsInfo.price" step="0.01">
  108. <span class="input-group-addon">元 /</span>
  109. <div class="input-group-btn">
  110. <input type="hidden" name="unit" value="{$goods_info['unit']}">
  111. {if $type == STORE_TYPE_ACCOUNT_RENEW}
  112. <input name="account_num" class="form-control" value="{$goods_info['account_num']}" ng-model="num">
  113. {elseif $type == STORE_TYPE_WXAPP_RENEW}
  114. <input name="wxapp_num" class="form-control" value="{$goods_info['wxapp_num']}" ng-modle="num">
  115. {/if}
  116. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  117. <span ng-if="unit == 'day'">日</span>
  118. <span ng-if="unit == 'month'">月</span>
  119. <span ng-if="unit == 'year'">年</span>
  120. <span class="caret"></span></button>
  121. <ul class="dropdown-menu dropdown-menu-right" style="min-width: 60px;">
  122. <li><a href="#" ng-click="changeUnit('day')">日</a></li>
  123. <li><a href="#" ng-click="changeUnit('month')">月</a></li>
  124. <li><a href="#" ng-click="changeUnit('year')">年</a></li>
  125. </ul>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. <div class="user-group-price-content"></div>
  131. {if $type != STORE_TYPE_USER_PACKAGE}
  132. <div class="form-group" ng-if="userGroups">
  133. <label class="control-label col-sm-2"></label>
  134. <div class="col-sm-8">
  135. <div class="input-group-btn">
  136. <button type="button" class="btn btn-default" style="color: #999;border-style: dashed" ng-click="addGroupPrice()">
  137. + 添加用户组价格
  138. </button>
  139. </div>
  140. </div>
  141. </div>
  142. {/if}
  143. {if in_array($type, array(STORE_TYPE_MODULE, STORE_TYPE_WXAPP_MODULE))}
  144. <div class="form-group">
  145. <label class="control-label col-sm-2">幻灯片</label>
  146. <div class="col-sm-8">
  147. <div class="panel we7-panel">
  148. <div class="panel-body">
  149. <div class="batch-img">
  150. <div class="img-container" ng-repeat="slide in slideLists" ng-if="slideLists">
  151. <input type="hidden" name="slide[]" value="{{slide}}">
  152. <img ng-src="{{slide}}" >
  153. <div class="del" ng-click="delSlide($index)">删除</div>
  154. </div>
  155. <div class="img-container add" ng-click="addSlide()" ng-if="slideLists.length < 10">
  156. <span class="wi wi-registersite"></span>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. <div class="form-group">
  164. <label class="control-label col-sm-2">应用详情</label>
  165. <div class="col-sm-8">
  166. {php echo tpl_ueditor('description', $goods_info['description']);}
  167. </div>
  168. </div>
  169. {elseif in_array($type, array(STORE_TYPE_ACCOUNT, STORE_TYPE_WXAPP))}
  170. <div class="form-group">
  171. <label class="control-label col-sm-2">{if $type == STORE_TYPE_ACCOUNT}公众号{else}小程序{/if}个数</label>
  172. <div class="col-sm-8">
  173. <div class="input-group">
  174. {if $type == STORE_TYPE_ACCOUNT}
  175. <input type="number" class="form-control" name="account_num" ng-value="goodsInfo.account_num">
  176. {else}
  177. <input type="number" class="form-control" name="wxapp_num" ng-value="goodsInfo.wxapp_num">
  178. {/if}
  179. <span class="input-group-addon">个</span>
  180. </div>
  181. </div>
  182. </div>
  183. {elseif $type == STORE_TYPE_PACKAGE}
  184. <div class="form-group">
  185. <label class="control-label col-sm-2">应用权限组</label>
  186. <div class="col-sm-8">
  187. <div class="input-group">
  188. <select class="we7-select" name="module_group">
  189. {loop $module_groups $group}
  190. <option value="{$group['id']}" {if !empty($goods_info) && $goods_info['module_group'] == $group['id']}selected{/if}>
  191. {$group['name']}
  192. </option>
  193. {/loop}
  194. </select>
  195. </div>
  196. </div>
  197. </div>
  198. {elseif $type == STORE_TYPE_USER_PACKAGE}
  199. <div class="form-group">
  200. <label class="control-label col-sm-2">用户权限组</label>
  201. <div class="col-sm-8">
  202. <div class="input-group">
  203. <select class="we7-select" name="user_group">
  204. {loop $user_groups $group}
  205. <option value="{$group['id']}" {if !empty($goods_info) && $goods_info['user_group'] == $group['id']}selected{/if}>
  206. {$group['name']}
  207. </option>
  208. {/loop}
  209. </select>
  210. </div>
  211. </div>
  212. </div>
  213. {/if}
  214. <div class="form-group">
  215. <label class="control-label col-sm-2"></label>
  216. <div class="col-sm-8">
  217. <input type="hidden" name="token" value="{$_W['token']}">
  218. <input type="submit" class="btn btn-primary" name="submit" value="仅保存">
  219. <input type="submit" class="btn btn-primary" name="submit" value="保存并上架">
  220. </div>
  221. </div>
  222. {/if}
  223. </form>
  224. </div>
  225. <script>
  226. angular.module('storeApp').value('config', {
  227. 'goodsInfo': {php echo !empty($goods_info) ? json_encode($goods_info) : 'null'},
  228. 'userGroups': {php echo !empty($user_groups) ? json_encode($user_groups) : 'null'},
  229. });
  230. angular.bootstrap($('#js-goods-post'), ['storeApp']);
  231. </script>
  232. {template 'common/footer'}