Files
yuxingu-Miniprogram-dev/pages/feedback/feedback.vue
T
2026-03-23 11:52:05 +08:00

92 lines
2.1 KiB
Vue

<template>
<view class="content">
<myNav title="意见反馈" bgColor="#fff" titleColor="#614D49" :backIcon="true" :backHome="false" :flex="false"
style="width: 100%;"></myNav>
<view style="margin-top: 40rpx;width: 670rpx;background-color: #fff;border-radius: 10rpx;padding: 20rpx;">
<textarea placeholder="请输入您的宝贵意见、优化建议等,可输入160字" :maxlength="160" style="width: 100%;height: 640rpx;"
v-model="text" />
</view>
<view @click="save" class="btn" style="margin-top: 80rpx">
<text class="btn-text">提交</text>
</view>
</view>
</template>
<script setup>
import myNav from '@/components/my-nav.vue'
import {
urls
} from '@/util/apiUrl.js'
import dohttp from '@/util/requestConfig.js'
const text = ref()
const save = async() => {
if (text.value) {
const result = await getFlag()
if(result){
let params = {
contentText: text.value
}
dohttp.post(urls.userFeedback, params).then((result) => {
uni.showToast({
title: '提交成功',
duration: 1500
});
})
}else{
uni.showToast({
title: '提交太频繁啦,请稍后再试',
icon:'none',
duration: 1500
});
}
}else{
uni.showToast({
title: '请输入意见反馈',
icon:'none',
duration: 1500
});
}
}
const getFlag = () => {
return dohttp.post(urls.feedbackFlag)
}
</script>
<style scoped>
.content {
width: 100vw;
height: 100vh;
background-color: #f9f8f8;
display: flex;
flex-direction: column;
align-items: center;
font-family: SourceHanSans;
background-image: url('https://miniapp.yuxingu.com.cn/yxg-mp/pic/bg-all.png');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.btn {
width: 550rpx;
height: 96rpx;
border-radius: 2002rpx;
/* 自动布局 */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: linear-gradient(180deg, #E84B2A 0%, #FF846A 100%);
}
.btn-text {
font-size: 36rpx;
font-family: SourceHanSansBold;
color: #FFFFFF;
}
</style>