李志伟 3 年之前
父節點
當前提交
8b21e141e7

+ 7
- 0
src/pages/feedback/index.config.js 查看文件

@@ -0,0 +1,7 @@
1
+export default {
2
+  navigationBarTitleText: '个人信息',
3
+  navigationStyle: 'custom',
4
+  styleIsolation: 'shared',
5
+  enableShareAppMessage: true,
6
+  disableScroll: true,
7
+}

+ 62
- 0
src/pages/feedback/index.jsx 查看文件

@@ -0,0 +1,62 @@
1
+import { useState } from "react"
2
+import Taro from "@tarojs/taro"
3
+import { View, Image, Textarea } from "@tarojs/components"
4
+import withLayout from '@/layouts'
5
+import CustomNav from "@/components/CustomNav"
6
+import MyButton from "@/components/MyButton"
7
+import editImg from '@/assets/user/edit.png'
8
+import './style.less'
9
+
10
+export default withLayout((props) => {
11
+  const [value, setValue] = useState()
12
+  const [show, setShow] = useState(true)
13
+  const onChange=(e)=>{
14
+    if (e.detail.value) {
15
+      setValue(e.detail.value)
16
+    }else{
17
+      setShow(true)
18
+    }
19
+  }
20
+  const handleSumbit = () => { 
21
+    if (show) {
22
+      Taro.showToast({
23
+        title: '请输入您的建议',
24
+        icon: 'none',
25
+      })
26
+    } else{
27
+      Taro.showToast({
28
+        title: '已反馈',
29
+        icon: 'none',
30
+      })
31
+      Taro.navigateBack({delta:1})
32
+    }
33
+  }
34
+  return (
35
+    <View className='page-index'>
36
+      <View className='index-navbar'>
37
+        <CustomNav title='意见反馈' />
38
+      </View>
39
+      <View className='index-container feedback'>
40
+        <View className='content'>
41
+          <Textarea
42
+            value={value}
43
+            onFocus={()=>setShow(false)}
44
+            onBlur={onChange}
45
+            className='value'
46
+          />
47
+          {
48
+            show && 
49
+            <View className='defaultValue'>
50
+              <Image src={editImg} className='edit' />
51
+              请留下您宝贵的意见和建议!
52
+            </View>
53
+          }
54
+
55
+        </View>
56
+        <View className='bottomBtn'>
57
+          <MyButton value='提交' onClick={handleSumbit} />
58
+        </View>
59
+      </View>
60
+    </View>
61
+  )
62
+})

+ 37
- 0
src/pages/feedback/style.less 查看文件

@@ -0,0 +1,37 @@
1
+.feedback{
2
+  margin: 30px;
3
+  .content{
4
+    margin-top: 35px;
5
+    position: relative;
6
+    .value{
7
+      background: #FEFEFE;
8
+      border: 2px solid #BEBDBD;
9
+      border-radius: 20px;
10
+      padding: 37px 53px;
11
+      box-sizing: border-box;
12
+      width: 100%;
13
+      font-size: 34px;
14
+      font-weight: 400;
15
+    }
16
+    .defaultValue{
17
+      position: absolute;
18
+      top: 37px;
19
+      left: 53px;
20
+      font-size: 34px;
21
+      font-weight: 400;
22
+      color: #BEBDBD;
23
+      .edit{
24
+        width: 30px;
25
+        height: 30px;
26
+        margin-right: 16px;
27
+      }
28
+    }
29
+    
30
+  }
31
+  .bottomBtn{
32
+    margin-bottom: 32px;
33
+    position: absolute;
34
+    bottom: 0;
35
+    width: 100%;
36
+  }
37
+}

+ 3
- 1
src/pages/index/components/User/index.jsx 查看文件

@@ -26,7 +26,9 @@ export default (props) => {
26 26
   const handleUpdate = () => {
27 27
     Taro.navigateTo({ url: '/pages/versionUpdate/index' });
28 28
    }
29
-  const handleFeedback = () => { }
29
+  const handleFeedback = () => { 
30
+    Taro.navigateTo({ url: '/pages/feedback/index' });
31
+  }
30 32
   const handleLogin = () => { 
31 33
     Taro.navigateTo({ url: '/pages/login/index' });
32 34
   }

+ 1
- 1
src/pages/userInfo/style.less 查看文件

@@ -46,7 +46,7 @@
46 46
     }
47 47
   }
48 48
   .bottomBtn{
49
-    margin-bottom: 30px;
49
+    margin-bottom: 12px;
50 50
     position: absolute;
51 51
     bottom: 0;
52 52
     width: 100%;

+ 4
- 0
src/routes.js 查看文件

@@ -54,6 +54,10 @@ const mainPages = [
54 54
     title: '版本更新',
55 55
     page: 'pages/versionUpdate/index',
56 56
   },  
57
+  {
58
+    title: '意见反馈',
59
+    page: 'pages/feedback/index',
60
+  },  
57 61
 ];
58 62
 
59 63
 // 所有的页面