123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- <template>
- <view class="content">
- <!-- 个人信息 -->
- <view class="user-info">
- <view class="info-box">
- <view class="left">
- <view class="head-box">
- <image class="img" :src="avatar" mode="aspectFill"></image>
- </view>
- <view class="info">
- <!-- <text class="name">{{nickName}}</text> -->
- <!-- <text class="title">{{postNames}}</text> -->
- <view>
- <text class="fs28">{{nickName}}</text>
- <text class="fs24 ml40 base-color-3">{{sex}}</text>
- </view>
- <view class="base-color-9 fs24 mt12">注册时间:{{!userinfo.createTime||userinfo.createTime.slice(0, 10)}}</view>
- </view>
- </view>
- <image v-if="!isShow" class="right" src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com:443/app/images/icon_edit.png" mode="aspectFill" @click="editInfo"></image>
- </view>
- <!-- 公司 -->
- <view class="justify-between">
- <view class="comp-info">
- <image class="img" src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com:443/app/images/icon_comp.png" mode="aspectFill"></image>
- <text class="fs24 base-color-6">{{userinfo.deptName}}</text>
- </view>
- <view class="comp-info">
- <image class="img" src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com:443/app/images/phone.png" mode="aspectFill"></image>
- <text class="fs24 base-color-6">{{userinfo.phonenumber}}</text>
- </view>
- </view>
-
- </view>
- <!-- 详细信息 -->
- <view class="p20 justify-between wrap">
- <view class="base-bg-sure radius12 pl20 ptb12 item">
- <view class="bold">会员总数</view>
- <view class="mt12 base-color">
- <text class="fs40 bold">{{userinfo.vipCount}}</text>
- <text class="fs28">人</text>
- </view>
- </view>
- <view class="base-bg-sure radius12 pl20 ptb12 item">
- <view class="bold">今日新增会员</view>
- <view class="mt12 base-color">
- <text class="fs40 bold">{{userinfo.newVipCount}}</text>
- <text class="fs28">人</text>
- </view>
- </view>
- <view class="base-bg-sure radius12 pl20 ptb12 item">
- <view class="bold">会员红包数</view>
- <view class="mt12 base-color">
- <text class="fs40 bold">{{userinfo.redPacketCount}}</text>
- <text class="fs28">个</text>
- </view>
- </view>
- <view class="base-bg-sure radius12 pl20 ptb12 item">
- <view class="bold">新会员红包金额</view>
- <view class="mt12 base-color">
- <text class="fs40 bold">{{userinfo.newVipRedPackAmount}}</text>
- <text class="fs28">元</text>
- </view>
- </view>
- </view>
- <view class="footer-btn ">
- <view :class="userinfo.isAudit==1?'shenhed':'notshenhe'" @click="submitshen">{{userinfo.isAudit==1?'已审核':'待审核'}}</view>
- <view :class="userinfo.status==1?'notshenhe':'shenhed'" @click="submitjin">{{userinfo.status==1?'禁用':'未禁用'}}</view>
- </view>
- </view>
- </template>
- <script>
- import {getUserInfoByUserId,getUserInfo} from '@/api/user.js';
- import {subsalesaudit,changesalesState} from '@/api/courseManage.js';
- export default {
- data() {
- return {
- avatar:"https://fbylive.obs.cn-southwest-2.myhuaweicloud.com:443/app/images/default.png",
- nickName:"",
- deptName:"",
- postNames:"",
- phonenumber:"",
- email:"",
- sex:"",
- isShow:false,
- userId:'',
- userinfo:[],
- shenhe:false,
- jinyong:false,
- }
- },
- onLoad(option) {
- // 修改顶部导航背景色
- // uni.setNavigationBarColor({
- // frontColor: '#ffffff',
- // backgroundColor: '#4BC9B1',
- // animation: {
- // duration: 400,
- // timingFunc: 'easeIn'
- // }
- // })
- if(!this.utils.isEmpty(option.userId)){
- this.userId = option.userId;
-
- this.isShow=true;
- }
-
- },
- onShow() {
- if(this.isShow){
- this.getUserInfoByUserId(this.userId);
- }
- else{
- this.getUserInfo();
- }
- },
- methods: {
- submitshen(){
- if(this.userinfo.isAudit==1){
- uni.showToast({
- title: "用户已经通过审核,无需多次审核",
- icon: 'none',
- });
- return
- }
- this.subsalesaudits()
- },
- submitjin(){
- if(this.userinfo.status==0){
- uni.showToast({
- title: "用户已经解除禁用,无需多次解除",
- icon: 'none',
- });
- return
- }
- this.changesalesStates()
- },
- subsalesaudits(){
- const data={
- userIds:this.userId
- }
- subsalesaudit(this.userId).then(res=>{
- console.log(res)
- if(res.code==200){
- uni.showToast({
- title: "用户通过审核,成为销售!",
- icon: 'none',
- });
- uni.navigateBack({
- delta: 1
- })
- }else{
- uni.showToast({
- title: res.msg,
- icon: 'none',
- });
- }
- })
- },
- changesalesStates(){
- const data={
- userIds:this.userId
- }
- changesalesState(this.userId).then(res=>{
- console.log(res)
- if(res.code==200){
- uni.showToast({
- title: "用户解除禁用!",
- icon: 'none',
- });
- uni.navigateBack({
- delta: 1
- })
- }else{
- uni.showToast({
- title: res.msg,
- icon: 'none',
- });
- }
- })
- },
- bindUser(data){
- var that=this;
- that.userinfo=data.user
- console.log(that.userinfo)
- that.nickName=data.user.nickName;
- that.deptName=data.user.dept.deptName;
- that.posts=data.post;
- that.phonenumber=data.user.phonenumber;
- that.email=data.user.email;
- if(data.user.sex==0){
- that.sex="男";
- }
- else if(data.user.sex==1){
- that.sex="女";
- }
- else if(data.user.sex==2){
- that.sex="未知";
- }
- if(data.post!=null&&data.post.length>0){
- var posts=[];
- data.post.forEach( (v,i) => {
- posts.push(v);
- },this);
- that.postNames=posts.toString()
- }
- if(!that.utils.isEmpty(data.user.avatar)){
- that.avatar=uni.getStorageSync('requestPath')+data.user.avatar;
- }
- },
- getUserInfoByUserId(userId){
- var data = {userId:userId};
- var that=this;
- getUserInfoByUserId(data).then(
- res => {
- // console.log(res)
- that.bindUser(res);
- },
- rej => {}
- );
- },
- getUserInfo(){
- var data = {};
- var that=this;
- getUserInfo(data).then(
- res => {
- that.bindUser(res);
- },
- rej => {}
- );
- },
- // 拨打电话
- callPhone(tel){
- uni.makePhoneCall({
- phoneNumber: tel
- })
- },
- // 个人信息编辑
- editInfo() {
- uni.navigateTo({
- url: '../editUser'
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page{
- background: #fff;
- }
- </style>
- <style scoped lang="scss">
- .footer-btn{
- display: flex;
- justify-content: space-around;
- position: fixed;
- bottom: 0;
- width: 100%;
- padding: 40rpx 0;
- view{
- width: 40%;
- text-align: center;
- padding: 20rpx 0;
- border-radius: 50rpx;
- }
- }
- .shenhed{
- background-color: rgba(64, 149,229,0.1);
- border: 2rpx solid #4095E5;
- color:#4095E5 ;
- }
- .notshenhe{
- background-color:rgba(255, 108,71,0.1) ;
- border: 2rpx solid #FF6C47;
- color: #FF6C47;
- }
- .item{
- width: calc(50% - 20rpx);
- margin-top: 20rpx;
- }
- .content{
- // 个人信息
- .user-info{
- background: linear-gradient(to right, #dae9ff, #e1e1fd);
- padding: 0 30upx;
- .info-box{
- display: flex;
- align-items: center;
- justify-content: space-between;
- .left{
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 20upx 0;
- .head-box{
- width: 120upx;
- height: 120upx;
- line-height: 100upx;
- font-size: 30upx;
- color: #fff;
- text-align: center;
- margin-right: 20upx;
- .img{
- border-radius: 50%;
- width: 100%;
- height: 100%;
- }
- }
- }
- .right{
- width: 40upx;
- height: 40upx;
- }
- }
- .comp-info{
- padding: 20upx 0 40upx;
- display: flex;
- align-items: center;
- .img{
- width: 30upx;
- height: 30upx;
- margin-right: 20upx;
- }
- .text{
- font-size: 30upx;
- color: #fff;
- }
- }
- }
-
- }
- </style>
|