zengh
2021-06-17 195bca26a1b0bd290e50d8eb3af1d67c26fe6489
Merge remote-tracking branch 'origin/master'
5 files modified
179 ■■■■■ changed files
pages/myself/childen/info/email.vue 2 ●●● patch | view | raw | blame | history
pages/myself/childen/info/phone.vue 2 ●●● patch | view | raw | blame | history
pages/myself/childen/xinxi.vue 21 ●●●● patch | view | raw | blame | history
pages/myself/myself.vue 152 ●●●●● patch | view | raw | blame | history
xcxjingqingmap_clock_sign_in/css/body.css 2 ●●● patch | view | raw | blame | history
pages/myself/childen/info/email.vue
@@ -76,7 +76,7 @@
            height: 60rpx;
            float: left;
            margin-left: 30rpx;
            margin-top: 10rpx;
            margin-top: 15rpx;
            font-size: 28rpx;
        }
        
pages/myself/childen/info/phone.vue
@@ -75,7 +75,7 @@
            height: 50rpx;
            float: left;
            margin-left: 30rpx;
            margin-top: 15rpx;
            margin-top: 20rpx;
            font-size: 28rpx;
        }
        
pages/myself/childen/xinxi.vue
@@ -36,7 +36,9 @@
            </view>
        </view>
        
        <view class="dept-info-title">所属部门</view>
        <view class="dept-info-title">
            <view class="dept-title">所属部门</view>
        </view>
        
        <view class="dept-info">
            <view class="row row-dept-info">
