|
@@ -1,7 +1,9 @@
|
1
|
1
|
import React, { useEffect, useState } from 'react'
|
2
|
2
|
import Taro, { useShareAppMessage, useRouter } from "@tarojs/taro";
|
3
|
|
-import { View, Input, Text, Picker, Button } from '@tarojs/components'
|
4
|
|
-import { AtModal, AtModalHeader, AtModalAction } from "taro-ui"
|
|
3
|
+import { useSelector, } from 'react-redux'
|
|
4
|
+import { View, Input, Text, Image, Picker, Button } from '@tarojs/components'
|
|
5
|
+import { AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui"
|
|
6
|
+import Loading from '@/compents/Loading'
|
5
|
7
|
import Layout from '../../layout/index'
|
6
|
8
|
import Tab from '../../compents/tab/index'
|
7
|
9
|
import Container from '../../compents/container/index'
|
|
@@ -36,6 +38,8 @@ const Index = () => {
|
36
|
38
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
37
|
39
|
}, [])
|
38
|
40
|
|
|
41
|
+ const [showShareLoading, setShowShareLoading] = useState(false)
|
|
42
|
+
|
39
|
43
|
const onTimeChange = (e) => {
|
40
|
44
|
setStartTime(e.detail.value)
|
41
|
45
|
}
|
|
@@ -48,10 +52,8 @@ const Index = () => {
|
48
|
52
|
startDate: startTime,
|
49
|
53
|
endDate: endTime
|
50
|
54
|
}
|
51
|
|
-
|
52
|
|
- Taro.showLoading({
|
53
|
|
- title: '正在生成分享内容,请稍后...'
|
54
|
|
- })
|
|
55
|
+
|
|
56
|
+ setShowShareLoading(true)
|
55
|
57
|
|
56
|
58
|
return request({ url: '/taHouseSetting', method: 'post', data }).then(res => {
|
57
|
59
|
const { data } = res.data
|
|
@@ -67,11 +69,11 @@ const Index = () => {
|
67
|
69
|
}
|
68
|
70
|
|
69
|
71
|
setShareObj(share)
|
70
|
|
- Taro.hideLoading()
|
|
72
|
+ setShowShareLoading(false)
|
71
|
73
|
setShowShareModal(true)
|
72
|
74
|
})
|
73
|
75
|
} else {
|
74
|
|
- Taro.hideLoading()
|
|
76
|
+ setShowShareLoading(false)
|
75
|
77
|
Taro.showModal({
|
76
|
78
|
title: '输入信息有误',
|
77
|
79
|
content: '请重新输入',
|
|
@@ -127,11 +129,19 @@ const Index = () => {
|
127
|
129
|
</View>
|
128
|
130
|
</Layout>
|
129
|
131
|
<Tab className='addhousetab' color='#ffffff' pageState='3' onClick={handleShareReady} value={['分享到微信']} ></Tab>
|
|
132
|
+ <AtModal isOpened={showShareLoading} closeOnClickOverlay={false}>
|
|
133
|
+ <AtModalContent>
|
|
134
|
+ <View style={{textAlign: 'center'}}>
|
|
135
|
+ <Loading size='48px' />
|
|
136
|
+ </View>
|
|
137
|
+ <View style={{marginTop: '2em', textAlign: 'center'}}>正在生成分享内容, 请稍后...</View>
|
|
138
|
+ </AtModalContent>
|
|
139
|
+ </AtModal>
|
130
|
140
|
<AtModal isOpened={showShareModal}>
|
131
|
141
|
<AtModalHeader>分享到微信</AtModalHeader>
|
132
|
142
|
<AtModalAction>
|
133
|
143
|
<Button onClick={() => setShowShareModal(false)}>取消</Button>
|
134
|
|
- <Button open-type="share" onClick={() => setShowShareModal(false)}>确定</Button>
|
|
144
|
+ <Button open-type='share' onClick={() => setShowShareModal(false)}>确定</Button>
|
135
|
145
|
</AtModalAction>
|
136
|
146
|
</AtModal>
|
137
|
147
|
</View>
|