zhao_js
2023-11-15 b44e169dd8a6e0f15d3788970176922e96aec6e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<template>
    <view class="container">
        <titleBar :titleText='"意见反馈"' :pageForm='"feedback"'></titleBar>
        <view style="padding: 0 32rpx;">
            <view class="feedbackConWrap">
                <u-input v-model="describe" type="textarea" :border="true" height="400" :clearable="false" :auto-height="true" :maxlength="300" placeholder="请在此输入您的宝贵意见,APP使用体验、优化建议都可以告诉我" />
                <!-- <textarea class="feedbackCon" placeholder="请在此输入您的宝贵意见,APP使用体验、优化建议都可以告诉我" placeholder-style="color:#999999" v-model="describe" /> -->
            </view>
            <view class="zishu">您还能输入{{300-describe.length}}个字</view>
        </view>
        <view class="rowCenCen" @click="feedback">
            <view class="tijiao">提交</view>
        </view>
        <!-- 弹框 mask-close-able:点击遮罩是否可以关闭弹出层,必须授权否则不能反馈-->
        <!-- <u-popup v-model="showTishi" mode="center" :mask-close-able="false" border-radius="10">
            <view class="tishiWrap colCen">
                <image src="/static/images/home/return.png" class="return" @click="goBack"></image>
                <view class="tishiTitle">提示</view>
                <view class="tishiCon">西瓜猪需要您授予手机存储(用于生成分享图片,保存图片、视频)权限,以便正常使用相关功能。</view>
                <view class="tishiBtn">去授权</view>
            </view>
        </u-popup> -->
    </view>
</template>
 
<script>
    import titleBar from '../../../components/backTitlebar.vue';
    export default {
        components:{
            titleBar
        },
        data() {
            return {
                showModel:'',
                describe: '',//输入的内容
                canClick:true
            };
        },
        onLoad(e) {
        },
        methods:{
            goBack(){
                uni.navigateBack();
            },
            onUploaded(lists) {
                this.filesArr = lists;
                console.log(this.filesArr)
                if(this.filesArr.length==0){
                    if(!this.describe) return this.$jsutl.toast('请填写评价内容');
                    uni.navigateBack({
                    })
                    
                }
            },
            onRemove(index, lists) {
                console.log('图片已被移除');
            },
            
            feedback(){
                if(this.canClick){
                    if(this.describe.trim().length){
                        this.canClick = false
                        var that = this;
                        this.$u.api.feedback({
                            content:this.describe
                        }).then(e => {
                            if(e.code != 0) return that.$alert(e.msg)
                            uni.showToast({
                                title: '反馈成功,感谢您宝贵的意见建议!',
                                icon: 'none',
                                position: 'bottom',
                                duration: 2000,
                            });
                            setTimeout(()=>{
                                uni.navigateBack({
                                    delta:1
                                })
                            },2000)
                        }).catch(function (err) {
                        })
                        
                        
                    }else{
                        uni.showToast({
                            title: '您还没有输入内容哦~',
                            icon: 'none',
                            position: 'bottom',
                            duration: 3000
                        });
                    }
                }
            },
            onSuccess(data, index, lists) {
                this.canClick = true;
                console.log('onSuccess', data, index, lists);
                this.pic = [],
                lists.forEach(item=>{
                    this.pic.push(item.response.data);
                })
                console.log(this.pic)
                if(!this.describe) return this.$jsutl.toast('请填写评价内容');
            },
        }
    }
</script>
 
<style>
    page{background: #EFF1F7;}
</style>
<style lang="scss" scoped>
    .container{
        .feedbackConWrap{background-color: #FFFFFF;border-radius: 20rpx;margin-top: 20rpx;
            .feedbackCon{width: 100%;height: 300rpx;padding: 20rpx 16rpx;font-size: 28rpx;}
        }
        .zishu{margin-top:24rpx;font-size: 28rpx;text-align: right;}
        .uploadWrap{background-color: #FFFFFF;border-radius: 20rpx;margin-top: 48rpx;padding: 20rpx 16rpx;
            .uploadTitle{font-size: 28rpx;margin-bottom: 30rpx;}
        }
        .tijiao{width: 686rpx;height: 90rpx;line-height: 90rpx;text-align: center;color: #FFFFFF;font-size: 32rpx;margin-top: 106rpx;
                background: linear-gradient(-77deg, #6141FE, #9F47FA);border-radius: 45rpx;}
        .tishiWrap{background-color: #FFFFFF;padding: 50rpx 40rpx 46rpx;width: 520rpx;
            .return{width: 17rpx;height: 32rpx;position: absolute;top: 50rpx;left: 40rpx;}
            .tishiTitle{font-size: 30rpx;}
            .tishiCon{font-size: 28rpx;margin: 30rpx 0 50rpx;}
            .tishiBtn{width: 200rpx;height: 60rpx;line-height: 52rpx;background: #FFFFFF;border: 2rpx solid #6A45DE;border-radius: 10rpx;font-size: 28rpx;text-align: center;color: #6A45DE;}
        }
    }
</style>