人人商城

member.html 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. {template 'common/header'}
  2. <style>
  3. .label{line-height: 1.8}
  4. </style>
  5. {template 'mc/common'}
  6. {if $do == 'display'}
  7. <div class="alert we7-page-alert">
  8. <p><i class="wi wi-info-sign"></i> 当前会员总数:<strong class="text-danger">{$stat['total']}</strong>。今日新增会员:<strong class="text-danger">{$stat['today']}</strong>。昨日新增会员:<strong class="text-danger">{$stat['yesterday']}</strong>。<br></p>
  9. <p><strong class="text-danger">
  10. <i class="wi wi-info-sign"></i> 会员的总积分 = 账户积分 + 账户贡献. 会员所在的会员组是根据 "总积分的多少" 和 "会员组的变更规则" (<根据总积分多少自动升价> 或 <根据总积分多少只升不降>) 自动匹配.<br>
  11. </strong></p>
  12. </div>
  13. <div class="panel we7-panel" ng-app="member" ng-controller="display" ng-cloak>
  14. <div class="panel-heading">筛选</div>
  15. <div class="panel-body we7-padding">
  16. <form action="./index.php" method="get" class="we7-form" role="form">
  17. <input type="hidden" name="c" value="mc">
  18. <input type="hidden" name="a" value="member">
  19. <input type="hidden" name="version_id" value="{$_GPC['version_id']}">
  20. <div class="form-group">
  21. <label class="col-sm-2 control-label">昵称/姓名/手机号码/openid</label>
  22. <div class="col-sm-5">
  23. <div class="input-group">
  24. <div class="input-group-btn">
  25. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  26. {{ searchMod == 2 ? '模糊' : '精准' }}
  27. <span class="caret"></span>
  28. </button>
  29. <ul class="dropdown-menu" role="menu" style="width: 10px;">
  30. <li><a href="javascript:;" ng-click="setSearchMod('2')">模糊</a></li>
  31. <li><a href="javascript:;" ng-click="setSearchMod('1')">精准</a></li>
  32. </ul>
  33. </div>
  34. <input type="text" class="form-control" name="username" value="{$_GPC['username']}" />
  35. <input type="text" name="search_mod" ng-model="searchMod" style="display:none;"/>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <label class="col-sm-2 control-label">注册时间</label>
  41. <div class="col-sm-5">
  42. {php echo tpl_form_field_daterange('datelimit', array('start' => $_GPC['datelimit']['start'],'end' => $_GPC['datelimit']['end']), false)}
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label class="col-sm-2 control-label">所属用户组</label>
  47. <div class="col-sm-5">
  48. <select name="groupid" class="form-control">
  49. <option value="" selected="selected">不限</option>
  50. {loop $groups $group}
  51. <option value="{$group['groupid']}"{if $group['groupid'] == $_GPC['groupid']} selected="selected"{/if}>{$group['title']}</option>
  52. {/loop}
  53. </select>
  54. </div>
  55. <div class="pull-right col-sm-5">
  56. <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
  57. <input type="hidden" name="token" value="{$_W['token']}"/>
  58. <input class="btn btn-primary" type="submit" name="export_submit" id="export_submit" value="导出">
  59. <a href="{php echo url('mc/member/add');}" class="btn btn-primary">添加会员</a>
  60. </div>
  61. </div>
  62. </form>
  63. </div>
  64. </div>
  65. <script>
  66. angular.module('member', []).controller('display', function($scope) {
  67. $scope.searchMod = "{$search_mod}";
  68. $scope.setSearchMod = function(type) {
  69. $scope.searchMod = type;
  70. };
  71. });
  72. </script>
  73. <form method="post" class="we7-form" id="form1">
  74. <table class="table we7-table table-hover vertical-middle">
  75. <input type="hidden" name="do" value="del" />
  76. <col width="40px"/>
  77. <col width="90px"/>
  78. <col width="150px"/>
  79. <col />
  80. <col />
  81. <col />
  82. <col width="90px"/>
  83. <col width="210px"/>
  84. <tr>
  85. <th class="text-left">删除</th>
  86. <th >会员编号</th>
  87. <th>昵称/真实姓名</th>
  88. <th>手机</th>
  89. <th >邮箱</th>
  90. <th class="text-left">{$creditnames['credit2']['title']}/{$creditnames['credit1']['title']}</th>
  91. <th >注册时间</th>
  92. <th class="text-right">操作</th>
  93. </tr>
  94. {loop $list $li}
  95. <tr>
  96. <td style="overflow: hidden;">
  97. <input type="checkbox" we7-check-all="1" name="uid[]" id="uid-{$li['uid']}" value="{$li['uid']}" class="">
  98. <label for="uid-{$li['uid']}">&nbsp;</label>
  99. </td>
  100. <td>{$li['uid']}</td>
  101. <td>
  102. {if $li['nickname']}{$li['nickname']}{else}未完善{/if}
  103. <br>
  104. {if $li['realname']}{$li['realname']}{else}未完善{/if}
  105. </td>
  106. <td>{if $li['mobile']}{$li['mobile']}{else}未完善{/if}</td>
  107. <td>{if $li['email_effective'] == 1}{$li['email']}{else}未完善{/if}</td>
  108. <td class="text-left">
  109. <span class="label label-primary">{$creditnames['credit2']['title']}:{$li['credit2']}</span>
  110. <br>
  111. <span class="label label-warning">{$creditnames['credit1']['title']}:{$li['credit1']}</span>
  112. </td>
  113. <td >{php echo date('Y-m-d H:i',$li['createtime'])}</td>
  114. <td style="overflow:visible;">
  115. <div class="link-group">
  116. <a href="{php echo url('mc/member/base_information',array('uid' => $li['uid']))}">管理设置</a>
  117. <a href="{php echo url('mc/member/del',array('uid' => $li['uid']))}" onclick="return confirm('确定删除会员吗?')" title="删除" class="">删除</a>
  118. </div>
  119. </td>
  120. </tr>
  121. {/loop}
  122. </table>
  123. <div class="we7-margin-left">
  124. <input type="hidden" name="token" value="{$_W['token']}">
  125. <input type="checkbox" we7-check-all="1" id="check-all" name="uid[]" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});">
  126. <label for="check-all"> &nbsp;</label>
  127. <input type="submit" name="submit" class="btn btn-danger btn-submit" value="删除">
  128. </div>
  129. <div class="text-right">
  130. {$pager}
  131. </div>
  132. </form>
  133. {/if}
  134. {if $do == 'add'}
  135. <form action="./index.php?c=mc&a=member&do=add" method="post" class="form-horizontal" role="form" id="form1">
  136. <div class="panel panel-info">
  137. <div class="panel-heading">添加会员</div>
  138. <div class="panel-body we7-padding">
  139. <div class="form-group">
  140. <label class="col-sm-2 control-label">会员姓名</label>
  141. <div class="col-sm-9 col-xs-12">
  142. <input type="text" name="realname" value="" class="form-control"/>
  143. </div>
  144. </div>
  145. <div class="form-group">
  146. <label class="col-sm-2 control-label">手机号</label>
  147. <div class="col-sm-9 col-xs-12">
  148. <input type="text" name="mobile" value="" class="form-control"/>
  149. </div>
  150. </div>
  151. <div class="form-group">
  152. <label class="col-sm-2 control-label">登录密码</label>
  153. <div class="col-sm-9 col-xs-12">
  154. <input type="password" name="password" value="" class="form-control"/>
  155. </div>
  156. </div>
  157. <div class="form-group">
  158. <label class="col-sm-2 control-label">邮箱</label>
  159. <div class="col-sm-9 col-xs-12">
  160. <input type="text" name="email" value="" class="form-control"/>
  161. </div>
  162. </div>
  163. <div class="form-group">
  164. <label class="col-sm-2 control-label">{$creditnames['credit1']['title']}</label>
  165. <div class="col-sm-9 col-xs-12">
  166. <input type="text" name="credit1" value="0" class="form-control"/>
  167. </div>
  168. </div>
  169. <div class="form-group">
  170. <label class="col-sm-2 control-label">{$creditnames['credit2']['title']}</label>
  171. <div class="col-sm-9 col-xs-12">
  172. <input type="text" name="credit2" value="0" class="form-control"/>
  173. </div>
  174. </div>
  175. <div class="form-group">
  176. <label class="col-sm-2 control-label">会员组</label>
  177. <div class="col-sm-9 col-xs-12">
  178. <select name="groupid" class="form-control">
  179. {loop $_W['account']['groups'] $group}
  180. <option value="{$group['groupid']}">{$group['title']}</option>
  181. {/loop}
  182. </select>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. <div class="form-group">
  188. <div class="col-sm-9 col-xs-12">
  189. <input type="hidden" name="token" value="{$_W['token']}"/>
  190. <input type="hidden" name="form" value="{$_W['token']}"/>
  191. <input type="submit" value="提交" class="btn btn-primary"/>
  192. </div>
  193. </div>
  194. </form>
  195. <script>
  196. require(['validator'], function(){
  197. $(function(){
  198. $('#form1').bootstrapValidator({
  199. fields: {
  200. realname: {
  201. validators: {
  202. notEmpty: {
  203. message: '姓名不能为空'
  204. }
  205. }
  206. },
  207. mobile: {
  208. validators: {
  209. notEmpty: {
  210. message: '手机不能为空'
  211. },
  212. regexp: {
  213. regexp: /1\d{10}/,
  214. message: '手机号格式不正确'
  215. },
  216. remote: {
  217. url: "{php echo url('mc/member/add');}",
  218. data: function(validator) {
  219. return {
  220. type: 'mobile',
  221. data: validator.getFieldElements('mobile').val()
  222. };
  223. },
  224. message: '手机号已经被占用'
  225. }
  226. }
  227. },
  228. email: {
  229. validators: {
  230. regexp: {
  231. regexp: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/i,
  232. message: '邮箱格式不正确'
  233. },
  234. remote: {
  235. url: "{php echo url('mc/member/add');}",
  236. data: function(validator) {
  237. return {
  238. type: 'email',
  239. data: validator.getFieldElements('email').val()
  240. };
  241. },
  242. message: '邮箱已经被占用'
  243. }
  244. }
  245. },
  246. password: {
  247. validators: {
  248. notEmpty: {
  249. message: '密码不能为空'
  250. },
  251. stringLength: {
  252. min: 8,
  253. max: 15,
  254. message: '密码最少为8位'
  255. }
  256. }
  257. },
  258. credit1: {
  259. validators: {
  260. regexp: {
  261. regexp: /^[0-9]\d*$/i,
  262. message: '积分格式不正确'
  263. }
  264. }
  265. },
  266. credit2: {
  267. validators: {
  268. regexp: {
  269. regexp: /^[0-9]\d*$/i,
  270. message: '余额格式不正确'
  271. }
  272. }
  273. }
  274. }
  275. });
  276. });
  277. });
  278. </script>
  279. {/if}
  280. {if $do == 'credit_setting'}
  281. <div id="js-profile-credit" ng-controller="creditCtrl" ng-cloak>
  282. <table class="table we7-table table-hover vertical-middle">
  283. <col width="140px " />
  284. <col />
  285. <col width="140px" />
  286. <tr>
  287. <th class="text-left" colspan="4">支付参数</th>
  288. </tr>
  289. <tr>
  290. <td >credit1</td>
  291. <td>{{ creditSetting.credit1.title }}</td>
  292. <td>
  293. <label>
  294. <input name="" class="form-control" type="checkbox" style="display: none;">
  295. <div ng-class="credit.enabled == 1 ? 'switch switchOn' : 'switch'" style="opacity : 0.3"></div>
  296. </label>
  297. </td>
  298. <td class="pull-right"><div class="link-group"><a href="javascript:;" ng-click="editCreditName('credit1')">设置名称</a></div></td>
  299. </tr>
  300. <tr>
  301. <td >credit2</td>
  302. <td>{{ creditSetting.credit2.title }}</td>
  303. <td>
  304. <label>
  305. <input name="" class="form-control" type="checkbox" style="display: none;">
  306. <div ng-class="credit.enabled == 1 ? 'switch switchOn' : 'switch'" style="opacity : 0.3"></div>
  307. </label>
  308. </td>
  309. <td class="pull-right"><div class="link-group"><a href="javascript:;" ng-click="editCreditName('credit2')">设置名称</a></div></td>
  310. </tr>
  311. <tr>
  312. <td >credit3</td>
  313. <td>{{ creditSetting.credit3.title }}</td>
  314. <td>
  315. <label>
  316. <input name="" class="form-control" type="checkbox" style="display: none;">
  317. <div ng-class="creditSetting.credit3.enabled == 1 ? 'switch switchOn' : 'switch'" ng-click="changeEnabled('credit3')"></div>
  318. </label>
  319. </td>
  320. <td class="pull-right"><div class="link-group"><a href="javascript:;" ng-click="editCreditName('credit3')">设置名称</a></div></td>
  321. </tr>
  322. <tr>
  323. <td >credit4</td>
  324. <td>{{ creditSetting.credit4.title }}</td>
  325. <td>
  326. <label>
  327. <input name="" class="form-control" type="checkbox" style="display: none;">
  328. <div ng-class="creditSetting.credit4.enabled == 1 ? 'switch switchOn' : 'switch'" ng-click="changeEnabled('credit4')"></div>
  329. </label>
  330. </td>
  331. <td class="pull-right"><div class="link-group"><a href="javascript:;" ng-click="editCreditName('credit4')">设置名称</a></div></td>
  332. </tr>
  333. <tr>
  334. <td >credit5</td>
  335. <td>{{ creditSetting.credit5.title }}</td>
  336. <td>
  337. <label>
  338. <input name="" class="form-control" type="checkbox" style="display: none;">
  339. <div ng-class="creditSetting.credit5.enabled == 1 ? 'switch switchOn' : 'switch'" ng-click="changeEnabled('credit5')"></div>
  340. </label>
  341. </td>
  342. <td class="pull-right"><div class="link-group"><a href="javascript:;" ng-click="editCreditName('credit5')">设置名称</a></div></td>
  343. </tr>
  344. </table>
  345. <table class="table we7-table table-hover table-form">
  346. <col width="140px " />
  347. <col />
  348. <col width="140px" />
  349. <tr>
  350. <th class="text-left" colspan="3">积分策略</th>
  351. </tr>
  352. <tr>
  353. <td >基本和营销</td>
  354. <td>
  355. {{ creditSetting[tactics.activity].title }}
  356. </td>
  357. <td class="text-center">
  358. <div class="link-group"><a href="javascript:;" ng-click="editCreditTactics('activity')">更改</a></div>
  359. </td>
  360. </tr>
  361. <tr>
  362. <td >交易和支付(余额)</td>
  363. <td>
  364. {{ creditSetting[tactics.currency].title }}
  365. </td>
  366. <td class="text-center">
  367. <div class="link-group"><a href="javascript:;" ng-click="editCreditTactics('currency')">更改</a></div>
  368. </td>
  369. </tr>
  370. </table>
  371. <div class="modal fade" id="credit-name" tabindex="-1" role="dialog" aria-hidden="true">
  372. <div class="we7-modal-dialog modal-dialog">
  373. <div class="modal-content">
  374. <div class="modal-header">
  375. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  376. <div class="modal-title">设置名称</div>
  377. </div>
  378. <div class="modal-body">
  379. <div class="we7-form">
  380. <div class="form-group">
  381. <div class="form-controls">
  382. <input type="text" name="" class="form-control" ng-model="creditTitle" placeholder="输入积分名称">
  383. </div>
  384. </div>
  385. </div>
  386. </div>
  387. <div class="modal-footer">
  388. <button type="button" class="btn btn-primary" ng-click="setCreditName()" data-dismiss="modal">确定</button>
  389. </div>
  390. </div>
  391. </div>
  392. </div>
  393. <div class="modal fade" id="tactics" tabindex="-1" role="dialog" aria-hidden="true">
  394. <div class="we7-modal-dialog modal-dialog">
  395. <div class="modal-content">
  396. <div class="modal-header">
  397. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  398. <div class="modal-title">设置积分策略</div>
  399. </div>
  400. <div class="modal-body">
  401. <div class="we7-form">
  402. <div class="form-group">
  403. <div class="form-controls">
  404. <select ng-model="tactics.activity" ng-if="activeTacticsType == 'activity'" class="form-control">
  405. <option ng-repeat="credit in enabledCredit" value="{{ credit }}" ng-selected="credit == tactics.activity">{{ creditSetting[credit].title }}</option>
  406. </select>
  407. <select ng-model="tactics.currency" ng-if="activeTacticsType == 'currency'" class="form-control">
  408. <option ng-repeat="credit in enabledCredit" value="{{ credit }}" ng-selected="credit == tactics.currency">{{ creditSetting[credit].title }}</option>
  409. </select>
  410. </div>
  411. </div>
  412. </div>
  413. </div>
  414. <div class="modal-footer">
  415. <button type="button" class="btn btn-primary" ng-click="setCreditTactics()" data-dismiss="modal">确定</button>
  416. </div>
  417. </div>
  418. </div>
  419. </div>
  420. </div>
  421. <script>
  422. angular.module('profileApp').value('config', {
  423. 'creditSetting' : {php echo json_encode($credit_setting)},
  424. 'enabledCredit' : {php echo json_encode($enable_credit)},
  425. 'activity' : "{$credit_tactics['activity']}",
  426. 'currency' : "{$credit_tactics['currency']}",
  427. 'saveCreditSetting' : "{php echo url('mc/member/save_credit_setting')}",
  428. 'saveTacticsSetting' : "{php echo url('mc/member/save_tactics_setting')}"
  429. });
  430. angular.bootstrap($('#js-profile-credit'), ['profileApp']);
  431. </script>
  432. {/if}
  433. {if $do == 'register_setting'}
  434. <form id="payform" action="{php echo url('mc/member/register_setting')}" method="post" class="we7-form form">
  435. <div class="panel-body">
  436. <div class="form-group">
  437. <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员注册设置</label>
  438. <div class="col-sm-9 col-xs-12">
  439. <input id="radio-1" type="radio" name="passport[focusreg]" value="1" {if !empty($register_setting['focusreg'])} checked="checked"{/if}/>
  440. <label for="radio-1">
  441. 会员手动注册
  442. </label>
  443. <input id="radio-2" type="radio" name="passport[focusreg]" value="0" {if empty($register_setting['focusreg'])} checked="checked"{/if}/>
  444. <label for="radio-2">
  445. 系统自动注册
  446. </label>
  447. <span class="help-block">当设置为"系统自动注册",用户从微信进入系统时,当模块使用"checkauth"验证用户身份时,可以在非登录状态下直接使用模块功能。</span>
  448. </div>
  449. </div>
  450. <div class="form-group">
  451. <label class="col-xs-12 col-sm-3 col-md-2 control-label">身份验证项</label>
  452. <div class="col-sm-9 col-xs-12">
  453. <input id="radio-3" type="radio" name="passport[item]" value="mobile" {if $register_setting['item'] == 'mobile'}
  454. checked="checked"{/if}/>
  455. <label for="radio-3">
  456. 手机注册
  457. </label>
  458. <input id="radio-4" type="radio" name="passport[item]" value="email" {if $register_setting['item'] == 'email'} checked="checked"{/if}/>
  459. <label for="radio-4">
  460. 邮箱注册
  461. </label>
  462. <input id="radio-5" type="radio" name="passport[item]" value="random" {if $register_setting['item'] == 'random' || empty($register_setting['item'])} checked="checked"{/if}/>
  463. <label for="radio-5">
  464. 二者都行
  465. </label>
  466. <span class="help-block">该项设置用户注册时用户名的格式,如果设置为:"邮箱注册",系统会判断用户的注册名是否是邮箱格式</span>
  467. </div>
  468. </div>
  469. <div class="form-group">
  470. <label class="col-xs-12 col-sm-3 col-md-2 control-label">强制验证手机号/邮箱</label>
  471. <div class="col-sm-9 col-xs-12">
  472. <input id="radio-6" type="radio" name="passport[audit]" value="1" {if $register_setting['audit'] == 1} checked="checked"{/if}/>
  473. <label for="radio-6">是</label>
  474. <input id="radio-7" type="radio" name="passport[audit]" value="0" {if empty($register_setting['audit'])} checked="checked"{/if}/>
  475. <label for="radio-7">否</label>
  476. <span class="help-block">设置强制验证手机号/邮箱,用户在注册的时候,系统会给用户的手机或邮箱发送验证码,以验证手机或邮箱的有效性</span>
  477. </div>
  478. </div>
  479. <div class="form-group">
  480. <label class="col-xs-12 col-sm-3 col-md-2 control-label">身份验证方式</label>
  481. <div class="col-sm-9 col-xs-12">
  482. <input id="radio-8" type="radio" name="passport[type]" value="code" {if $register_setting['type'] == 'code'} checked="checked"{/if}/>
  483. <label for="radio-8">随机密码</label>
  484. <input id="radio-9" type="radio" name="passport[type]" value="password" {if $register_setting['type'] == 'password'} checked="checked"{/if}/>
  485. <label for="radio-9">固定密码</label>
  486. <input id="radio-10" type="radio" name="passport[type]" value="hybird" {if $register_setting['type'] == 'hybird'} checked="checked"{/if}/>
  487. <label for="radio-10">混合密码</label>
  488. <span class="help-block">使用邮箱或者手机号+密码来登录系统</span>
  489. <span class="help-block">随机密码方式: 采用发送验证码的方式, 用户不需要记录密码. 在微信以外的渠道登录系统时, 需要输入手机或邮箱+验证码来进入系统</span>
  490. <span class="help-block">固定密码方式: 采用设置密码的方式, 用户在首次使用时设置固定的访问密码. 在微信以外的渠道登录系统时, 需要输入手机或邮箱+密码来进入系统</span>
  491. <span class="help-block">混合密码方式: 混合使用两种验证方式, 用户可以自己选择是否设置访问密码. 如果设置了访问密码, 那么登录是可以使用手机或邮箱+随机密码或固定密码来进入系统</span>
  492. <span class="help-block"><strong>注意: 使用随机密码或者混合密码时, 必须先 <a href="{php echo url('profile/notify');}" target="_blank">设置邮件</a> 或<a href="{php echo url('cloud/sms')}">短信</a></strong> 选项</strong></span>
  493. </div>
  494. </div>
  495. </div>
  496. <div class="form-group col-sm-12">
  497. <input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
  498. <input type="hidden" name="token" value="{$_W['token']}" />
  499. </div>
  500. </form>
  501. {/if}
  502. {template 'common/footer'}