zengh
2021-06-19 619fbeffc035339b4c3c803045b3e084f6717899
Merge remote-tracking branch 'origin/master'
2 files modified
13 files added
342 ■■■■■ changed files
pages.json 10 ●●●● patch | view | raw | blame | history
pages/poput/workbench/policeDetails/policeDetails.vue 1 ●●●● patch | view | raw | blame | history
pages/reported/reported.vue 331 ●●●●● patch | view | raw | blame | history
xcxMapJQ/img/alarm.png patch | view | raw | blame | history
xcxMapJQ/img/alarm_time.png patch | view | raw | blame | history
xcxMapJQ/img/alarm_type.png patch | view | raw | blame | history
xcxMapJQ/img/desc.png patch | view | raw | blame | history
xcxMapJQ/img/desc2.png patch | view | raw | blame | history
xcxMapJQ/img/people.png patch | view | raw | blame | history
xcxMapJQ/img/people1.png patch | view | raw | blame | history
xcxMapJQ/img/phone call.png patch | view | raw | blame | history
xcxMapJQ/img/phone.png patch | view | raw | blame | history
xcxMapJQ/img/phone1.png patch | view | raw | blame | history
xcxMapJQ/img/type.png patch | view | raw | blame | history
xcxMapJQ/img/type1.png patch | view | raw | blame | history
pages.json
@@ -92,10 +92,10 @@
            }
        },
        {
            "path": "pages/business/business",
            "name": "business",
            "path": "pages/reported/reported",
            "name": "reported",
            "style": {
                "navigationBarTitleText": "业务办理"
                "navigationBarTitleText": "我要报"
            }
        },
        {
@@ -199,7 +199,7 @@
            "path": "pages/workbench/workbench",
            "name": "workbench",
            "style": {
                "navigationBarTitleText": "工作台"
                "navigationBarTitleText": "我要查"
            }
        },
        {
@@ -269,7 +269,7 @@
                "selectedIconPath": "static/tabbar/articleH.png"
            },
            {
                "pagePath": "pages/business/business",
                "pagePath": "pages/reported/reported",
                "text": "我要报",
                "iconPath": "static/tabbar/business.png",
                "selectedIconPath": "static/tabbar/businessH.png"
pages/poput/workbench/policeDetails/policeDetails.vue
@@ -49,6 +49,7 @@
                    phone: this.$store.state.puserIphone,
                    snumber: this.$store.state.puserID,
                    result: this.longInputD,
                    status:0,
                    tpaddress: '',
                    spaddress: ''
                };
pages/reported/reported.vue
New file
@@ -0,0 +1,331 @@
<template>
    <view class="policeDetails">
        <view class="row address">
            <view class="title">地址</view>
            <input v-model="place" placeholder="请输入地址"/>
        </view>
        <view class="time">
            <view class="title">时间</view>
            <e-picker mode="dateTime" :style="{color:stimeColor}" class="select_time"  @change="stimeChange">{{stime||'请选择时间'}}</e-picker>
        </view>
        <view class="desc">
            <view class="title">备注</view>
            <textarea placeholder="请输入备注" v-model="result"></textarea>
        </view>
        <view class="photo">
            <view class="title">照片上传</view>
            <view class="main">
                <image @tap="takePhoto" src="../../static/workbench/policeDerails/xiangji.png" mode=""></image>
            </view>
        </view>
        <seeImgs :imgs="imgs" :videos="[]" @del="delImg" :type="'imgs'"></seeImgs>
        <view class="video">
            <view class="title">视频上传:</view>
            <view class="main">
                <image @tap="takeVideo" src="../../static/workbench/policeDerails/shiping11.png" mode=""></image>
            </view>
        </view>
        <seeImgs :imgs="[]" :videos="videos" @del="delVideo" :type="'videos'"></seeImgs>
        <view class="butb" @click="upData">
            提交
        </view>
    </view>
