123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import { useState } from "react"
- import { Textarea, View } from "@tarojs/components"
- import CustomNav from "@/components/CustomNav"
- import ButtontWX from "@/components/ButtontWX"
- import { feedback } from "@/services/mine"
- import Taro from "@tarojs/taro"
-
- import './style.less'
-
-
-
- export default (props) => {
-
- const [textAreaValue, setTextAreaValue] = useState('')
- const [loading, setLoading] = useState(false)
-
- const onSubmitClick = () => {
- setLoading(true)
- console.log('textAreaValue', textAreaValue);
- if (textAreaValue == '') {
- Taro.showToast({
- title: '请填写内容哦',
- icon: 'none',
- duration: 2000
- })
-
- } else {
-
- feedback({ content: textAreaValue }).then(() => {
- Taro.showToast({
- title: '反馈已收到!',
- icon: 'success',
- duration: 2000
- }).then(() => {
- setTimeout(() => {
- setLoading(true)
- Taro.navigateBack({
- delta: 1
- }
-
-
- )
- }, 1000)
-
- })
- })
- }
-
-
-
- }
-
- return (
- <View className='page-index'>
- <View className='index-navbar'>
- <CustomNav title='意见反馈' />
- </View>
- <View>
- <View className='components-page'>
-
- <Textarea placeholder='请留下您宝贵的意见和建议!' className='components-page-TextareaCentent' autoHeight onInput={(e) => { setTextAreaValue(e.detail.value) }} />
- </View>
- <View className='buton-bottom-Feedback'>
- <ButtontWX disabled={loading} onClick={onSubmitClick} butText='提交' butWidth={350} butHeight={49} butFontSize={16} butBorderRadius={49} />
- </View>
- </View>
- </View>
- )
- }
|