1
xuxy
2024-06-24 2e05e553f0caadf3d4ed9def5c922709f6ff942e
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
<template>
    <view class="option-container">
        <uni-easyinput type="textarea" v-model="content" placeholder="请输入您想要对我们说的话"></uni-easyinput>
 
        <view @click="submitOpinion" class="button-green" style="margin-top: 36rpx;">立即发送</view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                content: '',
            }
        },
        methods: {
            async submitOpinion() {
                if (this.content.trim()) {
                    
                    this.$message.showLoading()
                    const {code} = await this.$http.request('post','/api/current/customer/feedback',{
                        data:{
                            content:this.content.trim()
                        }
                    })
                    this.$message.hideLoading()
                    
                    if(code==0){
                        this.content = ''
                        this.$message.showToast('反馈成功')
                    }
                }else{
                    this.$message.showToast('未填写建议')
                }
            }
        }
    }
</script>
 
<style lang="scss">
    .option-container {
        /deep/ .uni-easyinput__content-textarea {
            min-height: 500rpx;
        }
    }
</style>