李志伟 3 vuotta sitten
vanhempi
commit
c916f7b3da

+ 18
- 74
src/pages/RandomItinerary/components/ConstellationCard/index.jsx Näytä tiedosto

@@ -1,18 +1,11 @@
1 1
 import Taro from "@tarojs/taro"
2
-import { Icon, View } from "@tarojs/components"
3
-import { useEffect, useState } from "react"
4
-import CustomNav from '@/components/CustomNav'
5
-import withLayout from '@/layouts'
6
-
7
-
2
+import { View,Text,Image } from "@tarojs/components"
3
+import React, { useState } from "react"
8 4
 import './style.less'
9 5
 
10
-
11
-
12
-
13
-
14 6
 export default (props) => {
15 7
   const { ico, textNext, onSelected, nextQuestio } = props
8
+  // nextQuestio进入下一题
16 9
   const [netxIma, setNetxIma] = useState(false)
17 10
 
18 11
   const Ari = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/ConstelPhoto/Ari.png'
@@ -42,35 +35,30 @@ export default (props) => {
42 35
         moon: '04.20-05.20',
43 36
         ico: Tau,
44 37
         active: false
45
-
46 38
       },
47 39
       {
48 40
         title: '双子座',
49 41
         moon: '05.21-06.21',
50 42
         ico: Gem,
51 43
         active: false
52
-
53 44
       },
54 45
       {
55 46
         title: '巨蟹座',
56 47
         moon: '06.22-07.22',
57 48
         ico: Cnc,
58 49
         active: false
59
-
60 50
       },
61 51
       {
62 52
         title: '狮子座',
63 53
         moon: '07.23-08.22',
64 54
         ico: Leo,
65 55
         active: false
66
-
67 56
       },
68 57
       {
69 58
         title: '处女座',
70 59
         moon: '08.23-09.22',
71 60
         ico: Vir,
72 61
         active: false
73
-
74 62
       },
75 63
     ]
76 64
   )
@@ -81,75 +69,55 @@ export default (props) => {
81 69
         moon: '09.23-10.23',
82 70
         ico: Lib,
83 71
         active: false
84
-
85 72
       },
86 73
       {
87 74
         title: '天蝎座',
88 75
         moon: '10.24-11.22',
89 76
         ico: Sco,
90 77
         active: false
91
-
92 78
       },
93 79
       {
94 80
         title: '射手座',
95 81
         moon: '11.23-12.21',
96 82
         ico: Sgr,
97 83
         active: false
98
-
99 84
       },
100 85
       {
101 86
         title: '摩羯座',
102 87
         moon: '12.22-01.19',
103 88
         ico: Cap,
104 89
         active: false
105
-
106 90
       },
107 91
       {
108 92
         title: '水瓶座',
109 93
         moon: '01.20-02.18',
110 94
         ico: Agr,
111 95
         active: false
112
-
113 96
       },
114 97
       {
115 98
         title: '双鱼座',
116 99
         moon: '02.19-03.20',
117 100
         ico: Psc,
118 101
         active: false
119
-
120 102
       },
121 103
     ]
122 104
   )
123 105
 
124
-
125
-
126
-  const handleTextNext = () => {
127
-    setNetxIma(!netxIma)
128
-  }
129
-
130 106
   //第一组
131 107
   const handleFilter = (e) => {
132 108
     onSelected()
133 109
     setTimeout(() => {
134 110
       nextQuestio()
135
-
136 111
     }, 500);
137 112
     const res = filterImage.map((item, inx) => {
138 113
       if (item.title == e.title) {
139
-
140 114
         item.active = true
141
-
142 115
       } else {
143
-
144 116
         item.active = false
145 117
       }
146 118
       return item
147
-
148 119
     })
149 120
     setFilterImage(res)
150
-
151
-
152
-
153 121
   }
154 122
 
155 123
   //第二组
