修改后台用户列表

main
fengxinyhyl 8 months ago
parent de58aa18ac
commit f54faca4b8
  1. 6
      app/common/dao/user/UserDao.php
  2. 5
      app/common/model/user/User.php
  3. 3
      app/common/repositories/user/UserAssetsLogRepository.php
  4. 7
      app/common/repositories/user/UserRepository.php
  5. 23
      app/controller/admin/user/User.php
  6. 5
      app/controller/admin/user/UserGroup.php
  7. 6
      route/admin/user.php
  8. 4
      view/admin/.env.production
  9. 17
      view/admin/src/api/user.js
  10. 261
      view/admin/src/views/user/list/index.vue
  11. 139
      view/admin/src/views/user/list/userDetails.vue
  12. 4
      view/mer/.env.production

@ -77,6 +77,12 @@ class UserDao extends BaseDao
return $query->where('User.user_type', $where['user_type']);
})->when(isset($where['uid']) && $where['uid'] !== '', function (BaseQuery $query) use ($where) {
return $query->where('User.uid', $where['uid']);
})->when(isset($where['agent_id']) && $where['agent_id'] !== '', function (BaseQuery $query) use ($where) {
return $query->where('User.agent_district_id' ,'>', 0);
})->when(isset($where['is_share']) && $where['is_share'] !== '', function (BaseQuery $query) use ($where) {
return $query->hasWhere('assets', function ($query) use ($where) {
$query->where('share_point', '>', 0);
});
})->when(isset($where['status']) && $where['status'] !== '', function (BaseQuery $query) use ($where) {
return $query->where('User.status', intval($where['status']));
})->when(isset($where['group_id']) && $where['group_id'], function (BaseQuery $query) use ($where) {

@ -161,6 +161,11 @@ class User extends BaseModel
return $this->hasOne(UserGroup::class, 'group_id', 'group_id');
}
public function assets()
{
return $this->hasOne(UserAssets::class, 'uid', 'uid');
}
public function spread()
{
return $this->hasOne(User::class, 'uid', 'spread_uid');

@ -733,6 +733,9 @@ class UserAssetsLogRepository extends BaseRepository
$changeType = $this->getChangeType();
foreach ($data as $item) {
$item['type'] = $changeType[$item['type']];
if($item['count'] > 0){
$item['count'] = "+".$item['count'];
}
$list[] = $item;
}
return compact('count', 'list');

@ -180,9 +180,12 @@ class UserRepository extends BaseRepository
'member' => function ($query) {
$query->field('user_brokerage_id,brokerage_level,brokerage_name,brokerage_icon');
},
'group']);
'group',
'assets' => function($query){
$query->field('share_point');
}]);
$make = app()->make(UserLabelRepository::class);
$count = $query->count($this->dao->getPk());
$count = $query->count();
$list = $query->page($page, $limit)->select()->each(function ($item) use ($make) {
return $item->label = count($item['label_id']) ? $make->labels($item['label_id']) : [];
});

