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