| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468 |
- <?php
- use common\services\xhCouponService;
- use common\services\xhUserService;
- use common\services\xhUserAssetService;
- use common\components\stringUtil;
- ?>
- <?php
- use backend\widgets\TabWidget;
- echo TabWidget::widget(['list' => $this->context->menuList, 'currentMenu' => $this->context->id]);
- ?>
- <div class="panel panel-default">
- <?php
- use backend\widgets\SubTabWidget;
- echo SubTabWidget::widget(['list' => $this->context->subMenuList, 'currentMenu' => $this->context->action->id]);
- ?>
- <div class="panel-body">
- <div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
- <div class="row">
- <form action="" method="GET">
- <div class="col-xs-6" style="width:90%;">
- <div class="dataTables_length">
- <label>昵称/手机号:<input type="search" value="<?php if (isset($_GET['content'])) {
- echo $_GET['content'];
- } ?>" class="form-control" name="content" placeholder=""></label>
- <input class="btn btn-secondary btn-single" type="submit" name="" value="搜索"/>
- </div>
- </div>
- </form>
- </div>
- <div class="table-responsive">
- <table class="table table-bordered table-striped table-hover table-condensed">
- <thead>
- <tr class="active">
- <th class="no-sorting hidden-xs"><input name="selectAll" type="checkbox"></th>
- <th class="hidden-xs">ID</th>
- <th class="hidden-xs">头像</th>
- <th>来源 昵称</th>
- <th class="hidden-xs">手机号</th>
- <th class="hidden-xs">标签</th>
- <th class="hidden-xs">等级</th>
- <th class="hidden-xs">粉丝</th>
- <th class="hidden-xs">余额</th>
- <th class="hidden-xs">积分</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="middle-align">
- <?php foreach ($models as $key => $val) { ?>
- <tr>
- <td class="hidden-xs"><input name="uId" value="<?= $val['id'] ?>" type="checkbox"></td>
- <td class="hidden-xs"><?= $val['id'] ?></td>
- <td class="hidden-xs">
- <a href="/user/detail?id=<?= $val['id'] ?>" title="<?= $val['userName'] ?>">
- <img src="<?php if (!empty($val['avatar'])) {
- $avatar = xhUserService::getAvatarList($val['avatar']);
- echo Yii::$app->params['imgUrl'] . $avatar['small'];
- } else {
- echo Yii::$app->params['imgUrl'] .'/unknowavatar.png';
- } ?>"
- style="width:20px;border-radius:10px;"/>
- </a>
- </td>
- <td>
- <?php $rand = rand(0,2);if($rand == 0){ ?>
- <img src="/images/source_wx.jpg" width="15" />
- <?php } if($rand == 1){ ?>
- <img src="/images/source_xcx.jpg" width="15" />
- <?php } if($rand == 2){ ?>
- <img src="/images/source_zfb.jpg" width="15" />
- <?php } ?>
- <a class="add-under-line" href="/user/detail?id=<?= $val['id'] ?>"
- title="<?= $val['userName'] ?>"><?php echo stringUtil::subStringUtf8($val['userName'], 10, '..'); ?></a>
- </td>
- <td class="hidden-xs">
- <?= $val['mobile'] ?>
- </td>
- <td class="hidden-xs">
- <?php
- $cacheTag = isset($val['tag']) ? $val['tag'] : '';
- if (!empty($cacheTag)) {
- $cacheTagList = explode(',', $cacheTag);
- foreach ($cacheTagList as $cacheKey => $cacheVal) {
- if (isset($merchantTag[$cacheVal])) {
- echo '<a href="javascript:void(0)" title="' . $merchantTag[$cacheVal] . '">' . stringUtil::subStringUtf8($merchantTag[$cacheVal], 3, '…') . '</a><br />';
- }
- }
- }
- $userAsset = xhUserAssetService::getByUserId($val['id']);
- $coupon = xhCouponService::getUserCoupon($val['id']);
- $couponJson = json_encode($coupon);
- ?>
- </td>
- <td class="hidden-xs">
- <?php if (!empty($userAsset['memberLevel'])) { ?>
- <?php if (empty($val['subscribe'])) { ?>
- <a href="javascript:void(0)" data-toggle="tooltip" data-placement="bottom"
- title="" data-original-title="客户需关注公众号并申请会员卡,才能查看等级"
- style="color:#68b828;cursor:pointer;text-decoration:none;"
- <i="" class="fa-question-circle"></a>
- <?php } else { ?>
- <?php if (empty($val['mobile'])) { ?>
- <a href="javascript:void(0)" data-toggle="tooltip" data-placement="bottom"
- title="" data-original-title="客户需申请会员卡才能查看等级"
- style="color:#68b828;cursor:pointer;text-decoration:none;"
- <i="" class="fa-question-circle"></a>
- <?php } else { ?>
- <?php
- $level = $userAsset['memberLevel'];
- $discount = $memberIntegral[$level]['discount'];
- echo $userAsset['memberLevel'] . '/' . $discount . '折';
- ?>
- <?php } ?>
- <?php } ?>
- <?php } ?>
- </td>
- <td class="hidden-xs"><?php if ($val['subscribe'] == 1) echo '<a href="javascript:void(0)" style="color:#68b828;cursor:text" <i class="fa fa-check"></i></a>'; ?></td>
- <td class="hidden-xs"><?php if (!empty($userAsset['balance']) && $userAsset['balance'] != 0.00) { ?>
- <a
- style="background-color: #68b828;color:white;padding:2px;border-radius:5px;text-decoration:none;color:#ffffff;"
- href="/capital/user?id=<?= $val['id'] ?>"><?= $userAsset['balance'] ?></a><?php } ?>
- </td>
- <td class="hidden-xs">
- <?php if (!empty($userAsset['integral'])) { ?>
- <?php if (empty($val['subscribe'])) { ?>
- <a href="javascript:void(0)" data-toggle="tooltip" data-placement="bottom"
- title="" data-original-title="客户需关注公众号并申请会员卡,才能查看积分"
- style="color:#68b828;cursor:pointer;text-decoration:none;"
- <i="" class="fa-question-circle"></a>
- <?php } else { ?>
- <?php if (empty($val['mobile'])) { ?>
- <a href="javascript:void(0)" data-toggle="tooltip" data-placement="bottom"
- title="" data-original-title="客户需申请会员卡才能查看积分"
- style="color:#68b828;cursor:pointer;text-decoration:none;"
- <i="" class="fa-question-circle"></a>
- <?php } else { ?>
- <a style="background-color: #68b828;color:white;padding:2px;border-radius:5px;text-decoration:none;color:#ffffff;"
- href="/integral/user?id=<?= $val['id'] ?>"><?= $userAsset['integral'] ?></a>
- <?php } ?>
- <?php } ?>
- <?php } ?>
- </td>
- <td>
- <?php if ($val['subscribe'] == 1) { ?>
- <?php if (!empty($merchantExtend['recharge'])) { ?>
- <?php } ?>
- <?php if (!empty($merchantExtend['init'])) { ?>
- <?php } ?>
- <?php } ?>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <div class="row">
- <div>
- <div class="dataTables_paginate paging_simple_numbers"
- style="float:right;padding-top:0px;margin-right:15px;">
- <?= $pages ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- footer -->
- <?php
- use backend\widgets\FooterWidget;
- ?>
- <?= FooterWidget::widget() ?>
- <!-- footer -->
- <!-- modal 升级会员确认提醒框 -->
- <div class="modal fade" id="memberModal">
- <div class="modal-dialog" style="height:300px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">消息提示</h4>
- </div>
- <div class="modal-body">
- <div class="row">
- <div class="col-md-6">
- <div class="form-group">
- <label for="field-1" class="control-label">确认将 <span></span>会员等级设置为</label>
- <select class="form-control" name="memberLevel">
- <?php foreach ($memberIntegral as $key => $val) { ?>
- <?php echo '<option value="' . $val['level'] . '">' . $val['level'] . '级 ' . $val['discount'] . '折</option>'; ?>
- <?php } ?>
- </select>
- </div>
- </div>
- </div>
- <input type="hidden" name="requestUrl" value=""/>
- <div class="row">
- <div class="col-md-6">
- <div class="form-group">
- <label for="field-1" class="control-label">请输入确认密码:</label>
- <input type="password" class="form-control" name="confirmPassword" placeholder="" value="">
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-info" name="memberConfirmButton">确认</button>
- <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function () {
- //升级为会员 取消会员操作
- jQuery("a[name=memberButton]").click(function () {
- var url = $(this).attr('data-url');
- var name = $(this).attr('data-name');
- $("#memberModal .modal-body span").text(name);
- $("#memberModal .modal-body input[name=requestUrl]").val(url);
- jQuery('#memberModal').modal('show', {backdrop: 'fade'});
- });
- //确认升级会员
- jQuery("button[name=memberConfirmButton]").click(function () {
- var url = $("#memberModal .modal-body input[name=requestUrl]").val();
- var confirmPassword = $("#memberModal .modal-body input[name=confirmPassword]").val();
- var memberLevel = $("select[name=memberLevel]").find("option:selected").val();
- $.ajax({
- type: "GET",
- url: url + "&confirmPassword=" + confirmPassword + "&memberLevel=" + memberLevel,
- async: false,
- dataType: 'json',
- success: function (data) {
- if (data.code == 'A0001') {
- setTimeout(function () {
- window.location.reload();
- }, 2000);
- }
- xhPopMsg(data.msg, 2000);
- }
- });
- });
- });
- </script>
- <!-- modal 充值 -->
- <div class="modal fade" id="rechargeModal">
- <div class="modal-dialog" style="height:450px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">操作提示</h4>
- </div>
- <div class="modal-body">
- <div class="row">
- <div class="col-md-6">
- <div class="form-group">
- <label for="field-1" class="control-label"><span></span> 帐户充值:</label>
- <input type="tel" class="form-control" placeholder="" name="rechargeAmount" value=""
- style="width:70%;display:inline-block;"> 元
- <input type="hidden" name="requestUrl" value=""/>
- <input type="hidden" name="userName" value=""/>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-6">
- <div class="form-group">
- <label for="field-1" class="control-label">请输入确认密码:</label>
- <input type="password" class="form-control" name="rechargePassword" placeholder="" value="">
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-6">
- <div class="checkbox">
- <label>
- <input name="confirmToRecharge" type="checkbox">确认为<span></span>充值 <em
- style="font-style: normal;">0</em> 元
- </label>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-info" name="rechargeConfirmButton">确认</button>
- <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function () {
- //充值操作
- jQuery("a[name=rechargeButton]").click(function () {
- var url = $(this).attr('data-url');
- var userName = $(this).attr('data-userName');
- $("#rechargeModal .modal-body span").text(userName);
- $("#rechargeModal .modal-body input[name=userName]").val(userName);
- $("#rechargeModal .modal-body input[name=requestUrl]").val(url);
- $("#rechargeModal .modal-body input[name=rechargeAmount]").val('');
- $("#rechargeModal .modal-body input[name=rechargePassword]").val('');
- $("#rechargeModal .modal-body em").html('0');
- $("input[name=confirmToRecharge]").prop("checked", false);
- jQuery('#rechargeModal').modal('show');
- });
- //确认充值
- jQuery("button[name=rechargeConfirmButton]").click(function () {
- var url = $("#rechargeModal .modal-body input[name=requestUrl]").val();
- var userName = $("#rechargeModal .modal-body input[name=userName]").val();
- var rechargeAmount = $("#rechargeModal .modal-body input[name=rechargeAmount]").val();
- var rechargePassword = $("#rechargeModal .modal-body input[name=rechargePassword]").val();
- if (isNaN(rechargeAmount)) {
- xhPopMsg('充值金额填写有误', 1300);
- return;
- }
- if (rechargeAmount <= 0) {
- xhPopMsg('金额不能小于0', 1300);
- return;
- }
- if (rechargePassword.length <= 0) {
- xhPopMsg('请输入确认密码', 1300);
- return;
- }
- if ($("input[name=confirmToRecharge]").prop("checked") == false) {
- xhPopMsg('请勾选确认充值项', 1300);
- return;
- }
- if ($("button[name=rechargeConfirmButton]").attr('submitStatus') == 'yes') {
- xhPopMsg('请稍候…', 1000);
- return;
- }
- $("button[name=rechargeConfirmButton]").attr('submitStatus', 'yes');
- setTimeout(function () {
- $("button[name=rechargeConfirmButton]").attr('submitStatus', 'no');
- }, 8000);
- $.ajax({
- type: "GET",
- url: url + '&rechargeAmount=' + rechargeAmount + '&rechargePassword=' + rechargePassword,
- async: false,
- dataType: 'json',
- success: function (data) {
- if (data.code == 'A0001') {
- setTimeout(function () {
- window.location.reload();
- }, 2000);
- }
- xhPopMsg(data.msg, 1300);
- }
- });
- });
- //充值时输入金额反应
- $("#rechargeModal .modal-body input[name=rechargeAmount]").keyup(function () {
- var val = $(this).val();
- if (isNaN(val) == false) {
- $("#rechargeModal .modal-body em").html(val);
- }
- });
- });
- </script>
- <script>
- //全选 全不选
- $(":checkbox[name=selectAll]").click(function () {
- var status = $(this).prop("checked");
- if (status == true) {
- $(":checkbox[name=uId]").prop("checked", true);
- } else {
- $(":checkbox[name=uId]").prop("checked", false);
- }
- });
- </script>
- <!-- 添加标签 -->
- <div class="modal fade" id="userTagModal">
- <div class="modal-dialog" style="height:450px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">请选择你要添加的标签</h4>
- </div>
- <div class="modal-body">
- <input type="hidden" name="requestUrl" value="/user/batch-add-user-tag"/>
- <?php if (!empty($merchantTag)) { ?>
- <?php foreach ($merchantTag as $key => $val) { ?>
- <div class="row">
- <div class="col-md-6">
- <div class="checkbox">
- <label>
- <input name="theTag" value="<?= $key ?>" type="radio"> <?= $val ?>
- </label>
- </div>
- </div>
- </div>
- <?php }
- } ?>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-info" name="userTagConfirmButton">确认</button>
- <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- var shopProvince = "<?=$merchant['shopProvince'] ?>";
- var shopCity = "<?=$merchant['shopCity'] ?>";
- $("button[name=multipConfirm]").click(function () {
- var ids = new Array();
- $(":checkbox[name=uId]:checked").each(function () {
- var theId = $(this).val();
- ids.push(theId);
- });
- if (ids.length <= 0) {
- xhPopMsg('请选择你要操作的用户', 1300);
- return;
- }
- var option = $("select[name=doOption]").val();
- option = parseInt(option);
- switch (option) {
- case 0:
- //批量添加标签
- jQuery('#userTagModal').modal('show');
- break;
- case 1:
- xhPopMsg('此功能开发中…', 1300);
- break;
- }
- });
- //确认添加标签
- jQuery("button[name=userTagConfirmButton]").click(function () {
- var tagId = $("#userTagModal .modal-body :input[name=theTag]:checked").val();
- var url = $("#userTagModal .modal-body input[name=requestUrl]").val();
- var ids = new Array();
- $(":checkbox[name=uId]:checked").each(function () {
- var theId = $(this).val();
- ids.push(theId);
- });
- if (ids.length <= 0) {
- xhPopMsg('请选择用户', 1300);
- return;
- }
- var userIdStr = ids.join(',');
- $.ajax({
- type: "GET",
- url: url + '?tagId=' + tagId + '&userIdStr=' + userIdStr,
- async: false,
- dataType: 'json',
- success: function (data) {
- xhPopMsg(data.msg, 1300);
- if (data.code == 'A0001') {
- setTimeout(function () {
- window.location.reload();
- }, 1000);
- }
- }
- });
- });
- </script>
|