@@ -157,7 +125,6 @@ export default (props) => {
157 125
     nextQuestio()
158 126
     setTimeout(() => {
159 127
       nextQuestio()
160
-
161 128
     }, 500);
162 129
 
163 130
     const res = twoImage.map((item, inx) => {
@@ -174,73 +141,50 @@ export default (props) => {
174 141
 
175 142
     })
176 143
     setTwoImage(res)
177
-
178
-
179 144
   }
180 145
 
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192 146
   return (
193 147
     <View >
194 148
       <View style='font-size: 20px;font-weight: bold;color: #140F0F;marginLeft:10px;margin-bottom: 1em;'>
195
-        1<text style='font-size: 13px;font-weight: bold;color: #140F0F;'> / 5 </text>你是什么星座的?
149
+        1<Text style='font-size: 13px;font-weight: bold;color: #140F0F;'> / 5 </Text>你是什么星座的?
196 150
       </View>
197 151
       {
198 152
         netxIma === false ? filterImage.map((item, index) =>
199
-          <view className='Random-Conste-box' key={index} onClick={() => handleFilter(item)} >
153
+          <View className='Random-Conste-box' key={index} onClick={() => handleFilter(item)} >
200 154
             <View className='RC-box-imageContent'>
201
-              <image className={`RC-box-image ${item.active && 'imageLess'}`} src={item.ico} />
155
+              <Image className={`RC-box-image ${item.active && 'imageLess'}`} src={item.ico} />
202 156
             </View>
203
-            <view className='RC-box-content' >
157
+            <View className='RC-box-content' >
204 158
               <View className='RC-box-C-title' >
205 159
                 {item.title}
206 160
               </View>
207 161
               <View className='RC-box-C-moon' >
208 162
                 {item.moon}
209 163
               </View>
210
-            </view>
211
-
212
-          </view>
213
-
164
+            </View>
165
+          </View>
214 166
         )
215 167
           :
216 168
           twoImage.map((item, index) =>
217
-            <view className='Random-Conste-box' key={index} onClick={() => handleTwoFilter(item)} >
169
+            <View className='Random-Conste-box' key={index} onClick={() => handleTwoFilter(item)} >
218 170
               <View className='RC-box-imageContent'>
219
-                <image className={`RC-box-image ${item.active && 'imageLess'}`} src={item.ico} />
220
-
171
+                <Image className={`RC-box-image ${item.active && 'imageLess'}`} src={item.ico} />
221 172
               </View>
222
-              <view className='RC-box-content' >
173
+              <View className='RC-box-content' >
223 174
                 <View className='RC-box-C-title' >
224 175
                   {item.title}
225 176
                 </View>
226 177
                 <View className='RC-box-C-moon' >
227 178
                   {item.moon}
228 179
                 </View>
229
-              </view>
230
-
231
-            </view>
232
-
180
+              </View>
181
+            </View>
233 182
           )
234
-
235 183
       }
236
-
237
-      <view className='bottom-text' onClick={handleTextNext}>
238
-        <image className='btn-image' src={ico} />
239
-        <text className='btn-text' >{textNext}</text>
240
-      </view>
241
-
184
+      <View className='bottom-text' onClick={()=>setNetxIma(!netxIma)}>
185
+        <Image className='btn-image' src={ico} />
186
+        <Text className='btn-text' >{textNext}</Text>
187
+      </View>
242 188
     </View>
243
-
244
-
245 189
   )
246 190
 }

+ 0
- 1
src/pages/RandomItinerary/components/ConstellationCard/style.less Näytä tiedosto

@@ -54,7 +54,6 @@
54 54
 