</template>
<script>
    import seeImgs from '../../components/seeImges/seeImges.vue'
    export default {
        components: {
            seeImgs
        },
        data() {
            return {
                datas: '',
                stime:'',
                stimeColor:"#808080",
                result:'',
                place:"",
                imgs: [],
                videos: [],
                // pathUrl:'http://s16s652780.51mypc.cn/api/blade-jfpts',
                pathUrl:'http://localhost:89',
            }
        },
        methods: {
            //日期选择
            stimeChange(e) {
                // this.stime = e.substr(0,e.length-3);
                this.stime = e;
                //修改颜色
                this.stimeColor = "#000000";
            },
            //上传
            upData() {
                console.log('开始上传');
                var dataList = {
                    sname: this.$store.state.puserName,
                    snumber: this.$store.state.puserID,
                    phone: this.$store.state.puserIphone,
                    stime:this.stime,
                    result:this.result,
                    place:this.place,
                    status:1,
                    tpaddress: '',
                    spaddress: ''
                };
                if (this.imgs.length > 0) {
                    var i = this.imgs;
                    for (var k in i) {
                        // console.log(i[k].src)
                        dataList.tpaddress += i[k].src + ','
                    }
                }
                if (this.videos.length > 0) {
                    var i = this.videos;
                    for (var k in i) {
                        // console.log(i[k].src)
                        dataList.spaddress += i[k].src + ','
                    }
                }
                // console.log(dataList)
                uni.showLoading({
                    title: "提交中...",
                    mask: true
                })
                uni.request({
                    url: this.pathUrl + '/feedback/feedback/saves',
                    data: dataList,
                    method: 'POST',
                    header: {
                        "Content-Type": "application/x-www-form-urlencoded"
                    },
                    success: (res) => {
                        if (res.data.code == 200) {
                            uni.showToast({
                                title: '提交成功!',
                                duration: 2000
                            });
                        }
                    }
                });
            },
            //图片上传
            takePhoto() {
                var that = this;
                uni.chooseImage({
                    count: 4, //可选择数量,默认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 {
                            wx.showLoading({
                                title: "上传中...",
                                mask: true
                            })
                            var that = this;
                            // 循环调用uni.uploadFile ,因微信小程序只支持单文件上传
                            for (var i = 0; i < tempFilePath.length; i++) {
                                wx.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[i],
                                    name: 'file',
                                    formData: {
                                        'user': 'test' // 上传附带参数
                                    },
                                    success: (data) => {
                                        wx.showToast({
                                            title: '上传图片成功!',
                                            duration: 1000
                                        });
                                        // 根据接口具体返回格式   赋值具体对应url
                                        that.imgs.push({
                                            id: i,
                                            src: JSON.parse(data.data).data
                                        })
                                    }
                                });
                            }
                    }
                });
            },
            //图片删除
            delImg(index) {
                this.imgs.splice(index, 1);
            },
            //视频上传
            takeVideo() {
                var that = this;
                wx.chooseVideo({
                    sourceType: ['album', 'camera'],
                    maxDuration: 60,
                    camera: 'back',
                    success(res) {
                        var tempFilePath = res.tempFilePath;
                        // try {
                            wx.showLoading({
                                title: "上传中...",
                                mask: true
                            })
                            wx.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,
                                name: 'file',
                                formData: {
                                    'user': 'test' // 上传附带参数
                                },
                                success: (data) => {
                                    wx.showToast({
                                        title: '上传视频成功!',
                                        duration: 1000
                                    });
                                    // 根据接口具体返回格式   赋值具体对应url
                                    that.videos.push({
                                        id: that.videos.length,
                                        src: JSON.parse(data.data).data
                                    })
                                }
                            });
                    }
                })
            },
            //视频删除
            delVideo(index) {
                this.videos.splice(index, 1);
            },
        }
    }
</script>
<style lang="scss">
    .policeDetails {
        width: 92%;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        .address{
            width: 100%;
            height: 100rpx;
            display: flex;
            align-items: center;
            border-bottom: 1px solid rgba($color: #f3f3f3, $alpha: 0.7);
            // border-top: 1px solid rgba($color: #f3f3f3, $alpha: 0.7);
            .title{
                float: left;
                font-size: 15px;
            }
            input{
                margin-left: 20px;
                font-size: 14px;
            }
        }
        .time{
            width: 100%;
            height: 100rpx;
            display: flex;
            align-items: center;
            // border-bottom: 1px solid rgba($color: #f3f3f3, $alpha: 0.7);
            .title{
                float: left;
                font-size: 15px;
            }
            .select_time{
                margin-left: 20px;
                font-size: 14px;
            }
        }
        .desc{
            width: 100%;
            height: 200rpx;
            display: flex;
            border-bottom: 1px solid rgba($color: #f3f3f3, $alpha: 0.7);
            .title{
                height: 100rpx;
                line-height: 100rpx;
                float: left;
                font-size: 15px;
            }
            textarea{
                // background-color: #00BFFF;
                line-height: 1.5;
                height: 160rpx;
                font-size: 14px;
                position: relative;
                left: 20px;
                top: 28rpx;
            }
        }
        .photo{
            width: 100%;
            height: 120rpx;
            display: flex;
            align-items: center;
            .title{
                font-size: 15px;
                float: left;
            }
            image{
                width: 60rpx;
                height: 60rpx;
                margin-left: 20px;
            }
        }
        .video{
            width: 100%;
            height: 120rpx;
            display: flex;
            align-items: center;
            border-bottom: 1px solid rgba($color: #f3f3f3, $alpha: 0.7);
            .title{
                font-size: 15px;
                float: left;
            }
            image{
                width: 60rpx;
                height: 60rpx;
                margin-left: 20px;
            }
        }
        .butb {
            margin: 2rem auto;
            width: 5.2rem;
            height: 5.2rem;
            // border: 1px solid rgb(46, 118, 228);
            border-radius: 3rem;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            background-image: linear-gradient(to bottom, #3CA7F4, #4D7CEE);
        }
    }
</style>
xcxMapJQ/img/alarm.png
xcxMapJQ/img/alarm_time.png
xcxMapJQ/img/alarm_type.png
xcxMapJQ/img/desc.png
xcxMapJQ/img/desc2.png
xcxMapJQ/img/people.png
xcxMapJQ/img/people1.png
xcxMapJQ/img/phone call.png
xcxMapJQ/img/phone.png
xcxMapJQ/img/phone1.png
xcxMapJQ/img/type.png
xcxMapJQ/img/type1.png