<template>
    <div class="el-identity_person_mobile_1">
        <div class="identity_person_mobile_1">
            <div :class="show==4?'mine-top':'mine-top3'">
                <div class="appbar appbar-transparency"><!--头部标题栏-->
                    <span class="goback">
                        <a href="javascript:;" v-if="show!=4" @click="showList(4)">返回</a>
                    </span>
                    <span class="appbar-title" v-if="show!=4" style="margin-right: 1rem">{{title}}</span>
                    <span class="appbar-title" v-else>{{title}}</span>
                    <span class="appbar-morebtn">
<!--                    <a href="">-->
                        <!--                       <span class="red-dot"></span>&lt;!&ndash;未读消息&ndash;&gt;-->
                        <!--                       <img src="../../theme-chalk/src/images/message_icon.png" alt="">-->
                        <!--                       <span>消息</span>-->
                        <!--                    </a>-->
                        <!--                    <a href="">-->
                        <!--                       <img src="../../theme-chalk/src/images/setting.png" alt="">-->
                        <!--                       <span>设置</span>-->
                        <!--                    </a>-->
                    </span>
                </div>
                <div class="mine-top-header" v-if="show==4"><!--头像-->
                    <div class="mine-top-info">
                        <span class="sp1"><a href="javascript:;" @click="showList(3)"><img :src="photo"
                                                                                           alt=""></a></span>
                        <div class="mine-top-infolist">
                            <p class="p1">{{phone}}</p>
                            <span class="mine-top-tips">
                            <span class="mine-top-name">{{name}}</span>
                        </span>
                        </div>
                    </div>
                    <!--                <span class="mine-signin"><a href="">签到</a></span>&lt;!&ndash;签完样式如下&ndash;&gt;-->
                    <!-- <span class="mine-signin ms-orange"><a href="">已签</a></span> -->
                </div>
                <!--      <div class="fournum">&lt;!&ndash;4个数字统计&ndash;&gt;-->
                <!--        <ul class="statistics-ul">-->
                <!--          <li class="statistics-bluetxt">23<span>完成课程(门)</span></li>-->
                <!--          <li class="statistics-bluetxt">273<span>学习时长(分钟)</span></li>-->
                <!--          <li class="statistics-bluetxt">1245<span>积分</span></li>-->
                <!--          <li class="statistics-bluetxt">12<span>签到天数</span></li>-->
                <!--        </ul>-->
                <!--      </div>-->
            </div>
            <!--8个按钮-->
            <!--    <div class="eightbtn">-->
            <!--      <div class="eightbtn-body">-->
            <!--        <div class="eightbtn-body-line">-->
            <!--          <span><a href=""><img src="images/mine_icon01.png" alt=""><br>我的班级</a></span>-->
            <!--          <span><a href=""><img src="images/mine_icon02.png" alt=""><br>我的课程</a></span>-->
            <!--          <span><a href=""><img src="images/mine_icon04.png" alt=""><br>我的直播</a></span>-->
            <!--          <span><a href=""><img src="images/mine_icon08.png" alt=""><br>我的收藏</a></span>-->
            <!--        </div>-->
            <!--      </div>-->
            <!--    </div> -->
            <!--链接-->
            <div class="fastlink" v-if="show==4">
                <div class="fastlink-list" @click="showList(0)">
                    <span class="sp1"><img src="../../theme-chalk/src/images/mine_icon01.png" alt="">我的班级</span>
                    <span class="sp2"><img src="../../theme-chalk/src/images/mine_goto2.png" alt=""></span>
                </div>
                <div class="fastlink-list" @click="showList(1)">
                    <span class="sp1"><img src="../../theme-chalk/src/images/mine_icon02.png" alt="">我的课程</span>
                    <span class="sp2"><img src="../../theme-chalk/src/images/mine_goto2.png" alt=""></span>
                </div>
               <!-- <div class="fastlink-list" @click="showList(11)">
                    <span class="sp1"><img src="../../theme-chalk/src/images/mine_icon02.png" alt="">我的资源</span>
                    <span class="sp2"><img src="../../theme-chalk/src/images/mine_goto2.png" alt=""></span>
                </div> -->
                <div class="fastlink-list" @click="showList(2)">
                    <span class="sp1"><img src="../../theme-chalk/src/images/mine_list_icon01.png" alt="">我的订单</span>
                    <span class="sp2"><img src="../../theme-chalk/src/images/mine_goto2.png" alt=""></span>
                </div>
                <div class="fastlink-list" @click="showList(5)">
                    <span class="sp1"><img src="../../theme-chalk/src/images/mine_list_icon05.png" alt="">我的直播</span>
                    <span class="sp2"><img src="../../theme-chalk/src/images/mine_goto2.png" alt=""></span>
                </div>
                <!--<div class="fastlink-list">-->
                <!--<span class="sp1"><img src="../../theme-chalk/src/images/mine_list_icon05.png" alt="">我的积分</span>-->
                <!--<span class="sp2"><img src="../../theme-chalk/src/images/mine_goto2.png" alt=""></span>-->
                <!--</div>-->
            </div>
            <!--            <div class="fastlink">-->
            <!--              <div class="fastlink-list">-->
            <!--                <span class="sp1"><img src="../../theme-chalk/src/images/mine_list_icon07.png" alt="">帮助中心</span>-->
            <!--                <span class="sp2"><img src="../../theme-chalk/src/images/mine_goto2.png" alt=""></span>-->
            <!--              </div>-->
            <!--            </div>-->
            <!--退出账号-->
            <span class="logout-account" v-if="show==4"><a href="javascript:;" @click="loginOut()">退出当前账号</a></span>
            <!--个人中心结束-->
            <!--我的订单开始-->
            <div class="grade-list" v-if="show===2">
                <div class="grade-list-tab">
                    <ul>
                        <li :class="orderStu==0?'active':''"><a href="javascript:;" @click="tabgetMyOrder(0)">全部</a></li>
                        <li :class="orderStu==1?'active':''"><a href="javascript:;" @click="tabgetMyOrder(1)">待支付</a></li>
                        <li :class="orderStu==2?'active':''"><a href="javascript:;" @click="tabgetMyOrder(2)">已支付</a></li>
                        <li :class="orderStu==3?'active':''"><a href="javascript:;" @click="tabgetMyOrder(3)">已取消</a></li>
                    </ul>
                </div>
                <fyer-load-more
                        ref="pulldown"
                        :pageIndex="page"
                        :pageSize="rows"
                        :totalCount="totalCount"
                        :openRefresh="false"
                        @loadmore="loadmore"
                        @refresh="refresh"
                >
                    <div class="grade-list-part" v-for="(item,index) in orderList" :key="index"><!--循环-->
                        <div class="order-part0">
                            <span class="sp1">订单号：{{item.sn}}</span>
                            <span :class="item.status==1?'state1': (item.status == 3 ? 'state2' : 'state3')">{{item.status == 1 ? '待支付' : (item.status == 3 ? '已支付' : '已取消')}}</span>
                        </div>
                        <div class="part1">
                            <!--<span class="sp1">-->
                            <!--                           <img src="images/jslndx-online-apply-pic.png" alt="">-->
                            <!--</span>-->
                            <span class="sp2">
                            <span class="spp1">
                                <span>{{item.name}}</span>
                            </span>
                            <span class="spp2">报名时间：<i>{{item.createDate | formatOrderDate}}</i></span>
                            <span class="spp3">培训费用：<i>￥{{item.realPrice}}元</i></span>
                        </span>
                        </div>
                        <div class="order-part2" v-if="item.status=='1'">
                            <a href="javascript:;" @click="delorder(item.orderId,item.orderType)" class="a1">取消订单</a>
                            <a :href="'/classreging?type='+item.orderType+'&fp='+item.orderType+'&id='+item.orderId+'&orderId='+item.orderId"
                               class="a2">立即支付</a>
                        </div>
                    </div>
                </fyer-load-more>
            </div>
            <!--我的订单结束-->
            <!--我的班级开始-->
            <div class="grade-list" v-if="show===0">
                <div class="grade-list-tab" style="height:0"></div>
                <fyer-load-more
                        ref="pulldown"
                        :pageIndex="page"
                        :pageSize="rows"
                        :totalCount="totalCount"
                        :openRefresh="false"
                        @loadmore="loadmore"
                        @refresh="refresh"
                >
                    <div class="myclass-list-part" v-for="(item,index) in clazzList" :key="index"><!--循环-->
                        <a :href="'/classregdetail?id='+item.czId+'&czId='+item.czId">
                            <span class="sp1">{{item.czName}}</span>
                            <span class="sp2">报名时间：<i>{{item.singupDate | formatDate}}</i></span>
                        </a>
                    </div>
                </fyer-load-more>
            </div>
            <!--我的班级结束-->
            <!--我的直播开始-->
            <div class="grade-list" v-if="show===5">
                <div class="grade-list-tab" style="height:0"></div>
                <fyer-load-more
                        ref="pulldown"
                        :pageIndex="page"
                        :pageSize="rows"
                        :totalCount="totalCount"
                        :openRefresh="false"
                        @loadmore="loadmore"
                        @refresh="refresh"
                >
                    <div class="myclass-list-part" v-for="(item,index) in LiveList" :key="index"><!--循环-->
                        <a :href="'/livedetail?lylId='+item.lylId+'&id='+item.lylId">
                            <span class="sp1">{{item.lylName}}</span>
                            <span class="sp2">直播时间：<i>{{item.lylStartDate | formatOrderDate}}-{{item.lylEndDate|formatOrderDate}}</i></span>
                        </a>
                    </div>
                </fyer-load-more>
            </div>
            <!--我的直播结束-->
            <!--我的课程开始-->
            <div class="grade-list" v-if="show===1">
                <div class="grade-list-tab2">
                    <ul>
                        <li :class="courseStu==0?'active':''"><a href="javascript:;" @click="tabgetMyCourse(0)">学习中</a>
                        </li>
                        <li :class="courseStu==1?'active':''"><a href="javascript:;" @click="tabgetMyCourse(1)">已完成</a>
                        </li>
                    </ul>
                </div>
                <fyer-load-more
                        ref="pulldown"
                        :pageIndex="page"
                        :pageSize="rows"
                        :totalCount="totalCount"
                        :openRefresh="false"
                        @loadmore="loadmore"
                        @refresh="refresh"
                >
                    <div class="course-list-part" v-for="(item,index) in courseList" :key="index"><!--循环-->
                        <span class="clp-sp1"><a href="">{{item.csName}}</a></span>
                        <span class="clp-sp2">最近学习：<i>{{item.updateDate | formatCsDate}}</i></span>
                        <span class="clp-sp3">最近进度：<i
                                :class="courseStu==0?'state1':'state2'">{{item.lcsProcess}}%</i></span>
                        <a :href="'/coursedetail?csId='+item.csId+'&id='+item.csId" class="clp-sp4">{{courseStu == 0 ? '继续学习' : '复习'}}</a>
                    </div>
                </fyer-load-more>
                <div class="loadings" style="display:none;height:40px;line-height:40px;font-size:12px;background:#f5f5f5;text-align:center;color:#aaa;">没有更多数据了</div>

            </div>
            <!--我的课程结束-->
             <!--我的资源开始-->
            <div class="grade-list" v-if="show===11">
                <div class="grade-list-tab2">
                    <ul>
                        <li :class="courseStu==0?'active':''"><a href="javascript:;" @click="tabgetMyCourse(0,'resource')">学习中</a>
                        </li>
                        <li :class="courseStu==1?'active':''"><a href="javascript:;" @click="tabgetMyCourse(1,'resource')">已完成</a>
                        </li>
                    </ul>
                </div>
                <fyer-load-more
                        ref="pulldown"
                        :pageIndex="page"
                        :pageSize="rows"
                        :totalCount="totalCount"
                        :openRefresh="false"
                        @loadmore="loadmore"
                        @refresh="refresh"
                >
                    <div class="course-list-part" v-for="(item,index) in courseList" :key="index"><!--循环-->
                        <span class="clp-sp1"><a href="">{{item.resName}}</a></span>
                        <span class="clp-sp2">最近学习：<i>{{item.updateDate | formatCsDate}}</i></span>
                        <span class="clp-sp3">学习时长：<i
                                :class="courseStu==0?'state1':'state2'">{{item.studyTime}}</i></span>
                        <a :href="'/resourcedetail?resId='+item.resId+'&id='+item.resId" class="clp-sp4">{{courseStu == 0 ? '继续学习' : '复习'}}</a>
                    </div>
                </fyer-load-more>
                <div class="loadings" style="display:none;height:40px;line-height:40px;font-size:12px;background:#f5f5f5;text-align:center;color:#aaa;">没有更多数据了</div>

            </div>
            <!--我的资源结束-->
            <!--编辑个人资料开始-->
            <div class="percenter-helpcenter" v-if="show==3">
                <span class="menu-list-goto menu-list-highbg">
                    <a href="javascript:; " class="list-a1">头像
                        <el-upload
                                class="avatar-uploader sp1"
                                :action="uploadurl"
                                :show-file-list="false"
                                :on-success="handleAvatarSuccess"
                                :before-upload="beforeAvatarUpload">
                                  <img v-if="imageUrl" :src="imageUrl" class="avatar">
                                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                                </el-upload>
                        <!--<span class="sp1"><img :src="userdata.photo" alt=""></span>-->
                    </a>
                </span>
                <span class="menu-list-goto">
                    <a href="javascript:;" class="list-a2">账号<span class="sp2">{{userdata.loginName}}</span></a>
                </span>
                <span class="menu-list-goto">
                    <a href="javascript:;" class="list-a1">姓名<input class="sp2 userinfoiput"
                                                                    v-model="userdata.custName">
                        <!--<span class="sp3">{{userdata.custName}}</span>-->
                    </a>
                </span>
                <span class="menu-list-goto">
                    <a href="javascript:;" class="list-a1">手机号<input class="sp2 userinfoiput"
                                                                     v-model.number="userdata.phone">
                        <!--<span class="sp3">{{userdata.phone}}</span>-->
                    </a>
                </span>
                <span class="menu-list-goto">
                    <a href="javascript:;" class="list-a1">身份证号<input class="sp2 userinfoiput"
                                                                      v-model="userdata.idcarNo">
                        <!--<span class="sp3">{{userdata.idcarNo}}</span>-->
                    </a>
                </span>
                <span class="sub-btn"><a href="javascript:;" @click="usersave()">确认并修改</a></span>
            </div>
            <!--编辑个人资料结束-->
            <div style="display:none; width:100%; height:20px; background-color: #f5f5f5;"></div><!--分割线-->
        </div>
    </div>