55 55
 .bottom-text {
56 56
   margin-left: 40%;
57
-  margin-top: -2em;
58 57
   width: 100%;
59 58
   padding: 0.5em 0 2em 0;
60 59
   display: flex;

+ 8
- 33
src/pages/RandomItinerary/components/FiveSenses/index.jsx Näytä tiedosto

@@ -1,9 +1,6 @@
1 1
 import Taro from "@tarojs/taro"
2
-import { Icon, View } from "@tarojs/components"
3
-import { useEffect, useState } from "react"
4
-import CustomNav from '@/components/CustomNav'
5
-import withLayout from '@/layouts'
6
-
2
+import { View,Image,Text } from "@tarojs/components"
3
+import {  useState } from "react"
7 4
 import './style.less'
8 5
 
9 6
 const ear = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/RandomIIcon/ear.png'
@@ -15,8 +12,6 @@ const mouth = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/RandomII
15 12
 export default (props) => {
16 13
   const { ico, textNext, onSelected, nextQuestio } = props
17 14
 
18
-
19
-  const [netxIma, setNetxIma] = useState(false)
20 15
   const [oneImage, setOneImage] = useState([
21 16
     {
22 17
       title: '眉毛',
@@ -43,12 +38,10 @@ export default (props) => {
43 38
       ico: ear,
44 39
       active: false
45 40
     },
46
-
47 41
   ])
48 42
 
49 43
   const handleTextNext = (e) => {
50 44
     onSelected()
51
-
52 45
     const res = oneImage.map((item, inx) => {
53 46
 
54 47
       if (item.title == e.title) {
@@ -67,47 +60,29 @@ export default (props) => {
67 60
       nextQuestio()
68 61
 
69 62
     }, 500);
70
-
71 63
   }
72 64
 
73
-
74
-
75
-
76
-
77
-
78
-
79 65
   return (
80 66
     <View >
81 67
       <View style='font-size: 20px;font-weight: bold;color: #140F0F;marginLeft:10px;;marginLeft:10px;'>
82
-        4<text style='font-size: 13px;font-weight: bold;color: #140F0F;'> / 5 </text>现在开始想你的一个五官,你想到的是?
68
+        4<Text style='font-size: 13px;font-weight: bold;color: #140F0F;'> / 5 </Text>现在开始想你的一个五官,你想到的是?
83 69
       </View>
84 70
       {
85 71
         oneImage.map((item, index) =>
86
-          <view className='Five-Conste-box' key={index} onClick={() => handleTextNext(item)}>
72
+          <View className='Five-Conste-box' key={index} onClick={() => handleTextNext(item)}>
87 73
             <View className='Five-box-imageContent'>
88
-              <image className={`Five-box-image ${item.active && 'Five-imageLess'}`} src={item.ico} />
89
-
74
+              <Image className={`Five-box-image ${item.active && 'Five-imageLess'}`} src={item.ico} />
90 75
             </View>
91
-            <view className='Five-box-content' >
76
+            <View className='Five-box-content' >
92 77
               <View className='Five-box-C-title' >
93 78
                 {item.title}
94 79
               </View>
95 80
               <View className='Five-box-C-moon' >
96 81
               </View>
97
-            </view>
98
-
99
-          </view>
100
-
82
+            </View>
83
+          </View>
101 84
         )
102
-
103
-
104
-
105
-
106 85
       }
107
-
108
-
109 86
     </View>
110
-
111
-
112 87
   )
113 88
 }

+ 13
- 36
src/pages/RandomItinerary/components/GirlFriend/index.jsx Näytä tiedosto

@@ -1,8 +1,6 @@
1 1
 import Taro from "@tarojs/taro"
2
-import { Icon, View } from "@tarojs/components"
3
-import { useEffect, useState } from "react"
4
-import CustomNav from '@/components/CustomNav'
5
-import withLayout from '@/layouts'
2
+import { View,Image,Text } from "@tarojs/components"
3
+import { useState } from "react"
6 4
 
7 5
 
8 6
 import './style.less'
@@ -23,70 +21,49 @@ export default (props) => {
23 21
     onSelected()
24 22
     setTimeout(() => {
25 23
       nextQuestio()
26
-
27 24
     }, 500);
28
-
29 25
   }
30 26
 
31
-
32 27
   const handleNo = () => {
33 28
     setImageOne(false)
34 29
     setImageTow(true)
35 30
     onSelected()//未选择不给到下一题
36 31
     setTimeout(() => {
37 32
       nextQuestio()
38
-
39 33
     }, 500);
40
-
41 34
   }
42 35
 
43
-
44
-
45
-
46
-
47 36
   return (
48 37
     <View >
49 38
       <View style='font-size: 20px;font-weight: bold;color: #140F0F;marginLeft:10px;;'>
50
-        2<text style='font-size: 13px;font-weight: bold;color: #140F0F;'> / 5 </text>你是单身吗?
39
+        2<Text style='font-size: 13px;font-weight: bold;color: #140F0F;'> / 5 </Text>你是单身吗?
51 40
       </View>
52
-
53
-
54
-      <view className='Girl-Conste-box' onClick={handleYES}  >
41
+      <View className='Girl-Conste-box' onClick={handleYES}  >
55 42
         <View className='Girl-box-imageContent'>
56
-          <image className={`Girl-box-image  imageTwo ${imageOne && 'Girl-imageLess'} `} src={YES} />
57
-
43
+          <Image className={`Girl-box-image  imageTwo ${imageOne && 'Girl-imageLess'} `} src={YES} />
58 44
         </View>
59
-        <view className='Girl-box-content' >
45
+        <View className='Girl-box-content' >
60 46
           <View className='Girl-box-C-title' >
61 47
             YES
62 48
           </View>
63 49
           <View className='Girl-box-C-moon' >
64 50
65 51
           </View>
66
-        </view>
67
-
68
-      </view>
69
-
70
-      <view className='Girl-Conste-box' onClick={handleNo} >
52
+        </View>
53
+      </View>
54
+      <View className='Girl-Conste-box' onClick={handleNo} >
71 55
         <View className='Girl-box-imageContent'>
72
-          <image className={`Girl-box-image ${imageTow && 'Girl-imageLess'} `} src={No} />
56
+          <Image className={`Girl-box-image ${imageTow && 'Girl-imageLess'} `} src={No} />
73 57
         </View>
74
-        <view className='Girl-box-content' >
58
+        <View className='Girl-box-content' >
75 59
           <View className='Girl-box-C-title' >
76 60
             No
77 61
           </View>
78 62
           <View className='Girl-box-C-moon' >
79 63
80 64
           </View>
81
-        </view>
82
-
83
-      </view>
84
-
85
-
86
-
87
-
65
+        </View>
66
+      </View>
88 67
     </View>
89
-
90
-
91 68
   )
92 69
 }

+ 13
- 35
src/pages/RandomItinerary/components/Hand/index.jsx Näytä tiedosto

@@ -1,11 +1,6 @@
1 1
 import Taro from "@tarojs/taro"
2
-import { Icon, View } from "@tarojs/components"
3
-import { useEffect, useState } from "react"
4
-import CustomNav from '@/components/CustomNav'
5
-import withLayout from '@/layouts'
6
-
7
-
8
-
2
+import { Image, View,Text } from "@tarojs/components"
3
+import {  useState } from "react"
9 4
 import './style.less'
10 5
 
11 6
 
@@ -23,66 +18,49 @@ export default (props) => {
23 18
     onSelected()
24 19
     setTimeout(() => {
25 20
       nextQuestio()
26
-
27 21
     }, 500);
28 22
   }
29 23
 
30
-
31 24
   const handleRightHand = () => {
32 25
     setImageOne(false)
33 26
     setImageTow(true)
34 27
     onSelected()
35 28
     setTimeout(() => {
36 29
       nextQuestio()
37
-
38 30
     }, 500);
39 31
   }
40 32
 
41
-
42
-
43 33
   return (
44 34
     <View >
45 35
       <View style='font-size: 20px;font-weight: bold;color: #140F0F;marginLeft:10px;;'>
46
-        3<text style='font-size: 13px;font-weight: bold;color: #140F0F;'> / 5 </text>双手交叉相握,你是拇指在上还是右手拇指在上?
36
+        3<Text style='font-size: 13px;font-weight: bold;color: #140F0F;'> / 5 </Text>双手交叉相握,你是拇指在上还是右手拇指在上?
47 37
       </View>
48
-
49
-
50
-      <view className='Hand-Conste-box' onClick={handleLeftHand} >
38
+      <View className='Hand-Conste-box' onClick={handleLeftHand} >
51 39
         <View className='Hand-box-imageContent'>
52
-          <image className={`Hand-box-image  ${imageOne && 'Hand-imageLess'} `} src={LeftHand} />
40
+          <Image className={`Hand-box-image  ${imageOne && 'Hand-imageLess'} `} src={LeftHand} />
53 41
         </View>
54
-        <view className='Hand-box-content' >
42
+        <View className='Hand-box-content' >
55 43
           <View className='Hand-box-C-title' >
56 44
             Head
57 45
           </View>
58 46
           <View className='Hand-box-C-moon' >
59 47
             左手
60 48
           </View>
61
-        </view>
62
-
63
-      </view>
64
-
65
-      <view className='Hand-Conste-box' onClick={handleRightHand} >
49
+        </View>
50
+      </View>
51
+      <View className='Hand-Conste-box' onClick={handleRightHand} >
66 52
         <View className='Hand-box-imageContent'>
67
-          <image className={`Hand-box-image  ${imageTow && 'Hand-imageLess'} `} src={RightHand} />
68
-
53
+          <Image className={`Hand-box-image  ${imageTow && 'Hand-imageLess'} `} src={RightHand} />
69 54
         </View>
70
-        <view className='Hand-box-content' >
55
+        <View className='Hand-box-content' >
71 56
           <View className='Hand-box-C-title' >
72 57
             Right
73 58
           </View>
74 59
           <View className='Hand-box-C-moon' >
75 60
             右手
76 61
           </View>
77
-        </view>
78
-
79
-      </view>
80
-
81
-
82
-
83
-
62
+        </View>
63
+      </View>
84 64
     </View>
85
-
86
-
87 65
   )
88 66
 }

+ 0
- 38
src/pages/RandomItinerary/components/ResultOver/index.jsx Näytä tiedosto

@@ -1,38 +0,0 @@
1
-import Taro from "@tarojs/taro"
2
-import { Text, View } from "@tarojs/components"
3
-import { useEffect, useState } from "react"
4
-
5
-import './style.less'
6
-
7
-
8
-export default (props) => {
9
-  const { ico, textNext } = props
10
-  const ShowOver = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/RandomIIcon/ShowOver.png'
11
-
12
-
13
-
14
-
15
-  return (
16
-    <View className='Over-box'>
17
-
18
-      <View className='Over-index-box' >
19
-        <image className='OI-image' src={ShowOver} />
20
-        <View className='OI-text-box'>
21
-          <Text className='OI-text'>
22
-            整体运势或有起伏的情况,需要做好各方面的平衡避免有故此彼伏的情况。 你要学会自己衡量得失利弊,但时间不够用的时候就要面临个人的
23
-          </Text>
24
-          <Text className='OI-text'>
25
-            未必就是走的人多的路就是对,你可以保持自己的想法。
26
-          </Text>
27
-          <Text className='OI-text'>
28
-            南京对于你而言是梦想中的地方,你的命定行程适合阳光、梦幻的地方。结合你的回答你的命定行程如下:
29
-          </Text>
30
-          <View className='bottom-text'>》</View>
31
-        </View>
32
-
33
-      </View>
34
-      <View className='content'>分享并邀请好友点开查看完整命定行程</View>
35
-    </View>
36
-
37
-  )
38
-}

+ 9
- 41
src/pages/RandomItinerary/components/UFO/index.jsx Näytä tiedosto

@@ -1,19 +1,11 @@
1 1
 import Taro from "@tarojs/taro"
2
-import { Icon, View } from "@tarojs/components"
3
-import { useEffect, useState } from "react"
4
-import CustomNav from '@/components/CustomNav'
5
-import withLayout from '@/layouts'
6
-
7
-
8
-
9
-
2
+import {Image, Text, View } from "@tarojs/components"
3
+import {  useState } from "react"
10 4
 import './style.less'
11 5
 
12 6
 
13 7
 export default (props) => {
14 8
   const { ico, onSelected, handleGoTo } = props
15
-  const [netxIma, setNetxIma] = useState(false)
16
-
17 9
   const MaJiang = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/RandomIIcon/MaJiang.png'
18 10
   const hello = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/RandomIIcon/hello.png'
19 11
   const WeChat = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/RandomIIcon/WeChat.png'
@@ -31,37 +23,27 @@ export default (props) => {
31 23
       title: '打招呼',
32 24
       ico: hello,
33 25
       active: false
34
-
35 26
     },
36 27
     {
37 28
       title: '加微信',
38 29
       ico: WeChat,
39 30
       active: false
40
-
41 31
     },
42 32
     {
43 33
       title: '报警',
44 34
       ico: police,
45 35
       active: false
46
-
47 36
     },
48 37
     {
49 38
       title: '逃跑',
50 39
       ico: RunAway,
51 40
       active: false
52
-
53 41
     },
54
-
55
-  ]
56
-
57
-  )
58
-
59
-
42
+  ])
60 43
 