@ -15,6 +15,8 @@ namespace app\controller\admin\user;
use app\common\repositories\store\ExcelRepository;
use app\common\repositories\user\UserAssetsLogRepository;
use app\common\repositories\user\UserAssetsRepository;
use app\common\repositories\user\UserSpreadLogRepository;
use app\common\repositories\user\UserVisitRepository;
use crmeb\basic\BaseController;
@ -89,6 +91,8 @@ class User extends BaseController
'group_id',
'phone',
'uid',
'agent_id',
'is_share',
]);
[$page, $limit] = $this->getPage();
return app('json')->success($this->repository->getList($where, $page, $limit));
@ -470,6 +474,25 @@ class User extends BaseController
return app('json')->success($this->repository->userOrderDetail($id));
}
public function info($id){
if (!$this->repository->exists($id))
return app('json')->fail('数据不存在');
$user = $this->repository->getWhere(['uid' => $id]);
$assets = app(UserAssetsRepository::class)->assets($id);
$user['assets'] = $assets;
$user['spread'] = $this->repository->getWhere(['uid' => $user['spread_uid']]);
return app('json')->success($user);
}
public function assetsLog($id, $type){
/**
* @var UserAssetsLogRepository $logRepository
*/
$logRepository = \app()->make(UserAssetsLogRepository::class);
[$page, $limit] = $this->getPage();
return \app('json')->success($logRepository->list($id, ['asset_type' => $type], $page, $limit));
}
public function order($id, StoreOrderRepository $repository)
{
if (!$this->repository->exists($id))

@ -59,8 +59,11 @@ class UserGroup extends BaseController
public function lst()
{
[$page, $limit] = $this->getPage();
$all = $this->request->param("all");
$where = array();
$where[] = ['group_id', '>', 1];
if(empty($all)){
$where[] = ['group_id', '>', 1];
}
Log::info(json_encode($where));
return app('json')->success($this->repository->getList($where, $page, $limit));
}

@ -85,6 +85,12 @@ Route::group(function () {
Route::get('detail/:id', '/detail')->name('systemUserDetail')->option([
'_alias' => '用户详情',
]);
Route::get('info/:id', '/info')->name('systemUserInfo')->option([
'_alias' => '用户详情',
]);
Route::get('assets_log/:id/:type', '/assetsLog')->name('systemUserAssetsLog')->option([
'_alias' => '用户资产记录',
]);
Route::get('order/:id', '/order')->name('systemUserOrder')->option([
'_alias' => '用户消费记录',
]);

@ -2,6 +2,6 @@
ENV = 'production'
# base api
VUE_APP_BASE_API =
VUE_APP_BASE_API ='https://b2.njrenzhou.com'
# socket 连接地址
VUE_APP_WS_URL =
VUE_APP_WS_URL ='ws://mer1.crmeb.net'

@ -182,6 +182,13 @@ export function userNewsApi(data) {
export function userDetailApi(uid) {
return request.get(`user/detail/${uid}`)
}
/**
* @description 用户 -- 详情头部
*/
export function userInfoApi(uid) {
return request.get(`user/info/${uid}`)
}
/**
* @description 用户 -- 详情消费记录
*/
@ -200,6 +207,12 @@ export function userCouponApi(uid, data) {
export function userBillApi(uid, data) {
return request.get(`user/bill/${uid}`, data)
}
/**
* @description 用户 -- 余额明细
*/
export function userAssetsLogApi(uid, type, data) {
return request.get(`user/assets_log/${uid}/${type}`, data)
}
/**
* @description 用户 -- 城市列表
*/
@ -310,7 +323,7 @@ export function recordListImportApi(data) {
}
/**
* 获取版权信息
* @returns
* @returns
*/
export function getVersion() {
return request.get('../api/version')
@ -374,4 +387,4 @@ export function getVersion() {
*/
export function giveMemberApi(id) {
return request.get(`user/svip/${id}/form`)
}
}

@ -2,14 +2,14 @@
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-tabs v-model="user_type" @tab-click="getList(1)">
<el-tab-pane label="全部用户" name="" />
<el-tab-pane label="微信用户" name="wechat" />
<el-tab-pane label="小程序用户" name="routine" />
<el-tab-pane label="H5用户" name="h5" />
<el-tab-pane label="APP" name="app" />
<el-tab-pane label="PC" name="pc" />
</el-tabs>
<!-- <el-tabs v-model="user_type" @tab-click="getList(1)">-->
<!-- <el-tab-pane label="全部用户" name="" />-->
<!-- <el-tab-pane label="微信用户" name="wechat" />-->
<!-- <el-tab-pane label="小程序用户" name="routine" />-->
<!-- <el-tab-pane label="H5用户" name="h5" />-->
<!-- <el-tab-pane label="APP" name="app" />-->
<!-- <el-tab-pane label="PC" name="pc" />-->
<!-- </el-tabs>-->
<div class="container">
<el-form inline size="small" :label-position="labelPosition" label-width="100px">
<el-row>
@ -27,87 +27,35 @@
<template v-if="collapse">
<el-col :xs="24" :sm="24" :md="24" :lg="18" :xl="18">
<el-col v-bind="grid">
<el-form-item label="会员分组:">
<el-form-item label="项目经理:">
<el-select v-model="userFrom.group_id" placeholder="请选择" class="selWidth" clearable filterable>
<el-option value="">全部</el-option>
<el-option v-for="(item, index) in groupList" :key="index" :value="item.group_id" :label="item.group_name" />
</el-select>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="会员标签:">
<el-select v-model="userFrom.label_id" placeholder="请选择" class="selWidth" clearable filterable>
<el-option value="">全部</el-option>
<el-option v-for="(item, index) in labelLists" :key="index" :value="item.label_id" :label="item.label_name" />
</el-select>
</el-form-item>
</el-col>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="18" :xl="18">
<el-col v-bind="grid">
<el-form-item label="性别:">
<el-radio-group v-model="userFrom.sex" type="button" class="selWidth">
<el-radio-button label="">
<span>全部</span>
</el-radio-button>
<el-radio-button label="1">
<span></span>
</el-radio-button>
<el-radio-button label="2">
<span></span>
</el-radio-button>
<el-radio-button label="0">
<span>保密</span>
</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="身份:">
<el-radio-group v-model="userFrom.is_promoter" type="button" class="selWidth">
<el-radio-button label="">
<span>全部</span>
</el-radio-button>
<el-radio-button label="1">
<span>推广员</span>
</el-radio-button>
<el-radio-button label="0">
<span>普通会员</span>
</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="18" :xl="18">
<el-col v-bind="grid">
<el-form-item label="访问情况:">
<el-select v-model="userFrom.user_time_type" placeholder="请选择" class="selWidth" clearable>
<!--<el-option value="visitno" label="时间段未访问" />-->
<el-option value="visit" label="最后访问" />
<el-option value="add_time" label="首次访问" />
</el-select>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="消费情况:">
<el-select v-model="userFrom.pay_count" placeholder="请选择" class="selWidth" clearable>
<el-option value="-1" label="0次"></el-option>
<el-option value="0" label="1次及以上"></el-option>
<el-option value="1" label="2次及以上"></el-option>
<el-option value="2" label="3次及以上"></el-option>
<el-option value="3" label="4次及以上"></el-option>
<el-option value="4" label="5次及以上"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="18" :xl="18">
<el-col v-bind="grid">
<el-form-item label="区域代理:">
<el-select v-model="userFrom.agent_id" placeholder="请选择" class="selWidth" clearable filterable>
<el-option value="">全部</el-option>
<el-option value="1" label="是"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="18" :xl="18">
<el-col v-bind="grid">
<el-form-item label="访问时间:" class="timeBox">
<el-date-picker v-model="timeVal" value-format="yyyy/MM/dd" align="right" unlink-panels format="yyyy/MM/dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" class="selWidth" :picker-options="pickerOptions" @change="onchangeTime" />
</el-form-item>
</el-col>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="18" :xl="18">
<el-col v-bind="grid">
<el-form-item label="分红点用户:">
<el-select v-model="userFrom.is_share" placeholder="请选择" class="selWidth" clearable filterable>
<el-option value="">全部</el-option>
<el-option value="1" label="是"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-col>
</template>
<el-col :xs="24" :sm="24" :md="24" :lg="6" :xl="6" class="text-right userFrom">
<el-form-item>
@ -126,51 +74,51 @@
</el-row>
</el-form>
</div>
<div class="mb15">
<el-button class="mr10" size="mini" @click="createUser">创建用户</el-button>
<el-button v-show="user_type === 'wechat'" size="mini" class="mr10" @click="sendNews">发送图文消息</el-button>
<el-button v-show="checkedIds.length != 0" size="mini" class="mr10" @click="batchGroup">批量设置分组</el-button>
<el-button v-show="checkedIds.length != 0" size="mini" @click="batchlabel">批量设置标签</el-button>
<el-button type="primary" icon="ios-search" label="default" class="mr15" size="mini" @click="sendCoupon" style="margin-bottom: 20px;">发送优惠券</el-button>
<!-- <div class="mb15">-->
<!-- <el-button class="mr10" size="mini" @click="createUser">创建用户</el-button>-->
<!-- <el-button v-show="user_type === 'wechat'" size="mini" class="mr10" @click="sendNews">发送图文消息</el-button>-->
<!-- <el-button v-show="checkedIds.length != 0" size="mini" class="mr10" @click="batchGroup">批量设置分组</el-button>-->
<!-- <el-button v-show="checkedIds.length != 0" size="mini" @click="batchlabel">批量设置标签</el-button>-->
<!-- <el-button type="primary" icon="ios-search" label="default" class="mr15" size="mini" @click="sendCoupon" style="margin-bottom: 20px;">发送优惠券</el-button>-->
</div>
<!-- </div>-->
<el-alert v-if="checkedIds.length>0 || allCheck" :title="allCheck ? `已选择 ${tableData.total}` : `已选择 ${checkedIds.length}`" type="info" show-icon />
<!-- <el-alert v-if="multipleSelection.length>0" :title="`已选择 ${multipleSelection.length}`" type="info" show-icon /> -->
</div>
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="small" highlight-current-row @selection-change="handleSelectionChange">
<el-table-column type="expand">
<template slot-scope="props">
<el-form label-position="left" inline class="demo-table-expand">
<el-form-item label="首次访问:">
<span>{{ props.row.create_time }}</span>
</el-form-item>
<el-form-item label="近次访问:">
<span>{{ props.row.last_time }}</span>
</el-form-item>
<el-form-item label="身份证号:">
<span>{{ props.row.card_id }}</span>
</el-form-item>
<el-form-item label="手机号:">
<span>{{ props.row.phone }}</span>
</el-form-item>
<el-form-item label="真实姓名:">
<span>{{ props.row.real_name }}</span>
</el-form-item>
<el-form-item label="标签:">
<span v-for="(item, index) in props.row.label" :key="index" v-text="item" />
</el-form-item>
<el-form-item label="生日:">
<span>{{ props.row.birthday }}</span>
</el-form-item>
<el-form-item label="地址:">
<span>{{ props.row.addres }}</span>
</el-form-item>
<el-form-item label="备注:">
<span>{{ props.row.mark }}</span>
</el-form-item>
</el-form>
</template>
</el-table-column>
<!-- <el-table-column type="expand">-->
<!-- <template slot-scope="props">-->
<!-- <el-form label-position="left" inline class="demo-table-expand">-->
<!-- <el-form-item label="首次访问:">-->
<!-- <span>{{ props.row.create_time }}</span>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="近次访问:">-->
<!-- <span>{{ props.row.last_time }}</span>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="身份证号:">-->
<!-- <span>{{ props.row.card_id }}</span>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号:">-->
<!-- <span>{{ props.row.phone }}</span>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="真实姓名:">-->
<!-- <span>{{ props.row.real_name }}</span>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="标签:">-->
<!-- <span v-for="(item, index) in props.row.label" :key="index" v-text="item" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="生日:">-->
<!-- <span>{{ props.row.birthday }}</span>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="地址:">-->
<!-- <span>{{ props.row.addres }}</span>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="备注:">-->
<!-- <span>{{ props.row.mark }}</span>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column type="selection" width="55" /> -->
<el-table-column width="50">
@ -205,18 +153,13 @@
</div>
</template>
</el-table-column>
<el-table-column prop="is_svip" label="付费会员" min-width="120">
<template slot-scope="{row}">
<span>{{row.is_svip > 0 ? "是" : "否"}}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="is_svip" label="付费会员" min-width="120">-->
<!-- <template slot-scope="{row}">-->
<!-- <span>{{row.is_svip > 0 ? "是" : "否"}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="phone" label="手机号" min-width="120" />
<el-table-column label="等级" min-width="100">
<template slot-scope="{row}">
<span>{{ row.member?row.member.brokerage_name:'-' }}</span>
</template>
</el-table-column>
<el-table-column label="分组" min-width="100">
<el-table-column label="项目经理级别" min-width="100">
<template slot-scope="{row}">
<span>{{ row.group?row.group.group_name:'无' }}</span>
</template>
@ -226,33 +169,40 @@
<span>{{ row.spread ? row.spread.nickname + ' / ' + row.spread.uid : '-' }}</span>
</template>
</el-table-column>
<el-table-column label="用户类型" min-width="100">
<el-table-column label="区域代理" min-width="100">
<template slot-scope="{row}">
<span>{{ row.agent_district_id ? '是' :'' }}</span>
</template>
</el-table-column>
<el-table-column prop="agent_district" label="代理区域" min-width="100" />
<el-table-column prop="is_share" label="分红点用户" min-width="100" >
<template slot-scope="{row}">
<span>{{ row.user_type === 'routine' ? '小程序' : row.user_type === 'wechat' ? '公众号' : row.user_type === 'app' || row.user_type === 'App' ? 'App' : row.user_type === 'pc' ? 'PC' : 'H5' }}</span>
<span>{{ row.assets ? row.assets.share_point > 0 ? "是" :'' : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="now_money" label="余额" sortable min-width="100" :sort-method="(a,b)=>{return a.now_money - b.now_money}"/>
<el-table-column prop="integral" label="当前可用积分" min-width="100" />
<el-table-column label="操作" min-width="130" fixed="right">
<template slot-scope="scope">
<el-button v-if="!scope.row.cancel_time" type="text" size="small" class="mr10" @click="onEdit(scope.row.uid)">编辑</el-button>
<!-- <el-button v-if="!scope.row.cancel_time" type="text" size="small" class="mr10" @click="onDetails(scope.row.uid)">用户详情</el-button>-->
<!-- <el-button v-if="!scope.row.cancel_time" type="text" size="small" class="mr10" @click="onEdit(scope.row.uid)">设为项目经理</el-button>-->
<!-- <el-button v-if="!scope.row.cancel_time" type="text" size="small" class="mr10" @click="onEdit(scope.row.uid)">设为区域代理</el-button>-->
<el-dropdown>
<span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="onDetails(scope.row.uid)">用户详情</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setMoney(scope.row)">设置余额</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.cancel_time" @click.native="changeIntegral(scope.row)">设置积分</el-dropdown-item>
<el-dropdown-item v-if="scope.row.vip_name && !scope.row.cancel_time">清除等级</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setGroup(scope.row)">设置分组</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setLabel(scope.row)">设置标签</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setModify(scope.row)">修改推荐人</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setPassword(scope.row)">修改密码</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setMember(scope.row)">编辑会员等级</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.cancel_time" @click.native="giveMember(scope.row)">付费会员设置</el-dropdown-item>
<el-dropdown-item @click.native="onDetails(scope.row.uid)">用户详情</el-dropdown-item>
<!-- <el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setMoney(scope.row)">设置余额</el-dropdown-item>-->
<!-- <el-dropdown-item v-if="!scope.row.cancel_time" @click.native="changeIntegral(scope.row)">设置积分</el-dropdown-item>-->
<el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setGroup(scope.row)">设为项目经理</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setLabel(scope.row)">设为区域代理</el-dropdown-item>
<!-- <el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setModify(scope.row)">修改推荐人</el-dropdown-item>-->
<!-- <el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setPassword(scope.row)">修改密码</el-dropdown-item>-->
<!-- <el-dropdown-item v-if="!scope.row.cancel_time" @click.native="setMember(scope.row)">编辑会员等级</el-dropdown-item>-->
<!-- <el-dropdown-item v-if="!scope.row.cancel_time" @click.native="giveMember(scope.row)">付费会员设置</el-dropdown-item>-->
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
@ -270,7 +220,7 @@
</el-dialog>
<!-- 选择优惠券 -->
<el-dialog v-if="visibleCoupon" title="优惠券列表" :visible.sync="visibleCoupon" width="1000px">
<coupon-List v-if="visibleCoupon" ref="couponList" :couponForm="couponForm" :checkedIds="checkedIds" :allCheck="allCheck" :userFrom="userFrom" @sendSuccess="sendSuccess" />
<coupon-List v-if="visibleCoupon" ref="couponList" :couponForm="couponForm" :checkedIds="checkedIds" :allCheck="allCheck" :userFrom="userFrom" @sendSuccess="sendSuccess" />
</el-dialog>
</div>
</template>
@ -411,7 +361,9 @@ export default {
city: '',
page: 1,
limit: 20,
group_id: ''
group_id: '',
agent_id: '',
is_share: '',
},
address: [],
grid: {
@ -484,7 +436,7 @@ export default {
} else if (index > -1) {
this.checkedPage.splice(index, 1)
}
this.syncCheckedId()
},
syncCheckedId() {
@ -513,7 +465,7 @@ export default {
}
})
}
},
//
changeOne(v, user) {
@ -552,7 +504,7 @@ export default {
let label_id = this.userFrom.label_id == '' ? '' : this.getLabelValue(),
user_type = this.findKey(this.userFrom.user_type,{'':'','微信用户':'wechat','小程序用户':'routine','H5用户':'h5'}),
sex = this.findKey(this.userFrom.sex,{'男':'1','女':'2','保密':'0','':''}),
pay_count = this.findKey(this.userFrom.sex,{'0次':'-1','1次以上':'0','2次以上':'1','3次以上':'2','4次以上':'3','5次以上':'4','': ''}),
pay_count = this.findKey(this.userFrom.sex,{'0次':'-1','1次以上':'0','2次以上':'1','3次以上':'2','4次以上':'3','5次以上':'4','': ''}),
is_promoter = this.findKey(this.userFrom.is_promoter,{'推广员':'1','普通用户':'0','':''}),
user_time_type = this.userFrom.user_time_type == 'visit' ? '最后访问' : this.userFrom.user_time_type == 'add_time' ? '首次访问' : ''
this.couponForm = {
@ -605,6 +557,7 @@ export default {
//
groupLists() {
groupLstApi({
all:1,
page: 1,
limit: 9999
}).then(async res => {
@ -637,7 +590,7 @@ export default {
if (this.checkedIds.length === 0 && this.allCheck == false) return this.$message.warning('请先选择用户')
this.visible = true
this.wechatIds = this.getWechatUsers(this.tableData.data, this.checkedIds)
},
handleClose() {
this.visible = false
@ -650,7 +603,7 @@ export default {
if(arr1[i]['wechat_user_id']){
newArr.push(arr1[i]['wechat_user_id']);
}
}
}
}else{
for (let i = 0; i < arr1.length; i++) {
for (let j = 0; j < arr2.length; j++) {
@ -700,7 +653,7 @@ export default {
this.$modalForm(changeMemberApi(row.uid)).then(() => this.getList(''))
},
//
giveMember(row) {
giveMember(row) {
this.$modalForm(giveMemberApi(row.uid)).then(() => this.getList(''))
},
//
@ -718,7 +671,7 @@ export default {
this.$modalForm(changeNowMoneyApi(row.uid)).then(() => this.getList(''))
},
//
changeIntegral(row){
changeIntegral(row){
this.$modalForm(changeNowIntegralApi(row.uid)).then(() => this.getList(''))
},
//

@ -3,15 +3,28 @@
<div v-if="psInfo" class="acea-row row-middle">
<div class="avatar mr15"><div class="block"><el-avatar :size="50" :src="psInfo.avatar ? psInfo.avatar : moren"></el-avatar></div></div>
<div class="dashboard-workplace-header-tip">
<p class="dashboard-workplace-header-tip-title" v-text="psInfo.nickname || '-'" />
<div class="dashboard-workplace-header-tip-desc">
<span class="dashboard-workplace-header-tip-desc-sp">余额: {{ psInfo.now_money }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">总计订单: {{ psInfo.pay_count }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">总消费金额: {{ psInfo.pay_price }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">本月订单: {{ psInfo.total_pay_count }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">本月消费金额: {{ psInfo.total_pay_price }}</span>
<span v-if="psInfo.is_svip" class="dashboard-workplace-header-tip-desc-sp">会员到期时间: {{ psInfo.svip_endtime }}</span>
<span v-if="cancelTime" class="dashboard-workplace-header-tip-desc-sp">注销时间: {{ cancelTime }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">uid: {{ psInfo.uid }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">手机号: {{ psInfo.phone }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">昵称: {{ psInfo.nickname }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">注册时间: {{ psInfo.create_time }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">登录时间: {{ psInfo.last_time }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">推广人: {{ psInfo.spread.nickname }}</span>
</div>
<div class="dashboard-workplace-header-tip-desc">
<span class="dashboard-workplace-header-tip-desc-sp">当前消费积分: {{ psInfo.assets.consume }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">冻结消费积分: {{ psInfo.assets.consume_frozen }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">当前分红点: {{ psInfo.assets.share_point }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">当前福利积分: {{ psInfo.assets.welfare }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">冻结福利积分: {{ psInfo.assets.welfare_frozen }}</span>
</div>
<div class="dashboard-workplace-header-tip-desc">
<span class="dashboard-workplace-header-tip-desc-sp">当前惠通宝: {{ psInfo.assets.huitong }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">冻结惠通宝: {{ psInfo.assets.huitong_frozen }}</span>
</div>
<div class="dashboard-workplace-header-tip-desc">
<span class="dashboard-workplace-header-tip-desc-sp">当前贡献值: {{ psInfo.assets.contribution }}</span>
<span class="dashboard-workplace-header-tip-desc-sp">冻结贡献值: {{ psInfo.assets.contribution_frozen }}</span>
</div>
</div>
</div>
@ -36,18 +49,7 @@
:label="item.title"
width="item.minWidth"
/>
<el-table-column v-if="type === '3'" :key="111" label="有效期" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row ? scope.row.start_time + '-' + scope.row.end_time: '' | filterEmpty}}</span>
</template>
</el-table-column>
<el-table-column v-if="type === '2'" :key="112" label="上级推荐人头像" min-width="150">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image style="width: 36px; height: 36px" :src="scope.row.spread&&scope.row.spread.avatar ? scope.row.spread.avatar : moren" :preview-src-list="[scope.row.avatar || moren]" />
</div>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@ -75,7 +77,7 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import { userOrderApi, userDetailApi, userCouponApi, userBillApi, modifyUserRefLog } from '@/api/user'
import { userOrderApi, userDetailApi, userCouponApi, userBillApi, modifyUserRefLog, userInfoApi, userAssetsLogApi } from '@/api/user'
export default {
name: 'UserDetails',
props: {
@ -96,9 +98,11 @@ export default {
Visible: false,
list: [
{ val: '0', label: '消费记录' },
{ val: '3', label: '持有优惠券' },
{ val: '4', label: '余额变动' },
{ val: '2', label: '推荐人修改记录' }
{ val: '1', label: '消费积分' },
{ val: '3', label: '福利积分' },
{ val: '2', label: '分红点' },
{ val: '5', label: '贡献值' },
{ val: '4', label: '惠通宝' }
],
tableData: {
data: [],
@ -173,98 +177,29 @@ export default {
this.loading = false
})
break
case '2':
modifyUserRefLog(this.uid, this.tableFrom).then(res => {
this.tableData.data = res.data.list
this.tableData.total = res.data.count
this.columns = [
{
title: '上级推荐人ID',
key: 'spread_uid',
minWidth: 120
},
{
title: '上级推荐人昵称',
key: 'spread.nickname',
minWidth: 120
},
{
title: '绑定时间',
key: 'create_time',
minWidth: 120
}
]
this.loading = false
}).catch(() => {
this.loading = false
})
break
case '3':
userCouponApi(this.uid, this.tableFrom).then(res => {
this.tableData.data = res.data.list
this.tableData.total = res.data.count
this.columns = [
{
title: '优惠券名称',
key: 'coupon_title',
minWidth: 120
},
{
title: '面值',
key: 'coupon_price',
minWidth: 120
},
// {
// title: '',
// key: 'add_time',
// minWidth: 120
// },
{
title: '最低消费额',
key: 'use_min_price',
minWidth: 120
},
{
title: '兑换时间',
key: 'use_time',
minWidth: 120
}
]
this.loading = false
}).catch(() => {
this.loading = false
})
break
default:
userBillApi(this.uid, this.tableFrom).then(res => {
userAssetsLogApi(this.uid, key, this.tableFrom).then(res => {
this.tableData.data = res.data.list
this.tableData.total = res.data.count
this.columns = [
{
title: '变动金额',
key: 'number',
title: '类型',
key: 'type',
minWidth: 90
},
{
title: '变动后',
key: 'balance',
title: '分值',
key: 'count',
minWidth: 90
},
{
title: '类型',
key: 'title',
minWidth: 100
},
{
title: '创建时间',
key: 'create_time',
minWidth: 150
},
{
title: '备注',
key: 'mark',
minWidth: 200
}
]
this.loading = false
}).catch(() => {
@ -281,7 +216,7 @@ export default {
this.getInfo(this.type)
},
getHeader() {
userDetailApi(this.uid).then(res => {
userInfoApi(this.uid).then(res => {
this.psInfo = res.data
})
}

@ -2,7 +2,7 @@
ENV = 'production'
# base api
VUE_APP_BASE_API =
VUE_APP_BASE_API ='https://b2.njrenzhou.com'
# socket 连接地址
VUE_APP_WS_URL =
VUE_APP_WS_URL ='ws://mer1.crmeb.net'

Loading…
Cancel
Save