</template>

<script>
    import {httpPost, logout} from '../../../src/utils/utils';
    import formMixin from '../../../src/mixins/formMixin';
    import lenye_base from 'lenye_base';
    import fyerLoadMore from "fyer-load-more";
    import $ from "fy-kit";
    import {Toast} from "vant";

    export default {
        name: 'ElIdentityPersonMobile1',
        mixins: [formMixin],
        model: {},
        data() {
            return {
                name: '',
                phone: '',
                title: '我的',
                photo: '',
                clazzList: [],
                LiveList: [],
                orderList: [],
                courseList: [],
                orderStu: 0,
                courseStu: 0,
                totalCount: 0,
                page: 1,
                rows: 6,
                show: 4,
                userdata: '',
                imageUrl: '',
                imageUrlid: '',
                uploadurl: '',
            }
        },
        components: {
            fyerLoadMore
        },
        // 过滤
        filters: {
            formatDate: function (value) {
                var datavalue = value.replace(/\-/g, '/');
                let date = new Date(datavalue);
                let y = date.getFullYear();
                let MM = date.getMonth() + 1;
                MM = MM < 10 ? ('0' + MM) : MM;
                let d = date.getDate();
                d = d < 10 ? ('0' + d) : d;
                let h = date.getHours();
                h = h < 10 ? ('0' + h) : h;
                let m = date.getMinutes();
                m = m < 10 ? ('0' + m) : m;
                let s = date.getSeconds();
                s = s < 10 ? ('0' + s) : s;
                return y + '年' + MM + '月' + d + '日 ' + h + ":" + m + ":" + s;
            },
            formatCsDate: function (value) {
                var datavalue = value.replace(/\-/g, '/');
                let date = new Date(datavalue);
                let y = date.getFullYear();
                let MM = date.getMonth() + 1;
                MM = MM < 10 ? ('0' + MM) : MM;
                let d = date.getDate();
                d = d < 10 ? ('0' + d) : d;
                let h = date.getHours();
                h = h < 10 ? ('0' + h) : h;
                let m = date.getMinutes();
                m = m < 10 ? ('0' + m) : m;
                let s = date.getSeconds();
                s = s < 10 ? ('0' + s) : s;
                return y + '/' + MM + '/' + d + ' ' + h + ":" + m + ":" + s;
            },
            formatOrderDate: function (value) {
                var datavalue = value.replace(/\-/g, '/');
                let date = new Date(datavalue);
                let y = date.getFullYear();
                let MM = date.getMonth() + 1;
                MM = MM < 10 ? ('0' + MM) : MM;
                let d = date.getDate();
                d = d < 10 ? ('0' + d) : d;
                let h = date.getHours();
                h = h < 10 ? ('0' + h) : h;
                let m = date.getMinutes();
                m = m < 10 ? ('0' + m) : m;
                let s = date.getSeconds();
                s = s < 10 ? ('0' + s) : s;
                return y + '年' + MM + '月' + d + '日';
            }
        },
        mounted() {
            console.log(httpPost);
            var user = lenye_base.user_data.getuserData();
            if (!user) {
                logout();
            }
            this.name = lenye_base.user_data.getuserData().custName;
            this.phone = lenye_base.user_data.getuserData().phone;
            this.photo = lenye_base.user_data.getuserData().photo;
            this.uploadurl = lenye_base.base_data.getapiUrl() + lenye_base.api_url.file.upload;
            // this.getMyClazz();
            // this.getMyOrder(0);
            // this.getMyCourse(0);
            console.log(lenye_base.user_data.getuserData());
            this.getuserinfo(1);
        },
        computed: {},
        methods: {
            tabgetMyOrder(val){
                this.page=1;
                this.getMyOrder(val)
            },
            tabgetMyCourse(val,params){
                this.page=1;
                this.getMyCourse(val,params)
            },
            /*取消订单*/
            delorder(orderId) {
                const that = this;
                httpPost(lenye_base.base_data.getapiUrl() + '/orderform-service/api2/ordOrderform/fqOrder.do', lenye_base.base_data.getformatting({
                    orderId: orderId
                }), function (e) {
                    if (e.data.status === 1) {
                        Toast.success('取消成功');
                        that.getMyOrder(that.orderStu)
                    } else {
                        Toast.fail(e.data.msg)
                    }
                });
            },
            loadmore(page) {
                this.page = page;
                if (this.show === 0) {
                    this.getMyClazz();
                } else if (this.show === 1) {
                    this.getMyCourse(this.courseStu);
                } else if (this.show === 2) {
                    this.getMyOrder(this.orderStu);
                } else if (this.show === 5) {
                    this.getMyLive(this.orderStu)
                }
            },
            refresh() {
                this.page = 1;
                if (this.show === 0) {
                    this.getMyClazz("pull");
                } else if (this.show === 1) {
                    this.getMyCourse(this.courseStu, "pull");
                } else if (this.show === 2) {
                    this.getMyOrder(this.orderStu, "pull");
                } else if (this.show === 5) {
                    this.getMyLive(this.orderStu, "pull");
                }
            },
            showList(type) {
                this.show = type;
                this.page = 1;
                if (type === 0) {
                    this.getMyClazz();
                    this.title = '我的班级';
                } else if (type === 1) {
                    this.getMyCourse(this.courseStu);
                    this.title = '我的课程'
                }else if (type === 11) {
                    this.getMyCourse(this.courseStu,'resource');
                    this.title = '我的资源'
                } else if (type === 2) {
                    this.getMyOrder(this.orderStu);
                    this.title = '我的订单'
                } else if (type === 3) {
                    this.getuserinfo();
                    this.title = '我的资料'
                } else if (type === 5) {
                    this.getMyLive();
                    this.title = '我的直播'
                } else if (type === 4) {
                    this.title = '我的';
                }
            },
            getMyClazz(params) {
                let that = this;
                if(this.page===1||!this.page){
                    that.clazzList = [];
                }
                httpPost(lenye_base.base_data.getapiUrl() + '/schoolclass-service/api2/clzStudentClazz/queryUserClazzPageById.do',
                    lenye_base.base_data.getformatting({
                        czCerted: '0',
                        page: this.page,
                        rows: this.rows
                    }),
                    function (data) {
                        if (params == "pull") {
                            that.clazzList = [];
                            this.$refs.pulldown.state = 0;
                        }
                        that.clazzList = that.clazzList.concat(data.data);
                        that.totalCount = data.totalCount;
                        if (that.clazzList.length <= 6) {
                            $._.default(".loadings").html("没有更多数据了");
                        }
                    }
                );
            },
            getMyLive(params) {
                let that = this;
                if(this.page===1||!this.page){
                    that.LiveList = [];
                }
                httpPost(lenye_base.base_data.getapiUrl() + '/learnyeai-live-service/api2/lylLive/queryUserLivePage.do',
                    lenye_base.base_data.getformatting({
                        custId: that.userdata.custId,
                        page: this.page,
                        rows: this.rows
                    }),
                    function (data) {
                        if (params == "pull") {
                            that.LiveList = [];
                            this.$refs.pulldown.state = 0;
                        }
                        that.LiveList = that.LiveList.concat(data.data);
                        that.totalCount = data.totalCount;
                        if (that.LiveList.length <= 6) {
                            $._.default(".loadings").html("没有更多数据了");
                        }
                    }
                );
            },
            getMyOrder(val, params) {
                this.orderStu = val;
                var reqData = {};
                if (val == 1) {
                    reqData.status = '1';
                } else if (val == 2) {
                    reqData.status = '3';
                } else if (val == 3) {
                    reqData.status = '2,4,5,6,7';
                }
                reqData.page = this.page;
                reqData.rows = this.rows;
                let that = this;
                if(this.page===1||!this.page){
                    this.orderList = [];
                }
                httpPost(lenye_base.base_data.getapiUrl() + '/orderform-service/api2/ordOrderform/queryManagePageByCurId.do',
                    lenye_base.base_data.getformatting(reqData),
                    function (data) {
                        if (params == "pull") {
                            that.orderList = [];
                            this.$refs.pulldown.state = 0;
                        }
                        that.orderList = that.orderList.concat(data.data);
                        that.totalCount = data.totalCount;
                        if (that.orderList.length <= 6) {
                            $._.default(".loadings").html("没有更多数据了");
                        }
                    }
                );
            },
            cList(val, params){
                this.courseStu = val;
                var reqData = {};
                reqData.lcsFinished = val;
                reqData.courseinfo = 1;
                reqData.orderType = 1;
                reqData.siteIds = lenye_base.site_data.getsiteData().siteId;
                reqData.page = this.page;
                reqData.rows = this.rows;
                let that = this;
                if(this.page===1||!this.page){
                    that.courseList = [];
                }
                httpPost(lenye_base.base_data.getapiUrl() + '/course-service/api2/crsCustLearnCourse/queryUserCoursePageById.do',
                    lenye_base.base_data.getformatting(reqData),
                    function (data) {
                        if (params == "pull") {
                            that.courseList = [];
                            this.$refs.pulldown.state = 0;
                        }
                        that.courseList = that.courseList.concat(data.data);
                        that.totalCount = data.totalCount;
                        that.noMore();
                    }
                );
            },
            rList(val, params){
                this.courseStu = val;
                var reqData = {};
                reqData.studyFinished = val;

                reqData.resinfo = 1;
                reqData.orderType = 1;
                //reqData.siteIds = lenye_base.site_data.getsiteData().siteId;
                reqData.page = this.page;
                reqData.rows = this.rows;
                let that = this;
                if(this.page===1||!this.page){
                    that.courseList = [];
                }
                httpPost(lenye_base.base_data.getapiUrl() + '/resource-service/api2/stdCustLearnResource/queryResourcePageById.do',
                    lenye_base.base_data.getformatting(reqData),
                    function (data) {
                        if (params == "pull") {
                            that.courseList = [];
                            this.$refs.pulldown.state = 0;
                        }
                        that.courseList = that.courseList.concat(data.data);
                        that.totalCount = data.totalCount;
                       that.noMore();
                    }
                );
            },
            getMyCourse(val, params) {
                if(params=='resource'){
                    this.rList(val, params);
                }else{
                    this.cList(val, params);
                }
            },
            getuserinfo(type) {
                const that = this;
                httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.base.detail, lenye_base.base_data.getformatting({
                    pt4dict: ''
                }), function (e) {
                    if (e.success === '1') {
                        console.log('我的信息', e);
                        that.userdata = e.data;
                        that.imageUrl = e.data.photo;
                        if (type == 1) {
                            that.name = e.data.custName;
                            that.phone = e.data.phone;
                            that.photo = e.data.photo;
                        }
                    } else {
                        Toast.fail(e.message);
                    }
                });
            },
            usersave() {
                const that = this;
                httpPost(lenye_base.base_data.getapiUrl() + '/base-service/api/cust/userSelf/save.do', lenye_base.base_data.getformatting({
                    custId: that.userdata.custId,
                    custName: that.userdata.custName,
                    phone: that.userdata.phone,
                    idcarNo: that.userdata.idcarNo,
                    photo: that.imageUrlid,
                }), function (e) {
                    console.log('我的信息', e);
                    if (e.success === '1') {
                        Toast.success('保存成功');
                        window.location.reload();
                    } else {
                        Toast.fail(e.message)
                    }
                });
            },
            handleAvatarSuccess(res, file) {
                console.log(res);
                console.log(file);
                // this.imageUrl = URL.createObjectURL(file.raw);
                this.imageUrl = res.data.fileUrl;
                this.imageUrlid = res.data.fileId;
            },
            beforeAvatarUpload(file) {
                console.log(file);
                const isJPG = file.type === 'image/jpeg' || 'image/png';
                const isLt2M = file.size / 1024 / 1024 < 2;

                if (!isJPG) {
                    this.$message.error('上传头像图片只能是 JPG 格式!');
                }
                if (!isLt2M) {
                    this.$message.error('上传头像图片大小不能超过 2MB!');
                }
                return isJPG && isLt2M;
            },
            noMore(){
                if (this.courseList.length < 6) {
                    $._.default(".loadings").show().html("没有更多数据了");
                }else{
                    $._.default(".loadings").hide()
                }
            },
            loginOut() {
                logout();
            },
        },
    };
</script>
