member.html 20 KB

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