1002884655 4 anni fa
parent
commit
82baa67513
2 ha cambiato i file con 18 aggiunte e 16 eliminazioni
  1. 1
    1
      project.config.json
  2. 17
    15
      src/pages/HuoDong/HuoDongSign/index.jsx

+ 1
- 1
project.config.json Vedi File

@@ -28,7 +28,7 @@
28 28
 		},
29 29
 		"bundle": false,
30 30
 		"useIsolateContext": true,
31
-		"useCompilerModule": false,
31
+		"useCompilerModule": true,
32 32
 		"userConfirmedUseCompilerModuleSwitch": false,
33 33
 		"useMultiFrameRuntime": false,
34 34
 		"useApiHook": true,

+ 17
- 15
src/pages/HuoDong/HuoDongSign/index.jsx Vedi File

@@ -14,16 +14,15 @@ export default function HuoDongDetail () {
14 14
   const [HasSign, setHasSign] = useState(false)
15 15
   const [ShowSign, setShowSign] = useState(false)
16 16
   const [CurrnetId, setCurrentId] = useState(useRouter().params.id) // 当前活动id
17
-  const [CurrnetFrom] = useState(useRouter().params.from || null) // 当前活动跳转来源
18 17
   const [CurrnetSceneId] = useState(useRouter().params.scene) // 当前活动id
19 18
   const [ActivityDetail, setActivityDetail] = useState(null) // 活动详情
20 19
   const [JoinInfo, setJoinInfo] = useState(null) // 参加活动详情
21 20
 
22 21
   useEffect(() => {
23
-    if (user && user.verifyStatus === 'certified' && CurrnetFrom !== 'detail') {
22
+    if (user && user.verifyStatus === 'certified' && CurrnetSceneId) {
24 23
       setShowSign(true)
25 24
     }
26
-  }, [user, CurrnetFrom])
25
+  }, [user, CurrnetSceneId])
27 26
 
28 27
   useEffect(() => {
29 28
     if (CurrnetId !== null && CurrnetId !== undefined) {
@@ -84,20 +83,23 @@ export default function HuoDongDetail () {
84 83
     <Page>
85 84
       <view className='HuoDongSign'>
86 85
         <image mode='aspectFill' src='https://zhiyun-image.oss-cn-shanghai.aliyuncs.com/xiangsong/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20201218165430-min.jpg' className='centerLabel'></image>
87
-        <view className={HasSign ? 'SignBtn' : 'SignBtn active'}>
88
-          <view>
89
-            {
90
-              JoinInfo !== null && JoinInfo.enlist !== null && ShowSign &&
91
-              <text className='centerLabel' onClick={ToSign}>{HasSign ? '已签到' : '签到'}</text>
92
-            }
93
-            {
94
-              JoinInfo !== null && JoinInfo.enlist === null && ShowSign &&
95
-              <text className='centerLabel' onClick={() => { Taro.navigateTo({ url: `/pages/HuoDong/HuoDongDetail/index?id=${CurrnetId}` }) }}>去报名</text>
96
-            }
86
+        {
87
+          ShowSign &&
88
+          <view className={HasSign ? 'SignBtn' : 'SignBtn active'}>
89
+            <view>
90
+              {
91
+                JoinInfo !== null && JoinInfo.enlist !== null &&
92
+                <text className='centerLabel' onClick={ToSign}>{HasSign ? '已签到' : '签到'}</text>
93
+              }
94
+              {
95
+                JoinInfo !== null && JoinInfo.enlist === null &&
96
+                <text className='centerLabel' onClick={() => { Taro.navigateTo({ url: `/pages/HuoDong/HuoDongDetail/index?id=${CurrnetId}` }) }}>去报名</text>
97
+              }
98
+            </view>
97 99
           </view>
98
-        </view>
100
+        }
99 101
         {
100
-          CurrnetFrom === 'detail' &&
102
+          !CurrnetSceneId &&
101 103
           <view className='AlertPopup'>
102 104
             <view className='centerLabel'>
103 105
               <text>请扫码签到</text>