@@ -71,7 +73,11 @@
            return this.$store.state.puserIphone
        },
    },
    mounted(){
    //子页面返回时刷新数据
    onShow(){
        this.getUserInfo();
    },
    onLoad() {
        //页面进入后查询用户账户信息
        this.getUserInfo();
    },
@@ -169,7 +175,7 @@
            
            image{
                position: absolute;
                margin-top: 20rpx;
                margin-top: 25rpx;
                right: 30rpx;
                width: 40rpx;
                height: 40rpx;
@@ -196,7 +202,7 @@
            
            image{
                position: absolute;
                margin-top: 20rpx;
                margin-top: 25rpx;
                right: 30rpx;
                width: 40rpx;
                height: 40rpx;
@@ -207,10 +213,13 @@
    .dept-info-title{
        height: 60rpx;
        line-height: 60rpx;
        position: relative;
        left: 20rpx;
        font-size: 24rpx;
        color: #808080;
        .dept-title{
            position: absolute;
            left: 20rpx;
        }
    }
    
    .dept-info{
pages/myself/myself.vue
@@ -108,6 +108,10 @@
                this.useimg = this.$store.state.avatar;
            }
        },
        //子页面返回时执行
        onShow() {
        },
        methods: {
            openThere(fn) {
                this[fn]();
@@ -166,73 +170,93 @@
                    that.showTextmsg = false;
                }
            },
            //图片上传
            //头像查看,上传
            ChooseImage() {
                var that = this;
                    uni.chooseImage({
                        count: 1, //可选择数量,默认9
                        sizeType: ['compressed','original'], //上传压缩图,原图
                        sourceType: ['album','camera'], //从相册选择或从使用相机
                        success: async (res) => {
                            for (var i = 0; i < res.tempFiles.length; i++) {
                                if(res.tempFiles[i].size > 10 * 1024 * 1000){  //上传图片大小限制
                                    uni.showToast({
                                        title: "照片大小不能10MB",
                                        icon: "none"
                                    })
                                    return
                                }
                            }
                            var tempFilePath = res.tempFilePaths;
                            try{
                                uni.showLoading({
                                    title:"上传中...",
                                    mask:true
                                })
                                var that = this;
                                // 文件上传
                                uni.uploadFile({
                                    // url: 'https://web.byisf.com/api/blade-jfpts/depl/put-depl', //仅为示例,非真实的接口地址
                                    url: 'http://web.byisf.com:82/blade-jfpts/depl/put-depl',
                                    filePath: tempFilePath[0],
                                    name: 'file',
                                    formData: {
                                        'user': 'test'  // 上传附带参数
                                    },
                                    success: (data) => {
                                        that.useimg = JSON.parse(data.data).data;
                                        //修改用户头像信息
                                        uni.request({
                                            url:"http://s16s652780.51mypc.cn/api/blade-user/updateUserInfo",
                                            method:"POST",
                                            data:{
                                                id: this.$store.state.puserID,
                                                avatar:that.useimg
                                            },
                                            success:(res)=> {
                                                if(res.data.code==200){
                                                    uni.showToast({
                                                        title: '上传成功!',
                                                        duration: 2000
                                                    });
                                                }
                                            }
                                        })
                                    }
                                });
                            }catch(e){
                                console.log(e);
                            }finally{
                                uni.hideLoading();
                            }
                uni.showActionSheet({
                    // itemList按钮的文字接受的是数组
                    itemList: ["查看头像","拍摄","从相册选择"],
                    success(e){
                        var index = e.tapIndex;
                        if(index == 0){
                            // 用户点击了预览当前图片
                            // 可以自己实现当前头像链接的读取
                            let url  = that.useimg;
                            let arr=[]
                            arr.push(url)
                            uni.previewImage({
                                // 预览功能图片也必须是数组的
                                urls: arr
                            })
                        }
                    });
                }
            // geton() {
            //     wx.navigateTo({
            //         url: '../poput/workbench/policeDetails/policeDetails?id=111'
            //     })
            // }
                        if(index == 1 || index==2 ){
                            //拍照或从图库上传
                            that.uploadPictrue(index);
                        }
                    }
                });
            },
            //图片上传
            uploadPictrue(e){
                var that = this;
                var sourceTypeArr = [];
                e==1 ? sourceTypeArr.push("camera") : sourceTypeArr.push("album")
                uni.chooseImage({
                    count: 1, //可选择数量,默认9
                    sizeType: ['compressed','original'], //上传压缩图,原图
                    sourceType: sourceTypeArr, //从相册选择
                    success: async (res) => {
                        if(res.tempFiles[0].size > 10 * 1024 * 1000){  //上传图片大小限制
                            uni.showToast({
                                title: "照片大小不能10MB",
                                icon: "none"
                            })
                            return
                        }
                        var tempFilePath = res.tempFilePaths;
                        try{
                            uni.showLoading({
                                title:"上传中...",
                                mask:true
                            })
                            // 文件上传
                            uni.uploadFile({
                                // url: 'https://web.byisf.com/api/blade-jfpts/depl/put-depl', //仅为示例,非真实的接口地址
                                url: 'http://web.byisf.com:82/blade-jfpts/depl/put-depl',
                                filePath: tempFilePath[0],
                                name: 'file',
                                formData: {
                                    'user': 'test'  // 上传附带参数
                                },
                                success: (data) => {
                                    that.useimg = JSON.parse(data.data).data;
                                    //修改用户头像信息
                                    uni.request({
                                        url:"http://s16s652780.51mypc.cn/api/blade-user/updateUserInfo",
                                        method:"POST",
                                        data:{
                                            id: that.$store.state.puserID,
                                            avatar:that.useimg
                                        },
                                        success:(res)=> {
                                            if(res.data.code==200){
                                                uni.showToast({
                                                    title: '上传成功!',
                                                    duration: 2000
                                                });
                                            }
                                        }
                                    })
                                }
                            });
                        }catch(e){
                            console.log(e);
                        }finally{
                            uni.hideLoading();
                        }
                    }
                })
            }
        },
    }
</script>
xcxjingqingmap_clock_sign_in/css/body.css
@@ -95,7 +95,7 @@
    left: 20px;
    border: none;
    height: 33px;
    top: -2px;
    /* top: -2px; */
    font-size: 13px;
    color: #808080;
}