61 44
   const handleTexUfo = (e) => {
62 45
     onSelected()
63 46
     const res = ufoImage.map((item, inx) => {
64
-
65 47
       if (item.title == e.title) {
66 48
 
67 49
         item.active = true
@@ -76,45 +58,31 @@ export default (props) => {
76 58
     setUfoImage(res)
77 59
     setTimeout(() => {
78 60
       handleGoTo()
79
-
80 61
     }, 500);
81
-
82
-
83 62
   }
84 63
 
85 64
 
86 65
   return (
87 66
     <View >
88 67
       <View style='font-size: 20px;font-weight: bold;color: #140F0F;marginLeft:10px;;marginLeft:10px;'>
89
-        5<text style='font-size: 13px;font-weight: bold;color: #140F0F;'> / 5 </text>当你看到外星人是第一时间会做什么?
68
+        5<Text style='font-size: 13px;font-weight: bold;color: #140F0F;'> / 5 </Text>当你看到外星人是第一时间会做什么?
90 69
       </View>
91 70
       {
92 71
         ufoImage.map((item, index) =>
93
-          <view className='UFO-Conste-box' key={index} onClick={() => handleTexUfo(item)}>
72
+          <View className='UFO-Conste-box' key={index} onClick={() => handleTexUfo(item)}>
94 73
             <View className='UFO-box-imageContent'>
95
-              <image className={`UFO-box-image ${item.active && 'UFO-imageLess'}`} src={item.ico} />
96
-
74
+              <Image className={`UFO-box-image ${item.active && 'UFO-imageLess'}`} src={item.ico} />
97 75
             </View>
98
-            <view className='UFO-box-content' >
76
+            <View className='UFO-box-content' >
99 77
               <View className='UFO-box-C-title' >
100 78
                 {item.title}
101 79
               </View>
102 80
               <View className='UFO-box-C-moon' >
103 81
               </View>
104
-            </view>
105
-
106
-          </view>
107
-
82
+            </View>
83
+          </View>
108 84
         )
109
-
110
-
111
-
112
-
113 85
       }
114
-
115
-
116 86
     </View>
117
-
118
-
119 87
   )
120 88
 }

+ 0
- 18
src/pages/RandomItinerary/index.jsx Näytä tiedosto

@@ -12,8 +12,6 @@ import Hand from "./components/Hand"//左右手
12 12
 import UFO from "./components/UFO"//不明飞行物
13 13
 import './style.less'
14 14
 
15
-
16
-
17 15
 export default withLayout((props) => {
18 16
   const { router, person } = props
19 17
   const [show, setShow] = useState(1)
@@ -26,7 +24,6 @@ export default withLayout((props) => {
26 24
     setI(true)
27 25
   }
28 26
 
29
-
30 27
   const handleGoTo = () => {
31 28
     if (show >= 5) {
32 29
       if (i === false) {
@@ -35,20 +32,12 @@ export default withLayout((props) => {
35 32
           icon: 'none',
36 33
           duration: 2000
37 34
         })
38
-
39 35
       } else {
40 36
         setI(false)
41 37
         seaveTravelDestiny().then(e => {
42
-
43 38
           Taro.navigateTo({ url: `/pages/RandomItinerary/ResultOver/index` })
44
-
45 39
         })
46
-
47 40
       }
48
-
49
-
50
-
51
-
52 41
     } else {
53 42
       if (i === false) {
54 43
         Taro.showToast({
@@ -56,22 +45,15 @@ export default withLayout((props) => {
56 45
           icon: 'none',
57 46
           duration: 2000
58 47
         })
59
-
60 48
       } else {
61 49
         setShow(show + 1)
62 50
         setI(false)
63
-
64 51
       }
65
-
66 52
     }
67
-
68 53
   }
69 54
   //选择题目即下一题
70 55
   const nextQuestio = () => setShow(show + 1)
71 56
 
72
-
73
-
74
-
75 57
   return (
76 58
     <view className='page-index'>
77 59
       <view className='index-navbar'>